This commit is contained in:
2026-11-02 12:42:04 +00:00
commit e4e28174bf
5498 changed files with 1735888 additions and 0 deletions

7
node_modules/esrap/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,7 @@
Copyright (c) 2023-2025 [these people](https://github.com/sveltejs/esrap/graphs/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.

168
node_modules/esrap/README.md generated vendored Normal file
View File

@@ -0,0 +1,168 @@
# esrap
Parse in reverse. AST goes in, code comes out.
## Usage
```js
import { print } from 'esrap';
import ts from 'esrap/languages/ts';
const ast = {
type: 'Program',
body: [
{
type: 'ExpressionStatement',
expression: {
callee: {
type: 'Identifier',
name: 'alert'
},
arguments: [
{
type: 'Literal',
value: 'hello world!'
}
]
}
}
]
};
const { code, map } = print(ast, ts());
console.log(code); // alert('hello world!');
```
If the nodes of the input AST have `loc` properties (e.g. the AST was generated with [`acorn`](https://github.com/acornjs/acorn/tree/master/acorn/#interface) with the `locations` option set), sourcemap mappings will be created.
## Built-in languages
`esrap` ships with two built-in languages — `ts()` and `tsx()` (considered experimental at present!) — which can print ASTs conforming to [`@typescript-eslint/types`](https://www.npmjs.com/package/@typescript-eslint/types) (which extends [ESTree](https://github.com/estree/estree)):
```js
import ts from 'esrap/languages/ts';
import tsx from 'esrap/languages/tsx'; // experimental!
```
Both languages accept an options object:
```js
const { code, map } = print(
ast,
ts({
// how string literals should be quoted — `single` (the default) or `double`
quotes: 'single',
// an array of `{ type: 'Line' | 'Block', value: string, loc: { start, end } }` objects
comments: [],
// a pair of functions for inserting additional comments before or after a given node.
// returns `Array<{ type: 'Line' | 'Block', value: string }>` or `undefined`
getLeadingComments: (node) => [{ type: 'Line', value: ' a comment before the node' }],
getTrailingComments: (node) => [{ type: 'Block', value: ' a comment after the node' }]
})
);
```
You can generate the `comments` array by, for example, using [Acorn's](https://github.com/acornjs/acorn/tree/master/acorn/#interface) `onComment` option.
## Custom languages
You can also create your own languages:
```ts
import { print, type Visitors } from 'esrap';
const language: Visitors<MyNodeType> = {
_(node, context, visit) {
// the `_` visitor handles any node type
context.write('[');
visit(node);
context.write(']');
},
List(node, context) {
// node.type === 'List'
for (const child of node.children) {
context.visit(child);
}
},
Foo(node, context) {
// node.type === 'Foo'
context.write('foo');
},
Bar(node, context) {
// node.type === 'Bar'
context.write('bar');
}
};
const ast: MyNodeType = {
type: 'List',
children: [{ type: 'Foo' }, { type: 'Bar' }]
};
const { code, map } = print(ast, language);
code; // `[[foo][bar]]`
```
The `context` API has several methods:
- `context.write(data: string, node?: BaseNode)` — add a string. If `node` is provided and has a standard `loc` property (with `start` and `end` properties each with a `line` and `column`), a sourcemap mapping will be created. Otherwise, if `tokens` were passed to `print` and `data` (ignoring surrounding whitespace) is the next token in the source, it will be mapped to that token — so write tokens individually (e.g. `')'` then `' {'` rather than `') {'`)
- `context.indent()` — increase the indentation level, typically before adding a newline
- `context.newline()` — self-explanatory
- `context.space()` — adds a space character, if it doesn't immediately follow a newline
- `context.margin()` — causes the next newline to be repeated (consecutive newlines are otherwise merged into one)
- `context.dedent()` — decrease the indentation level (again, typically before adding a newline)
- `context.visit(node: BaseNode)` — calls the visitor corresponding to `node.type`
- `context.location(line: number, column: number)` — insert a sourcemap mapping _without_ calling `context.write(...)`
- `context.measure()` — returns the number of characters contained in `context`
- `context.empty()` — returns true if the context has no content
- `context.new()` — creates a child context
- `context.append(child)` — appends a child context
In addition, `context.multiline` is `true` if the context has multiline content. (This is useful for knowing, for example, when to insert newlines between nodes.)
To understand how to wield these methods effectively, read the source code for the built-in languages.
## Options
You can pass the following options:
```js
const { code, map } = print(ast, ts(), {
// Populate the `sources` field of the resulting sourcemap
// (note that the AST is assumed to come from a single file)
sourceMapSource: 'input.js',
// Populate the `sourcesContent` field of the resulting sourcemap
sourceMapContent: fs.readFileSync('input.js', 'utf-8'),
// Whether to encode the `mappings` field of the resulting sourcemap
// as a VLQ string, rather than an unencoded array. Defaults to `true`
sourceMapEncodeMappings: false,
// The parser's tokens, if `ast` came from parsing source code. Used to
// create accurate mappings for punctuation and keywords. Tokens must have
// `loc` properties — e.g. Acorn's `onToken` array (with `locations: true`),
// or `ast.tokens` from espree/@typescript-eslint/parser (with
// `tokens: true, loc: true`)
tokens,
// String to use for indentation — defaults to '\t'
indent: ' '
});
```
## Why not just use Prettier?
Because it's ginormous.
## Developing
This repo uses [pnpm](https://pnpm.io). Once it's installed, do `pnpm install` to install dependencies, and `pnpm test` to run the tests.
## License
[MIT](LICENSE)

68
node_modules/esrap/package.json generated vendored Normal file
View File

@@ -0,0 +1,68 @@
{
"name": "esrap",
"version": "2.4.0",
"description": "Parse in reverse",
"repository": {
"type": "git",
"url": "git+https://github.com/sveltejs/esrap.git"
},
"type": "module",
"files": [
"src",
"types"
],
"exports": {
".": {
"types": "./types/public.d.ts",
"default": "./src/index.js"
},
"./languages/ts": {
"types": "./types/languages/ts/public.d.ts",
"default": "./src/languages/ts/index.js"
},
"./languages/tsx": {
"types": "./types/languages/tsx/public.d.ts",
"default": "./src/languages/tsx/index.js"
}
},
"devDependencies": {
"@changesets/cli": "^2.27.11",
"@sveltejs/acorn-typescript": "^1.0.13",
"@types/estree": "^1.0.8",
"@types/node": "^20.12.14",
"@typescript-eslint/types": "^8.2.0",
"@vitest/ui": "^2.1.1",
"acorn": "^8.15.0",
"oxc-parser": "^0.95.0",
"prettier": "^3.0.3",
"typescript": "^5.7.2",
"vitest": "^2.1.1",
"zimmerframe": "^1.0.0"
},
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15"
},
"peerDependencies": {
"@typescript-eslint/types": "^8.2.0"
},
"peerDependenciesMeta": {
"@typescript-eslint/types": {
"optional": true
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"changeset:version": "changeset version",
"changeset:publish": "changeset publish",
"build": "tsc -p tsconfig.build.json",
"check": "pnpm build && tsc",
"sandbox": "node test/sandbox/index.js",
"test": "vitest --run",
"test:ui": "vitest --ui",
"format": "pnpm lint --write",
"lint": "prettier --check . --ignore-path .gitignore --ignore-path .prettierignore"
}
}

188
node_modules/esrap/src/context.js generated vendored Normal file
View File

@@ -0,0 +1,188 @@
/** @import { BaseNode, Command, Visitors } from './types.js' */
/** @import { Tokens } from './tokens.js' */
export const margin = 0;
export const newline = 1;
export const indent = 2;
export const dedent = 3;
export const space = 4;
export class Context {
#visitors;
#commands;
#tokens;
#has_newline = false;
multiline = false;
/**
*
* @param {Visitors} visitors
* @param {Command[]} commands
* @param {Tokens | null} tokens
*/
constructor(visitors, commands = [], tokens = null) {
this.#visitors = visitors;
this.#commands = commands;
this.#tokens = tokens;
}
indent() {
this.#commands.push(indent);
}
dedent() {
this.#commands.push(dedent);
}
margin() {
this.#commands.push(margin);
}
newline() {
this.#has_newline = true;
this.#commands.push(newline);
}
space() {
this.#commands.push(space);
}
/**
* @param {Context} context
*/
append(context) {
this.#commands.push(context.#commands);
if (this.#has_newline || context.multiline) {
this.multiline = true;
}
}
/**
* Write `content`. If `node` is provided, `content` is mapped to its location. Otherwise, if `tokens`
* were passed to `print` and `content` (ignoring surrounding whitespace) is the next token
* in the source, it is mapped to that token's location.
* @param {string} content
* @param {BaseNode} [node]
*/
write(content, node) {
const value = this.#tokens && content.trim();
const token = value
? this.#tokens?.consume(value, node?.loc?.start, node?.loc?.end)
: undefined;
if (node?.loc) {
this.location(node.loc.start.line, node.loc.start.column);
this.#commands.push(content);
this.location(node.loc.end.line, node.loc.end.column);
} else if (token && value) {
const start = content.indexOf(value);
const end = start + value.length;
if (start > 0) this.#commands.push(content.slice(0, start));
this.location(token.start.line, token.start.column);
this.#commands.push(value);
this.location(token.end.line, token.end.column);
if (end < content.length) this.#commands.push(content.slice(end));
} else {
this.#commands.push(content);
}
if (this.#has_newline) {
this.multiline = true;
}
}
/**
*
* @param {number} line
* @param {number} column
*/
location(line, column) {
this.#commands.push({ type: 'Location', line, column });
}
/**
* @param {{ type: string }} node
*/
visit(node) {
const visitor = this.#visitors[node.type];
if (!visitor) {
let message = `Not implemented: ${node.type}`;
if (node.type.includes('TS')) {
message += ` (consider using 'esrap/languages/ts')`;
}
if (node.type.includes('JSX')) {
message += ` (consider using 'esrap/languages/tsx')`;
}
throw new Error(message);
}
const tokens = this.#tokens;
const previous = tokens?.enter(node);
if (this.#visitors._) {
// @ts-ignore
this.#visitors._(node, this, (node) => visitor(node, this));
} else {
// @ts-ignore
visitor(node, this);
}
if (previous) tokens?.exit(node, previous);
}
empty() {
return !this.#commands.some(has_content);
}
measure() {
return measure(this.#commands);
}
new() {
return new Context(this.#visitors, [], this.#tokens);
}
}
/**
*
* @param {Command[]} commands
* @param {number} [from]
* @param {number} [to]
*/
function measure(commands, from = 0, to = commands.length) {
let total = 0;
for (let i = from; i < to; i += 1) {
const command = commands[i];
if (typeof command === 'string') {
total += command.length;
} else if (Array.isArray(command)) {
total += measure(command);
}
}
return total;
}
/**
* @param {Command} command
*/
function has_content(command) {
if (Array.isArray(command)) {
return command.some(has_content);
}
if (typeof command === 'string') {
return command.length > 0;
}
return false;
}

200
node_modules/esrap/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,200 @@
/** @import { BaseNode, Command, Location, Visitors, PrintOptions } from './types.js' */
import { encode } from '@jridgewell/sourcemap-codec';
import { Context, dedent, indent, margin, newline, space } from './context.js';
import { Tokens } from './tokens.js';
/** @type {(str: string) => string} str */
let btoa = () => {
throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
};
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
btoa = (str) => window.btoa(unescape(encodeURIComponent(str)));
} else if (typeof Buffer === 'function') {
btoa = (str) => Buffer.from(str, 'utf-8').toString('base64');
}
class SourceMap {
version = 3;
/** @type {string[]} */
names = [];
/**
* @param {[number, number, number, number][][]} mappings
* @param {PrintOptions} opts
*/
constructor(mappings, opts) {
this.sources = [opts.sourceMapSource || null];
this.sourcesContent = [opts.sourceMapContent || null];
this.mappings = opts.sourceMapEncodeMappings === false ? mappings : encode(mappings);
}
/**
* Returns a JSON representation suitable for saving as a `*.map` file
*/
toString() {
return JSON.stringify(this);
}
/**
* Returns a base64-encoded JSON representation suitable for inlining at the bottom of a file with `//# sourceMappingURL={...}`
*/
toUrl() {
return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());
}
}
/**
* @template {BaseNode} [T=BaseNode]
* @param {T} node
* @param {Visitors<T>} visitors
* @param {PrintOptions} opts
* @returns {{ code: string, map: any }} // TODO
*/
export function print(node, visitors, opts = {}) {
/** @type {Command[]} */
const commands = [];
const tokens = opts.tokens ? new Tokens(opts.tokens) : null;
// @ts-ignore some nonsense I don't understand
const context = new Context(visitors, commands, tokens);
context.visit(node);
/** @typedef {[generatedColumn: number, sourceIndex: number, originalLine: number, originalColumn: number]} Segment */
let code = '';
let current_column = 0;
/** @type {Segment[][]} */
let mappings = [];
/** @type {Segment[]} */
let current_line = [];
/** @param {string} str */
function append(str) {
code += str;
for (let i = 0; i < str.length; i += 1) {
if (str[i] === '\n') {
mappings.push(current_line);
current_line = [];
current_column = 0;
} else {
current_column += 1;
}
}
}
let current_newline = '\n';
const indent_str = opts.indent ?? '\t';
let needs_newline = false;
let needs_margin = false;
let needs_space = false;
/** @type {Location[]} */
const pending_locations = [];
/** @param {Location} location */
function add_location(location) {
const prev = current_line[current_line.length - 1];
/** @type {Segment} */
const segment = [
current_column,
0, // source index is always zero
location.line - 1,
location.column
];
if (!prev || prev[0] !== segment[0] || prev[2] !== segment[2] || prev[3] !== segment[3]) {
current_line.push(segment);
}
}
function flush_locations() {
for (const location of pending_locations) {
add_location(location);
}
pending_locations.length = 0;
}
/** @param {Command} command */
function run(command) {
if (Array.isArray(command)) {
for (let i = 0; i < command.length; i += 1) {
run(command[i]);
}
return;
}
if (typeof command === 'number') {
if (command === newline) {
needs_newline = true;
} else if (command === margin) {
needs_margin = true;
} else if (command === space) {
needs_space = true;
} else if (command === indent) {
current_newline += indent_str;
} else if (command === dedent) {
// `slice(0, -0)` would return an empty string, dropping the newline
current_newline = current_newline.slice(0, current_newline.length - indent_str.length);
}
return;
}
if (typeof command === 'string') {
if (needs_newline) {
append(needs_margin ? '\n' + current_newline : current_newline);
} else if (needs_space) {
append(' ');
}
needs_margin = needs_newline = needs_space = false;
flush_locations();
append(command);
return;
}
if (command.type === 'Location') {
// Locations must not flush whitespace, but should follow it if more text is written.
if (needs_newline || needs_space) {
pending_locations.push(command);
} else {
add_location(command);
}
}
}
for (let i = 0; i < commands.length; i += 1) {
run(commands[i]);
}
// Preserve trailing mappings without emitting trailing whitespace.
flush_locations();
mappings.push(current_line);
/** @type {SourceMap} */
let map;
return {
code,
// create sourcemap lazily in case we don't need it
get map() {
return (map ??= new SourceMap(mappings, opts));
}
};
}
// it sucks that we have to export the class rather than just
// re-exporting it via public.d.ts, but otherwise TypeScript
// gets confused about private fields because it is really dumb!
export { Context };

2975
node_modules/esrap/src/languages/ts/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

4
node_modules/esrap/src/languages/ts/public.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export type { BaseNode as Node } from '../../types.js';
export type { BaseComment, Comment } from '../types.js';
export { default, EXPRESSIONS_PRECEDENCE } from './index.js';

163
node_modules/esrap/src/languages/tsx/index.js generated vendored Normal file
View File

@@ -0,0 +1,163 @@
/** @import { TSESTree } from '@typescript-eslint/types' */
/** @import { BaseNode, Visitors } from '../../types.js' */
/** @import { TSOptions } from '../types.js' */
import ts from '../ts/index.js';
/**
* @param {TSOptions} [options]
* @returns {Visitors<BaseNode>}
*/
export default (options) => {
/** @type {Visitors<TSESTree.Node>} */
const visitors = {
.../** @type {Visitors<TSESTree.Node>} */ (ts(options)),
TSTypeParameterDeclaration(node, context) {
context.write('<');
for (let i = 0; i < node.params.length; i++) {
if (i > 0) context.write(', ');
context.visit(node.params[i]);
}
// Keep single-parameter declarations unambiguous with JSX.
if (node.params.length === 1) context.write(',');
context.write('>');
},
JSXElement(node, context) {
context.visit(node.openingElement);
if (node.children.length > 0) {
context.indent();
}
for (const child of node.children) {
context.visit(child);
}
if (node.children.length > 0) {
context.dedent();
}
if (node.closingElement) {
context.visit(node.closingElement);
}
},
JSXOpeningElement(node, context) {
context.write('<');
context.visit(node.name);
// explicit type arguments (`<Comp<string> ... />`)
if (node.typeArguments) {
context.visit(node.typeArguments);
}
for (const attribute of node.attributes) {
context.write(' ');
context.visit(attribute);
}
if (node.selfClosing) {
context.write(' /');
}
context.write('>');
},
JSXClosingElement(node, context) {
context.write('</');
context.visit(node.name);
context.write('>');
},
JSXNamespacedName(node, context) {
context.visit(node.namespace);
context.write(':');
context.visit(node.name);
},
JSXIdentifier(node, context) {
context.write(node.name, node);
},
JSXMemberExpression(node, context) {
context.visit(node.object);
context.write('.');
context.visit(node.property);
},
JSXText(node, context) {
// `value` is decoded — re-emitting it would turn `&lt;`, `&gt;`, `&#123;`
// and `&#125;` back into characters that can't appear in JSX text
context.write(node.raw ?? node.value, node);
},
JSXAttribute(node, context) {
context.visit(node.name);
if (node.value) {
context.write('=');
context.visit(node.value);
}
},
JSXEmptyExpression(node, context) {},
JSXFragment(node, context) {
context.visit(node.openingFragment);
if (node.children.length > 0) {
context.indent();
}
for (const child of node.children) {
context.visit(child);
}
if (node.children.length > 0) {
context.dedent();
}
context.visit(node.closingFragment);
},
JSXOpeningFragment(node, context) {
context.write('<>');
},
JSXClosingFragment(node, context) {
context.write('</>');
},
JSXExpressionContainer(node, context) {
context.write('{');
context.visit(node.expression);
context.write('}');
},
JSXSpreadChild(node, context) {
context.write('{...');
context.visit(node.expression);
context.write('}');
},
JSXSpreadAttribute(node, context) {
context.write('{...');
context.visit(node.argument);
context.write('}');
}
};
// Accept compatible ASTs from other parsers at the public boundary.
return /** @type {Visitors<BaseNode>} */ (visitors);
};

4
node_modules/esrap/src/languages/tsx/public.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export type { BaseNode as Node } from '../../types.js';
export type { BaseComment, Comment } from '../types.js';
export { default } from './index.js';

29
node_modules/esrap/src/languages/types.ts generated vendored Normal file
View File

@@ -0,0 +1,29 @@
import type { BaseNode } from '../types.js';
export type TSOptions = {
quotes?: 'double' | 'single';
comments?: Comment[];
getLeadingComments?: (node: BaseNode) => BaseComment[] | undefined;
getTrailingComments?: (node: BaseNode) => BaseComment[] | undefined;
};
interface Position {
line: number;
column: number;
}
// this exists in TSESTree but because of the inanity around enums
// it's easier to do this ourselves
export interface BaseComment {
type: 'Line' | 'Block';
value: string;
start?: number;
end?: number;
}
export interface Comment extends BaseComment {
loc: {
start: Position;
end: Position;
};
}

2
node_modules/esrap/src/public.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export type { PrintOptions, Token, Visitors } from './types.js';
export * from './index.js';

235
node_modules/esrap/src/tokens.js generated vendored Normal file
View File

@@ -0,0 +1,235 @@
/** @import { BaseNode, Token } from './types.js' */
/**
* @typedef {{ line: number, column: number }} Position
* @typedef {{ value: string, start: Position, end: Position, pair: number }} Entry
* @typedef {{ lo: number, hi: number, openers: Opener[] }} Frame
* @typedef {{ value: string, pair: number }} Opener
*/
/** Acorn/Babel token types that don't correspond to anything written verbatim */
const IGNORED = new Set([
'string',
'num',
'bigint',
'decimal',
'regexp',
'template',
'invalidTemplate',
'privateId',
'jsxText',
'eof'
]);
/** ESLint-style token types (espree, typescript-eslint) whose `value` is written verbatim */
const VERBATIM = new Set([
'Punctuator',
'Keyword',
'Identifier',
'Boolean',
'Null',
'JSXIdentifier'
]);
/** @type {Record<string, string>} */
const OPENERS = { ')': '(', ']': '[', '}': '{' };
/**
* The text a parser token stands for, or `null` if it's not something a printer writes as-is.
* Acorn and Babel describe tokens with a `type` object whose `label` is the punctuator (or
* `name` for identifiers and contextual keywords), with operators and words in `value`.
* ESLint-style tokens have a string `type` and the source text in `value`.
* @param {Token} token
* @returns {string | null}
*/
function text(token) {
const { type, value } = token;
if (typeof type === 'object' && type !== null) {
const label = type.label;
if (label === undefined || IGNORED.has(label)) return null;
if (label === 'jsxTagStart') return '<';
if (label === 'jsxTagEnd') return '>';
return typeof value === 'string' ? value : label;
}
if (typeof type === 'string' && VERBATIM.has(type) && typeof value === 'string') {
return value;
}
return null;
}
/**
* @param {Position} a
* @param {Position} b
*/
function compare(a, b) {
return a.line - b.line || a.column - b.column;
}
/**
* Tracks which of the parser's tokens have been written, so that `context.write`
* can map a token to its source location. Each `context.visit` narrows the search to
* the tokens inside the visited node; each written token advances the cursor past it.
*/
export class Tokens {
/** @type {Entry[]} */
#entries = [];
/** @type {Frame} */
#frame = { lo: 0, hi: 0, openers: [] };
/** @param {readonly Token[]} tokens */
constructor(tokens) {
/** @type {Entry[]} */
const entries = [];
for (const token of tokens) {
if (!token.loc) continue;
const value = text(token);
if (value === null) continue;
entries.push({ value, start: token.loc.start, end: token.loc.end, pair: -1 });
}
// parsers that backtrack (e.g. acorn-typescript) can emit tokens more than once, or out
// of order. Keep the last token emitted at each position, and drop any that overlap
entries.sort((a, b) => compare(a.start, b.start));
for (const entry of entries) {
const previous = this.#entries[this.#entries.length - 1];
if (previous && compare(previous.start, entry.start) === 0) {
this.#entries[this.#entries.length - 1] = entry;
} else if (!previous || compare(previous.end, entry.start) <= 0) {
this.#entries.push(entry);
}
}
// pair up brackets, so that a closing bracket can be found from its opening bracket
// regardless of any redundant parentheses or trailing commas in between
/** @type {number[]} */
const stack = [];
for (let i = 0; i < this.#entries.length; i += 1) {
const { value } = this.#entries[i];
if (value === '(' || value === '[' || value === '{' || value === '${') {
stack.push(i);
} else if (value in OPENERS) {
const opener = stack.pop();
if (opener === undefined) continue;
const expected = this.#entries[opener].value;
if (expected === OPENERS[value] || (value === '}' && expected === '${')) {
this.#entries[opener].pair = i;
this.#entries[i].pair = opener;
}
}
}
}
/**
* Bound the search to the tokens within `node`. If `node` has no location, disable
* searching until a descendant with a location is visited
* @param {BaseNode} node
* @returns {Frame} the previous state, to be passed to `exit`
*/
enter(node) {
const previous = this.#frame;
if (node.loc) {
let lo = this.#search(node.loc.start);
const hi = this.#search(node.loc.end);
// if the parent has already written tokens inside this node (e.g. the decorators
// of an exported class, which are printed before `export`), skip them
if (previous.lo > lo && previous.lo < hi) lo = previous.lo;
this.#frame = { lo, hi, openers: [] };
} else {
this.#frame = { lo: 0, hi: 0, openers: [] };
}
return previous;
}
/**
* Restore the state from before `enter`, advancing the cursor past `node`
* @param {BaseNode} node
* @param {Frame} previous
*/
exit(node, previous) {
this.#frame = previous;
if (node.loc) this.skip(node.loc.end);
}
/**
* Advance the cursor past `position`
* @param {Position} position
*/
skip(position) {
this.#frame.lo = Math.max(this.#frame.lo, this.#search(position));
}
/**
* If `value` is the next unwritten token, consume it and return it. A closing
* bracket matches the partner of the opening bracket that was last written
* @param {string} value
* @param {Position} [from] only match tokens starting at or after this position
* @param {Position} [to] only match tokens ending at or before this position
* @returns {Entry | undefined}
*/
consume(value, from, to) {
const frame = this.#frame;
const is_opener = value === '(' || value === '[' || value === '{' || value === '${';
if (value in OPENERS) {
const opener = frame.openers[frame.openers.length - 1];
if (opener && (opener.value === OPENERS[value] || (value === '}' && opener.value === '${'))) {
frame.openers.pop();
const i = opener.pair;
if (i === -1 || i >= frame.hi) return;
frame.lo = Math.max(frame.lo, i + 1);
return this.#entries[i];
}
}
const entry = frame.lo < frame.hi ? this.#entries[frame.lo] : undefined;
const match =
entry !== undefined &&
entry.value === value &&
(!from || compare(entry.start, from) >= 0) &&
(!to || compare(entry.end, to) <= 0);
if (is_opener) {
frame.openers.push({ value, pair: match ? entry.pair : -1 });
}
if (match) {
frame.lo += 1;
return entry;
}
}
/**
* The index of the first token starting at or after `position`
* @param {Position} position
*/
#search(position) {
let lo = 0;
let hi = this.#entries.length;
while (lo < hi) {
const mid = (lo + hi) >> 1;
if (compare(this.#entries[mid].start, position) < 0) lo = mid + 1;
else hi = mid;
}
return lo;
}
}

67
node_modules/esrap/src/types.ts generated vendored Normal file
View File

@@ -0,0 +1,67 @@
import type { Context } from 'esrap';
export type BaseNode = {
type: string;
loc?: null | {
start: { line: number; column: number };
end: { line: number; column: number };
};
};
type NodeOf<T extends string, X> = X extends { type: T } ? X : never;
type SpecialisedVisitors<T extends BaseNode> = {
[K in T['type']]?: Visitor<NodeOf<K, T>>;
};
export type Visitor<T> = (node: T, context: Context) => void;
export type Visitors<T extends BaseNode = BaseNode> = T['type'] extends '_'
? never
: SpecialisedVisitors<T> & { _?: (node: T, context: Context, visit: (node: T) => void) => void };
export { Context };
type TSExpressionWithTypeArguments = {
type: 'TSExpressionWithTypeArguments';
expression: any;
};
export interface Location {
type: 'Location';
line: number;
column: number;
}
export interface IndentChange {
type: 'IndentChange';
offset: number;
}
export type Command = string | number | Location | Command[];
export interface PrintOptions {
sourceMapSource?: string;
sourceMapContent?: string;
sourceMapEncodeMappings?: boolean; // default true
indent?: string; // default tab
/**
* The parser's tokens — e.g. Acorn's `onToken` array, or `ast.tokens` from
* typescript-eslint or espree. When provided, punctuation and keywords
* written by visitors are mapped to their location in the source
*/
tokens?: readonly Token[];
}
/**
* A token produced by a parser. Acorn and Babel tokens have a `type` object
* with a `label`; ESLint-style tokens have a string `type` and a `value`
*/
export interface Token {
type?: string | { label?: string };
value?: unknown;
loc?: null | {
start: { line: number; column: number };
end: { line: number; column: number };
};
}

55
node_modules/esrap/types/context.d.ts generated vendored Normal file
View File

@@ -0,0 +1,55 @@
/** @import { BaseNode, Command, Visitors } from './types.js' */
/** @import { Tokens } from './tokens.js' */
export const margin: 0;
export const newline: 1;
export const indent: 2;
export const dedent: 3;
export const space: 4;
export class Context {
/**
*
* @param {Visitors} visitors
* @param {Command[]} commands
* @param {Tokens | null} tokens
*/
constructor(visitors: Visitors, commands?: Command[], tokens?: Tokens | null);
multiline: boolean;
indent(): void;
dedent(): void;
margin(): void;
newline(): void;
space(): void;
/**
* @param {Context} context
*/
append(context: Context): void;
/**
* Write `content`. If `node` is provided, `content` is mapped to its location. Otherwise, if `tokens`
* were passed to `print` and `content` (ignoring surrounding whitespace) is the next token
* in the source, it is mapped to that token's location.
* @param {string} content
* @param {BaseNode} [node]
*/
write(content: string, node?: BaseNode): void;
/**
*
* @param {number} line
* @param {number} column
*/
location(line: number, column: number): void;
/**
* @param {{ type: string }} node
*/
visit(node: {
type: string;
}): void;
empty(): boolean;
measure(): number;
"new"(): Context;
#private;
}
import type { BaseNode } from './types.js';
import type { Visitors } from './types.js';
import type { Command } from './types.js';
import type { Tokens } from './tokens.js';
//# sourceMappingURL=context.d.ts.map

1
node_modules/esrap/types/context.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.js"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,4CAA4C;AAE5C,qBAAsB,CAAC,CAAC;AACxB,sBAAuB,CAAC,CAAC;AACzB,qBAAsB,CAAC,CAAC;AACxB,qBAAsB,CAAC,CAAC;AACxB,oBAAqB,CAAC,CAAC;AAEvB;IAQC;;;;;OAKG;IACH,sBAJW,QAAQ,aACR,OAAO,EAAE,WACT,MAAM,GAAG,IAAI,EAMvB;IAZD,mBAAkB;IAclB,eAEC;IAED,eAEC;IAED,eAEC;IAED,gBAGC;IAED,cAEC;IAED;;OAEG;IACH,gBAFW,OAAO,QAQjB;IAED;;;;;;OAMG;IACH,eAHW,MAAM,SACN,QAAQ,QA4BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,UACN,MAAM,QAIhB;IAED;;OAEG;IACH,YAFW;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,QA+B1B;IAED,iBAEC;IAED,kBAEC;IAED,iBAEC;;CACD;8BAtJgD,YAAY;8BAAZ,YAAY;6BAAZ,YAAY;4BACjC,aAAa"}

17
node_modules/esrap/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/**
* @template {BaseNode} [T=BaseNode]
* @param {T} node
* @param {Visitors<T>} visitors
* @param {PrintOptions} opts
* @returns {{ code: string, map: any }} // TODO
*/
export function print<T extends BaseNode = BaseNode>(node: T, visitors: Visitors<T>, opts?: PrintOptions): {
code: string;
map: any;
};
export { Context };
import type { BaseNode } from './types.js';
import type { Visitors } from './types.js';
import type { PrintOptions } from './types.js';
import { Context } from './context.js';
//# sourceMappingURL=index.d.ts.map

1
node_modules/esrap/types/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AA+CA;;;;;;GAMG;AACH,sBANyB,CAAC,SAAb,QAAU,mBACZ,CAAC,YACD,SAAS,CAAC,CAAC,SACX,YAAY,GACV;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CA8ItC;;8BAlMwE,YAAY;8BAAZ,YAAY;kCAAZ,YAAY;wBAErB,cAAc"}

11
node_modules/esrap/types/languages/ts/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* @type {Record<string, number>}
* @satisfies {Record<TSESTree.Expression['type'] | 'Super' | 'RestElement', number>}
*/
export const EXPRESSIONS_PRECEDENCE: Record<string, number>;
declare function _default(options?: TSOptions): Visitors<BaseNode>;
export default _default;
import type { TSOptions } from '../types.js';
import type { BaseNode } from '../../types.js';
import type { Visitors } from '../../types.js';
//# sourceMappingURL=index.d.ts.map

1
node_modules/esrap/types/languages/ts/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/languages/ts/index.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qCAHU,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAyC9B;AAuHa,oCAHJ,SAAS,GACP,SAAS,QAAQ,CAAC,CA8vE9B;;+BAj6E2C,aAAa;8BADjB,gBAAgB;8BAAhB,gBAAgB"}

4
node_modules/esrap/types/languages/ts/public.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export type { BaseNode as Node } from '../../types.js';
export type { BaseComment, Comment } from '../types.js';
export { default, EXPRESSIONS_PRECEDENCE } from './index.js';
//# sourceMappingURL=public.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/languages/ts/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}

6
node_modules/esrap/types/languages/tsx/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
declare function _default(options?: TSOptions): Visitors<BaseNode>;
export default _default;
import type { TSOptions } from '../types.js';
import type { BaseNode } from '../../types.js';
import type { Visitors } from '../../types.js';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/languages/tsx/index.js"],"names":[],"mappings":"AASe,oCAHJ,SAAS,GACP,SAAS,QAAQ,CAAC,CA2J9B;;+BAhK8B,aAAa;8BADJ,gBAAgB;8BAAhB,gBAAgB"}

4
node_modules/esrap/types/languages/tsx/public.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export type { BaseNode as Node } from '../../types.js';
export type { BaseComment, Comment } from '../types.js';
export { default } from './index.js';
//# sourceMappingURL=public.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/languages/tsx/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}

25
node_modules/esrap/types/languages/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import type { BaseNode } from '../types.js';
export type TSOptions = {
quotes?: 'double' | 'single';
comments?: Comment[];
getLeadingComments?: (node: BaseNode) => BaseComment[] | undefined;
getTrailingComments?: (node: BaseNode) => BaseComment[] | undefined;
};
interface Position {
line: number;
column: number;
}
export interface BaseComment {
type: 'Line' | 'Block';
value: string;
start?: number;
end?: number;
}
export interface Comment extends BaseComment {
loc: {
start: Position;
end: Position;
};
}
export {};
//# sourceMappingURL=types.d.ts.map

1
node_modules/esrap/types/languages/types.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/languages/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG;IACvB,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,WAAW,EAAE,GAAG,SAAS,CAAC;IACnE,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,WAAW,EAAE,GAAG,SAAS,CAAC;CACpE,CAAC;AAEF,UAAU,QAAQ;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAID,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,OAAQ,SAAQ,WAAW;IAC3C,GAAG,EAAE;QACJ,KAAK,EAAE,QAAQ,CAAC;QAChB,GAAG,EAAE,QAAQ,CAAC;KACd,CAAC;CACF"}

3
node_modules/esrap/types/public.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export type { PrintOptions, Token, Visitors } from './types.js';
export * from './index.js';
//# sourceMappingURL=public.d.ts.map

1
node_modules/esrap/types/public.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChE,cAAc,YAAY,CAAC"}

59
node_modules/esrap/types/tokens.d.ts generated vendored Normal file
View File

@@ -0,0 +1,59 @@
/**
* Tracks which of the parser's tokens have been written, so that `context.write`
* can map a token to its source location. Each `context.visit` narrows the search to
* the tokens inside the visited node; each written token advances the cursor past it.
*/
export class Tokens {
/** @param {readonly Token[]} tokens */
constructor(tokens: readonly Token[]);
/**
* Bound the search to the tokens within `node`. If `node` has no location, disable
* searching until a descendant with a location is visited
* @param {BaseNode} node
* @returns {Frame} the previous state, to be passed to `exit`
*/
enter(node: BaseNode): Frame;
/**
* Restore the state from before `enter`, advancing the cursor past `node`
* @param {BaseNode} node
* @param {Frame} previous
*/
exit(node: BaseNode, previous: Frame): void;
/**
* Advance the cursor past `position`
* @param {Position} position
*/
skip(position: Position): void;
/**
* If `value` is the next unwritten token, consume it and return it. A closing
* bracket matches the partner of the opening bracket that was last written
* @param {string} value
* @param {Position} [from] only match tokens starting at or after this position
* @param {Position} [to] only match tokens ending at or before this position
* @returns {Entry | undefined}
*/
consume(value: string, from?: Position, to?: Position): Entry | undefined;
#private;
}
export type Position = {
line: number;
column: number;
};
export type Entry = {
value: string;
start: Position;
end: Position;
pair: number;
};
export type Frame = {
lo: number;
hi: number;
openers: Opener[];
};
export type Opener = {
value: string;
pair: number;
};
import type { BaseNode } from './types.js';
import type { Token } from './types.js';
//# sourceMappingURL=tokens.d.ts.map

1
node_modules/esrap/types/tokens.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.js"],"names":[],"mappings":"AAsEA;;;;GAIG;AACH;IAOC,uCAAuC;IACvC,oBADY,SAAS,KAAK,EAAE,EA+C3B;IAED;;;;;OAKG;IACH,YAHW,QAAQ,GACN,KAAK,CAmBjB;IAED;;;;OAIG;IACH,WAHW,QAAQ,YACR,KAAK,QAKf;IAED;;;OAGG;IACH,eAFW,QAAQ,QAIlB;IAED;;;;;;;OAOG;IACH,eALW,MAAM,SACN,QAAQ,OACR,QAAQ,GACN,KAAK,GAAG,SAAS,CAoC7B;;CAkBD;uBAvOY;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;oBAChC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;oBAC/D;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE;qBAC7C;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;8BANP,YAAY;2BAAZ,YAAY"}

68
node_modules/esrap/types/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,68 @@
import type { Context } from 'esrap';
export type BaseNode = {
type: string;
loc?: null | {
start: {
line: number;
column: number;
};
end: {
line: number;
column: number;
};
};
};
type NodeOf<T extends string, X> = X extends {
type: T;
} ? X : never;
type SpecialisedVisitors<T extends BaseNode> = {
[K in T['type']]?: Visitor<NodeOf<K, T>>;
};
export type Visitor<T> = (node: T, context: Context) => void;
export type Visitors<T extends BaseNode = BaseNode> = T['type'] extends '_' ? never : SpecialisedVisitors<T> & {
_?: (node: T, context: Context, visit: (node: T) => void) => void;
};
export { Context };
export interface Location {
type: 'Location';
line: number;
column: number;
}
export interface IndentChange {
type: 'IndentChange';
offset: number;
}
export type Command = string | number | Location | Command[];
export interface PrintOptions {
sourceMapSource?: string;
sourceMapContent?: string;
sourceMapEncodeMappings?: boolean;
indent?: string;
/**
* The parser's tokens — e.g. Acorn's `onToken` array, or `ast.tokens` from
* typescript-eslint or espree. When provided, punctuation and keywords
* written by visitors are mapped to their location in the source
*/
tokens?: readonly Token[];
}
/**
* A token produced by a parser. Acorn and Babel tokens have a `type` object
* with a `label`; ESLint-style tokens have a string `type` and a `value`
*/
export interface Token {
type?: string | {
label?: string;
};
value?: unknown;
loc?: null | {
start: {
line: number;
column: number;
};
end: {
line: number;
column: number;
};
};
}
//# sourceMappingURL=types.d.ts.map

1
node_modules/esrap/types/types.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,IAAI,GAAG;QACZ,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACxC,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACtC,CAAC;CACF,CAAC;AAEF,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAErE,KAAK,mBAAmB,CAAC,CAAC,SAAS,QAAQ,IAAI;KAC7C,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAE7D,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,GACxE,KAAK,GACL,mBAAmB,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,KAAK,IAAI,CAAA;CAAE,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,CAAC;AAOnB,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,EAAE,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,IAAI,GAAG;QACZ,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACxC,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACtC,CAAC;CACF"}