import { a as setCurrentWorkspace, n as currentWorkspace, o as workspaces, r as currentWorkspaceUri } from "./workspace2.js"; import { t as getErrorMessage } from "./utils.js"; import { createRequire } from "node:module"; import "node:assert"; //#region \0rolldown/runtime.js var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports), __copyProps = (to, from, except, desc) => { if (from && typeof from == "object" || typeof from == "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) key = keys[i], !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: ((k) => from[k]).bind(null, key), enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); return to; }, __toESM = (mod, isNodeMode, target) => (target = mod == null ? {} : __create(__getProtoOf(mod)), __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod)), __require = /* @__PURE__ */ createRequire(import.meta.url); //#endregion //#region src-js/generated/constants.ts /** * Total size of the allocator block (including metadata and allocator `ChunkFooter`). */ const BLOCK_SIZE = 2147483632, BLOCK_ALIGN = 4294967296, BUFFER_SIZE = 2147483576, ACTIVE_SIZE = 2147483560, DATA_POINTER_POS_32 = 536870890, { freeze } = Object, $EMPTY = freeze([]), DECORATORS__KEY__TYPE_ANNOTATION__VALUE = freeze([ "decorators", "key", "typeAnnotation", "value" ]), LEFT__RIGHT = freeze(["left", "right"]), ARGUMENT = freeze(["argument"]), BODY = freeze(["body"]), LABEL = freeze(["label"]), CALLEE__TYPE_ARGUMENTS__ARGUMENTS = freeze([ "callee", "typeArguments", "arguments" ]), EXPRESSION = freeze(["expression"]), DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY = freeze([ "decorators", "id", "typeParameters", "superClass", "superTypeArguments", "implements", "body" ]), TEST__CONSEQUENT__ALTERNATE = freeze([ "test", "consequent", "alternate" ]), LEFT__RIGHT__BODY = freeze([ "left", "right", "body" ]), ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY = freeze([ "id", "typeParameters", "params", "returnType", "body" ]), KEY__VALUE = freeze(["key", "value"]), LOCAL = freeze(["local"]), OBJECT__PROPERTY = freeze(["object", "property"]), DECORATORS__KEY__TYPE_ANNOTATION = freeze([ "decorators", "key", "typeAnnotation" ]), EXPRESSION__TYPE_ANNOTATION = freeze(["expression", "typeAnnotation"]), TYPE_PARAMETERS__PARAMS__RETURN_TYPE = freeze([ "typeParameters", "params", "returnType" ]), EXPRESSION__TYPE_ARGUMENTS = freeze(["expression", "typeArguments"]), MEMBERS = freeze(["members"]), ID__BODY = freeze(["id", "body"]), TYPES = freeze(["types"]), TYPE_ANNOTATION = freeze(["typeAnnotation"]), PARAMS = freeze(["params"]); var keys_default = freeze({ DebuggerStatement: $EMPTY, EmptyStatement: $EMPTY, Literal: $EMPTY, PrivateIdentifier: $EMPTY, Super: $EMPTY, TemplateElement: $EMPTY, ThisExpression: $EMPTY, JSXClosingFragment: $EMPTY, JSXEmptyExpression: $EMPTY, JSXIdentifier: $EMPTY, JSXOpeningFragment: $EMPTY, JSXText: $EMPTY, TSAnyKeyword: $EMPTY, TSBigIntKeyword: $EMPTY, TSBooleanKeyword: $EMPTY, TSIntrinsicKeyword: $EMPTY, TSJSDocUnknownType: $EMPTY, TSNeverKeyword: $EMPTY, TSNullKeyword: $EMPTY, TSNumberKeyword: $EMPTY, TSObjectKeyword: $EMPTY, TSStringKeyword: $EMPTY, TSSymbolKeyword: $EMPTY, TSThisType: $EMPTY, TSUndefinedKeyword: $EMPTY, TSUnknownKeyword: $EMPTY, TSVoidKeyword: $EMPTY, AccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION__VALUE, ArrayExpression: freeze(["elements"]), ArrayPattern: freeze([ "decorators", "elements", "typeAnnotation" ]), ArrowFunctionExpression: freeze([ "typeParameters", "params", "returnType", "body" ]), AssignmentExpression: LEFT__RIGHT, AssignmentPattern: freeze([ "decorators", "left", "right", "typeAnnotation" ]), AwaitExpression: ARGUMENT, BinaryExpression: LEFT__RIGHT, BlockStatement: BODY, BreakStatement: LABEL, CallExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS, CatchClause: freeze(["param", "body"]), ChainExpression: EXPRESSION, ClassBody: BODY, ClassDeclaration: DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY, ClassExpression: DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY, ConditionalExpression: TEST__CONSEQUENT__ALTERNATE, ContinueStatement: LABEL, Decorator: EXPRESSION, DoWhileStatement: freeze(["body", "test"]), ExportAllDeclaration: freeze([ "exported", "source", "attributes" ]), ExportDefaultDeclaration: freeze(["declaration"]), ExportNamedDeclaration: freeze([ "declaration", "specifiers", "source", "attributes" ]), ExportSpecifier: freeze(["local", "exported"]), ExpressionStatement: EXPRESSION, ForInStatement: LEFT__RIGHT__BODY, ForOfStatement: LEFT__RIGHT__BODY, ForStatement: freeze([ "init", "test", "update", "body" ]), FunctionDeclaration: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY, FunctionExpression: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY, Identifier: freeze(["decorators", "typeAnnotation"]), IfStatement: TEST__CONSEQUENT__ALTERNATE, ImportAttribute: KEY__VALUE, ImportDeclaration: freeze([ "specifiers", "source", "attributes" ]), ImportDefaultSpecifier: LOCAL, ImportExpression: freeze(["source", "options"]), ImportNamespaceSpecifier: LOCAL, ImportSpecifier: freeze(["imported", "local"]), LabeledStatement: freeze(["label", "body"]), LogicalExpression: LEFT__RIGHT, MemberExpression: OBJECT__PROPERTY, MetaProperty: freeze(["meta", "property"]), MethodDefinition: freeze([ "decorators", "key", "value" ]), NewExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS, ObjectExpression: freeze(["properties"]), ObjectPattern: freeze([ "decorators", "properties", "typeAnnotation" ]), ParenthesizedExpression: EXPRESSION, Program: BODY, Property: KEY__VALUE, PropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION__VALUE, RestElement: freeze([ "decorators", "argument", "typeAnnotation" ]), ReturnStatement: ARGUMENT, SequenceExpression: freeze(["expressions"]), SpreadElement: ARGUMENT, StaticBlock: BODY, SwitchCase: freeze(["test", "consequent"]), SwitchStatement: freeze(["discriminant", "cases"]), TaggedTemplateExpression: freeze([ "tag", "typeArguments", "quasi" ]), TemplateLiteral: freeze(["quasis", "expressions"]), ThrowStatement: ARGUMENT, TryStatement: freeze([ "block", "handler", "finalizer" ]), UnaryExpression: ARGUMENT, UpdateExpression: ARGUMENT, V8IntrinsicExpression: freeze(["name", "arguments"]), VariableDeclaration: freeze(["declarations"]), VariableDeclarator: freeze(["id", "init"]), WhileStatement: freeze(["test", "body"]), WithStatement: freeze(["object", "body"]), YieldExpression: ARGUMENT, JSXAttribute: freeze(["name", "value"]), JSXClosingElement: freeze(["name"]), JSXElement: freeze([ "openingElement", "children", "closingElement" ]), JSXExpressionContainer: EXPRESSION, JSXFragment: freeze([ "openingFragment", "children", "closingFragment" ]), JSXMemberExpression: OBJECT__PROPERTY, JSXNamespacedName: freeze(["namespace", "name"]), JSXOpeningElement: freeze([ "name", "typeArguments", "attributes" ]), JSXSpreadAttribute: ARGUMENT, JSXSpreadChild: EXPRESSION, TSAbstractAccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION, TSAbstractMethodDefinition: KEY__VALUE, TSAbstractPropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION, TSArrayType: freeze(["elementType"]), TSAsExpression: EXPRESSION__TYPE_ANNOTATION, TSCallSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE, TSClassImplements: EXPRESSION__TYPE_ARGUMENTS, TSConditionalType: freeze([ "checkType", "extendsType", "trueType", "falseType" ]), TSConstructSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE, TSConstructorType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE, TSDeclareFunction: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY, TSEmptyBodyFunctionExpression: freeze([ "id", "typeParameters", "params", "returnType" ]), TSEnumBody: MEMBERS, TSEnumDeclaration: ID__BODY, TSEnumMember: freeze(["id", "initializer"]), TSExportAssignment: EXPRESSION, TSExternalModuleReference: EXPRESSION, TSFunctionType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE, TSImportEqualsDeclaration: freeze(["id", "moduleReference"]), TSImportType: freeze([ "source", "options", "qualifier", "typeArguments" ]), TSIndexSignature: freeze(["parameters", "typeAnnotation"]), TSIndexedAccessType: freeze(["objectType", "indexType"]), TSInferType: freeze(["typeParameter"]), TSInstantiationExpression: EXPRESSION__TYPE_ARGUMENTS, TSInterfaceBody: BODY, TSInterfaceDeclaration: freeze([ "id", "typeParameters", "extends", "body" ]), TSInterfaceHeritage: EXPRESSION__TYPE_ARGUMENTS, TSIntersectionType: TYPES, TSJSDocNonNullableType: TYPE_ANNOTATION, TSJSDocNullableType: TYPE_ANNOTATION, TSLiteralType: freeze(["literal"]), TSMappedType: freeze([ "key", "constraint", "nameType", "typeAnnotation" ]), TSMethodSignature: freeze([ "key", "typeParameters", "params", "returnType" ]), TSModuleBlock: BODY, TSModuleDeclaration: ID__BODY, TSNamedTupleMember: freeze(["label", "elementType"]), TSNamespaceExportDeclaration: freeze(["id"]), TSNonNullExpression: EXPRESSION, TSOptionalType: TYPE_ANNOTATION, TSParameterProperty: freeze(["decorators", "parameter"]), TSParenthesizedType: TYPE_ANNOTATION, TSPropertySignature: freeze(["key", "typeAnnotation"]), TSQualifiedName: LEFT__RIGHT, TSRestType: TYPE_ANNOTATION, TSSatisfiesExpression: EXPRESSION__TYPE_ANNOTATION, TSTemplateLiteralType: freeze(["quasis", "types"]), TSTupleType: freeze(["elementTypes"]), TSTypeAliasDeclaration: freeze([ "id", "typeParameters", "typeAnnotation" ]), TSTypeAnnotation: TYPE_ANNOTATION, TSTypeAssertion: freeze(["typeAnnotation", "expression"]), TSTypeLiteral: MEMBERS, TSTypeOperator: TYPE_ANNOTATION, TSTypeParameter: freeze([ "name", "constraint", "default" ]), TSTypeParameterDeclaration: PARAMS, TSTypeParameterInstantiation: PARAMS, TSTypePredicate: freeze(["parameterName", "typeAnnotation"]), TSTypeQuery: freeze(["exprName", "typeArguments"]), TSTypeReference: freeze(["typeName", "typeArguments"]), TSUnionType: TYPES }); //#endregion //#region src-js/plugins/location.ts const ObjectDefineProperty$4 = Object.defineProperty, ArrayIsArray$6 = Array.isArray, LINE_BREAK_PATTERN = /\r\n|[\r\n\u2028\u2029]/gu, lines = [], lineStartIndices = [0], cachedLocations = []; let activeLocationsCount = 0; /** * Split source text into lines. */ function initLines() { sourceText === null && initSourceText(); let lastOffset = 0, offset, match; for (; (match = LINE_BREAK_PATTERN.exec(sourceText)) !== null;) offset = match.index, lines.push(sourceText.slice(lastOffset, offset)), lineStartIndices.push(lastOffset = offset + match[0].length); lines.push(sourceText.slice(lastOffset)); } /** * Reset lines after file has been linted, to free memory. * Reset `Location` object pool. */ function resetLinesAndLocs() { lines.length = 0, lineStartIndices.length = 1, activeLocationsCount = 0; } /** * Convert a source text index into a (line, column) pair. * @param offset - The index of a character in a file. * @returns `{line, column}` location object with 1-indexed line and 0-indexed column. * @throws {TypeError|RangeError} If non-numeric `offset`, or `offset` out of range. */ function getLineColumnFromOffset(offset) { if (typeof offset != "number" || offset < 0 || (offset | 0) !== offset) throw TypeError("Expected `offset` to be a non-negative integer."); if (lines.length === 0 && initLines(), offset > sourceText.length) throw RangeError(`Index out of range (requested index ${offset}, but source text has length ${sourceText.length}).`); let low = 0, high = lineStartIndices.length, mid; do mid = low + high >> 1, offset < lineStartIndices[mid] ? high = mid : low = mid + 1; while (low < high); return { line: low, column: offset - lineStartIndices[low - 1] }; } /** * Convert a `{ line, column }` pair into a range index. * @param loc - A line/column location. * @returns The character index of the location in the file. * @throws {TypeError|RangeError} If `loc` is not an object with a numeric `line` and `column`, * or if the `line` is less than or equal to zero, or the line or column is out of the expected range. */ function getOffsetFromLineColumn$1(loc) { if (typeof loc == "object" && loc) { let { line, column } = loc; if (typeof line == "number" && typeof column == "number" && (line | 0) === line && (column | 0) === column) { lines.length === 0 && initLines(); let linesCount = lineStartIndices.length; if (line <= 0 || line > linesCount) throw RangeError(`Line number out of range (line ${line} requested). Line numbers should be 1-based, and less than or equal to number of lines in file (${linesCount}).`); if (column < 0) throw RangeError(`Invalid column number (column ${column} requested).`); let lineOffset = lineStartIndices[line - 1], offset = lineOffset + column, nextLineOffset; if (line === linesCount) { if (nextLineOffset = sourceText.length, offset <= nextLineOffset) return offset; } else if (nextLineOffset = lineStartIndices[line], offset < nextLineOffset) return offset; throw RangeError(`Column number out of range (column ${column} requested, but the length of line ${line} is ${nextLineOffset - lineOffset}).`); } } throw TypeError("Expected `loc` to be an object with integer `line` and `column` properties"); } /** * Get the range of the given node or token. * @param nodeOrToken - Node or token to get the range of * @returns Range of the node or token */ function getRange(nodeOrToken) { return nodeOrToken.range; } /** * Get the location of the given node or token. * @param nodeOrToken - Node or token to get the location of * @returns Location of the node or token */ function getLoc(nodeOrToken) { return nodeOrToken.loc; } /** * Calculate the `Location` for an AST node, and cache it on the node. * * Used in `loc` getter on AST nodes (not tokens or comments - they use their own caching * via `Token` / `Comment` class private fields). * * Defines a `loc` property on the node with the calculated `Location`, so accessing `loc` twice on same node * results in the same object each time. * * For internal use only. * * @param node - AST node * @returns Location */ function getNodeLoc(node) { let loc = computeLoc(node.start, node.end); return LOC_DESCRIPTOR.value = loc, ObjectDefineProperty$4(node, "loc", LOC_DESCRIPTOR), loc; } const LOC_DESCRIPTOR = { value: null, writable: !0, enumerable: !1, configurable: !1 }; /** * Compute a `Location` from `start` and `end` source offsets. * * Returns a recycled `Location` object from the pool when possible, allocating only during warmup. * Initializes `lines` and `lineStartIndices` tables if they haven't been already. * * @param start - Start offset * @param end - End offset * @returns Location */ function computeLoc(start, end) { lines.length === 0 && initLines(); let loc; activeLocationsCount < cachedLocations.length ? loc = cachedLocations[activeLocationsCount] : cachedLocations.push(loc = { start: { line: 0, column: 0 }, end: { line: 0, column: 0 } }), activeLocationsCount++; let linesLen = lineStartIndices.length, line = 0, high = linesLen, mid; do mid = line + high >> 1, start < lineStartIndices[mid] ? high = mid : line = mid + 1; while (line < high); let lineStart = lineStartIndices[line - 1], locStart = loc.start; locStart.line = line, locStart.column = start - lineStart; let locEnd = loc.end; if (line === linesLen || end < lineStartIndices[line]) locEnd.line = line, locEnd.column = end - lineStart; else { for (line++, high = linesLen; line < high;) mid = line + high >> 1, end < lineStartIndices[mid] ? high = mid : line = mid + 1; locEnd.line = line, locEnd.column = end - lineStartIndices[line - 1]; } return loc; } /** * Get the deepest node containing a range index. * @param offset - Range index of the desired node * @returns The node if found, or `null` if not found */ function getNodeByRangeIndex(offset) { return ast === null && initAst(), offset < ast.start || offset >= ast.end ? null : (index = offset, traverse(ast)); } let index = 0; /** * Find deepest node containing `index`. * `node` must contain `index` itself. This function finds a deeper node if one exists. * * @param node - Node to start traversal from * @returns Deepest node containing `index` */ function traverse(node) { let keys = keys_default[node.type]; for (let keyIndex = 0, keysLen = keys.length; keyIndex < keysLen; keyIndex++) { let child = node[keys[keyIndex]]; if (ArrayIsArray$6(child)) for (let arrIndex = 0, arrLen = child.length; arrIndex < arrLen; arrIndex++) { let entry = child[arrIndex]; if (entry !== null) { if (entry.start > index) break; if (entry.end > index) return traverse(entry); } } else if (child !== null) { if (child.start > index) break; if (child.end > index) return traverse(child); } } return node; } //#endregion //#region src-js/utils/typed_arrays.ts const EMPTY_UINT8_ARRAY = /* @__PURE__ */ new Uint8Array(), EMPTY_INT32_ARRAY = /* @__PURE__ */ new Int32Array(), FunctionPrototypeCall$1 = Function.prototype.call, ObjectPrototype__defineGetter__$1 = Object.prototype.__defineGetter__, MathMax$4 = Math.max, StringFromCodePoint$1 = String.fromCodePoint; let tokens = null, tokensUint8 = null, tokensInt32 = null, tokensLen = 0, allTokensDeserialized = !1; const cachedTokens = []; let previousTokens = []; const tokensWithLoc = []; let activeTokensWithLocCount = 0; const regexObjects = []; let tokensWithRegexIndexes = EMPTY_INT32_ARRAY, activeTokensWithRegexCount = 0, deserializedTokenIndexes = EMPTY_INT32_ARRAY, deserializedTokensLen = 0; const defineGetter$1 = FunctionPrototypeCall$1.bind(ObjectPrototype__defineGetter__$1); let getTokenLocTemp, resetLocTemp; /** * Token implementation with lazy `loc` caching via private field. * * `loc` is defined as an own accessor property via `__defineGetter__` in the constructor, * using a shared getter function (`getTokenLoc`). This makes `loc` an own enumerable property, * so `{...token}` spreads it and `JSON.stringify(token)` serializes it. * * The computed `Location` value is cached in the private `#loc` field on first access. * All instances share the same getter function, keeping the V8 hidden class transition * identical across instances. Reset only clears the `#loc` field. */ var Token = class { type = null; value = null; regex; start = 0; end = 0; range = [0, 0]; #loc = null; constructor() { defineGetter$1(this, "loc", getTokenLoc); } static { getTokenLocTemp = function() { let loc = this.#loc; return loc === null ? (activeTokensWithLocCount < tokensWithLoc.length ? tokensWithLoc[activeTokensWithLocCount] = this : tokensWithLoc.push(this), activeTokensWithLocCount++, this.#loc = computeLoc(this.start, this.end)) : loc; }, resetLocTemp = (token) => { token.#loc = null; }; } }; const getTokenLoc = getTokenLocTemp, resetLoc = resetLocTemp, TOKEN_TYPES = [ "Identifier", "Keyword", "PrivateIdentifier", "Punctuator", "Numeric", "String", "Boolean", "Null", "RegularExpression", "Template", "JSXText", "JSXIdentifier" ]; /** * Deserialize all tokens and build the `tokens` array. * Called by `ast.tokens` getter. */ function initTokens() { allTokensDeserialized || deserializeTokens(), previousTokens.length >= tokensLen ? (previousTokens.length = tokensLen, tokens = previousTokens) : tokens = previousTokens = cachedTokens.slice(0, tokensLen); } /** * Deserialize all tokens into `cachedTokens`. * Does NOT build the `tokens` array - use `initTokens` for that. */ function deserializeTokens() { tokensInt32 === null && initTokensBuffer(); for (let i = 0; i < tokensLen; i++) deserializeTokenIfNeeded(i); allTokensDeserialized = !0, deserializedTokensLen = 0; } /** * Initialize typed array views over the tokens region of the buffer. * * Populates `tokensUint8`, `tokensInt32`, and `tokensLen`, and grows `cachedTokens` if needed. * Does NOT deserialize tokens - they are deserialized lazily via `deserializeTokenIfNeeded`. */ function initTokensBuffer() { sourceText === null && initSourceText(); let { int32 } = buffer, tokensPos = int32[536870891]; tokensLen = int32[536870892]; let arrayBuffer = buffer.buffer, absolutePos = buffer.byteOffset + tokensPos; if (tokensUint8 = new Uint8Array(arrayBuffer, absolutePos, tokensLen << 4), tokensInt32 = new Int32Array(arrayBuffer, absolutePos, tokensLen << 2), cachedTokens.length < tokensLen) { do cachedTokens.push(new Token()); while (cachedTokens.length < tokensLen); let indexesLen = deserializedTokenIndexes.length; indexesLen < tokensLen && (deserializedTokenIndexes = new Int32Array(MathMax$4(tokensLen, indexesLen === 0 ? 16 : indexesLen << 1))); } } /** * Get token at `index`, deserializing if needed. * * Caller must ensure `initTokensBuffer()` has been called before calling this function. * * @param index - Token index in the tokens buffer * @returns Deserialized token */ function getToken(index) { if (!allTokensDeserialized) { let token = deserializeTokenIfNeeded(index); if (token !== null) return deserializedTokenIndexes[deserializedTokensLen++] = index, token; } return cachedTokens[index]; } /** * Deserialize token at `index` if not already deserialized. * * Caller must ensure `initTokensBuffer()` has been called before calling this function. * * @param index - Token index in the tokens buffer * @returns `Token` object if newly deserialized, or `null` if already deserialized */ function deserializeTokenIfNeeded(index) { let pos = index << 4, flagPos = pos + 15; if (tokensUint8[flagPos] !== 0) return null; tokensUint8[flagPos] = 1; let token = cachedTokens[index], kind = tokensUint8[pos + 8], pos32 = pos >> 2, start = tokensInt32[pos32], end = tokensInt32[pos32 + 1], value = sourceText.slice(start + +(kind === 2), end); if (kind <= 2) tokensUint8[pos + 10] === 1 && (value = unescapeIdentifier(value)); else if (kind === 8) { let regex; if (activeTokensWithRegexCount < regexObjects.length) regex = regexObjects[activeTokensWithRegexCount]; else { regexObjects.push(regex = { pattern: null, flags: null }); let indexesLen = tokensWithRegexIndexes.length; if (indexesLen === activeTokensWithRegexCount) { let newArr = new Int32Array(indexesLen === 0 ? 16 : indexesLen << 1); newArr.set(tokensWithRegexIndexes, 0), tokensWithRegexIndexes = newArr; } } token.regex = regex, tokensWithRegexIndexes[activeTokensWithRegexCount++] = index; let patternEnd = value.lastIndexOf("/"); regex.pattern = value.slice(1, patternEnd), regex.flags = value.slice(patternEnd + 1); } return token.type = TOKEN_TYPES[kind], token.value = value, token.range[0] = token.start = start, token.range[1] = token.end = end, token; } /** * Unescape an identifier. * * We do this on JS side, because escaped identifiers are so extremely rare that this function * is never called in practice anyway. * * @param {string} name - Identifier name to unescape * @returns {string} - Unescaped identifier name */ function unescapeIdentifier(name) { return name.replace(/\\u(?:\{([0-9a-fA-F]+)\}|([0-9a-fA-F]{4}))/g, (_, hex1, hex2) => StringFromCodePoint$1(parseInt(hex1 ?? hex2, 16))); } /** * Reset tokens after file has been linted. * * Clears cached `loc` on tokens that had it accessed, so the getter * will recalculate it when the token is reused for a different file. */ function resetTokens() { if (tokensInt32 !== null) { if (allTokensDeserialized === !1) { for (let i = 0; i < deserializedTokensLen; i++) cachedTokens[deserializedTokenIndexes[i]].value = null; deserializedTokensLen = 0; } else { for (let i = 0; i < tokensLen; i++) cachedTokens[i].value = null; allTokensDeserialized = !1; } for (let i = 0; i < activeTokensWithLocCount; i++) resetLoc(tokensWithLoc[i]); activeTokensWithLocCount = 0; for (let i = 0; i < activeTokensWithRegexCount; i++) { let token = cachedTokens[tokensWithRegexIndexes[i]], regex = token.regex; regex.pattern = null, regex.flags = null, token.regex = void 0; } activeTokensWithRegexCount = 0, tokens = null, tokensUint8 = null, tokensInt32 = null, tokensLen = 0; } } //#endregion //#region src-js/plugins/comments.ts const ObjectFreeze$7 = Object.freeze, FunctionPrototypeCall = Function.prototype.call, ObjectPrototype__defineGetter__ = Object.prototype.__defineGetter__, MathMax$3 = Math.max; let comments = null, commentsUint8 = null, commentsInt32 = null, commentsLen = 0, allCommentsDeserialized = !1; const cachedComments = []; let previousComments = []; const commentsWithLoc = []; let activeCommentsWithLocCount = 0, deserializedCommentIndexes = EMPTY_INT32_ARRAY, deserializedCommentsLen = 0; const EMPTY_COMMENTS = ObjectFreeze$7([]), defineGetter = FunctionPrototypeCall.bind(ObjectPrototype__defineGetter__); let getCommentLocTemp, resetCommentLocTemp; /** * Comment class. * * `loc` is defined as an own accessor property via `__defineGetter__` in the constructor, * using a shared getter function (`getCommentLoc`). This makes `loc` an own enumerable property, * so `{...comment}` spreads it and `JSON.stringify(comment)` serializes it. * * The computed `Location` value is cached in the private `#loc` field on first access. * All instances share the same getter function, keeping the V8 hidden class transition * identical across instances. Reset only clears the `#loc` field. */ var Comment = class { type = null; value = null; start = 0; end = 0; range = [0, 0]; #loc = null; constructor() { defineGetter(this, "loc", getCommentLoc); } static { getCommentLocTemp = function() { let loc = this.#loc; return loc === null ? (activeCommentsWithLocCount < commentsWithLoc.length ? commentsWithLoc[activeCommentsWithLocCount] = this : commentsWithLoc.push(this), activeCommentsWithLocCount++, this.#loc = computeLoc(this.start, this.end)) : loc; }, resetCommentLocTemp = (comment) => { comment.#loc = null; }; } }; const getCommentLoc = getCommentLocTemp, resetCommentLoc = resetCommentLocTemp; /** * Deserialize all comments and build the `comments` array. * Called by `ast.comments` getter. */ function initComments() { allCommentsDeserialized || deserializeComments(), comments === null && (previousComments.length >= commentsLen ? (previousComments.length = commentsLen, comments = previousComments) : comments = previousComments = cachedComments.slice(0, commentsLen)); } /** * Deserialize all comments into `cachedComments`. * Does NOT build the `comments` array - use `initComments` for that. */ function deserializeComments() { commentsInt32 === null && initCommentsBuffer(); for (let i = 0; i < commentsLen; i++) deserializeCommentIfNeeded(i); allCommentsDeserialized = !0, deserializedCommentsLen = 0; } /** * Initialize typed array views over the comments region of the buffer. * * Populates `commentsUint8`, `commentsInt32`, and `commentsLen`, and grows `cachedComments` if needed. * Does NOT deserialize comments - they are deserialized lazily via `deserializeCommentIfNeeded`. * * Exception: If the file has a hashbang, eagerly deserializes the first comment and sets its type to `Shebang`. */ function initCommentsBuffer() { sourceText === null && initSourceText(); let { int32 } = buffer, programPos32 = int32[DATA_POINTER_POS_32] >> 2, commentsPos = int32[programPos32 + 8]; if (commentsLen = int32[programPos32 + 10], commentsLen === 0) { comments = EMPTY_COMMENTS, commentsUint8 = EMPTY_UINT8_ARRAY, commentsInt32 = EMPTY_INT32_ARRAY, allCommentsDeserialized = !0; return; } let arrayBuffer = buffer.buffer, absolutePos = buffer.byteOffset + commentsPos; if (commentsUint8 = new Uint8Array(arrayBuffer, absolutePos, commentsLen * 16), commentsInt32 = new Int32Array(arrayBuffer, absolutePos, commentsLen * 4), cachedComments.length < commentsLen) { do cachedComments.push(new Comment()); while (cachedComments.length < commentsLen); let indexesLen = deserializedCommentIndexes.length; indexesLen < commentsLen && (deserializedCommentIndexes = new Int32Array(MathMax$3(commentsLen, indexesLen === 0 ? 16 : indexesLen << 1))); } commentsInt32[0] === 0 && sourceText.startsWith("#!") && (getComment(0).type = "Shebang"); } /** * Get comment at `index`, deserializing if needed. * * Caller must ensure `initCommentsBuffer()` has been called before calling this function. * * @param index - Comment index in the comments buffer * @returns Deserialized comment */ function getComment(index) { if (!allCommentsDeserialized) { let comment = deserializeCommentIfNeeded(index); if (comment !== null) return deserializedCommentIndexes[deserializedCommentsLen++] = index, comment; } return cachedComments[index]; } /** * Deserialize comment at `index` if not already deserialized. * * Caller must ensure `initCommentsBuffer()` has been called before calling this function. * * @param index - Comment index in the comments buffer * @returns `Comment` object if newly deserialized, or `null` if already deserialized */ function deserializeCommentIfNeeded(index) { let pos = index << 4, flagPos = pos + 15; if (commentsUint8[flagPos] !== 0) return null; commentsUint8[flagPos] = 1; let comment = cachedComments[index], isBlock = commentsUint8[pos + 12] !== 0, pos32 = pos >> 2, start = commentsInt32[pos32], end = commentsInt32[pos32 + 1]; return comment.type = isBlock ? "Block" : "Line", comment.value = sourceText.slice(start + 2, end - (isBlock << 1)), comment.range[0] = comment.start = start, comment.range[1] = comment.end = end, comment; } /** * Reset comments after file has been linted. * * Clears cached `loc` on comments that had it accessed, so the getter * will recalculate it when the comment is reused for a different file. */ function resetComments() { if (commentsInt32 !== null) { if (allCommentsDeserialized === !1) { for (let i = 0; i < deserializedCommentsLen; i++) cachedComments[deserializedCommentIndexes[i]].value = null; deserializedCommentsLen = 0; } else { for (let i = 0; i < commentsLen; i++) cachedComments[i].value = null; allCommentsDeserialized = !1; } for (let i = 0; i < activeCommentsWithLocCount; i++) resetCommentLoc(commentsWithLoc[i]); activeCommentsWithLocCount = 0, comments = null, commentsUint8 = null, commentsInt32 = null, commentsLen = 0; } } //#endregion //#region src-js/generated/deserialize.js const BufferPrototype$1 = Buffer.prototype, ObjectCreate$1 = Object.create, ObjectPrototype = Object.prototype, StringFromCodePoint = String.fromCodePoint, ObjectHasOwn$4 = Object.hasOwn; let uint8, int32, float64, sourceText$1, sourceTextLatin, sourceStartPos$1 = 0, firstNonAsciiPos = 0, parent = null; const { fromCharCode } = String, { utf8Slice: utf8Slice$1, latin1Slice } = BufferPrototype$1, stringDecodeArrays = Array(65).fill(null); for (let i = 0; i <= 64; i++) stringDecodeArrays[i] = Array(i).fill(0); const NodeProto = ObjectCreate$1(ObjectPrototype, { loc: { get() { return getNodeLoc(this); }, enumerable: !0 } }); function deserializeProgramOnly(buffer, sourceText, sourceStartPos, sourceByteLen) { return deserializeWith(buffer, sourceText, sourceStartPos, sourceByteLen, deserializeProgram); } function deserializeWith(buffer, sourceTextInput, sourceStartPosInput, sourceByteLen, deserialize) { if (uint8 = buffer, int32 = buffer.int32, float64 = buffer.float64, sourceText$1 = sourceTextInput, sourceStartPos$1 = sourceStartPosInput, sourceText$1.length === sourceByteLen) firstNonAsciiPos = sourceStartPos$1 + sourceByteLen, sourceTextLatin = sourceText$1; else { let i = sourceStartPos$1, sourceEndPos = sourceStartPos$1 + sourceByteLen; for (; i < sourceEndPos && uint8[i] < 128; i++); firstNonAsciiPos = i, sourceTextLatin = latin1Slice.call(uint8, sourceStartPos$1, sourceEndPos); } let data = deserialize(int32[536870890]); return resetBuffer(), data; } function resetBuffer() { uint8 = int32 = float64 = sourceText$1 = sourceTextLatin = void 0; } function deserializeProgram(pos) { let end = deserializeI32(pos + 4), program = parent = { __proto__: NodeProto, type: "Program", body: null, sourceType: deserializeModuleKind(pos + 137), get comments() { return comments === null && initComments(), comments; }, get tokens() { return tokens === null && initTokens(), tokens; }, start: 0, end, range: [0, end], parent: null }, body = program.body = deserializeVecDirective(pos + 88); body.push(...deserializeVecStatement(pos + 112)); { let start; if (body.length > 0) { let first = body[0]; if (start = first.start, first.type === "ExportNamedDeclaration" || first.type === "ExportDefaultDeclaration") { let { declaration } = first; if (declaration !== null && declaration.type === "ClassDeclaration" && declaration.decorators.length > 0) { let decoratorStart = declaration.decorators[0].start; decoratorStart < start && (start = decoratorStart); } } } else start = end; program.start = program.range[0] = start; } return parent = null, program; } function deserializeExpression(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for Expression`); } } function deserializeIdentifierName(pos) { let start, end; return { __proto__: NodeProto, type: "Identifier", decorators: [], name: deserializeStr(pos + 16), optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeIdentifierReference(pos) { let start, end; return { __proto__: NodeProto, type: "Identifier", decorators: [], name: deserializeStr(pos + 16), optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeBindingIdentifier(pos) { let start, end; return { __proto__: NodeProto, type: "Identifier", decorators: [], name: deserializeStr(pos + 16), optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeLabelIdentifier(pos) { let start, end; return { __proto__: NodeProto, type: "Identifier", decorators: [], name: deserializeStr(pos + 16), optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeThisExpression(pos) { let start, end; return { __proto__: NodeProto, type: "ThisExpression", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeArrayExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ArrayExpression", elements: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.elements = deserializeVecArrayExpressionElement(pos + 16), parent = previousParent, node; } function deserializeArrayExpressionElement(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); case 64: return deserializeBoxSpreadElement(pos + 8); case 65: return deserializeBoxElision(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ArrayExpressionElement`); } } function deserializeElision(pos) { return null; } function deserializeObjectExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ObjectExpression", properties: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.properties = deserializeVecObjectPropertyKind(pos + 16), parent = previousParent, node; } function deserializeObjectPropertyKind(pos) { switch (uint8[pos]) { case 0: return deserializeBoxObjectProperty(pos + 8); case 1: return deserializeBoxSpreadElement(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ObjectPropertyKind`); } } function deserializeObjectProperty(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "Property", kind: deserializePropertyKind(pos + 12), key: null, value: null, method: deserializeBool(pos + 13), shorthand: deserializeBool(pos + 14), computed: deserializeBool(pos + 15), optional: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.key = deserializePropertyKey(pos + 16), node.value = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializePropertyKey(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); case 64: return deserializeBoxIdentifierName(pos + 8); case 65: return deserializeBoxPrivateIdentifier(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyKey`); } } function deserializePropertyKind(pos) { switch (uint8[pos]) { case 0: return "init"; case 1: return "get"; case 2: return "set"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyKind`); } } function deserializeTemplateLiteral(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TemplateLiteral", quasis: null, expressions: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.quasis = deserializeVecTemplateElement(pos + 16), node.expressions = deserializeVecExpression(pos + 40), parent = previousParent, node; } function deserializeTaggedTemplateExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TaggedTemplateExpression", tag: null, typeArguments: null, quasi: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.tag = deserializeExpression(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), node.quasi = deserializeTemplateLiteral(pos + 40), parent = previousParent, node; } function deserializeTemplateElement(pos) { let tail = deserializeBool(pos + 12), start = deserializeI32(pos) - 1, end = deserializeI32(pos + 4) + 2 - tail, value = deserializeTemplateElementValue(pos + 16); return value.cooked !== null && deserializeBool(pos + 13) && (value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) => StringFromCodePoint(parseInt(hex, 16)))), { __proto__: NodeProto, type: "TemplateElement", value, tail, start, end, range: [start, end], parent }; } function deserializeTemplateElementValue(pos) { return { raw: deserializeStr(pos), cooked: deserializeOptionStr(pos + 16) }; } function deserializeComputedMemberExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "MemberExpression", object: null, property: null, optional: deserializeBool(pos + 12), computed: !0, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.object = deserializeExpression(pos + 16), node.property = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeStaticMemberExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "MemberExpression", object: null, property: null, optional: deserializeBool(pos + 12), computed: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.object = deserializeExpression(pos + 16), node.property = deserializeIdentifierName(pos + 32), parent = previousParent, node; } function deserializePrivateFieldExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "MemberExpression", object: null, property: null, optional: deserializeBool(pos + 12), computed: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.object = deserializeExpression(pos + 16), node.property = deserializePrivateIdentifier(pos + 32), parent = previousParent, node; } function deserializeCallExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "CallExpression", callee: null, typeArguments: null, arguments: null, optional: deserializeBool(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.callee = deserializeExpression(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), node.arguments = deserializeVecArgument(pos + 40), parent = previousParent, node; } function deserializeNewExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "NewExpression", callee: null, typeArguments: null, arguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.callee = deserializeExpression(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), node.arguments = deserializeVecArgument(pos + 40), parent = previousParent, node; } function deserializeMetaProperty(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "MetaProperty", meta: null, property: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.meta = deserializeIdentifierName(pos + 16), node.property = deserializeIdentifierName(pos + 48), parent = previousParent, node; } function deserializeSpreadElement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "SpreadElement", argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeArgument(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); case 64: return deserializeBoxSpreadElement(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for Argument`); } } function deserializeUpdateExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "UpdateExpression", operator: deserializeUpdateOperator(pos + 12), prefix: deserializeBool(pos + 13), argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeSimpleAssignmentTarget(pos + 16), parent = previousParent, node; } function deserializeUnaryExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "UnaryExpression", operator: deserializeUnaryOperator(pos + 12), argument: null, prefix: !0, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeBinaryExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "BinaryExpression", left: null, operator: deserializeBinaryOperator(pos + 12), right: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeExpression(pos + 16), node.right = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializePrivateInExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "BinaryExpression", left: null, operator: "in", right: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializePrivateIdentifier(pos + 16), node.right = deserializeExpression(pos + 48), parent = previousParent, node; } function deserializeLogicalExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "LogicalExpression", left: null, operator: deserializeLogicalOperator(pos + 12), right: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeExpression(pos + 16), node.right = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeConditionalExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ConditionalExpression", test: null, consequent: null, alternate: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.test = deserializeExpression(pos + 16), node.consequent = deserializeExpression(pos + 32), node.alternate = deserializeExpression(pos + 48), parent = previousParent, node; } function deserializeAssignmentExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "AssignmentExpression", operator: deserializeAssignmentOperator(pos + 12), left: null, right: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeAssignmentTarget(pos + 16), node.right = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeAssignmentTarget(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierReference(pos + 8); case 1: return deserializeBoxTSAsExpression(pos + 8); case 2: return deserializeBoxTSSatisfiesExpression(pos + 8); case 3: return deserializeBoxTSNonNullExpression(pos + 8); case 4: return deserializeBoxTSTypeAssertion(pos + 8); case 8: return deserializeBoxArrayAssignmentTarget(pos + 8); case 9: return deserializeBoxObjectAssignmentTarget(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentTarget`); } } function deserializeSimpleAssignmentTarget(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierReference(pos + 8); case 1: return deserializeBoxTSAsExpression(pos + 8); case 2: return deserializeBoxTSSatisfiesExpression(pos + 8); case 3: return deserializeBoxTSNonNullExpression(pos + 8); case 4: return deserializeBoxTSTypeAssertion(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for SimpleAssignmentTarget`); } } function deserializeArrayAssignmentTarget(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ArrayPattern", decorators: [], elements: null, optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, elements = deserializeVecOptionAssignmentTargetMaybeDefault(pos + 16), rest = deserializeOptionBoxAssignmentTargetRest(pos + 40); return rest !== null && elements.push(rest), node.elements = elements, parent = previousParent, node; } function deserializeObjectAssignmentTarget(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ObjectPattern", decorators: [], properties: null, optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, properties = deserializeVecAssignmentTargetProperty(pos + 16), rest = deserializeOptionBoxAssignmentTargetRest(pos + 40); return rest !== null && properties.push(rest), node.properties = properties, parent = previousParent, node; } function deserializeAssignmentTargetRest(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "RestElement", decorators: [], argument: null, optional: !1, typeAnnotation: null, value: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeAssignmentTarget(pos + 16), parent = previousParent, node; } function deserializeAssignmentTargetMaybeDefault(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierReference(pos + 8); case 1: return deserializeBoxTSAsExpression(pos + 8); case 2: return deserializeBoxTSSatisfiesExpression(pos + 8); case 3: return deserializeBoxTSNonNullExpression(pos + 8); case 4: return deserializeBoxTSTypeAssertion(pos + 8); case 8: return deserializeBoxArrayAssignmentTarget(pos + 8); case 9: return deserializeBoxObjectAssignmentTarget(pos + 8); case 16: return deserializeBoxAssignmentTargetWithDefault(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentTargetMaybeDefault`); } } function deserializeAssignmentTargetWithDefault(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "AssignmentPattern", decorators: [], left: null, right: null, optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeAssignmentTarget(pos + 16), node.right = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeAssignmentTargetProperty(pos) { switch (uint8[pos]) { case 0: return deserializeBoxAssignmentTargetPropertyIdentifier(pos + 8); case 1: return deserializeBoxAssignmentTargetPropertyProperty(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentTargetProperty`); } } function deserializeAssignmentTargetPropertyIdentifier(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4), previousParent = parent, node = parent = { __proto__: NodeProto, type: "Property", kind: "init", key: null, value: null, method: !1, shorthand: !0, computed: !1, optional: !1, start, end, range: [start, end], parent }, key = deserializeIdentifierReference(pos + 16), keyStart, keyEnd, value = { __proto__: NodeProto, type: "Identifier", decorators: [], name: key.name, optional: !1, typeAnnotation: null, start: keyStart = key.start, end: keyEnd = key.end, range: [keyStart, keyEnd], parent }, init = deserializeOptionExpression(pos + 48); if (init !== null) { let left = value; value = { __proto__: NodeProto, type: "AssignmentPattern", decorators: [], left, right: init, optional: !1, typeAnnotation: null, start, end, range: [start, end], parent }, left.parent = value, init.parent = value; } return node.key = key, node.value = value, parent = previousParent, node; } function deserializeAssignmentTargetPropertyProperty(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "Property", kind: "init", key: null, value: null, method: !1, shorthand: !1, computed: deserializeBool(pos + 12), optional: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.key = deserializePropertyKey(pos + 16), node.value = deserializeAssignmentTargetMaybeDefault(pos + 32), parent = previousParent, node; } function deserializeSequenceExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "SequenceExpression", expressions: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expressions = deserializeVecExpression(pos + 16), parent = previousParent, node; } function deserializeSuper(pos) { let start, end; return { __proto__: NodeProto, type: "Super", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeAwaitExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "AwaitExpression", argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeChainExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ChainExpression", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeChainElement(pos + 16), parent = previousParent, node; } function deserializeChainElement(pos) { switch (uint8[pos]) { case 0: return deserializeBoxCallExpression(pos + 8); case 1: return deserializeBoxTSNonNullExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ChainElement`); } } function deserializeParenthesizedExpression(pos) { let node; return node = deserializeExpression(pos + 16), node; } function deserializeStatement(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBlockStatement(pos + 8); case 1: return deserializeBoxBreakStatement(pos + 8); case 2: return deserializeBoxContinueStatement(pos + 8); case 3: return deserializeBoxDebuggerStatement(pos + 8); case 4: return deserializeBoxDoWhileStatement(pos + 8); case 5: return deserializeBoxEmptyStatement(pos + 8); case 6: return deserializeBoxExpressionStatement(pos + 8); case 7: return deserializeBoxForInStatement(pos + 8); case 8: return deserializeBoxForOfStatement(pos + 8); case 9: return deserializeBoxForStatement(pos + 8); case 10: return deserializeBoxIfStatement(pos + 8); case 11: return deserializeBoxLabeledStatement(pos + 8); case 12: return deserializeBoxReturnStatement(pos + 8); case 13: return deserializeBoxSwitchStatement(pos + 8); case 14: return deserializeBoxThrowStatement(pos + 8); case 15: return deserializeBoxTryStatement(pos + 8); case 16: return deserializeBoxWhileStatement(pos + 8); case 17: return deserializeBoxWithStatement(pos + 8); case 32: return deserializeBoxVariableDeclaration(pos + 8); case 33: return deserializeBoxFunction(pos + 8); case 34: return deserializeBoxClass(pos + 8); case 35: return deserializeBoxTSTypeAliasDeclaration(pos + 8); case 36: return deserializeBoxTSInterfaceDeclaration(pos + 8); case 37: return deserializeBoxTSEnumDeclaration(pos + 8); case 38: return deserializeBoxTSModuleDeclaration(pos + 8); case 39: return deserializeBoxTSGlobalDeclaration(pos + 8); case 40: return deserializeBoxTSImportEqualsDeclaration(pos + 8); case 64: return deserializeBoxImportDeclaration(pos + 8); case 65: return deserializeBoxExportAllDeclaration(pos + 8); case 66: return deserializeBoxExportDefaultDeclaration(pos + 8); case 67: return deserializeBoxExportNamedDeclaration(pos + 8); case 68: return deserializeBoxTSExportAssignment(pos + 8); case 69: return deserializeBoxTSNamespaceExportDeclaration(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for Statement`); } } function deserializeDirective(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ExpressionStatement", expression: null, directive: deserializeStr(pos + 64), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeStringLiteral(pos + 16), parent = previousParent, node; } function deserializeBlockStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "BlockStatement", body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.body = deserializeVecStatement(pos + 16), parent = previousParent, node; } function deserializeDeclaration(pos) { switch (uint8[pos]) { case 32: return deserializeBoxVariableDeclaration(pos + 8); case 33: return deserializeBoxFunction(pos + 8); case 34: return deserializeBoxClass(pos + 8); case 35: return deserializeBoxTSTypeAliasDeclaration(pos + 8); case 36: return deserializeBoxTSInterfaceDeclaration(pos + 8); case 37: return deserializeBoxTSEnumDeclaration(pos + 8); case 38: return deserializeBoxTSModuleDeclaration(pos + 8); case 39: return deserializeBoxTSGlobalDeclaration(pos + 8); case 40: return deserializeBoxTSImportEqualsDeclaration(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for Declaration`); } } function deserializeVariableDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "VariableDeclaration", kind: deserializeVariableDeclarationKind(pos + 12), declarations: null, declare: deserializeBool(pos + 13), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.declarations = deserializeVecVariableDeclarator(pos + 16), parent = previousParent, node; } function deserializeVariableDeclarationKind(pos) { switch (uint8[pos]) { case 0: return "var"; case 1: return "let"; case 2: return "const"; case 3: return "using"; case 4: return "await using"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for VariableDeclarationKind`); } } function deserializeVariableDeclarator(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "VariableDeclarator", id: null, init: null, definite: deserializeBool(pos + 13), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, pattern = deserializeBindingPattern(pos + 16); { let previousParent = parent; parent = pattern; let typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 32); typeAnnotation !== null && (pattern.typeAnnotation = typeAnnotation, pattern.range[1] = pattern.end = typeAnnotation.end), parent = previousParent; } return node.id = pattern, node.init = deserializeOptionExpression(pos + 40), parent = previousParent, node; } function deserializeEmptyStatement(pos) { let start, end; return { __proto__: NodeProto, type: "EmptyStatement", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeExpressionStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ExpressionStatement", expression: null, directive: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeIfStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "IfStatement", test: null, consequent: null, alternate: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.test = deserializeExpression(pos + 16), node.consequent = deserializeStatement(pos + 32), node.alternate = deserializeOptionStatement(pos + 48), parent = previousParent, node; } function deserializeDoWhileStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "DoWhileStatement", body: null, test: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.body = deserializeStatement(pos + 16), node.test = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeWhileStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "WhileStatement", test: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.test = deserializeExpression(pos + 16), node.body = deserializeStatement(pos + 32), parent = previousParent, node; } function deserializeForStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ForStatement", init: null, test: null, update: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.init = deserializeOptionForStatementInit(pos + 16), node.test = deserializeOptionExpression(pos + 32), node.update = deserializeOptionExpression(pos + 48), node.body = deserializeStatement(pos + 64), parent = previousParent, node; } function deserializeForStatementInit(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); case 64: return deserializeBoxVariableDeclaration(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ForStatementInit`); } } function deserializeForInStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ForInStatement", left: null, right: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeForStatementLeft(pos + 16), node.right = deserializeExpression(pos + 32), node.body = deserializeStatement(pos + 48), parent = previousParent, node; } function deserializeForStatementLeft(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierReference(pos + 8); case 1: return deserializeBoxTSAsExpression(pos + 8); case 2: return deserializeBoxTSSatisfiesExpression(pos + 8); case 3: return deserializeBoxTSNonNullExpression(pos + 8); case 4: return deserializeBoxTSTypeAssertion(pos + 8); case 8: return deserializeBoxArrayAssignmentTarget(pos + 8); case 9: return deserializeBoxObjectAssignmentTarget(pos + 8); case 16: return deserializeBoxVariableDeclaration(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ForStatementLeft`); } } function deserializeForOfStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ForOfStatement", await: deserializeBool(pos + 64), left: null, right: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeForStatementLeft(pos + 16), node.right = deserializeExpression(pos + 32), node.body = deserializeStatement(pos + 48), parent = previousParent, node; } function deserializeContinueStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ContinueStatement", label: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.label = deserializeOptionLabelIdentifier(pos + 16), parent = previousParent, node; } function deserializeBreakStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "BreakStatement", label: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.label = deserializeOptionLabelIdentifier(pos + 16), parent = previousParent, node; } function deserializeReturnStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ReturnStatement", argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeOptionExpression(pos + 16), parent = previousParent, node; } function deserializeWithStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "WithStatement", object: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.object = deserializeExpression(pos + 16), node.body = deserializeStatement(pos + 32), parent = previousParent, node; } function deserializeSwitchStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "SwitchStatement", discriminant: null, cases: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.discriminant = deserializeExpression(pos + 16), node.cases = deserializeVecSwitchCase(pos + 32), parent = previousParent, node; } function deserializeSwitchCase(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "SwitchCase", test: null, consequent: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.test = deserializeOptionExpression(pos + 16), node.consequent = deserializeVecStatement(pos + 32), parent = previousParent, node; } function deserializeLabeledStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "LabeledStatement", label: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.label = deserializeLabelIdentifier(pos + 16), node.body = deserializeStatement(pos + 48), parent = previousParent, node; } function deserializeThrowStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ThrowStatement", argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeTryStatement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TryStatement", block: null, handler: null, finalizer: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.block = deserializeBoxBlockStatement(pos + 16), node.handler = deserializeOptionBoxCatchClause(pos + 24), node.finalizer = deserializeOptionBoxBlockStatement(pos + 32), parent = previousParent, node; } function deserializeCatchClause(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "CatchClause", param: null, body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.param = deserializeOptionCatchParameter(pos + 16), node.body = deserializeBoxBlockStatement(pos + 56), parent = previousParent, node; } function deserializeCatchParameter(pos) { let previousParent = parent, pattern = deserializeBindingPattern(pos + 16); { parent = pattern; let typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 32); pattern.typeAnnotation = typeAnnotation, typeAnnotation !== null && (pattern.end = typeAnnotation.end, pattern.range[1] = typeAnnotation.end), parent = previousParent; } return pattern; } function deserializeDebuggerStatement(pos) { let start, end; return { __proto__: NodeProto, type: "DebuggerStatement", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeBindingPattern(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBindingIdentifier(pos + 8); case 1: return deserializeBoxObjectPattern(pos + 8); case 2: return deserializeBoxArrayPattern(pos + 8); case 3: return deserializeBoxAssignmentPattern(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for BindingPattern`); } } function deserializeAssignmentPattern(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "AssignmentPattern", decorators: [], left: null, right: null, optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeBindingPattern(pos + 16), node.right = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeObjectPattern(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ObjectPattern", decorators: [], properties: null, optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, properties = deserializeVecBindingProperty(pos + 16), rest = deserializeOptionBoxBindingRestElement(pos + 40); return rest !== null && properties.push(rest), node.properties = properties, parent = previousParent, node; } function deserializeBindingProperty(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "Property", kind: "init", key: null, value: null, method: !1, shorthand: deserializeBool(pos + 12), computed: deserializeBool(pos + 13), optional: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.key = deserializePropertyKey(pos + 16), node.value = deserializeBindingPattern(pos + 32), parent = previousParent, node; } function deserializeArrayPattern(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ArrayPattern", decorators: [], elements: null, optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, elements = deserializeVecOptionBindingPattern(pos + 16), rest = deserializeOptionBoxBindingRestElement(pos + 40); return rest !== null && elements.push(rest), node.elements = elements, parent = previousParent, node; } function deserializeBindingRestElement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "RestElement", decorators: [], argument: null, optional: !1, typeAnnotation: null, value: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeBindingPattern(pos + 16), parent = previousParent, node; } function deserializeFunction(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: deserializeFunctionType(pos + 88), id: null, generator: deserializeBool(pos + 89), async: deserializeBool(pos + 90), declare: deserializeBool(pos + 91), typeParameters: null, params: null, returnType: null, body: null, expression: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, params = deserializeBoxFormalParameters(pos + 64); { let thisParam = deserializeOptionBoxTSThisParameter(pos + 56); thisParam !== null && params.unshift(thisParam); } return node.id = deserializeOptionBindingIdentifier(pos + 16), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 48), node.params = params, node.returnType = deserializeOptionBoxTSTypeAnnotation(pos + 72), node.body = deserializeOptionBoxFunctionBody(pos + 80), parent = previousParent, node; } function deserializeFunctionType(pos) { switch (uint8[pos]) { case 0: return "FunctionDeclaration"; case 1: return "FunctionExpression"; case 2: return "TSDeclareFunction"; case 3: return "TSEmptyBodyFunctionExpression"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for FunctionType`); } } function deserializeFormalParameters(pos) { let params = deserializeVecFormalParameter(pos + 16), restFieldPos32 = (pos >> 2) + 10; if (int32[restFieldPos32] !== 0 && int32[restFieldPos32 + 1] !== 0) { pos = int32[restFieldPos32]; let start, end, previousParent = parent, rest = parent = { __proto__: NodeProto, type: "RestElement", decorators: [], argument: null, optional: !1, typeAnnotation: null, value: null, start: start = deserializeI32(pos + 40), end: end = deserializeI32(pos + 44), range: [start, end], parent: previousParent }; rest.argument = deserializeBindingPattern(pos + 56), rest.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 72), rest.typeAnnotation !== null && (end = rest.typeAnnotation.end, rest.end = end, rest.range[1] = end), params.push(rest), parent = previousParent; } return params; } function deserializeFormalParameter(pos) { let param, previousParent = parent, initializerFieldPos32 = (pos >> 2) + 16, hasInitializer = int32[initializerFieldPos32] !== 0 && int32[initializerFieldPos32 + 1] !== 0; { let accessibility = deserializeOptionTSAccessibility(pos + 13), readonly = deserializeBool(pos + 14), override = deserializeBool(pos + 15); if (accessibility === null && !readonly && !override) { let optional = deserializeBool(pos + 12); if (hasInitializer) { let start, end; param = parent = { __proto__: NodeProto, type: "AssignmentPattern", decorators: null, left: null, right: null, optional, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent: previousParent }, param.decorators = deserializeVecDecorator(pos + 16), param.left = deserializeBindingPattern(pos + 40), param.left.decorators = [], param.left.optional = !1, parent = param.left; let leftTypeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 56); param.left.typeAnnotation = leftTypeAnnotation, leftTypeAnnotation !== null && (param.left.end = leftTypeAnnotation.end, param.left.range[1] = leftTypeAnnotation.end), parent = param, param.right = deserializeOptionBoxExpression(pos + 64); } else { param = deserializeBindingPattern(pos + 40), param.parent = previousParent, parent = param, param.decorators = deserializeVecDecorator(pos + 16), param.optional = optional; let typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 56); param.typeAnnotation = typeAnnotation, typeAnnotation === null ? optional && (param.end = deserializeI32(pos + 4), param.range[1] = deserializeI32(pos + 4)) : (param.end = typeAnnotation.end, param.range[1] = typeAnnotation.end), parent = previousParent; } } else { let start, end; if (param = parent = { __proto__: NodeProto, type: "TSParameterProperty", accessibility, decorators: null, override, parameter: null, readonly, static: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent: previousParent }, param.decorators = deserializeVecDecorator(pos + 16), hasInitializer) { let pattern = deserializeBindingPattern(pos + 40), initializer = deserializeOptionBoxExpression(pos + 64), assignStart, assignEnd, assignParam = parent = { __proto__: NodeProto, type: "AssignmentPattern", decorators: [], left: null, right: null, optional: !1, typeAnnotation: null, start: assignStart = pattern.start, end: assignEnd = initializer.end, range: [assignStart, assignEnd], parent: param }; assignParam.left = pattern, pattern.parent = assignParam, pattern.decorators = [], pattern.optional = !1, parent = pattern; let patternTypeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 56); pattern.typeAnnotation = patternTypeAnnotation, patternTypeAnnotation !== null && (pattern.end = patternTypeAnnotation.end, pattern.range[1] = patternTypeAnnotation.end), parent = assignParam, assignParam.right = initializer, initializer !== null && (initializer.parent = assignParam), param.parameter = assignParam; } else { param.parameter = deserializeBindingPattern(pos + 40), param.parameter.decorators = []; let paramOptional = deserializeBool(pos + 12); param.parameter.optional = paramOptional, parent = param.parameter; let paramTypeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 56); if (param.parameter.typeAnnotation = paramTypeAnnotation, paramTypeAnnotation !== null) param.parameter.end = paramTypeAnnotation.end, param.parameter.range[1] = paramTypeAnnotation.end; else if (paramOptional) { let paramEnd = deserializeI32(pos + 4); param.parameter.end = paramEnd, param.parameter.range[1] = paramEnd; } parent = param; } } } return parent = previousParent, param; } function deserializeFunctionBody(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "BlockStatement", body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, body = deserializeVecDirective(pos + 16); return body.push(...deserializeVecStatement(pos + 40)), node.body = body, parent = previousParent, node; } function deserializeArrowFunctionExpression(pos) { let expression = deserializeBool(pos + 48), start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ArrowFunctionExpression", expression, async: deserializeBool(pos + 49), typeParameters: null, params: null, returnType: null, body: null, id: null, generator: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, body = deserializeBoxFunctionBody(pos + 40); return expression === !0 && (body = body.body[0].expression, body.parent = parent), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 16), node.params = deserializeBoxFormalParameters(pos + 24), node.returnType = deserializeOptionBoxTSTypeAnnotation(pos + 32), node.body = body, parent = previousParent, node; } function deserializeYieldExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "YieldExpression", delegate: deserializeBool(pos + 12), argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeOptionExpression(pos + 16), parent = previousParent, node; } function deserializeClass(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: deserializeClassType(pos + 136), decorators: null, id: null, typeParameters: null, superClass: null, superTypeArguments: null, implements: null, body: null, abstract: deserializeBool(pos + 137), declare: deserializeBool(pos + 138), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.decorators = deserializeVecDecorator(pos + 16), node.id = deserializeOptionBindingIdentifier(pos + 40), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 72), node.superClass = deserializeOptionExpression(pos + 80), node.superTypeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 96), node.implements = deserializeVecTSClassImplements(pos + 104), node.body = deserializeBoxClassBody(pos + 128), parent = previousParent, node; } function deserializeClassType(pos) { switch (uint8[pos]) { case 0: return "ClassDeclaration"; case 1: return "ClassExpression"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for ClassType`); } } function deserializeClassBody(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ClassBody", body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.body = deserializeVecClassElement(pos + 16), parent = previousParent, node; } function deserializeClassElement(pos) { switch (uint8[pos]) { case 0: return deserializeBoxStaticBlock(pos + 8); case 1: return deserializeBoxMethodDefinition(pos + 8); case 2: return deserializeBoxPropertyDefinition(pos + 8); case 3: return deserializeBoxAccessorProperty(pos + 8); case 4: return deserializeBoxTSIndexSignature(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ClassElement`); } } function deserializeMethodDefinition(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: deserializeMethodDefinitionType(pos + 12), decorators: null, key: null, value: null, kind: deserializeMethodDefinitionKind(pos + 13), computed: deserializeBool(pos + 14), static: deserializeBool(pos + 15), override: deserializeBool(pos + 64), optional: deserializeBool(pos + 65), accessibility: deserializeOptionTSAccessibility(pos + 66), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.decorators = deserializeVecDecorator(pos + 16), node.key = deserializePropertyKey(pos + 40), node.value = deserializeBoxFunction(pos + 56), parent = previousParent, node; } function deserializeMethodDefinitionType(pos) { switch (uint8[pos]) { case 0: return "MethodDefinition"; case 1: return "TSAbstractMethodDefinition"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionType`); } } function deserializePropertyDefinition(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: deserializePropertyDefinitionType(pos + 12), decorators: null, key: null, typeAnnotation: null, value: null, computed: deserializeBool(pos + 13), static: deserializeBool(pos + 14), declare: deserializeBool(pos + 15), override: deserializeBool(pos + 80), optional: deserializeBool(pos + 81), definite: deserializeBool(pos + 82), readonly: deserializeBool(pos + 83), accessibility: deserializeOptionTSAccessibility(pos + 84), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.decorators = deserializeVecDecorator(pos + 16), node.key = deserializePropertyKey(pos + 40), node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 56), node.value = deserializeOptionExpression(pos + 64), parent = previousParent, node; } function deserializePropertyDefinitionType(pos) { switch (uint8[pos]) { case 0: return "PropertyDefinition"; case 1: return "TSAbstractPropertyDefinition"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyDefinitionType`); } } function deserializeMethodDefinitionKind(pos) { switch (uint8[pos]) { case 0: return "constructor"; case 1: return "method"; case 2: return "get"; case 3: return "set"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionKind`); } } function deserializePrivateIdentifier(pos) { let start, end; return { __proto__: NodeProto, type: "PrivateIdentifier", name: deserializeStr(pos + 16), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeStaticBlock(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "StaticBlock", body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.body = deserializeVecStatement(pos + 16), parent = previousParent, node; } function deserializeAccessorPropertyType(pos) { switch (uint8[pos]) { case 0: return "AccessorProperty"; case 1: return "TSAbstractAccessorProperty"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for AccessorPropertyType`); } } function deserializeAccessorProperty(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: deserializeAccessorPropertyType(pos + 12), decorators: null, key: null, typeAnnotation: null, value: null, computed: deserializeBool(pos + 13), static: deserializeBool(pos + 14), override: deserializeBool(pos + 15), definite: deserializeBool(pos + 80), accessibility: deserializeOptionTSAccessibility(pos + 81), declare: !1, optional: !1, readonly: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.decorators = deserializeVecDecorator(pos + 16), node.key = deserializePropertyKey(pos + 40), node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 56), node.value = deserializeOptionExpression(pos + 64), parent = previousParent, node; } function deserializeImportExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ImportExpression", source: null, options: null, phase: deserializeOptionImportPhase(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.source = deserializeExpression(pos + 16), node.options = deserializeOptionExpression(pos + 32), parent = previousParent, node; } function deserializeImportDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ImportDeclaration", specifiers: null, source: null, phase: deserializeOptionImportPhase(pos + 12), attributes: null, importKind: deserializeImportOrExportKind(pos + 13), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, specifiers = deserializeOptionVecImportDeclarationSpecifier(pos + 16); specifiers === null && (specifiers = []); let withClause = deserializeOptionBoxWithClause(pos + 88); return node.specifiers = specifiers, node.source = deserializeStringLiteral(pos + 40), node.attributes = withClause === null ? [] : withClause.attributes, parent = previousParent, node; } function deserializeImportPhase(pos) { switch (uint8[pos]) { case 0: return "source"; case 1: return "defer"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for ImportPhase`); } } function deserializeImportDeclarationSpecifier(pos) { switch (uint8[pos]) { case 0: return deserializeBoxImportSpecifier(pos + 8); case 1: return deserializeBoxImportDefaultSpecifier(pos + 8); case 2: return deserializeBoxImportNamespaceSpecifier(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ImportDeclarationSpecifier`); } } function deserializeImportSpecifier(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ImportSpecifier", imported: null, local: null, importKind: deserializeImportOrExportKind(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.imported = deserializeModuleExportName(pos + 16), node.local = deserializeBindingIdentifier(pos + 72), parent = previousParent, node; } function deserializeImportDefaultSpecifier(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ImportDefaultSpecifier", local: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.local = deserializeBindingIdentifier(pos + 16), parent = previousParent, node; } function deserializeImportNamespaceSpecifier(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ImportNamespaceSpecifier", local: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.local = deserializeBindingIdentifier(pos + 16), parent = previousParent, node; } function deserializeWithClause(pos) { return { attributes: deserializeVecImportAttribute(pos + 16) }; } function deserializeImportAttribute(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ImportAttribute", key: null, value: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.key = deserializeImportAttributeKey(pos + 16), node.value = deserializeStringLiteral(pos + 72), parent = previousParent, node; } function deserializeImportAttributeKey(pos) { switch (uint8[pos]) { case 0: return deserializeIdentifierName(pos + 8); case 1: return deserializeStringLiteral(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ImportAttributeKey`); } } function deserializeExportNamedDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ExportNamedDeclaration", declaration: null, specifiers: null, source: null, exportKind: deserializeImportOrExportKind(pos + 12), attributes: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, withClause = deserializeOptionBoxWithClause(pos + 104); return node.declaration = deserializeOptionDeclaration(pos + 16), node.specifiers = deserializeVecExportSpecifier(pos + 32), node.source = deserializeOptionStringLiteral(pos + 56), node.attributes = withClause === null ? [] : withClause.attributes, parent = previousParent, node; } function deserializeExportDefaultDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ExportDefaultDeclaration", declaration: null, exportKind: "value", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.declaration = deserializeExportDefaultDeclarationKind(pos + 16), parent = previousParent, node; } function deserializeExportAllDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ExportAllDeclaration", exported: null, source: null, attributes: null, exportKind: deserializeImportOrExportKind(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, withClause = deserializeOptionBoxWithClause(pos + 120); return node.exported = deserializeOptionModuleExportName(pos + 16), node.source = deserializeStringLiteral(pos + 72), node.attributes = withClause === null ? [] : withClause.attributes, parent = previousParent, node; } function deserializeExportSpecifier(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "ExportSpecifier", local: null, exported: null, exportKind: deserializeImportOrExportKind(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.local = deserializeModuleExportName(pos + 16), node.exported = deserializeModuleExportName(pos + 72), parent = previousParent, node; } function deserializeExportDefaultDeclarationKind(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); case 64: return deserializeBoxFunction(pos + 8); case 65: return deserializeBoxClass(pos + 8); case 66: return deserializeBoxTSInterfaceDeclaration(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ExportDefaultDeclarationKind`); } } function deserializeModuleExportName(pos) { switch (uint8[pos]) { case 0: return deserializeIdentifierName(pos + 8); case 1: return deserializeIdentifierReference(pos + 8); case 2: return deserializeStringLiteral(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for ModuleExportName`); } } function deserializeV8IntrinsicExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "V8IntrinsicExpression", name: null, arguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.name = deserializeIdentifierName(pos + 16), node.arguments = deserializeVecArgument(pos + 48), parent = previousParent, node; } function deserializeBooleanLiteral(pos) { let value = deserializeBool(pos + 12), start = deserializeI32(pos), end = deserializeI32(pos + 4), previousParent = parent, node = parent = { __proto__: NodeProto, type: "Literal", value, raw: null, start, end, range: [start, end], parent }; return node.raw = start === 0 && end === 0 ? null : value + "", parent = previousParent, node; } function deserializeNullLiteral(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4); return { __proto__: NodeProto, type: "Literal", value: null, raw: start === 0 && end === 0 ? null : "null", start, end, range: [start, end], parent }; } function deserializeNumericLiteral(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4); return { __proto__: NodeProto, type: "Literal", value: deserializeF64(pos + 32), raw: int32[(pos >> 2) + 4] === 0 && int32[(pos >> 2) + 5] === 0 ? null : sourceText$1.slice(start, end), start, end, range: [start, end], parent }; } function deserializeStringLiteral(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4), previousParent = parent, node = parent = { __proto__: NodeProto, type: "Literal", value: null, raw: int32[(pos >> 2) + 8] === 0 && int32[(pos >> 2) + 9] === 0 ? null : sourceText$1.slice(start, end), start, end, range: [start, end], parent }, value = deserializeStr(pos + 16); return deserializeBool(pos + 12) && (value = value.replace(/\uFFFD(.{4})/g, (_, hex) => StringFromCodePoint(parseInt(hex, 16)))), node.value = value, parent = previousParent, node; } function deserializeBigIntLiteral(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4), bigint = deserializeStr(pos + 16); return { __proto__: NodeProto, type: "Literal", value: BigInt(bigint), raw: int32[(pos >> 2) + 8] === 0 && int32[(pos >> 2) + 9] === 0 ? null : sourceText$1.slice(start, end), bigint, start, end, range: [start, end], parent }; } function deserializeRegExpLiteral(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4), previousParent = parent, node = parent = { __proto__: NodeProto, type: "Literal", value: null, raw: int32[(pos >> 2) + 12] === 0 && int32[(pos >> 2) + 13] === 0 ? null : sourceText$1.slice(start, end), regex: null, start, end, range: [start, end], parent }, regex = deserializeRegExp(pos + 16), value = null; try { value = new RegExp(regex.pattern, regex.flags); } catch {} return node.value = value, node.regex = regex, parent = previousParent, node; } function deserializeRegExp(pos) { return { pattern: deserializeStr(pos), flags: deserializeRegExpFlags(pos + 24) }; } function deserializeRegExpFlags(pos) { let flagBits = deserializeU8(pos), flags = ""; return flagBits & 64 && (flags += "d"), flagBits & 1 && (flags += "g"), flagBits & 2 && (flags += "i"), flagBits & 4 && (flags += "m"), flagBits & 8 && (flags += "s"), flagBits & 16 && (flags += "u"), flagBits & 128 && (flags += "v"), flagBits & 32 && (flags += "y"), flags; } function deserializeJSXElement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXElement", openingElement: null, children: null, closingElement: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, closingElement = deserializeOptionBoxJSXClosingElement(pos + 48), openingElement = deserializeBoxJSXOpeningElement(pos + 16); return closingElement === null && (openingElement.selfClosing = !0), node.openingElement = openingElement, node.children = deserializeVecJSXChild(pos + 24), node.closingElement = closingElement, parent = previousParent, node; } function deserializeJSXOpeningElement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXOpeningElement", name: null, typeArguments: null, attributes: null, selfClosing: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.name = deserializeJSXElementName(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), node.attributes = deserializeVecJSXAttributeItem(pos + 40), parent = previousParent, node; } function deserializeJSXClosingElement(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXClosingElement", name: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.name = deserializeJSXElementName(pos + 16), parent = previousParent, node; } function deserializeJSXFragment(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXFragment", openingFragment: null, children: null, closingFragment: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.openingFragment = deserializeJSXOpeningFragment(pos + 16), node.children = deserializeVecJSXChild(pos + 32), node.closingFragment = deserializeJSXClosingFragment(pos + 56), parent = previousParent, node; } function deserializeJSXOpeningFragment(pos) { let start, end; return { __proto__: NodeProto, type: "JSXOpeningFragment", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeJSXClosingFragment(pos) { let start, end; return { __proto__: NodeProto, type: "JSXClosingFragment", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeJSXElementName(pos) { switch (uint8[pos]) { case 0: return deserializeBoxJSXIdentifier(pos + 8); case 1: let ident = deserializeBoxIdentifierReference(pos + 8); return { __proto__: NodeProto, type: "JSXIdentifier", name: ident.name, start: ident.start, end: ident.end, range: ident.range, parent }; case 2: return deserializeBoxJSXNamespacedName(pos + 8); case 3: return deserializeBoxJSXMemberExpression(pos + 8); case 4: let thisExpr = deserializeBoxThisExpression(pos + 8); return { __proto__: NodeProto, type: "JSXIdentifier", name: "this", start: thisExpr.start, end: thisExpr.end, range: thisExpr.range, parent }; default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXElementName`); } } function deserializeJSXNamespacedName(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXNamespacedName", namespace: null, name: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.namespace = deserializeJSXIdentifier(pos + 16), node.name = deserializeJSXIdentifier(pos + 48), parent = previousParent, node; } function deserializeJSXMemberExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXMemberExpression", object: null, property: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.object = deserializeJSXMemberExpressionObject(pos + 16), node.property = deserializeJSXIdentifier(pos + 32), parent = previousParent, node; } function deserializeJSXMemberExpressionObject(pos) { switch (uint8[pos]) { case 0: let ident = deserializeBoxIdentifierReference(pos + 8); return { __proto__: NodeProto, type: "JSXIdentifier", name: ident.name, start: ident.start, end: ident.end, range: ident.range, parent }; case 1: return deserializeBoxJSXMemberExpression(pos + 8); case 2: let thisExpr = deserializeBoxThisExpression(pos + 8); return { __proto__: NodeProto, type: "JSXIdentifier", name: "this", start: thisExpr.start, end: thisExpr.end, range: thisExpr.range, parent }; default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXMemberExpressionObject`); } } function deserializeJSXExpressionContainer(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXExpressionContainer", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeJSXExpression(pos + 16), parent = previousParent, node; } function deserializeJSXExpression(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNullLiteral(pos + 8); case 2: return deserializeBoxNumericLiteral(pos + 8); case 3: return deserializeBoxBigIntLiteral(pos + 8); case 4: return deserializeBoxRegExpLiteral(pos + 8); case 5: return deserializeBoxStringLiteral(pos + 8); case 6: return deserializeBoxTemplateLiteral(pos + 8); case 7: return deserializeBoxIdentifierReference(pos + 8); case 8: return deserializeBoxMetaProperty(pos + 8); case 9: return deserializeBoxSuper(pos + 8); case 10: return deserializeBoxArrayExpression(pos + 8); case 11: return deserializeBoxArrowFunctionExpression(pos + 8); case 12: return deserializeBoxAssignmentExpression(pos + 8); case 13: return deserializeBoxAwaitExpression(pos + 8); case 14: return deserializeBoxBinaryExpression(pos + 8); case 15: return deserializeBoxCallExpression(pos + 8); case 16: return deserializeBoxChainExpression(pos + 8); case 17: return deserializeBoxClass(pos + 8); case 18: return deserializeBoxConditionalExpression(pos + 8); case 19: return deserializeBoxFunction(pos + 8); case 20: return deserializeBoxImportExpression(pos + 8); case 21: return deserializeBoxLogicalExpression(pos + 8); case 22: return deserializeBoxNewExpression(pos + 8); case 23: return deserializeBoxObjectExpression(pos + 8); case 24: return deserializeBoxParenthesizedExpression(pos + 8); case 25: return deserializeBoxSequenceExpression(pos + 8); case 26: return deserializeBoxTaggedTemplateExpression(pos + 8); case 27: return deserializeBoxThisExpression(pos + 8); case 28: return deserializeBoxUnaryExpression(pos + 8); case 29: return deserializeBoxUpdateExpression(pos + 8); case 30: return deserializeBoxYieldExpression(pos + 8); case 31: return deserializeBoxPrivateInExpression(pos + 8); case 32: return deserializeBoxJSXElement(pos + 8); case 33: return deserializeBoxJSXFragment(pos + 8); case 34: return deserializeBoxTSAsExpression(pos + 8); case 35: return deserializeBoxTSSatisfiesExpression(pos + 8); case 36: return deserializeBoxTSTypeAssertion(pos + 8); case 37: return deserializeBoxTSNonNullExpression(pos + 8); case 38: return deserializeBoxTSInstantiationExpression(pos + 8); case 39: return deserializeBoxV8IntrinsicExpression(pos + 8); case 48: return deserializeBoxComputedMemberExpression(pos + 8); case 49: return deserializeBoxStaticMemberExpression(pos + 8); case 50: return deserializeBoxPrivateFieldExpression(pos + 8); case 64: return deserializeBoxJSXEmptyExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXExpression`); } } function deserializeJSXEmptyExpression(pos) { let start, end; return { __proto__: NodeProto, type: "JSXEmptyExpression", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeJSXAttributeItem(pos) { switch (uint8[pos]) { case 0: return deserializeBoxJSXAttribute(pos + 8); case 1: return deserializeBoxJSXSpreadAttribute(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXAttributeItem`); } } function deserializeJSXAttribute(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXAttribute", name: null, value: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.name = deserializeJSXAttributeName(pos + 16), node.value = deserializeOptionJSXAttributeValue(pos + 32), parent = previousParent, node; } function deserializeJSXSpreadAttribute(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXSpreadAttribute", argument: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.argument = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeJSXAttributeName(pos) { switch (uint8[pos]) { case 0: return deserializeBoxJSXIdentifier(pos + 8); case 1: return deserializeBoxJSXNamespacedName(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXAttributeName`); } } function deserializeJSXAttributeValue(pos) { switch (uint8[pos]) { case 0: return deserializeBoxStringLiteral(pos + 8); case 1: return deserializeBoxJSXExpressionContainer(pos + 8); case 2: return deserializeBoxJSXElement(pos + 8); case 3: return deserializeBoxJSXFragment(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXAttributeValue`); } } function deserializeJSXIdentifier(pos) { let start, end; return { __proto__: NodeProto, type: "JSXIdentifier", name: deserializeStr(pos + 16), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeJSXChild(pos) { switch (uint8[pos]) { case 0: return deserializeBoxJSXText(pos + 8); case 1: return deserializeBoxJSXElement(pos + 8); case 2: return deserializeBoxJSXFragment(pos + 8); case 3: return deserializeBoxJSXExpressionContainer(pos + 8); case 4: return deserializeBoxJSXSpreadChild(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXChild`); } } function deserializeJSXSpreadChild(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "JSXSpreadChild", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeJSXText(pos) { let start = deserializeI32(pos), end = deserializeI32(pos + 4); return { __proto__: NodeProto, type: "JSXText", value: deserializeStr(pos + 16), raw: int32[(pos >> 2) + 8] === 0 && int32[(pos >> 2) + 9] === 0 ? null : sourceText$1.slice(start, end), start, end, range: [start, end], parent }; } function deserializeTSThisParameter(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "Identifier", decorators: [], name: "this", optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 24), parent = previousParent, node; } function deserializeTSEnumDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSEnumDeclaration", id: null, body: null, const: deserializeBool(pos + 12), declare: deserializeBool(pos + 13), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.id = deserializeBindingIdentifier(pos + 16), node.body = deserializeTSEnumBody(pos + 48), parent = previousParent, node; } function deserializeTSEnumBody(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSEnumBody", members: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.members = deserializeVecTSEnumMember(pos + 16), parent = previousParent, node; } function deserializeTSEnumMember(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSEnumMember", id: null, initializer: null, computed: deserializeU8(pos + 16) > 1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.id = deserializeTSEnumMemberName(pos + 16), node.initializer = deserializeOptionExpression(pos + 32), parent = previousParent, node; } function deserializeTSEnumMemberName(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierName(pos + 8); case 1: return deserializeBoxStringLiteral(pos + 8); case 2: return deserializeBoxStringLiteral(pos + 8); case 3: return deserializeBoxTemplateLiteral(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSEnumMemberName`); } } function deserializeTSTypeAnnotation(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeAnnotation", typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeTSLiteralType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSLiteralType", literal: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.literal = deserializeTSLiteral(pos + 16), parent = previousParent, node; } function deserializeTSLiteral(pos) { switch (uint8[pos]) { case 0: return deserializeBoxBooleanLiteral(pos + 8); case 1: return deserializeBoxNumericLiteral(pos + 8); case 2: return deserializeBoxBigIntLiteral(pos + 8); case 3: return deserializeBoxStringLiteral(pos + 8); case 4: return deserializeBoxTemplateLiteral(pos + 8); case 5: return deserializeBoxUnaryExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSLiteral`); } } function deserializeTSType(pos) { switch (uint8[pos]) { case 0: return deserializeBoxTSAnyKeyword(pos + 8); case 1: return deserializeBoxTSBigIntKeyword(pos + 8); case 2: return deserializeBoxTSBooleanKeyword(pos + 8); case 3: return deserializeBoxTSIntrinsicKeyword(pos + 8); case 4: return deserializeBoxTSNeverKeyword(pos + 8); case 5: return deserializeBoxTSNullKeyword(pos + 8); case 6: return deserializeBoxTSNumberKeyword(pos + 8); case 7: return deserializeBoxTSObjectKeyword(pos + 8); case 8: return deserializeBoxTSStringKeyword(pos + 8); case 9: return deserializeBoxTSSymbolKeyword(pos + 8); case 10: return deserializeBoxTSThisType(pos + 8); case 11: return deserializeBoxTSUndefinedKeyword(pos + 8); case 12: return deserializeBoxTSUnknownKeyword(pos + 8); case 13: return deserializeBoxTSVoidKeyword(pos + 8); case 14: return deserializeBoxTSArrayType(pos + 8); case 15: return deserializeBoxTSConditionalType(pos + 8); case 16: return deserializeBoxTSConstructorType(pos + 8); case 17: return deserializeBoxTSFunctionType(pos + 8); case 18: return deserializeBoxTSImportType(pos + 8); case 19: return deserializeBoxTSIndexedAccessType(pos + 8); case 20: return deserializeBoxTSInferType(pos + 8); case 21: return deserializeBoxTSIntersectionType(pos + 8); case 22: return deserializeBoxTSLiteralType(pos + 8); case 23: return deserializeBoxTSMappedType(pos + 8); case 24: return deserializeBoxTSNamedTupleMember(pos + 8); case 26: return deserializeBoxTSTemplateLiteralType(pos + 8); case 27: return deserializeBoxTSTupleType(pos + 8); case 28: return deserializeBoxTSTypeLiteral(pos + 8); case 29: return deserializeBoxTSTypeOperator(pos + 8); case 30: return deserializeBoxTSTypePredicate(pos + 8); case 31: return deserializeBoxTSTypeQuery(pos + 8); case 32: return deserializeBoxTSTypeReference(pos + 8); case 33: return deserializeBoxTSUnionType(pos + 8); case 34: return deserializeBoxTSParenthesizedType(pos + 8); case 35: return deserializeBoxJSDocNullableType(pos + 8); case 36: return deserializeBoxJSDocNonNullableType(pos + 8); case 37: return deserializeBoxJSDocUnknownType(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSType`); } } function deserializeTSConditionalType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSConditionalType", checkType: null, extendsType: null, trueType: null, falseType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.checkType = deserializeTSType(pos + 16), node.extendsType = deserializeTSType(pos + 32), node.trueType = deserializeTSType(pos + 48), node.falseType = deserializeTSType(pos + 64), parent = previousParent, node; } function deserializeTSUnionType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSUnionType", types: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.types = deserializeVecTSType(pos + 16), parent = previousParent, node; } function deserializeTSIntersectionType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSIntersectionType", types: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.types = deserializeVecTSType(pos + 16), parent = previousParent, node; } function deserializeTSParenthesizedType(pos) { let node; return node = deserializeTSType(pos + 16), node; } function deserializeTSTypeOperator(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeOperator", operator: deserializeTSTypeOperatorOperator(pos + 12), typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeTSTypeOperatorOperator(pos) { switch (uint8[pos]) { case 0: return "keyof"; case 1: return "unique"; case 2: return "readonly"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeOperatorOperator`); } } function deserializeTSArrayType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSArrayType", elementType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.elementType = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeTSIndexedAccessType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSIndexedAccessType", objectType: null, indexType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.objectType = deserializeTSType(pos + 16), node.indexType = deserializeTSType(pos + 32), parent = previousParent, node; } function deserializeTSTupleType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTupleType", elementTypes: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.elementTypes = deserializeVecTSTupleElement(pos + 16), parent = previousParent, node; } function deserializeTSNamedTupleMember(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSNamedTupleMember", label: null, elementType: null, optional: deserializeBool(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.label = deserializeIdentifierName(pos + 16), node.elementType = deserializeTSTupleElement(pos + 48), parent = previousParent, node; } function deserializeTSOptionalType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSOptionalType", typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeTSRestType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSRestType", typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeTSTupleElement(pos) { switch (uint8[pos]) { case 0: return deserializeBoxTSAnyKeyword(pos + 8); case 1: return deserializeBoxTSBigIntKeyword(pos + 8); case 2: return deserializeBoxTSBooleanKeyword(pos + 8); case 3: return deserializeBoxTSIntrinsicKeyword(pos + 8); case 4: return deserializeBoxTSNeverKeyword(pos + 8); case 5: return deserializeBoxTSNullKeyword(pos + 8); case 6: return deserializeBoxTSNumberKeyword(pos + 8); case 7: return deserializeBoxTSObjectKeyword(pos + 8); case 8: return deserializeBoxTSStringKeyword(pos + 8); case 9: return deserializeBoxTSSymbolKeyword(pos + 8); case 10: return deserializeBoxTSThisType(pos + 8); case 11: return deserializeBoxTSUndefinedKeyword(pos + 8); case 12: return deserializeBoxTSUnknownKeyword(pos + 8); case 13: return deserializeBoxTSVoidKeyword(pos + 8); case 14: return deserializeBoxTSArrayType(pos + 8); case 15: return deserializeBoxTSConditionalType(pos + 8); case 16: return deserializeBoxTSConstructorType(pos + 8); case 17: return deserializeBoxTSFunctionType(pos + 8); case 18: return deserializeBoxTSImportType(pos + 8); case 19: return deserializeBoxTSIndexedAccessType(pos + 8); case 20: return deserializeBoxTSInferType(pos + 8); case 21: return deserializeBoxTSIntersectionType(pos + 8); case 22: return deserializeBoxTSLiteralType(pos + 8); case 23: return deserializeBoxTSMappedType(pos + 8); case 24: return deserializeBoxTSNamedTupleMember(pos + 8); case 26: return deserializeBoxTSTemplateLiteralType(pos + 8); case 27: return deserializeBoxTSTupleType(pos + 8); case 28: return deserializeBoxTSTypeLiteral(pos + 8); case 29: return deserializeBoxTSTypeOperator(pos + 8); case 30: return deserializeBoxTSTypePredicate(pos + 8); case 31: return deserializeBoxTSTypeQuery(pos + 8); case 32: return deserializeBoxTSTypeReference(pos + 8); case 33: return deserializeBoxTSUnionType(pos + 8); case 34: return deserializeBoxTSParenthesizedType(pos + 8); case 35: return deserializeBoxJSDocNullableType(pos + 8); case 36: return deserializeBoxJSDocNonNullableType(pos + 8); case 37: return deserializeBoxJSDocUnknownType(pos + 8); case 64: return deserializeBoxTSOptionalType(pos + 8); case 65: return deserializeBoxTSRestType(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSTupleElement`); } } function deserializeTSAnyKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSAnyKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSStringKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSStringKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSBooleanKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSBooleanKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSNumberKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSNumberKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSNeverKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSNeverKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSIntrinsicKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSIntrinsicKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSUnknownKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSUnknownKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSNullKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSNullKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSUndefinedKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSUndefinedKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSVoidKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSVoidKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSSymbolKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSSymbolKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSThisType(pos) { let start, end; return { __proto__: NodeProto, type: "TSThisType", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSObjectKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSObjectKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSBigIntKeyword(pos) { let start, end; return { __proto__: NodeProto, type: "TSBigIntKeyword", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeTSTypeReference(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeReference", typeName: null, typeArguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeName = deserializeTSTypeName(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), parent = previousParent, node; } function deserializeTSTypeName(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierReference(pos + 8); case 1: return deserializeBoxTSQualifiedName(pos + 8); case 2: return deserializeBoxThisExpression(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeName`); } } function deserializeTSQualifiedName(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSQualifiedName", left: null, right: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeTSTypeName(pos + 16), node.right = deserializeIdentifierName(pos + 32), parent = previousParent, node; } function deserializeTSTypeParameterInstantiation(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeParameterInstantiation", params: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.params = deserializeVecTSType(pos + 16), parent = previousParent, node; } function deserializeTSTypeParameter(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeParameter", name: null, constraint: null, default: null, in: deserializeBool(pos + 12), out: deserializeBool(pos + 13), const: deserializeBool(pos + 14), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.name = deserializeBindingIdentifier(pos + 16), node.constraint = deserializeOptionTSType(pos + 48), node.default = deserializeOptionTSType(pos + 64), parent = previousParent, node; } function deserializeTSTypeParameterDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeParameterDeclaration", params: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.params = deserializeVecTSTypeParameter(pos + 16), parent = previousParent, node; } function deserializeTSTypeAliasDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeAliasDeclaration", id: null, typeParameters: null, typeAnnotation: null, declare: deserializeBool(pos + 72), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.id = deserializeBindingIdentifier(pos + 16), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 48), node.typeAnnotation = deserializeTSType(pos + 56), parent = previousParent, node; } function deserializeTSAccessibility(pos) { switch (uint8[pos]) { case 0: return "private"; case 1: return "protected"; case 2: return "public"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSAccessibility`); } } function deserializeTSClassImplements(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSClassImplements", expression: null, typeArguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, expression = deserializeTSTypeName(pos + 16); if (expression.type === "TSQualifiedName") { let object = expression.left, { right } = expression, start, end, previous = expression = { __proto__: NodeProto, type: "MemberExpression", object, property: right, optional: !1, computed: !1, start: start = expression.start, end: end = expression.end, range: [start, end], parent }; for (right.parent = previous;;) { if (object.type !== "TSQualifiedName") { object.parent = previous; break; } let { left, right } = object; previous = previous.object = { __proto__: NodeProto, type: "MemberExpression", object: left, property: right, optional: !1, computed: !1, start: start = object.start, end: end = object.end, range: [start, end], parent: previous }, right.parent = previous, object = left; } } return node.expression = expression, node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), parent = previousParent, node; } function deserializeTSInterfaceDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSInterfaceDeclaration", id: null, typeParameters: null, extends: null, body: null, declare: deserializeBool(pos + 88), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.id = deserializeBindingIdentifier(pos + 16), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 48), node.extends = deserializeVecTSInterfaceHeritage(pos + 56), node.body = deserializeBoxTSInterfaceBody(pos + 80), parent = previousParent, node; } function deserializeTSInterfaceBody(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSInterfaceBody", body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.body = deserializeVecTSSignature(pos + 16), parent = previousParent, node; } function deserializeTSPropertySignature(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSPropertySignature", computed: deserializeBool(pos + 12), optional: deserializeBool(pos + 13), readonly: deserializeBool(pos + 14), key: null, typeAnnotation: null, accessibility: null, static: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.key = deserializePropertyKey(pos + 16), node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 32), parent = previousParent, node; } function deserializeTSSignature(pos) { switch (uint8[pos]) { case 0: return deserializeBoxTSIndexSignature(pos + 8); case 1: return deserializeBoxTSPropertySignature(pos + 8); case 2: return deserializeBoxTSCallSignatureDeclaration(pos + 8); case 3: return deserializeBoxTSConstructSignatureDeclaration(pos + 8); case 4: return deserializeBoxTSMethodSignature(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSSignature`); } } function deserializeTSIndexSignature(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSIndexSignature", parameters: null, typeAnnotation: null, readonly: deserializeBool(pos + 12), static: deserializeBool(pos + 13), accessibility: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.parameters = deserializeVecTSIndexSignatureName(pos + 16), node.typeAnnotation = deserializeBoxTSTypeAnnotation(pos + 40), parent = previousParent, node; } function deserializeTSCallSignatureDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSCallSignatureDeclaration", typeParameters: null, params: null, returnType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, params = deserializeBoxFormalParameters(pos + 32), thisParam = deserializeOptionBoxTSThisParameter(pos + 24); return thisParam !== null && params.unshift(thisParam), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 16), node.params = params, node.returnType = deserializeOptionBoxTSTypeAnnotation(pos + 40), parent = previousParent, node; } function deserializeTSMethodSignatureKind(pos) { switch (uint8[pos]) { case 0: return "method"; case 1: return "get"; case 2: return "set"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSMethodSignatureKind`); } } function deserializeTSMethodSignature(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSMethodSignature", key: null, computed: deserializeBool(pos + 64), optional: deserializeBool(pos + 65), kind: deserializeTSMethodSignatureKind(pos + 66), typeParameters: null, params: null, returnType: null, accessibility: null, readonly: !1, static: !1, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, params = deserializeBoxFormalParameters(pos + 48), thisParam = deserializeOptionBoxTSThisParameter(pos + 40); return thisParam !== null && params.unshift(thisParam), node.key = deserializePropertyKey(pos + 16), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 32), node.params = params, node.returnType = deserializeOptionBoxTSTypeAnnotation(pos + 56), parent = previousParent, node; } function deserializeTSConstructSignatureDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSConstructSignatureDeclaration", typeParameters: null, params: null, returnType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 16), node.params = deserializeBoxFormalParameters(pos + 24), node.returnType = deserializeOptionBoxTSTypeAnnotation(pos + 32), parent = previousParent, node; } function deserializeTSIndexSignatureName(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "Identifier", decorators: [], name: deserializeStr(pos + 16), optional: !1, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeBoxTSTypeAnnotation(pos + 32), parent = previousParent, node; } function deserializeTSInterfaceHeritage(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSInterfaceHeritage", expression: null, typeArguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), parent = previousParent, node; } function deserializeTSTypePredicate(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypePredicate", parameterName: null, asserts: deserializeBool(pos + 12), typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.parameterName = deserializeTSTypePredicateName(pos + 16), node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 32), parent = previousParent, node; } function deserializeTSTypePredicateName(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierName(pos + 8); case 1: return deserializeBoxTSThisType(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypePredicateName`); } } function deserializeTSModuleDeclaration(pos) { let kind = deserializeTSModuleDeclarationKind(pos + 88), start = deserializeI32(pos), end = deserializeI32(pos + 4), declare = deserializeBool(pos + 89), node, previousParent = parent, body = deserializeOptionTSModuleDeclarationBody(pos + 72); if (body === null) node = parent = { __proto__: NodeProto, type: "TSModuleDeclaration", id: null, kind, declare, global: !1, start, end, range: [start, end], parent }, node.id = deserializeTSModuleDeclarationName(pos + 16); else { node = parent = { __proto__: NodeProto, type: "TSModuleDeclaration", id: null, body, kind, declare, global: !1, start, end, range: [start, end], parent }; let id = deserializeTSModuleDeclarationName(pos + 16); if (body.type === "TSModuleBlock") node.id = id, body.parent = node; else { let innerId = body.id; if (innerId.type === "Identifier") { let start, end, outerId = node.id = parent = { __proto__: NodeProto, type: "TSQualifiedName", left: id, right: innerId, start: start = id.start, end: end = innerId.end, range: [start, end], parent: node }; id.parent = innerId.parent = outerId; } else { node.id = innerId, innerId.parent = node; let { start } = id; for (; innerId.start = innerId.range[0] = start, innerId.left.type !== "Identifier";) innerId = innerId.left; let end, right = innerId.left; id.parent = right.parent = innerId.left = { __proto__: NodeProto, type: "TSQualifiedName", left: id, right, start, end: end = right.end, range: [start, end], parent: innerId }; } ObjectHasOwn$4(body, "body") ? (body = body.body, node.body = body, body.parent = node) : body = null; } } return parent = previousParent, node; } function deserializeTSModuleDeclarationKind(pos) { switch (uint8[pos]) { case 0: return "module"; case 1: return "namespace"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationKind`); } } function deserializeTSModuleDeclarationName(pos) { switch (uint8[pos]) { case 0: return deserializeBindingIdentifier(pos + 8); case 1: return deserializeStringLiteral(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationName`); } } function deserializeTSModuleDeclarationBody(pos) { switch (uint8[pos]) { case 0: return deserializeBoxTSModuleDeclaration(pos + 8); case 1: return deserializeBoxTSModuleBlock(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationBody`); } } function deserializeTSGlobalDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSModuleDeclaration", id: null, body: null, kind: "global", declare: deserializeBool(pos + 88), global: !0, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, keywordStart, keywordEnd; return node.id = { __proto__: NodeProto, type: "Identifier", decorators: [], name: "global", optional: !1, typeAnnotation: null, start: keywordStart = deserializeI32(pos + 16), end: keywordEnd = deserializeI32(pos + 20), range: [keywordStart, keywordEnd], parent }, node.body = deserializeTSModuleBlock(pos + 24), parent = previousParent, node; } function deserializeTSModuleBlock(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSModuleBlock", body: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, body = deserializeVecDirective(pos + 16); return body.push(...deserializeVecStatement(pos + 40)), node.body = body, parent = previousParent, node; } function deserializeTSTypeLiteral(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeLiteral", members: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.members = deserializeVecTSSignature(pos + 16), parent = previousParent, node; } function deserializeTSInferType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSInferType", typeParameter: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeParameter = deserializeBoxTSTypeParameter(pos + 16), parent = previousParent, node; } function deserializeTSTypeQuery(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeQuery", exprName: null, typeArguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.exprName = deserializeTSTypeQueryExprName(pos + 16), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 32), parent = previousParent, node; } function deserializeTSTypeQueryExprName(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierReference(pos + 8); case 1: return deserializeBoxTSQualifiedName(pos + 8); case 2: return deserializeBoxThisExpression(pos + 8); case 3: return deserializeBoxTSImportType(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeQueryExprName`); } } function deserializeTSImportType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSImportType", source: null, options: null, qualifier: null, typeArguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.source = deserializeStringLiteral(pos + 16), node.options = deserializeOptionBoxObjectExpression(pos + 64), node.qualifier = deserializeOptionTSImportTypeQualifier(pos + 72), node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 88), parent = previousParent, node; } function deserializeTSImportTypeQualifier(pos) { switch (uint8[pos]) { case 0: return deserializeBoxIdentifierName(pos + 8); case 1: return deserializeBoxTSImportTypeQualifiedName(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSImportTypeQualifier`); } } function deserializeTSImportTypeQualifiedName(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSQualifiedName", left: null, right: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.left = deserializeTSImportTypeQualifier(pos + 16), node.right = deserializeIdentifierName(pos + 32), parent = previousParent, node; } function deserializeTSFunctionType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSFunctionType", typeParameters: null, params: null, returnType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, params = deserializeBoxFormalParameters(pos + 32), thisParam = deserializeOptionBoxTSThisParameter(pos + 24); return thisParam !== null && params.unshift(thisParam), node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 16), node.params = params, node.returnType = deserializeBoxTSTypeAnnotation(pos + 40), parent = previousParent, node; } function deserializeTSConstructorType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSConstructorType", abstract: deserializeBool(pos + 40), typeParameters: null, params: null, returnType: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeParameters = deserializeOptionBoxTSTypeParameterDeclaration(pos + 16), node.params = deserializeBoxFormalParameters(pos + 24), node.returnType = deserializeBoxTSTypeAnnotation(pos + 32), parent = previousParent, node; } function deserializeTSMappedType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSMappedType", key: null, constraint: null, nameType: null, typeAnnotation: null, optional: null, readonly: deserializeOptionTSMappedTypeModifierOperator(pos + 97), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }, optional = deserializeOptionTSMappedTypeModifierOperator(pos + 96); return optional === null && (optional = !1), node.key = deserializeBindingIdentifier(pos + 16), node.constraint = deserializeTSType(pos + 48), node.nameType = deserializeOptionTSType(pos + 64), node.typeAnnotation = deserializeOptionTSType(pos + 80), node.optional = optional, parent = previousParent, node; } function deserializeTSMappedTypeModifierOperator(pos) { switch (uint8[pos]) { case 0: return !0; case 1: return "+"; case 2: return "-"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSMappedTypeModifierOperator`); } } function deserializeTSTemplateLiteralType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTemplateLiteralType", quasis: null, types: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.quasis = deserializeVecTemplateElement(pos + 16), node.types = deserializeVecTSType(pos + 40), parent = previousParent, node; } function deserializeTSAsExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSAsExpression", expression: null, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), node.typeAnnotation = deserializeTSType(pos + 32), parent = previousParent, node; } function deserializeTSSatisfiesExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSSatisfiesExpression", expression: null, typeAnnotation: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), node.typeAnnotation = deserializeTSType(pos + 32), parent = previousParent, node; } function deserializeTSTypeAssertion(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSTypeAssertion", typeAnnotation: null, expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), node.expression = deserializeExpression(pos + 32), parent = previousParent, node; } function deserializeTSImportEqualsDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSImportEqualsDeclaration", id: null, moduleReference: null, importKind: deserializeImportOrExportKind(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.id = deserializeBindingIdentifier(pos + 16), node.moduleReference = deserializeTSModuleReference(pos + 48), parent = previousParent, node; } function deserializeTSModuleReference(pos) { switch (uint8[pos]) { case 0: return deserializeBoxTSExternalModuleReference(pos + 8); case 1: return deserializeBoxIdentifierReference(pos + 8); case 2: return deserializeBoxTSQualifiedName(pos + 8); default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleReference`); } } function deserializeTSExternalModuleReference(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSExternalModuleReference", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeStringLiteral(pos + 16), parent = previousParent, node; } function deserializeTSNonNullExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSNonNullExpression", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeDecorator(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "Decorator", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeTSExportAssignment(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSExportAssignment", expression: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), parent = previousParent, node; } function deserializeTSNamespaceExportDeclaration(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSNamespaceExportDeclaration", id: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.id = deserializeIdentifierName(pos + 16), parent = previousParent, node; } function deserializeTSInstantiationExpression(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSInstantiationExpression", expression: null, typeArguments: null, start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.expression = deserializeExpression(pos + 16), node.typeArguments = deserializeBoxTSTypeParameterInstantiation(pos + 32), parent = previousParent, node; } function deserializeImportOrExportKind(pos) { switch (uint8[pos]) { case 0: return "value"; case 1: return "type"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for ImportOrExportKind`); } } function deserializeJSDocNullableType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSJSDocNullableType", typeAnnotation: null, postfix: deserializeBool(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeJSDocNonNullableType(pos) { let start, end, previousParent = parent, node = parent = { __proto__: NodeProto, type: "TSJSDocNonNullableType", typeAnnotation: null, postfix: deserializeBool(pos + 12), start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; return node.typeAnnotation = deserializeTSType(pos + 16), parent = previousParent, node; } function deserializeJSDocUnknownType(pos) { let start, end; return { __proto__: NodeProto, type: "TSJSDocUnknownType", start: start = deserializeI32(pos), end: end = deserializeI32(pos + 4), range: [start, end], parent }; } function deserializeModuleKind(pos) { switch (uint8[pos]) { case 0: return "script"; case 1: return "module"; case 3: return "commonjs"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for ModuleKind`); } } function deserializeAssignmentOperator(pos) { switch (uint8[pos]) { case 0: return "="; case 1: return "+="; case 2: return "-="; case 3: return "*="; case 4: return "/="; case 5: return "%="; case 6: return "**="; case 7: return "<<="; case 8: return ">>="; case 9: return ">>>="; case 10: return "|="; case 11: return "^="; case 12: return "&="; case 13: return "||="; case 14: return "&&="; case 15: return "??="; default: throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentOperator`); } } function deserializeBinaryOperator(pos) { switch (uint8[pos]) { case 0: return "=="; case 1: return "!="; case 2: return "==="; case 3: return "!=="; case 4: return "<"; case 5: return "<="; case 6: return ">"; case 7: return ">="; case 8: return "+"; case 9: return "-"; case 10: return "*"; case 11: return "/"; case 12: return "%"; case 13: return "**"; case 14: return "<<"; case 15: return ">>"; case 16: return ">>>"; case 17: return "|"; case 18: return "^"; case 19: return "&"; case 20: return "in"; case 21: return "instanceof"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for BinaryOperator`); } } function deserializeLogicalOperator(pos) { switch (uint8[pos]) { case 0: return "||"; case 1: return "&&"; case 2: return "??"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for LogicalOperator`); } } function deserializeUnaryOperator(pos) { switch (uint8[pos]) { case 0: return "+"; case 1: return "-"; case 2: return "!"; case 3: return "~"; case 4: return "typeof"; case 5: return "void"; case 6: return "delete"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for UnaryOperator`); } } function deserializeUpdateOperator(pos) { switch (uint8[pos]) { case 0: return "++"; case 1: return "--"; default: throw Error(`Unexpected discriminant ${uint8[pos]} for UpdateOperator`); } } function deserializeStr(pos) { let pos32 = pos >> 2, len = int32[pos32 + 2]; if (len === 0) return ""; pos = int32[pos32]; let end = pos + len, isInSourceRegion = pos >= sourceStartPos$1; if (isInSourceRegion && end <= firstNonAsciiPos) return sourceTextLatin.substr(pos - sourceStartPos$1, len); if (len > 64) return utf8Slice$1.call(uint8, pos, end); if (isInSourceRegion) { for (let i = pos; i < end; i++) if (uint8[i] >= 128) return utf8Slice$1.call(uint8, pos, end); return sourceTextLatin.substr(pos - sourceStartPos$1, len); } let arr = stringDecodeArrays[len]; for (let i = 0; i < len; i++) { let b = uint8[pos + i]; if (b >= 128) return utf8Slice$1.call(uint8, pos, end); arr[i] = b; } return fromCharCode.apply(null, arr); } function deserializeVecDirective(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 80; for (; pos !== endPos;) arr.push(deserializeDirective(pos)), pos += 80; return arr; } function deserializeVecStatement(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeStatement(pos)), pos += 16; return arr; } function deserializeBoxBooleanLiteral(pos) { return deserializeBooleanLiteral(int32[pos >> 2]); } function deserializeBoxNullLiteral(pos) { return deserializeNullLiteral(int32[pos >> 2]); } function deserializeBoxNumericLiteral(pos) { return deserializeNumericLiteral(int32[pos >> 2]); } function deserializeBoxBigIntLiteral(pos) { return deserializeBigIntLiteral(int32[pos >> 2]); } function deserializeBoxRegExpLiteral(pos) { return deserializeRegExpLiteral(int32[pos >> 2]); } function deserializeBoxStringLiteral(pos) { return deserializeStringLiteral(int32[pos >> 2]); } function deserializeBoxTemplateLiteral(pos) { return deserializeTemplateLiteral(int32[pos >> 2]); } function deserializeBoxIdentifierReference(pos) { return deserializeIdentifierReference(int32[pos >> 2]); } function deserializeBoxMetaProperty(pos) { return deserializeMetaProperty(int32[pos >> 2]); } function deserializeBoxSuper(pos) { return deserializeSuper(int32[pos >> 2]); } function deserializeBoxArrayExpression(pos) { return deserializeArrayExpression(int32[pos >> 2]); } function deserializeBoxArrowFunctionExpression(pos) { return deserializeArrowFunctionExpression(int32[pos >> 2]); } function deserializeBoxAssignmentExpression(pos) { return deserializeAssignmentExpression(int32[pos >> 2]); } function deserializeBoxAwaitExpression(pos) { return deserializeAwaitExpression(int32[pos >> 2]); } function deserializeBoxBinaryExpression(pos) { return deserializeBinaryExpression(int32[pos >> 2]); } function deserializeBoxCallExpression(pos) { return deserializeCallExpression(int32[pos >> 2]); } function deserializeBoxChainExpression(pos) { return deserializeChainExpression(int32[pos >> 2]); } function deserializeBoxClass(pos) { return deserializeClass(int32[pos >> 2]); } function deserializeBoxConditionalExpression(pos) { return deserializeConditionalExpression(int32[pos >> 2]); } function deserializeBoxFunction(pos) { return deserializeFunction(int32[pos >> 2]); } function deserializeBoxImportExpression(pos) { return deserializeImportExpression(int32[pos >> 2]); } function deserializeBoxLogicalExpression(pos) { return deserializeLogicalExpression(int32[pos >> 2]); } function deserializeBoxNewExpression(pos) { return deserializeNewExpression(int32[pos >> 2]); } function deserializeBoxObjectExpression(pos) { return deserializeObjectExpression(int32[pos >> 2]); } function deserializeBoxParenthesizedExpression(pos) { return deserializeParenthesizedExpression(int32[pos >> 2]); } function deserializeBoxSequenceExpression(pos) { return deserializeSequenceExpression(int32[pos >> 2]); } function deserializeBoxTaggedTemplateExpression(pos) { return deserializeTaggedTemplateExpression(int32[pos >> 2]); } function deserializeBoxThisExpression(pos) { return deserializeThisExpression(int32[pos >> 2]); } function deserializeBoxUnaryExpression(pos) { return deserializeUnaryExpression(int32[pos >> 2]); } function deserializeBoxUpdateExpression(pos) { return deserializeUpdateExpression(int32[pos >> 2]); } function deserializeBoxYieldExpression(pos) { return deserializeYieldExpression(int32[pos >> 2]); } function deserializeBoxPrivateInExpression(pos) { return deserializePrivateInExpression(int32[pos >> 2]); } function deserializeBoxJSXElement(pos) { return deserializeJSXElement(int32[pos >> 2]); } function deserializeBoxJSXFragment(pos) { return deserializeJSXFragment(int32[pos >> 2]); } function deserializeBoxTSAsExpression(pos) { return deserializeTSAsExpression(int32[pos >> 2]); } function deserializeBoxTSSatisfiesExpression(pos) { return deserializeTSSatisfiesExpression(int32[pos >> 2]); } function deserializeBoxTSTypeAssertion(pos) { return deserializeTSTypeAssertion(int32[pos >> 2]); } function deserializeBoxTSNonNullExpression(pos) { return deserializeTSNonNullExpression(int32[pos >> 2]); } function deserializeBoxTSInstantiationExpression(pos) { return deserializeTSInstantiationExpression(int32[pos >> 2]); } function deserializeBoxV8IntrinsicExpression(pos) { return deserializeV8IntrinsicExpression(int32[pos >> 2]); } function deserializeVecArrayExpressionElement(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeArrayExpressionElement(pos)), pos += 16; return arr; } function deserializeBoxSpreadElement(pos) { return deserializeSpreadElement(int32[pos >> 2]); } function deserializeBoxElision(pos) { return deserializeElision(int32[pos >> 2]); } function deserializeVecObjectPropertyKind(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeObjectPropertyKind(pos)), pos += 16; return arr; } function deserializeBoxObjectProperty(pos) { return deserializeObjectProperty(int32[pos >> 2]); } function deserializeBool(pos) { return uint8[pos] === 1; } function deserializeBoxIdentifierName(pos) { return deserializeIdentifierName(int32[pos >> 2]); } function deserializeBoxPrivateIdentifier(pos) { return deserializePrivateIdentifier(int32[pos >> 2]); } function deserializeVecTemplateElement(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 48; for (; pos !== endPos;) arr.push(deserializeTemplateElement(pos)), pos += 48; return arr; } function deserializeVecExpression(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeExpression(pos)), pos += 16; return arr; } function deserializeBoxTSTypeParameterInstantiation(pos) { return deserializeTSTypeParameterInstantiation(int32[pos >> 2]); } function deserializeOptionBoxTSTypeParameterInstantiation(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxTSTypeParameterInstantiation(pos); } function deserializeOptionStr(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeStr(pos); } function deserializeBoxComputedMemberExpression(pos) { return deserializeComputedMemberExpression(int32[pos >> 2]); } function deserializeBoxStaticMemberExpression(pos) { return deserializeStaticMemberExpression(int32[pos >> 2]); } function deserializeBoxPrivateFieldExpression(pos) { return deserializePrivateFieldExpression(int32[pos >> 2]); } function deserializeVecArgument(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeArgument(pos)), pos += 16; return arr; } function deserializeBoxArrayAssignmentTarget(pos) { return deserializeArrayAssignmentTarget(int32[pos >> 2]); } function deserializeBoxObjectAssignmentTarget(pos) { return deserializeObjectAssignmentTarget(int32[pos >> 2]); } function deserializeOptionAssignmentTargetMaybeDefault(pos) { return uint8[pos] === 51 ? null : deserializeAssignmentTargetMaybeDefault(pos); } function deserializeVecOptionAssignmentTargetMaybeDefault(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeOptionAssignmentTargetMaybeDefault(pos)), pos += 16; return arr; } function deserializeBoxAssignmentTargetRest(pos) { return deserializeAssignmentTargetRest(int32[pos >> 2]); } function deserializeOptionBoxAssignmentTargetRest(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxAssignmentTargetRest(pos); } function deserializeVecAssignmentTargetProperty(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeAssignmentTargetProperty(pos)), pos += 16; return arr; } function deserializeBoxAssignmentTargetWithDefault(pos) { return deserializeAssignmentTargetWithDefault(int32[pos >> 2]); } function deserializeBoxAssignmentTargetPropertyIdentifier(pos) { return deserializeAssignmentTargetPropertyIdentifier(int32[pos >> 2]); } function deserializeBoxAssignmentTargetPropertyProperty(pos) { return deserializeAssignmentTargetPropertyProperty(int32[pos >> 2]); } function deserializeOptionExpression(pos) { return uint8[pos] === 51 ? null : deserializeExpression(pos); } function deserializeBoxBlockStatement(pos) { return deserializeBlockStatement(int32[pos >> 2]); } function deserializeBoxBreakStatement(pos) { return deserializeBreakStatement(int32[pos >> 2]); } function deserializeBoxContinueStatement(pos) { return deserializeContinueStatement(int32[pos >> 2]); } function deserializeBoxDebuggerStatement(pos) { return deserializeDebuggerStatement(int32[pos >> 2]); } function deserializeBoxDoWhileStatement(pos) { return deserializeDoWhileStatement(int32[pos >> 2]); } function deserializeBoxEmptyStatement(pos) { return deserializeEmptyStatement(int32[pos >> 2]); } function deserializeBoxExpressionStatement(pos) { return deserializeExpressionStatement(int32[pos >> 2]); } function deserializeBoxForInStatement(pos) { return deserializeForInStatement(int32[pos >> 2]); } function deserializeBoxForOfStatement(pos) { return deserializeForOfStatement(int32[pos >> 2]); } function deserializeBoxForStatement(pos) { return deserializeForStatement(int32[pos >> 2]); } function deserializeBoxIfStatement(pos) { return deserializeIfStatement(int32[pos >> 2]); } function deserializeBoxLabeledStatement(pos) { return deserializeLabeledStatement(int32[pos >> 2]); } function deserializeBoxReturnStatement(pos) { return deserializeReturnStatement(int32[pos >> 2]); } function deserializeBoxSwitchStatement(pos) { return deserializeSwitchStatement(int32[pos >> 2]); } function deserializeBoxThrowStatement(pos) { return deserializeThrowStatement(int32[pos >> 2]); } function deserializeBoxTryStatement(pos) { return deserializeTryStatement(int32[pos >> 2]); } function deserializeBoxWhileStatement(pos) { return deserializeWhileStatement(int32[pos >> 2]); } function deserializeBoxWithStatement(pos) { return deserializeWithStatement(int32[pos >> 2]); } function deserializeBoxVariableDeclaration(pos) { return deserializeVariableDeclaration(int32[pos >> 2]); } function deserializeBoxTSTypeAliasDeclaration(pos) { return deserializeTSTypeAliasDeclaration(int32[pos >> 2]); } function deserializeBoxTSInterfaceDeclaration(pos) { return deserializeTSInterfaceDeclaration(int32[pos >> 2]); } function deserializeBoxTSEnumDeclaration(pos) { return deserializeTSEnumDeclaration(int32[pos >> 2]); } function deserializeBoxTSModuleDeclaration(pos) { return deserializeTSModuleDeclaration(int32[pos >> 2]); } function deserializeBoxTSGlobalDeclaration(pos) { return deserializeTSGlobalDeclaration(int32[pos >> 2]); } function deserializeBoxTSImportEqualsDeclaration(pos) { return deserializeTSImportEqualsDeclaration(int32[pos >> 2]); } function deserializeVecVariableDeclarator(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 56; for (; pos !== endPos;) arr.push(deserializeVariableDeclarator(pos)), pos += 56; return arr; } function deserializeBoxTSTypeAnnotation(pos) { return deserializeTSTypeAnnotation(int32[pos >> 2]); } function deserializeOptionBoxTSTypeAnnotation(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxTSTypeAnnotation(pos); } function deserializeOptionStatement(pos) { return uint8[pos] === 70 ? null : deserializeStatement(pos); } function deserializeOptionForStatementInit(pos) { return uint8[pos] === 65 ? null : deserializeForStatementInit(pos); } function deserializeOptionLabelIdentifier(pos) { return int32[(pos >> 2) + 4] === 0 && int32[(pos >> 2) + 5] === 0 ? null : deserializeLabelIdentifier(pos); } function deserializeVecSwitchCase(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 56; for (; pos !== endPos;) arr.push(deserializeSwitchCase(pos)), pos += 56; return arr; } function deserializeBoxCatchClause(pos) { return deserializeCatchClause(int32[pos >> 2]); } function deserializeOptionBoxCatchClause(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxCatchClause(pos); } function deserializeOptionBoxBlockStatement(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxBlockStatement(pos); } function deserializeOptionCatchParameter(pos) { return uint8[pos + 16] === 4 ? null : deserializeCatchParameter(pos); } function deserializeBoxBindingIdentifier(pos) { return deserializeBindingIdentifier(int32[pos >> 2]); } function deserializeBoxObjectPattern(pos) { return deserializeObjectPattern(int32[pos >> 2]); } function deserializeBoxArrayPattern(pos) { return deserializeArrayPattern(int32[pos >> 2]); } function deserializeBoxAssignmentPattern(pos) { return deserializeAssignmentPattern(int32[pos >> 2]); } function deserializeVecBindingProperty(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 48; for (; pos !== endPos;) arr.push(deserializeBindingProperty(pos)), pos += 48; return arr; } function deserializeBoxBindingRestElement(pos) { return deserializeBindingRestElement(int32[pos >> 2]); } function deserializeOptionBoxBindingRestElement(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxBindingRestElement(pos); } function deserializeOptionBindingPattern(pos) { return uint8[pos] === 4 ? null : deserializeBindingPattern(pos); } function deserializeVecOptionBindingPattern(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeOptionBindingPattern(pos)), pos += 16; return arr; } function deserializeOptionBindingIdentifier(pos) { return int32[(pos >> 2) + 4] === 0 && int32[(pos >> 2) + 5] === 0 ? null : deserializeBindingIdentifier(pos); } function deserializeBoxTSTypeParameterDeclaration(pos) { return deserializeTSTypeParameterDeclaration(int32[pos >> 2]); } function deserializeOptionBoxTSTypeParameterDeclaration(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxTSTypeParameterDeclaration(pos); } function deserializeBoxTSThisParameter(pos) { return deserializeTSThisParameter(int32[pos >> 2]); } function deserializeOptionBoxTSThisParameter(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxTSThisParameter(pos); } function deserializeBoxFormalParameters(pos) { return deserializeFormalParameters(int32[pos >> 2]); } function deserializeBoxFunctionBody(pos) { return deserializeFunctionBody(int32[pos >> 2]); } function deserializeOptionBoxFunctionBody(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxFunctionBody(pos); } function deserializeVecFormalParameter(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 72; for (; pos !== endPos;) arr.push(deserializeFormalParameter(pos)), pos += 72; return arr; } function deserializeVecDecorator(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 5); for (; pos !== endPos;) arr.push(deserializeDecorator(pos)), pos += 32; return arr; } function deserializeBoxExpression(pos) { return deserializeExpression(int32[pos >> 2]); } function deserializeOptionBoxExpression(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxExpression(pos); } function deserializeOptionTSAccessibility(pos) { return uint8[pos] === 3 ? null : deserializeTSAccessibility(pos); } function deserializeVecTSClassImplements(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 40; for (; pos !== endPos;) arr.push(deserializeTSClassImplements(pos)), pos += 40; return arr; } function deserializeBoxClassBody(pos) { return deserializeClassBody(int32[pos >> 2]); } function deserializeVecClassElement(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeClassElement(pos)), pos += 16; return arr; } function deserializeBoxStaticBlock(pos) { return deserializeStaticBlock(int32[pos >> 2]); } function deserializeBoxMethodDefinition(pos) { return deserializeMethodDefinition(int32[pos >> 2]); } function deserializeBoxPropertyDefinition(pos) { return deserializePropertyDefinition(int32[pos >> 2]); } function deserializeBoxAccessorProperty(pos) { return deserializeAccessorProperty(int32[pos >> 2]); } function deserializeBoxTSIndexSignature(pos) { return deserializeTSIndexSignature(int32[pos >> 2]); } function deserializeBoxImportDeclaration(pos) { return deserializeImportDeclaration(int32[pos >> 2]); } function deserializeBoxExportAllDeclaration(pos) { return deserializeExportAllDeclaration(int32[pos >> 2]); } function deserializeBoxExportDefaultDeclaration(pos) { return deserializeExportDefaultDeclaration(int32[pos >> 2]); } function deserializeBoxExportNamedDeclaration(pos) { return deserializeExportNamedDeclaration(int32[pos >> 2]); } function deserializeBoxTSExportAssignment(pos) { return deserializeTSExportAssignment(int32[pos >> 2]); } function deserializeBoxTSNamespaceExportDeclaration(pos) { return deserializeTSNamespaceExportDeclaration(int32[pos >> 2]); } function deserializeOptionImportPhase(pos) { return uint8[pos] === 2 ? null : deserializeImportPhase(pos); } function deserializeVecImportDeclarationSpecifier(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeImportDeclarationSpecifier(pos)), pos += 16; return arr; } function deserializeOptionVecImportDeclarationSpecifier(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeVecImportDeclarationSpecifier(pos); } function deserializeBoxWithClause(pos) { return deserializeWithClause(int32[pos >> 2]); } function deserializeOptionBoxWithClause(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxWithClause(pos); } function deserializeBoxImportSpecifier(pos) { return deserializeImportSpecifier(int32[pos >> 2]); } function deserializeBoxImportDefaultSpecifier(pos) { return deserializeImportDefaultSpecifier(int32[pos >> 2]); } function deserializeBoxImportNamespaceSpecifier(pos) { return deserializeImportNamespaceSpecifier(int32[pos >> 2]); } function deserializeVecImportAttribute(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 120; for (; pos !== endPos;) arr.push(deserializeImportAttribute(pos)), pos += 120; return arr; } function deserializeOptionDeclaration(pos) { return uint8[pos] === 31 ? null : deserializeDeclaration(pos); } function deserializeVecExportSpecifier(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 7); for (; pos !== endPos;) arr.push(deserializeExportSpecifier(pos)), pos += 128; return arr; } function deserializeOptionStringLiteral(pos) { return uint8[pos + 12] === 2 ? null : deserializeStringLiteral(pos); } function deserializeOptionModuleExportName(pos) { return uint8[pos] === 3 ? null : deserializeModuleExportName(pos); } function deserializeF64(pos) { return float64[pos >> 3]; } function deserializeU8(pos) { return uint8[pos]; } function deserializeBoxJSXOpeningElement(pos) { return deserializeJSXOpeningElement(int32[pos >> 2]); } function deserializeVecJSXChild(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeJSXChild(pos)), pos += 16; return arr; } function deserializeBoxJSXClosingElement(pos) { return deserializeJSXClosingElement(int32[pos >> 2]); } function deserializeOptionBoxJSXClosingElement(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxJSXClosingElement(pos); } function deserializeVecJSXAttributeItem(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeJSXAttributeItem(pos)), pos += 16; return arr; } function deserializeBoxJSXIdentifier(pos) { return deserializeJSXIdentifier(int32[pos >> 2]); } function deserializeBoxJSXNamespacedName(pos) { return deserializeJSXNamespacedName(int32[pos >> 2]); } function deserializeBoxJSXMemberExpression(pos) { return deserializeJSXMemberExpression(int32[pos >> 2]); } function deserializeBoxJSXEmptyExpression(pos) { return deserializeJSXEmptyExpression(int32[pos >> 2]); } function deserializeBoxJSXAttribute(pos) { return deserializeJSXAttribute(int32[pos >> 2]); } function deserializeBoxJSXSpreadAttribute(pos) { return deserializeJSXSpreadAttribute(int32[pos >> 2]); } function deserializeOptionJSXAttributeValue(pos) { return uint8[pos] === 4 ? null : deserializeJSXAttributeValue(pos); } function deserializeBoxJSXExpressionContainer(pos) { return deserializeJSXExpressionContainer(int32[pos >> 2]); } function deserializeBoxJSXText(pos) { return deserializeJSXText(int32[pos >> 2]); } function deserializeBoxJSXSpreadChild(pos) { return deserializeJSXSpreadChild(int32[pos >> 2]); } function deserializeVecTSEnumMember(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 48; for (; pos !== endPos;) arr.push(deserializeTSEnumMember(pos)), pos += 48; return arr; } function deserializeBoxTSAnyKeyword(pos) { return deserializeTSAnyKeyword(int32[pos >> 2]); } function deserializeBoxTSBigIntKeyword(pos) { return deserializeTSBigIntKeyword(int32[pos >> 2]); } function deserializeBoxTSBooleanKeyword(pos) { return deserializeTSBooleanKeyword(int32[pos >> 2]); } function deserializeBoxTSIntrinsicKeyword(pos) { return deserializeTSIntrinsicKeyword(int32[pos >> 2]); } function deserializeBoxTSNeverKeyword(pos) { return deserializeTSNeverKeyword(int32[pos >> 2]); } function deserializeBoxTSNullKeyword(pos) { return deserializeTSNullKeyword(int32[pos >> 2]); } function deserializeBoxTSNumberKeyword(pos) { return deserializeTSNumberKeyword(int32[pos >> 2]); } function deserializeBoxTSObjectKeyword(pos) { return deserializeTSObjectKeyword(int32[pos >> 2]); } function deserializeBoxTSStringKeyword(pos) { return deserializeTSStringKeyword(int32[pos >> 2]); } function deserializeBoxTSSymbolKeyword(pos) { return deserializeTSSymbolKeyword(int32[pos >> 2]); } function deserializeBoxTSUndefinedKeyword(pos) { return deserializeTSUndefinedKeyword(int32[pos >> 2]); } function deserializeBoxTSUnknownKeyword(pos) { return deserializeTSUnknownKeyword(int32[pos >> 2]); } function deserializeBoxTSVoidKeyword(pos) { return deserializeTSVoidKeyword(int32[pos >> 2]); } function deserializeBoxTSArrayType(pos) { return deserializeTSArrayType(int32[pos >> 2]); } function deserializeBoxTSConditionalType(pos) { return deserializeTSConditionalType(int32[pos >> 2]); } function deserializeBoxTSConstructorType(pos) { return deserializeTSConstructorType(int32[pos >> 2]); } function deserializeBoxTSFunctionType(pos) { return deserializeTSFunctionType(int32[pos >> 2]); } function deserializeBoxTSImportType(pos) { return deserializeTSImportType(int32[pos >> 2]); } function deserializeBoxTSIndexedAccessType(pos) { return deserializeTSIndexedAccessType(int32[pos >> 2]); } function deserializeBoxTSInferType(pos) { return deserializeTSInferType(int32[pos >> 2]); } function deserializeBoxTSIntersectionType(pos) { return deserializeTSIntersectionType(int32[pos >> 2]); } function deserializeBoxTSLiteralType(pos) { return deserializeTSLiteralType(int32[pos >> 2]); } function deserializeBoxTSMappedType(pos) { return deserializeTSMappedType(int32[pos >> 2]); } function deserializeBoxTSNamedTupleMember(pos) { return deserializeTSNamedTupleMember(int32[pos >> 2]); } function deserializeBoxTSTemplateLiteralType(pos) { return deserializeTSTemplateLiteralType(int32[pos >> 2]); } function deserializeBoxTSThisType(pos) { return deserializeTSThisType(int32[pos >> 2]); } function deserializeBoxTSTupleType(pos) { return deserializeTSTupleType(int32[pos >> 2]); } function deserializeBoxTSTypeLiteral(pos) { return deserializeTSTypeLiteral(int32[pos >> 2]); } function deserializeBoxTSTypeOperator(pos) { return deserializeTSTypeOperator(int32[pos >> 2]); } function deserializeBoxTSTypePredicate(pos) { return deserializeTSTypePredicate(int32[pos >> 2]); } function deserializeBoxTSTypeQuery(pos) { return deserializeTSTypeQuery(int32[pos >> 2]); } function deserializeBoxTSTypeReference(pos) { return deserializeTSTypeReference(int32[pos >> 2]); } function deserializeBoxTSUnionType(pos) { return deserializeTSUnionType(int32[pos >> 2]); } function deserializeBoxTSParenthesizedType(pos) { return deserializeTSParenthesizedType(int32[pos >> 2]); } function deserializeBoxJSDocNullableType(pos) { return deserializeJSDocNullableType(int32[pos >> 2]); } function deserializeBoxJSDocNonNullableType(pos) { return deserializeJSDocNonNullableType(int32[pos >> 2]); } function deserializeBoxJSDocUnknownType(pos) { return deserializeJSDocUnknownType(int32[pos >> 2]); } function deserializeVecTSType(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeTSType(pos)), pos += 16; return arr; } function deserializeVecTSTupleElement(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeTSTupleElement(pos)), pos += 16; return arr; } function deserializeBoxTSOptionalType(pos) { return deserializeTSOptionalType(int32[pos >> 2]); } function deserializeBoxTSRestType(pos) { return deserializeTSRestType(int32[pos >> 2]); } function deserializeBoxTSQualifiedName(pos) { return deserializeTSQualifiedName(int32[pos >> 2]); } function deserializeOptionTSType(pos) { return uint8[pos] === 38 ? null : deserializeTSType(pos); } function deserializeVecTSTypeParameter(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 80; for (; pos !== endPos;) arr.push(deserializeTSTypeParameter(pos)), pos += 80; return arr; } function deserializeVecTSInterfaceHeritage(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 40; for (; pos !== endPos;) arr.push(deserializeTSInterfaceHeritage(pos)), pos += 40; return arr; } function deserializeBoxTSInterfaceBody(pos) { return deserializeTSInterfaceBody(int32[pos >> 2]); } function deserializeVecTSSignature(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + (int32[pos32 + 2] << 4); for (; pos !== endPos;) arr.push(deserializeTSSignature(pos)), pos += 16; return arr; } function deserializeBoxTSPropertySignature(pos) { return deserializeTSPropertySignature(int32[pos >> 2]); } function deserializeBoxTSCallSignatureDeclaration(pos) { return deserializeTSCallSignatureDeclaration(int32[pos >> 2]); } function deserializeBoxTSConstructSignatureDeclaration(pos) { return deserializeTSConstructSignatureDeclaration(int32[pos >> 2]); } function deserializeBoxTSMethodSignature(pos) { return deserializeTSMethodSignature(int32[pos >> 2]); } function deserializeVecTSIndexSignatureName(pos) { let arr = [], pos32 = pos >> 2; pos = int32[pos32]; let endPos = pos + int32[pos32 + 2] * 40; for (; pos !== endPos;) arr.push(deserializeTSIndexSignatureName(pos)), pos += 40; return arr; } function deserializeOptionTSModuleDeclarationBody(pos) { return uint8[pos] === 2 ? null : deserializeTSModuleDeclarationBody(pos); } function deserializeBoxTSModuleBlock(pos) { return deserializeTSModuleBlock(int32[pos >> 2]); } function deserializeBoxTSTypeParameter(pos) { return deserializeTSTypeParameter(int32[pos >> 2]); } function deserializeOptionBoxObjectExpression(pos) { return int32[pos >> 2] === 0 && int32[(pos >> 2) + 1] === 0 ? null : deserializeBoxObjectExpression(pos); } function deserializeOptionTSImportTypeQualifier(pos) { return uint8[pos] === 2 ? null : deserializeTSImportTypeQualifier(pos); } function deserializeBoxTSImportTypeQualifiedName(pos) { return deserializeTSImportTypeQualifiedName(int32[pos >> 2]); } function deserializeOptionTSMappedTypeModifierOperator(pos) { return uint8[pos] === 3 ? null : deserializeTSMappedTypeModifierOperator(pos); } function deserializeBoxTSExternalModuleReference(pos) { return deserializeTSExternalModuleReference(int32[pos >> 2]); } function deserializeI32(pos) { return int32[pos >> 2]; } //#endregion //#region src-js/plugins/tokens_and_comments.ts /** * Initialization and deserialization of merged tokens-and-comments array and buffer. */ const MathMax$2 = Math.max; let tokensAndComments = null, previousTokensAndComments = [], tokensAndCommentsInt32 = null, tokensAndCommentsLen = 0, tokensAndCommentsBackingInt32 = EMPTY_INT32_ARRAY; /** * Initialize tokens-and-comments buffer. * * Creates a buffer containing tokens and comments interleaved in ascending order of `start`. * * Each token/comment in the input buffers is 16 bytes, with `start` as the first `u32`. * * `tokensAndCommentsInt32` contains 16-byte entries with the layout: * `{ start: u32, index: u32, type: u32, 4 bytes padding }`. * * `index` is the index of the token/comment within its original buffer (in 16-byte units). */ function initTokensAndCommentsBuffer() { tokensInt32 === null && initTokensBuffer(), commentsInt32 === null && initCommentsBuffer(), tokensAndCommentsLen = tokensLen + commentsLen; let requiredLen32 = tokensAndCommentsLen + 1 << 2, backingLen = tokensAndCommentsBackingInt32.length; backingLen < requiredLen32 && (tokensAndCommentsBackingInt32 = new Int32Array(MathMax$2(requiredLen32, backingLen === 0 ? 256 : backingLen << 1))), tokensAndCommentsInt32 = tokensAndCommentsBackingInt32, commentsLen === 0 ? fillMergedEntries(0, tokensInt32, 0, 0, tokensLen) : tokensLen === 0 ? fillMergedEntries(1, commentsInt32, 0, 0, commentsLen) : mergeTokensAndComments(tokensInt32, commentsInt32), tokensAndCommentsInt32[(tokensAndCommentsLen << 2) + 2] = 0; } /** * Merge tokens and comments in ascending order of `start`. * * Uses two separate inner loops (one for token runs, one for comment runs) * so the branch predictor sees a consistent "continue" pattern within each run, * only mispredicting once at each run transition. */ function mergeTokensAndComments(tokensInt32, commentsInt32) { let tokenIndex = 0, commentIndex = 0, mergedPos32 = 0, tokenStart = tokensInt32[0], commentStart = commentsInt32[0]; for (; commentStart < tokenStart;) { if (writeMergedEntry(1, mergedPos32, commentIndex, commentStart), mergedPos32 += 4, ++commentIndex === commentsLen) { fillMergedEntries(0, tokensInt32, mergedPos32, tokenIndex, tokensLen); return; } commentStart = commentsInt32[commentIndex << 2]; } for (;;) { do { if (writeMergedEntry(0, mergedPos32, tokenIndex, tokenStart), mergedPos32 += 4, ++tokenIndex === tokensLen) { fillMergedEntries(1, commentsInt32, mergedPos32, commentIndex, commentsLen); return; } tokenStart = tokensInt32[tokenIndex << 2]; } while (tokenStart < commentStart); do { if (writeMergedEntry(1, mergedPos32, commentIndex, commentStart), mergedPos32 += 4, ++commentIndex === commentsLen) { fillMergedEntries(0, tokensInt32, mergedPos32, tokenIndex, tokensLen); return; } commentStart = commentsInt32[commentIndex << 2]; } while (commentStart < tokenStart); } } /** * Write a single entry to the merged buffer. */ function writeMergedEntry(type, mergedPos32, originalIndex, start) { tokensAndCommentsInt32[mergedPos32] = start, tokensAndCommentsInt32[mergedPos32 + 1] = originalIndex, tokensAndCommentsInt32[mergedPos32 + 2] = type; } /** * Fill output entries from a single source buffer (tokens or comments) sequentially. * Used for fast paths and for appending remaining items after the merge loop. */ function fillMergedEntries(type, srcInt32, mergedPos32, srcIndex, srcLen) { let srcPos32 = srcIndex << 2; for (; srcIndex < srcLen; srcIndex++) tokensAndCommentsInt32[mergedPos32] = srcInt32[srcPos32], tokensAndCommentsInt32[mergedPos32 + 1] = srcIndex, tokensAndCommentsInt32[mergedPos32 + 2] = type, mergedPos32 += 4, srcPos32 += 4; } /** * Get token or comment from the merged buffer at `index`. * Deserializes the underlying token/comment if needed. * * @param index - Index in the merged buffer * @returns Deserialized token or comment */ function getTokenOrComment(index) { let pos32 = index << 2, originalIndex = tokensAndCommentsInt32[pos32 + 1]; return tokensAndCommentsInt32[pos32 + 2] === 0 ? getToken(originalIndex) : getComment(originalIndex); } /** * Get the `end` value for an entry in the merged `tokensAndComments` buffer, * by looking it up in the original tokens or comments buffer. * * @param entryIndex - Index in the merged buffer * @returns The `end` offset of the token/comment in source text */ function getTokenOrCommentEnd(entryIndex) { let pos32 = entryIndex << 2, originalEndPos32 = (tokensAndCommentsInt32[pos32 + 1] << 2) + 1; return tokensAndCommentsInt32[pos32 + 2] === 0 ? tokensInt32[originalEndPos32] : commentsInt32[originalEndPos32]; } /** * Get all tokens and comments in source order. * * Builds and caches the merged array on first call. * Subsequent calls return the same cached array. * * @returns Array of all tokens and comments, sorted by source position */ function getTokensAndComments() { if (tokensAndComments !== null) return tokensAndComments; if (tokensInt32 === null && initTokensBuffer(), commentsInt32 === null && initCommentsBuffer(), commentsLen === 0) return tokens === null && initTokens(), tokensAndComments = tokens; if (tokensLen === 0) return comments === null && initComments(), tokensAndComments = comments; allTokensDeserialized || deserializeTokens(), allCommentsDeserialized || deserializeComments(), tokensAndCommentsInt32 === null && initTokensAndCommentsBuffer(), previousTokensAndComments.length >= tokensAndCommentsLen ? (tokensAndComments = previousTokensAndComments, tokensAndComments.length = tokensAndCommentsLen) : (tokensAndComments = previousTokensAndComments = Array(tokensAndCommentsLen).fill(0), tokensAndComments[0] = null); for (let i = 0; i < tokensAndCommentsLen; i++) { let pos32 = i << 2, originalIndex = tokensAndCommentsInt32[pos32 + 1]; tokensAndComments[i] = tokensAndCommentsInt32[pos32 + 2] === 0 ? cachedTokens[originalIndex] : cachedComments[originalIndex]; } return tokensAndComments; } /** * Reset merged tokens-and-comments array and buffer after file has been linted. */ function resetTokensAndComments() { tokensAndComments = null, tokensAndCommentsInt32 = null, tokensAndCommentsLen = 0; } //#endregion //#region src-js/plugins/comments_methods.ts /** * Retrieve an array containing all comments in the source code. * @returns Array of `Comment`s in order they appear in source. */ function getAllComments() { return comments === null && initComments(), comments; } /** * Get all comments directly before the given node or token. * * "Directly before" means only comments before this node, and after the preceding token. * * ```js * // Define `x` * const x = 1; * // Define `y` * const y = 2; * ``` * * `sourceCode.getCommentsBefore(varDeclY)` will only return "Define `y`" comment, not also "Define `x`". * * @param nodeOrToken - The AST node or token to check for adjacent comment tokens. * @returns Array of `Comment`s in occurrence order. */ function getCommentsBefore(nodeOrToken) { if (tokensAndCommentsInt32 === null && initTokensAndCommentsBuffer(), commentsLen === 0) return []; let targetStart = nodeOrToken.range[0], searchIndex = 0; for (let endIndex = tokensAndCommentsLen; searchIndex < endIndex;) { let mid = searchIndex + endIndex >> 1; tokensAndCommentsInt32[mid << 2] < targetStart ? searchIndex = mid + 1 : endIndex = mid; } let startTypePos32 = (searchIndex << 2) - 2, typePos32 = startTypePos32; for (; typePos32 > 0 && tokensAndCommentsInt32[typePos32] !== 0;) typePos32 -= 4; let count32 = startTypePos32 - typePos32; if (count32 === 0) return []; let sliceStart = tokensAndCommentsInt32[typePos32 + 3], sliceEnd = sliceStart + (count32 >> 2); for (let i = sliceStart; i < sliceEnd; i++) getComment(i); return cachedComments.slice(sliceStart, sliceEnd); } /** * Get all comment tokens directly after the given node or token. * * "Directly after" means only comments between end of this node, and the next token following it. * * ```js * const x = 1; * // Define `y` * const y = 2; * // Define `z` * const z = 3; * ``` * * `sourceCode.getCommentsAfter(varDeclX)` will only return "Define `y`" comment, not also "Define `z`". * * @param nodeOrToken - The AST node or token to check for adjacent comment tokens. * @returns Array of `Comment`s in occurrence order. */ function getCommentsAfter(nodeOrToken) { if (tokensAndCommentsInt32 === null && initTokensAndCommentsBuffer(), commentsLen === 0) return []; let targetEnd = nodeOrToken.range[1], searchIndex = 0; for (let endIndex = tokensAndCommentsLen; searchIndex < endIndex;) { let mid = searchIndex + endIndex >> 1; tokensAndCommentsInt32[mid << 2] < targetEnd ? searchIndex = mid + 1 : endIndex = mid; } let startTypePos32 = (searchIndex << 2) + 2, typePos32 = startTypePos32; for (; tokensAndCommentsInt32[typePos32] !== 0;) typePos32 += 4; let count32 = typePos32 - startTypePos32; if (count32 === 0) return []; let sliceStart = tokensAndCommentsInt32[startTypePos32 - 1], sliceEnd = sliceStart + (count32 >> 2); for (let i = sliceStart; i < sliceEnd; i++) getComment(i); return cachedComments.slice(sliceStart, sliceEnd); } /** * Get all comment tokens inside the given node. * @param node - The AST node to get the comments for. * @returns Array of `Comment`s in occurrence order. */ function getCommentsInside(node) { if (commentsInt32 === null && initCommentsBuffer(), commentsLen === 0) return []; let { range } = node, rangeStart = range[0], rangeEnd = range[1], sliceStart = 0; for (let endIndex = commentsLen; sliceStart < endIndex;) { let mid = sliceStart + endIndex >> 1; commentsInt32[mid << 2] < rangeStart ? sliceStart = mid + 1 : endIndex = mid; } let sliceEnd = sliceStart; for (let endIndex = commentsLen; sliceEnd < endIndex;) { let mid = sliceEnd + endIndex >> 1; commentsInt32[mid << 2] < rangeEnd ? sliceEnd = mid + 1 : endIndex = mid; } for (let i = sliceStart; i < sliceEnd; i++) getComment(i); return cachedComments.slice(sliceStart, sliceEnd); } /** * Check whether any comments exist or not between the given 2 nodes. * @param nodeOrToken1 - Start node/token. * @param nodeOrToken2 - End node/token. * @returns `true` if one or more comments exist between the two. */ function commentsExistBetween(nodeOrToken1, nodeOrToken2) { if (commentsInt32 === null && initCommentsBuffer(), commentsLen === 0) return !1; let betweenRangeStart = nodeOrToken1.range[1], firstCommentBetween = 0; for (let endIndex = commentsLen; firstCommentBetween < endIndex;) { let mid = firstCommentBetween + endIndex >> 1; commentsInt32[mid << 2] < betweenRangeStart ? firstCommentBetween = mid + 1 : endIndex = mid; } return firstCommentBetween < commentsLen && commentsInt32[(firstCommentBetween << 2) + 1] <= nodeOrToken2.range[0]; } /** * Retrieve the JSDoc comment for a given node. * * @deprecated * * @param node - The AST node to get the comment for. * @returns The JSDoc comment for the given node, or `null` if not found. */ function getJSDocComment(node) { throw Error("`sourceCode.getJSDocComment` is not supported at present (and deprecated)"); } //#endregion //#region src-js/plugins/directives.ts const LABEL_PATTERN = /^\s*(?