diff --git a/dist/index.js b/dist/index.js index fdde1f2..2294383 100644 --- a/dist/index.js +++ b/dist/index.js @@ -48,8 +48,8 @@ var require_virtual_types = __commonJS({ exports.Statement = Statement; var Expression = ["Expression"]; exports.Expression = Expression; - var Scope2 = ["Scopable", "Pattern"]; - exports.Scope = Scope2; + var Scope3 = ["Scopable", "Pattern"]; + exports.Scope = Scope3; var Referenced = null; exports.Referenced = Referenced; var BlockScoped = null; @@ -18062,7 +18062,7 @@ var require_scope = __commonJS({ } }; var uid = 0; - var Scope2 = class _Scope { + var Scope3 = class _Scope { constructor(path2) { this.uid = void 0; this.path = void 0; @@ -18697,9 +18697,9 @@ var require_scope = __commonJS({ } while (scope = scope.parent); } }; - exports.default = Scope2; - Scope2.globals = Object.keys(_globals.builtin); - Scope2.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; + exports.default = Scope3; + Scope3.globals = Object.keys(_globals.builtin); + Scope3.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; } }); @@ -29011,7 +29011,7 @@ var require_lib9 = __commonJS({ var CLASS_ELEMENT_INSTANCE_GETTER2 = CLASS_ELEMENT_KIND_GETTER2; var CLASS_ELEMENT_INSTANCE_SETTER2 = CLASS_ELEMENT_KIND_SETTER2; var CLASS_ELEMENT_OTHER2 = 0; - var Scope2 = class { + var Scope3 = class { constructor(flags) { this.var = /* @__PURE__ */ new Set(); this.lexical = /* @__PURE__ */ new Set(); @@ -29067,7 +29067,7 @@ var require_lib9 = __commonJS({ return this.treatFunctionsAsVarInScope(this.currentScope()); } createScope(flags) { - return new Scope2(flags); + return new Scope3(flags); } enter(flags) { this.scopeStack.push(this.createScope(flags)); @@ -29162,7 +29162,7 @@ var require_lib9 = __commonJS({ } } }; - var FlowScope2 = class extends Scope2 { + var FlowScope2 = class extends Scope3 { constructor(...args) { super(...args); this.declareFunctions = /* @__PURE__ */ new Set(); @@ -34668,7 +34668,7 @@ var require_lib9 = __commonJS({ } } }; - var TypeScriptScope2 = class extends Scope2 { + var TypeScriptScope2 = class extends Scope3 { constructor(...args) { super(...args); this.types = /* @__PURE__ */ new Set(); @@ -86277,13 +86277,7 @@ var traverse2 = ( //@ts-ignore import_traverse2.default.default?.default || import_traverse2.default.default || import_traverse2.default ); -function analyze2(content) { - const ast = parse_1$1(content, { - sourceType: "module", - plugins: [ - "typescript" - ] - }); +function processSetup(ast, parentScope, parentPath) { const graph = { nodes: /* @__PURE__ */ new Set(), edges: /* @__PURE__ */ new Map() @@ -86291,10 +86285,38 @@ function analyze2(content) { traverse2(ast, { VariableDeclaration(path2) { path2.node.declarations.forEach((declaration2) => { + if (declaration2.id.type === "ArrayPattern") { + declaration2.id.elements.forEach((element) => { + if (element?.type === "Identifier") { + const name = element.name; + const binding2 = path2.scope.getBinding(name); + if (binding2 && (path2.parent.type === "Program" || parentPath?.type === "ObjectMethod" && parentPath.body === path2.parent) && !(declaration2.init?.type === "CallExpression" && declaration2.init?.callee.type === "Identifier" && ["defineProps", "defineEmits"].includes(declaration2.init?.callee.name))) { + graph.nodes.add(name); + if (!graph.edges.get(name)) { + graph.edges.set(name, /* @__PURE__ */ new Set()); + } + } + } + }); + } + if (declaration2.id.type === "ObjectPattern") { + declaration2.id.properties.forEach((property) => { + if (property.type === "ObjectProperty" && property.value.type === "Identifier") { + const name = property.value.name; + const binding2 = path2.scope.getBinding(name); + if (binding2 && (path2.parent.type === "Program" || parentPath?.type === "ObjectMethod" && parentPath.body === path2.parent) && !(declaration2.init?.type === "CallExpression" && declaration2.init?.callee.type === "Identifier" && ["defineProps", "defineEmits"].includes(declaration2.init?.callee.name))) { + graph.nodes.add(name); + if (!graph.edges.get(name)) { + graph.edges.set(name, /* @__PURE__ */ new Set()); + } + } + } + }); + } if (declaration2.id?.type === "Identifier") { const name = declaration2.id.name; const binding2 = path2.scope.getBinding(name); - if (binding2 && path2.parent.type === "Program" && !(declaration2.init?.type === "CallExpression" && declaration2.init?.callee.type === "Identifier" && ["defineProps", "defineEmits"].includes(declaration2.init?.callee.name))) { + if (binding2 && (path2.parent.type === "Program" || parentPath?.type === "ObjectMethod" && parentPath.body === path2.parent) && !(declaration2.init?.type === "CallExpression" && declaration2.init?.callee.type === "Identifier" && ["defineProps", "defineEmits"].includes(declaration2.init?.callee.name))) { graph.nodes.add(name); if (!graph.edges.get(name)) { graph.edges.set(name, /* @__PURE__ */ new Set()); @@ -86307,7 +86329,7 @@ function analyze2(content) { const name = path2.node.id?.name; if (name) { const binding2 = path2.scope.getBinding(name); - if (binding2 && path2.parent.type === "Program") { + if (binding2 && (path2.parent.type === "Program" || parentPath?.type === "ObjectMethod" && parentPath.body === path2.parent)) { graph.nodes.add(name); if (!graph.edges.get(name)) { graph.edges.set(name, /* @__PURE__ */ new Set()); @@ -86315,15 +86337,16 @@ function analyze2(content) { } } } - }); + }, parentScope, parentPath); traverse2(ast, { FunctionDeclaration(path2) { const name = path2.node.id?.name; if (name && graph.nodes.has(name)) { path2.traverse({ - Identifier(path3) { - if (graph.nodes.has(path3.node.name) && path3.node.name !== name) { - graph.edges.get(name)?.add(path3.node.name); + Identifier(path1) { + const binding2 = path1.scope.getBinding(path1.node.name); + if (graph.nodes.has(path1.node.name) && path1.node.name !== name && (binding2?.scope.block.type === "Program" || parentScope === binding2?.scope)) { + graph.edges.get(name)?.add(path1.node.name); } } }); @@ -86331,6 +86354,40 @@ function analyze2(content) { }, VariableDeclarator(path2) { if (path2.node.init) { + if (path2.node.id.type === "ArrayPattern") { + path2.node.id.elements.forEach((element) => { + if (element?.type === "Identifier") { + const name = element.name; + if (name && graph.nodes.has(name) && path2.node.init?.type === "CallExpression") { + traverse2(path2.node.init, { + Identifier(path1) { + const binding2 = path1.scope.getBinding(path1.node.name); + if (graph.nodes.has(path1.node.name) && path1.node.name !== name && (binding2?.scope.block.type === "Program" || parentScope === binding2?.scope)) { + graph.edges.get(name)?.add(path1.node.name); + } + } + }, path2.scope, path2); + } + } + }); + } + if (path2.node.id.type === "ObjectPattern") { + path2.node.id.properties.forEach((property) => { + if (property.type === "ObjectProperty" && property.value.type === "Identifier") { + const name = property.value.name; + if (name && graph.nodes.has(name) && path2.node.init) { + traverse2(path2.node.init, { + Identifier(path1) { + const binding2 = path1.scope.getBinding(path1.node.name); + if (graph.nodes.has(path1.node.name) && path1.node.name !== name && (binding2?.scope.block.type === "Program" || parentScope === binding2?.scope)) { + graph.edges.get(name)?.add(path1.node.name); + } + } + }, path2.scope, path2); + } + } + }); + } if ([ "CallExpression", "ArrowFunctionExpression", @@ -86338,20 +86395,30 @@ function analyze2(content) { ].includes(path2.node.init.type) && path2.node.id.type === "Identifier") { const name = path2.node.id?.name; if (name && graph.nodes.has(name)) { - path2.traverse({ - Identifier(path3) { - if (graph.nodes.has(path3.node.name) && path3.node.name !== name) { - graph.edges.get(name)?.add(path3.node.name); + traverse2(path2.node.init, { + Identifier(path1) { + const binding2 = path1.scope.getBinding(path1.node.name); + if (graph.nodes.has(path1.node.name) && path1.node.name !== name && (binding2?.scope.block.type === "Program" || parentScope === binding2?.scope)) { + graph.edges.get(name)?.add(path1.node.name); } } - }); + }, path2.scope, path2); } } } } - }); + }, parentScope, parentPath); return graph; } +function analyze2(content) { + const ast = parse_1$1(content, { + sourceType: "module", + plugins: [ + "typescript" + ] + }); + return processSetup(ast); +} // src/analyze/options.ts var import_traverse3 = __toESM(require_lib13()); @@ -86412,68 +86479,10 @@ function analyze3(content) { if (path2.node.declaration.type === "ObjectExpression" && path1.parent === path2.node.declaration || path2.node.declaration.type === "CallExpression" && path1.parent === path2.node.declaration.arguments[0]) { if (path1.node.key.type === "Identifier" && path1.node.key.name === "setup") { const setupNode = path1.node; - const tempNodes = /* @__PURE__ */ new Set(); - const tempEdges = /* @__PURE__ */ new Map(); - traverse3(setupNode, { - VariableDeclaration(path22) { - path22.node.declarations.forEach((declaration2) => { - if (declaration2.id?.type === "Identifier") { - const name = declaration2.id.name; - if (path22.parent == setupNode.body) { - tempNodes.add(name); - if (!tempEdges.get(name)) { - tempEdges.set(name, /* @__PURE__ */ new Set()); - } - } - } - }); - }, - FunctionDeclaration(path22) { - const name = path22.node.id?.name; - if (name) { - if (path22.parent == setupNode.body) { - tempNodes.add(name); - if (!tempEdges.get(name)) { - tempEdges.set(name, /* @__PURE__ */ new Set()); - } - } - } - } - }, path1.scope, path1); - traverse3(setupNode, { - FunctionDeclaration(path3) { - const name = path3.node.id?.name; - if (name && tempNodes.has(name)) { - path3.traverse({ - Identifier(path4) { - if (tempNodes.has(path4.node.name) && path4.node.name !== name) { - tempEdges.get(name)?.add(path4.node.name); - } - } - }); - } - }, - VariableDeclarator(path3) { - if (path3.node.init) { - if ([ - "CallExpression", - "ArrowFunctionExpression", - "FunctionDeclaration" - ].includes(path3.node.init.type) && path3.node.id.type === "Identifier") { - const name = path3.node.id?.name; - if (name && tempNodes.has(name)) { - path3.traverse({ - Identifier(path4) { - if (tempNodes.has(path4.node.name) && path4.node.name !== name) { - tempEdges.get(name)?.add(path4.node.name); - } - } - }); - } - } - } - } - }, path1.scope, path1); + const { + nodes: tempNodes, + edges: tempEdges + } = processSetup(setupNode, path1.scope, setupNode); traverse3(setupNode, { ReturnStatement(path22) { if (path22.node.argument?.type === "ObjectExpression") { @@ -86589,7 +86598,6 @@ function analyze3(content) { process2(path2.node.declaration, path2); } else if (path2.node.declaration.type === "CallExpression" && path2.node.declaration.callee.type === "Identifier" && path2.node.declaration.callee.name === "defineComponent" && path2.node.declaration.arguments[0].type === "ObjectExpression") { process2(path2.node.declaration.arguments[0], path2); - console.log(graph); } } }); diff --git a/dist/index.js.map b/dist/index.js.map index 9364fc4..c2309bb 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/lib/virtual-types.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/utils/shallowEqual.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/utils/deprecationWarning.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/generated/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/matchesPattern.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/buildMatchMemberExpression.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/react/isReactComponent.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/react/isCompatTag.ts","../node_modules/.pnpm/to-fast-properties@2.0.0/node_modules/to-fast-properties/index.js","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isType.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isPlaceholderType.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/is.ts","../node_modules/.pnpm/@babel+helper-validator-identifier@7.22.5/node_modules/@babel/helper-validator-identifier/src/identifier.ts","../node_modules/.pnpm/@babel+helper-validator-identifier@7.22.5/node_modules/@babel/helper-validator-identifier/src/keyword.ts","../node_modules/.pnpm/@babel+helper-validator-identifier@7.22.5/node_modules/@babel/helper-validator-identifier/src/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isValidIdentifier.ts","../node_modules/.pnpm/@babel+helper-string-parser@7.22.5/node_modules/@babel/helper-string-parser/src/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/constants/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/utils.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/core.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/flow.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/jsx.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/placeholders.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/misc.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/experimental.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/typescript.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/deprecated-aliases.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/definitions/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/validate.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/validateNode.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/generated/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/utils/react/cleanJSXElementLiteralChild.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/react/buildChildren.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isNode.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/asserts/assertNode.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/asserts/generated/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/flow/createTypeAnnotationBasedOnTypeof.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/flow/removeTypeDuplicates.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/flow/createFlowUnionType.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/typescript/removeTypeDuplicates.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/typescript/createTSUnionType.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/builders/generated/uppercase.js","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/clone/cloneNode.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/clone/clone.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/clone/cloneDeep.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/clone/cloneDeepWithoutLoc.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/clone/cloneWithoutLoc.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/addComments.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/addComment.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/utils/inherit.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/inheritInnerComments.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/inheritLeadingComments.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/inheritTrailingComments.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/inheritsComments.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/comments/removeComments.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/constants/generated/index.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toBlock.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/ensureBlock.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toIdentifier.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toBindingIdentifierName.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toComputedKey.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toExpression.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/traverse/traverseFast.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/removeProperties.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/removePropertiesDeep.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toKeyAlias.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/retrievers/getBindingIdentifiers.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/gatherSequenceExpressions.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toSequenceExpression.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/toStatement.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/converters/valueToNode.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/appendToMemberExpression.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/inherits.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/modifications/prependToMemberExpression.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/retrievers/getOuterBindingIdentifiers.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/traverse/traverse.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isBinding.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isLet.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isBlockScoped.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isImmutable.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isNodesEquivalent.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isReferenced.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isScope.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isSpecifierDefault.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isValidES3Identifier.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/validators/isVar.ts","../node_modules/.pnpm/@babel+types@7.22.5/node_modules/@babel/types/src/index.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/visitors.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/cache.ts","../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js","../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js","../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js","../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js","../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js","../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js","../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js","../node_modules/.pnpm/@babel+helper-split-export-declaration@7.22.6/node_modules/@babel/helper-split-export-declaration/src/index.ts","../node_modules/.pnpm/@babel+helper-environment-visitor@7.22.5/node_modules/@babel/helper-environment-visitor/src/index.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/scope/lib/renamer.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/scope/binding.ts","../node_modules/.pnpm/globals@11.12.0/node_modules/globals/globals.json","../node_modules/.pnpm/globals@11.12.0/node_modules/globals/index.js","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/scope/index.ts","../node_modules/.pnpm/@jridgewell+set-array@1.1.2/node_modules/@jridgewell/set-array/src/set-array.ts","../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.15/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts","../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.14/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts","../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.0/node_modules/@jridgewell/resolve-uri/src/resolve-uri.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/resolve.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/sort.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/binary-search.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/by-source.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/any-map.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.18/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts","../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts","../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/source-map.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/buffer.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/node/whitespace.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/node/parentheses.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/node/index.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/template-literals.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/expressions.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/statements.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/classes.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/methods.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/modules.ts","../node_modules/.pnpm/jsesc@2.5.2/node_modules/jsesc/jsesc.js","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/types.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/flow.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/base.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/jsx.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/typescript.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/generators/index.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/printer.ts","../node_modules/.pnpm/@babel+generator@7.22.9/node_modules/@babel/generator/src/index.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/ancestry.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/inference/util.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/inference/inferer-reference.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/inference/inferers.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/inference/index.ts","../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js","../node_modules/.pnpm/escape-string-regexp@1.0.5/node_modules/escape-string-regexp/index.js","../node_modules/.pnpm/color-name@1.1.3/node_modules/color-name/index.js","../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/conversions.js","../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/route.js","../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/index.js","../node_modules/.pnpm/ansi-styles@3.2.1/node_modules/ansi-styles/index.js","../node_modules/.pnpm/chalk@2.4.2/node_modules/chalk/templates.js","../node_modules/.pnpm/chalk@2.4.2/node_modules/chalk/index.js","../node_modules/.pnpm/@babel+highlight@7.22.5/node_modules/@babel/highlight/src/index.ts","../node_modules/.pnpm/@babel+code-frame@7.22.5/node_modules/@babel/code-frame/src/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/location.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error/credentials.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error/module-errors.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error/to-node-description.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error/standard-errors.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error/strict-mode-errors.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error/pipeline-operator-errors.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parse-error.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/estree.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/tokenizer/context.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/tokenizer/types.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/babel-helper-validator-identifier/src/identifier.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/babel-helper-validator-identifier/src/keyword.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/identifier.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/scopeflags.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/scope.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/flow/scope.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/base.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/comments.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/whitespace.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/tokenizer/state.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/babel-helper-string-parser/src/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/tokenizer/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/class-scope.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/expression-scope.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/util/production-parameter.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/util.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/node.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/flow/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/jsx/xhtml.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/jsx/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/typescript/scope.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/lval.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/typescript/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/placeholders.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugins/v8intrinsic.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/plugin-utils.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/options.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/expression.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/statement.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/parser/index.ts","../node_modules/.pnpm/@babel+parser@7.22.7/node_modules/@babel/parser/src/index.ts","../node_modules/.pnpm/@babel+helper-hoist-variables@7.22.5/node_modules/@babel/helper-hoist-variables/src/index.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/replacement.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/evaluation.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/formatters.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/options.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/parse.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/populate.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/string.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/literal.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/builder.ts","../node_modules/.pnpm/@babel+template@7.22.5/node_modules/@babel/template/src/index.ts","../node_modules/.pnpm/@babel+helper-function-name@7.22.5/node_modules/@babel/helper-function-name/src/index.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/conversion.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/introspection.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/context.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/lib/removal-hooks.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/removal.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/lib/hoister.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/modification.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/family.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/comments.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/lib/virtual-types-validator.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/path/index.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/context.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/traverse-node.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/hub.ts","../node_modules/.pnpm/@babel+traverse@7.22.8/node_modules/@babel/traverse/src/index.ts","../src/index.ts","../node_modules/.pnpm/@vue+compiler-sfc@3.3.4/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js","../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js","../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/stringify.js","../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js","../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js","../src/analyze/template.ts","../src/analyze/setupScript.ts","../src/analyze/options.ts","../src/vis.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\n\nexport interface VirtualTypeAliases {\n BindingIdentifier: t.Identifier;\n BlockScoped: t.Node;\n ExistentialTypeParam: t.ExistsTypeAnnotation;\n Expression: t.Expression;\n Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;\n ForAwaitStatement: t.ForOfStatement;\n Generated: t.Node;\n NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;\n Pure: t.Node;\n Referenced: t.Node;\n ReferencedIdentifier: t.Identifier | t.JSXIdentifier;\n ReferencedMemberExpression: t.MemberExpression;\n RestProperty: t.RestElement;\n Scope: t.Scopable | t.Pattern;\n SpreadProperty: t.RestElement;\n Statement: t.Statement;\n User: t.Node;\n Var: t.VariableDeclaration;\n}\n\ntype VirtualTypeMapping = readonly (t.Node[\"type\"] | keyof t.Aliases)[] | null;\n\nexport const ReferencedIdentifier: VirtualTypeMapping = [\n \"Identifier\",\n \"JSXIdentifier\",\n] as const;\n\nexport const ReferencedMemberExpression: VirtualTypeMapping = [\n \"MemberExpression\",\n] as const;\n\nexport const BindingIdentifier: VirtualTypeMapping = [\"Identifier\"] as const;\n\nexport const Statement: VirtualTypeMapping = [\"Statement\"] as const;\n\nexport const Expression: VirtualTypeMapping = [\"Expression\"] as const;\n\nexport const Scope: VirtualTypeMapping = [\"Scopable\", \"Pattern\"] as const;\n\nexport const Referenced: VirtualTypeMapping = null;\n\nexport const BlockScoped: VirtualTypeMapping = null;\n\nexport const Var: VirtualTypeMapping = [\"VariableDeclaration\"];\n\nexport const User: VirtualTypeMapping = null;\n\nexport const Generated: VirtualTypeMapping = null;\n\nexport const Pure: VirtualTypeMapping = null;\n\nexport const Flow: VirtualTypeMapping = [\n \"Flow\",\n \"ImportDeclaration\",\n \"ExportDeclaration\",\n \"ImportSpecifier\",\n] as const;\n\n// TODO: 7.0 Backwards Compat\nexport const RestProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const SpreadProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const ExistentialTypeParam: VirtualTypeMapping = [\n \"ExistsTypeAnnotation\",\n] as const;\n\nexport const NumericLiteralTypeAnnotation: VirtualTypeMapping = [\n \"NumberLiteralTypeAnnotation\",\n] as const;\n\nexport const ForAwaitStatement: VirtualTypeMapping = [\n \"ForOfStatement\",\n] as const;\n","export default function shallowEqual(\n actual: object,\n expected: T,\n): actual is T {\n const keys = Object.keys(expected) as (keyof T)[];\n\n for (const key of keys) {\n if (\n // @ts-expect-error maybe we should check whether key exists first\n actual[key] !== expected[key]\n ) {\n return false;\n }\n }\n\n return true;\n}\n","const warnings = new Set();\n\nexport default function deprecationWarning(\n oldName: string,\n newName: string,\n prefix: string = \"\",\n) {\n if (warnings.has(oldName)) return;\n warnings.add(oldName);\n\n const { internal, trace } = captureShortStackTrace(1, 2);\n if (internal) {\n // If usage comes from an internal package, there is no point in warning because\n // 1. The new version of the package will already use the new API\n // 2. When the deprecation will become an error (in a future major version), users\n // will have to update every package anyway.\n return;\n }\n console.warn(\n `${prefix}\\`${oldName}\\` has been deprecated, please migrate to \\`${newName}\\`\\n${trace}`,\n );\n}\n\nfunction captureShortStackTrace(skip: number, length: number) {\n const { stackTraceLimit, prepareStackTrace } = Error;\n let stackTrace: NodeJS.CallSite[];\n // We add 1 to also take into account this function.\n Error.stackTraceLimit = 1 + skip + length;\n Error.prepareStackTrace = function (err, stack) {\n stackTrace = stack;\n };\n new Error().stack;\n Error.stackTraceLimit = stackTraceLimit;\n Error.prepareStackTrace = prepareStackTrace;\n\n if (!stackTrace) return { internal: false, trace: \"\" };\n\n const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length);\n return {\n internal: /[\\\\/]@babel[\\\\/]/.test(shortStackTrace[1].getFileName()),\n trace: shortStackTrace.map(frame => ` at ${frame}`).join(\"\\n\"),\n };\n}\n","/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\n\n/* eslint-disable no-fallthrough */\n\nimport shallowEqual from \"../../utils/shallowEqual\";\nimport type * as t from \"../..\";\nimport deprecationWarning from \"../../utils/deprecationWarning\";\n\ntype Opts = Partial<{\n [Prop in keyof Object]: Object[Prop] extends t.Node\n ? t.Node | Object[Prop]\n : Object[Prop] extends t.Node[]\n ? t.Node[] | Object[Prop]\n : Object[Prop];\n}>;\n\nexport function isArrayExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ArrayExpression {\n if (!node) return false;\n\n if (node.type !== \"ArrayExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isAssignmentExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.AssignmentExpression {\n if (!node) return false;\n\n if (node.type !== \"AssignmentExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBinaryExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BinaryExpression {\n if (!node) return false;\n\n if (node.type !== \"BinaryExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isInterpreterDirective(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.InterpreterDirective {\n if (!node) return false;\n\n if (node.type !== \"InterpreterDirective\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDirective(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Directive {\n if (!node) return false;\n\n if (node.type !== \"Directive\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDirectiveLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DirectiveLiteral {\n if (!node) return false;\n\n if (node.type !== \"DirectiveLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBlockStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BlockStatement {\n if (!node) return false;\n\n if (node.type !== \"BlockStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBreakStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BreakStatement {\n if (!node) return false;\n\n if (node.type !== \"BreakStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isCallExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.CallExpression {\n if (!node) return false;\n\n if (node.type !== \"CallExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isCatchClause(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.CatchClause {\n if (!node) return false;\n\n if (node.type !== \"CatchClause\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isConditionalExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ConditionalExpression {\n if (!node) return false;\n\n if (node.type !== \"ConditionalExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isContinueStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ContinueStatement {\n if (!node) return false;\n\n if (node.type !== \"ContinueStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDebuggerStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DebuggerStatement {\n if (!node) return false;\n\n if (node.type !== \"DebuggerStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDoWhileStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DoWhileStatement {\n if (!node) return false;\n\n if (node.type !== \"DoWhileStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEmptyStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EmptyStatement {\n if (!node) return false;\n\n if (node.type !== \"EmptyStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExpressionStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExpressionStatement {\n if (!node) return false;\n\n if (node.type !== \"ExpressionStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFile(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.File {\n if (!node) return false;\n\n if (node.type !== \"File\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isForInStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ForInStatement {\n if (!node) return false;\n\n if (node.type !== \"ForInStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isForStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ForStatement {\n if (!node) return false;\n\n if (node.type !== \"ForStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFunctionDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FunctionDeclaration {\n if (!node) return false;\n\n if (node.type !== \"FunctionDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFunctionExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FunctionExpression {\n if (!node) return false;\n\n if (node.type !== \"FunctionExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isIdentifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Identifier {\n if (!node) return false;\n\n if (node.type !== \"Identifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isIfStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.IfStatement {\n if (!node) return false;\n\n if (node.type !== \"IfStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isLabeledStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.LabeledStatement {\n if (!node) return false;\n\n if (node.type !== \"LabeledStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isStringLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.StringLiteral {\n if (!node) return false;\n\n if (node.type !== \"StringLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNumericLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NumericLiteral {\n if (!node) return false;\n\n if (node.type !== \"NumericLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNullLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NullLiteral {\n if (!node) return false;\n\n if (node.type !== \"NullLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBooleanLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BooleanLiteral {\n if (!node) return false;\n\n if (node.type !== \"BooleanLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isRegExpLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.RegExpLiteral {\n if (!node) return false;\n\n if (node.type !== \"RegExpLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isLogicalExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.LogicalExpression {\n if (!node) return false;\n\n if (node.type !== \"LogicalExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isMemberExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.MemberExpression {\n if (!node) return false;\n\n if (node.type !== \"MemberExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNewExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NewExpression {\n if (!node) return false;\n\n if (node.type !== \"NewExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isProgram(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Program {\n if (!node) return false;\n\n if (node.type !== \"Program\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectExpression {\n if (!node) return false;\n\n if (node.type !== \"ObjectExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectMethod(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectMethod {\n if (!node) return false;\n\n if (node.type !== \"ObjectMethod\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectProperty {\n if (!node) return false;\n\n if (node.type !== \"ObjectProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isRestElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.RestElement {\n if (!node) return false;\n\n if (node.type !== \"RestElement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isReturnStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ReturnStatement {\n if (!node) return false;\n\n if (node.type !== \"ReturnStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isSequenceExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.SequenceExpression {\n if (!node) return false;\n\n if (node.type !== \"SequenceExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isParenthesizedExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ParenthesizedExpression {\n if (!node) return false;\n\n if (node.type !== \"ParenthesizedExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isSwitchCase(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.SwitchCase {\n if (!node) return false;\n\n if (node.type !== \"SwitchCase\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isSwitchStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.SwitchStatement {\n if (!node) return false;\n\n if (node.type !== \"SwitchStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isThisExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ThisExpression {\n if (!node) return false;\n\n if (node.type !== \"ThisExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isThrowStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ThrowStatement {\n if (!node) return false;\n\n if (node.type !== \"ThrowStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTryStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TryStatement {\n if (!node) return false;\n\n if (node.type !== \"TryStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isUnaryExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.UnaryExpression {\n if (!node) return false;\n\n if (node.type !== \"UnaryExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isUpdateExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.UpdateExpression {\n if (!node) return false;\n\n if (node.type !== \"UpdateExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isVariableDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.VariableDeclaration {\n if (!node) return false;\n\n if (node.type !== \"VariableDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isVariableDeclarator(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.VariableDeclarator {\n if (!node) return false;\n\n if (node.type !== \"VariableDeclarator\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isWhileStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.WhileStatement {\n if (!node) return false;\n\n if (node.type !== \"WhileStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isWithStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.WithStatement {\n if (!node) return false;\n\n if (node.type !== \"WithStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isAssignmentPattern(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.AssignmentPattern {\n if (!node) return false;\n\n if (node.type !== \"AssignmentPattern\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isArrayPattern(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ArrayPattern {\n if (!node) return false;\n\n if (node.type !== \"ArrayPattern\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isArrowFunctionExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ArrowFunctionExpression {\n if (!node) return false;\n\n if (node.type !== \"ArrowFunctionExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassBody {\n if (!node) return false;\n\n if (node.type !== \"ClassBody\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassExpression {\n if (!node) return false;\n\n if (node.type !== \"ClassExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassDeclaration {\n if (!node) return false;\n\n if (node.type !== \"ClassDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportAllDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportAllDeclaration {\n if (!node) return false;\n\n if (node.type !== \"ExportAllDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportDefaultDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportDefaultDeclaration {\n if (!node) return false;\n\n if (node.type !== \"ExportDefaultDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportNamedDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportNamedDeclaration {\n if (!node) return false;\n\n if (node.type !== \"ExportNamedDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportSpecifier {\n if (!node) return false;\n\n if (node.type !== \"ExportSpecifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isForOfStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ForOfStatement {\n if (!node) return false;\n\n if (node.type !== \"ForOfStatement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImportDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportDeclaration {\n if (!node) return false;\n\n if (node.type !== \"ImportDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImportDefaultSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportDefaultSpecifier {\n if (!node) return false;\n\n if (node.type !== \"ImportDefaultSpecifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImportNamespaceSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportNamespaceSpecifier {\n if (!node) return false;\n\n if (node.type !== \"ImportNamespaceSpecifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImportSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportSpecifier {\n if (!node) return false;\n\n if (node.type !== \"ImportSpecifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isMetaProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.MetaProperty {\n if (!node) return false;\n\n if (node.type !== \"MetaProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassMethod(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassMethod {\n if (!node) return false;\n\n if (node.type !== \"ClassMethod\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectPattern(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectPattern {\n if (!node) return false;\n\n if (node.type !== \"ObjectPattern\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isSpreadElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.SpreadElement {\n if (!node) return false;\n\n if (node.type !== \"SpreadElement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isSuper(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Super {\n if (!node) return false;\n\n if (node.type !== \"Super\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTaggedTemplateExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TaggedTemplateExpression {\n if (!node) return false;\n\n if (node.type !== \"TaggedTemplateExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTemplateElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TemplateElement {\n if (!node) return false;\n\n if (node.type !== \"TemplateElement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTemplateLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TemplateLiteral {\n if (!node) return false;\n\n if (node.type !== \"TemplateLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isYieldExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.YieldExpression {\n if (!node) return false;\n\n if (node.type !== \"YieldExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isAwaitExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.AwaitExpression {\n if (!node) return false;\n\n if (node.type !== \"AwaitExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImport(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Import {\n if (!node) return false;\n\n if (node.type !== \"Import\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBigIntLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BigIntLiteral {\n if (!node) return false;\n\n if (node.type !== \"BigIntLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportNamespaceSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportNamespaceSpecifier {\n if (!node) return false;\n\n if (node.type !== \"ExportNamespaceSpecifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isOptionalMemberExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.OptionalMemberExpression {\n if (!node) return false;\n\n if (node.type !== \"OptionalMemberExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isOptionalCallExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.OptionalCallExpression {\n if (!node) return false;\n\n if (node.type !== \"OptionalCallExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassProperty {\n if (!node) return false;\n\n if (node.type !== \"ClassProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassAccessorProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassAccessorProperty {\n if (!node) return false;\n\n if (node.type !== \"ClassAccessorProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassPrivateProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassPrivateProperty {\n if (!node) return false;\n\n if (node.type !== \"ClassPrivateProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassPrivateMethod(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassPrivateMethod {\n if (!node) return false;\n\n if (node.type !== \"ClassPrivateMethod\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPrivateName(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.PrivateName {\n if (!node) return false;\n\n if (node.type !== \"PrivateName\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isStaticBlock(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.StaticBlock {\n if (!node) return false;\n\n if (node.type !== \"StaticBlock\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isAnyTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.AnyTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"AnyTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isArrayTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ArrayTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"ArrayTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBooleanTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BooleanTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"BooleanTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBooleanLiteralTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BooleanLiteralTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"BooleanLiteralTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNullLiteralTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NullLiteralTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"NullLiteralTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClassImplements(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ClassImplements {\n if (!node) return false;\n\n if (node.type !== \"ClassImplements\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareClass(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareClass {\n if (!node) return false;\n\n if (node.type !== \"DeclareClass\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareFunction(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareFunction {\n if (!node) return false;\n\n if (node.type !== \"DeclareFunction\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareInterface(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareInterface {\n if (!node) return false;\n\n if (node.type !== \"DeclareInterface\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareModule(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareModule {\n if (!node) return false;\n\n if (node.type !== \"DeclareModule\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareModuleExports(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareModuleExports {\n if (!node) return false;\n\n if (node.type !== \"DeclareModuleExports\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareTypeAlias(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareTypeAlias {\n if (!node) return false;\n\n if (node.type !== \"DeclareTypeAlias\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareOpaqueType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareOpaqueType {\n if (!node) return false;\n\n if (node.type !== \"DeclareOpaqueType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareVariable(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareVariable {\n if (!node) return false;\n\n if (node.type !== \"DeclareVariable\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareExportDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareExportDeclaration {\n if (!node) return false;\n\n if (node.type !== \"DeclareExportDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclareExportAllDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclareExportAllDeclaration {\n if (!node) return false;\n\n if (node.type !== \"DeclareExportAllDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclaredPredicate(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DeclaredPredicate {\n if (!node) return false;\n\n if (node.type !== \"DeclaredPredicate\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExistsTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExistsTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"ExistsTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFunctionTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FunctionTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"FunctionTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFunctionTypeParam(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FunctionTypeParam {\n if (!node) return false;\n\n if (node.type !== \"FunctionTypeParam\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isGenericTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.GenericTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"GenericTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isInferredPredicate(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.InferredPredicate {\n if (!node) return false;\n\n if (node.type !== \"InferredPredicate\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isInterfaceExtends(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.InterfaceExtends {\n if (!node) return false;\n\n if (node.type !== \"InterfaceExtends\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isInterfaceDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.InterfaceDeclaration {\n if (!node) return false;\n\n if (node.type !== \"InterfaceDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isInterfaceTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.InterfaceTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"InterfaceTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isIntersectionTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.IntersectionTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"IntersectionTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isMixedTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.MixedTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"MixedTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEmptyTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EmptyTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"EmptyTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNullableTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NullableTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"NullableTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNumberLiteralTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NumberLiteralTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"NumberLiteralTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNumberTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.NumberTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"NumberTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"ObjectTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectTypeInternalSlot(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectTypeInternalSlot {\n if (!node) return false;\n\n if (node.type !== \"ObjectTypeInternalSlot\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectTypeCallProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectTypeCallProperty {\n if (!node) return false;\n\n if (node.type !== \"ObjectTypeCallProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectTypeIndexer(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectTypeIndexer {\n if (!node) return false;\n\n if (node.type !== \"ObjectTypeIndexer\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectTypeProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectTypeProperty {\n if (!node) return false;\n\n if (node.type !== \"ObjectTypeProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectTypeSpreadProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectTypeSpreadProperty {\n if (!node) return false;\n\n if (node.type !== \"ObjectTypeSpreadProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isOpaqueType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.OpaqueType {\n if (!node) return false;\n\n if (node.type !== \"OpaqueType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isQualifiedTypeIdentifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.QualifiedTypeIdentifier {\n if (!node) return false;\n\n if (node.type !== \"QualifiedTypeIdentifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isStringLiteralTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.StringLiteralTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"StringLiteralTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isStringTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.StringTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"StringTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isSymbolTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.SymbolTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"SymbolTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isThisTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ThisTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"ThisTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTupleTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TupleTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"TupleTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeofTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeofTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"TypeofTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeAlias(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeAlias {\n if (!node) return false;\n\n if (node.type !== \"TypeAlias\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"TypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeCastExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeCastExpression {\n if (!node) return false;\n\n if (node.type !== \"TypeCastExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeParameter(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeParameter {\n if (!node) return false;\n\n if (node.type !== \"TypeParameter\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeParameterDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeParameterDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TypeParameterDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeParameterInstantiation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeParameterInstantiation {\n if (!node) return false;\n\n if (node.type !== \"TypeParameterInstantiation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isUnionTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.UnionTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"UnionTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isVariance(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Variance {\n if (!node) return false;\n\n if (node.type !== \"Variance\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isVoidTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.VoidTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"VoidTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumDeclaration {\n if (!node) return false;\n\n if (node.type !== \"EnumDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumBooleanBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumBooleanBody {\n if (!node) return false;\n\n if (node.type !== \"EnumBooleanBody\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumNumberBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumNumberBody {\n if (!node) return false;\n\n if (node.type !== \"EnumNumberBody\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumStringBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumStringBody {\n if (!node) return false;\n\n if (node.type !== \"EnumStringBody\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumSymbolBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumSymbolBody {\n if (!node) return false;\n\n if (node.type !== \"EnumSymbolBody\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumBooleanMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumBooleanMember {\n if (!node) return false;\n\n if (node.type !== \"EnumBooleanMember\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumNumberMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumNumberMember {\n if (!node) return false;\n\n if (node.type !== \"EnumNumberMember\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumStringMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumStringMember {\n if (!node) return false;\n\n if (node.type !== \"EnumStringMember\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumDefaultedMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumDefaultedMember {\n if (!node) return false;\n\n if (node.type !== \"EnumDefaultedMember\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isIndexedAccessType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.IndexedAccessType {\n if (!node) return false;\n\n if (node.type !== \"IndexedAccessType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isOptionalIndexedAccessType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.OptionalIndexedAccessType {\n if (!node) return false;\n\n if (node.type !== \"OptionalIndexedAccessType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXAttribute(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXAttribute {\n if (!node) return false;\n\n if (node.type !== \"JSXAttribute\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXClosingElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXClosingElement {\n if (!node) return false;\n\n if (node.type !== \"JSXClosingElement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXElement {\n if (!node) return false;\n\n if (node.type !== \"JSXElement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXEmptyExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXEmptyExpression {\n if (!node) return false;\n\n if (node.type !== \"JSXEmptyExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXExpressionContainer(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXExpressionContainer {\n if (!node) return false;\n\n if (node.type !== \"JSXExpressionContainer\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXSpreadChild(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXSpreadChild {\n if (!node) return false;\n\n if (node.type !== \"JSXSpreadChild\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXIdentifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXIdentifier {\n if (!node) return false;\n\n if (node.type !== \"JSXIdentifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXMemberExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXMemberExpression {\n if (!node) return false;\n\n if (node.type !== \"JSXMemberExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXNamespacedName(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXNamespacedName {\n if (!node) return false;\n\n if (node.type !== \"JSXNamespacedName\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXOpeningElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXOpeningElement {\n if (!node) return false;\n\n if (node.type !== \"JSXOpeningElement\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXSpreadAttribute(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXSpreadAttribute {\n if (!node) return false;\n\n if (node.type !== \"JSXSpreadAttribute\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXText(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXText {\n if (!node) return false;\n\n if (node.type !== \"JSXText\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXFragment(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXFragment {\n if (!node) return false;\n\n if (node.type !== \"JSXFragment\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXOpeningFragment(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXOpeningFragment {\n if (!node) return false;\n\n if (node.type !== \"JSXOpeningFragment\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSXClosingFragment(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSXClosingFragment {\n if (!node) return false;\n\n if (node.type !== \"JSXClosingFragment\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isNoop(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Noop {\n if (!node) return false;\n\n if (node.type !== \"Noop\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPlaceholder(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Placeholder {\n if (!node) return false;\n\n if (node.type !== \"Placeholder\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isV8IntrinsicIdentifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.V8IntrinsicIdentifier {\n if (!node) return false;\n\n if (node.type !== \"V8IntrinsicIdentifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isArgumentPlaceholder(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ArgumentPlaceholder {\n if (!node) return false;\n\n if (node.type !== \"ArgumentPlaceholder\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBindExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BindExpression {\n if (!node) return false;\n\n if (node.type !== \"BindExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImportAttribute(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportAttribute {\n if (!node) return false;\n\n if (node.type !== \"ImportAttribute\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDecorator(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Decorator {\n if (!node) return false;\n\n if (node.type !== \"Decorator\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDoExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DoExpression {\n if (!node) return false;\n\n if (node.type !== \"DoExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportDefaultSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportDefaultSpecifier {\n if (!node) return false;\n\n if (node.type !== \"ExportDefaultSpecifier\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isRecordExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.RecordExpression {\n if (!node) return false;\n\n if (node.type !== \"RecordExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTupleExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TupleExpression {\n if (!node) return false;\n\n if (node.type !== \"TupleExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDecimalLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.DecimalLiteral {\n if (!node) return false;\n\n if (node.type !== \"DecimalLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isModuleExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ModuleExpression {\n if (!node) return false;\n\n if (node.type !== \"ModuleExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTopicReference(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TopicReference {\n if (!node) return false;\n\n if (node.type !== \"TopicReference\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPipelineTopicExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.PipelineTopicExpression {\n if (!node) return false;\n\n if (node.type !== \"PipelineTopicExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPipelineBareFunction(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.PipelineBareFunction {\n if (!node) return false;\n\n if (node.type !== \"PipelineBareFunction\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPipelinePrimaryTopicReference(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.PipelinePrimaryTopicReference {\n if (!node) return false;\n\n if (node.type !== \"PipelinePrimaryTopicReference\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSParameterProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSParameterProperty {\n if (!node) return false;\n\n if (node.type !== \"TSParameterProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSDeclareFunction(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSDeclareFunction {\n if (!node) return false;\n\n if (node.type !== \"TSDeclareFunction\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSDeclareMethod(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSDeclareMethod {\n if (!node) return false;\n\n if (node.type !== \"TSDeclareMethod\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSQualifiedName(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSQualifiedName {\n if (!node) return false;\n\n if (node.type !== \"TSQualifiedName\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSCallSignatureDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSCallSignatureDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSCallSignatureDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSConstructSignatureDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSConstructSignatureDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSConstructSignatureDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSPropertySignature(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSPropertySignature {\n if (!node) return false;\n\n if (node.type !== \"TSPropertySignature\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSMethodSignature(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSMethodSignature {\n if (!node) return false;\n\n if (node.type !== \"TSMethodSignature\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSIndexSignature(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSIndexSignature {\n if (!node) return false;\n\n if (node.type !== \"TSIndexSignature\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSAnyKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSAnyKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSAnyKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSBooleanKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSBooleanKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSBooleanKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSBigIntKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSBigIntKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSBigIntKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSIntrinsicKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSIntrinsicKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSIntrinsicKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSNeverKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSNeverKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSNeverKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSNullKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSNullKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSNullKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSNumberKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSNumberKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSNumberKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSObjectKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSObjectKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSObjectKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSStringKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSStringKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSStringKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSSymbolKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSSymbolKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSSymbolKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSUndefinedKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSUndefinedKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSUndefinedKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSUnknownKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSUnknownKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSUnknownKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSVoidKeyword(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSVoidKeyword {\n if (!node) return false;\n\n if (node.type !== \"TSVoidKeyword\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSThisType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSThisType {\n if (!node) return false;\n\n if (node.type !== \"TSThisType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSFunctionType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSFunctionType {\n if (!node) return false;\n\n if (node.type !== \"TSFunctionType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSConstructorType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSConstructorType {\n if (!node) return false;\n\n if (node.type !== \"TSConstructorType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeReference(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeReference {\n if (!node) return false;\n\n if (node.type !== \"TSTypeReference\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypePredicate(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypePredicate {\n if (!node) return false;\n\n if (node.type !== \"TSTypePredicate\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeQuery(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeQuery {\n if (!node) return false;\n\n if (node.type !== \"TSTypeQuery\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeLiteral {\n if (!node) return false;\n\n if (node.type !== \"TSTypeLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSArrayType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSArrayType {\n if (!node) return false;\n\n if (node.type !== \"TSArrayType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTupleType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTupleType {\n if (!node) return false;\n\n if (node.type !== \"TSTupleType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSOptionalType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSOptionalType {\n if (!node) return false;\n\n if (node.type !== \"TSOptionalType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSRestType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSRestType {\n if (!node) return false;\n\n if (node.type !== \"TSRestType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSNamedTupleMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSNamedTupleMember {\n if (!node) return false;\n\n if (node.type !== \"TSNamedTupleMember\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSUnionType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSUnionType {\n if (!node) return false;\n\n if (node.type !== \"TSUnionType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSIntersectionType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSIntersectionType {\n if (!node) return false;\n\n if (node.type !== \"TSIntersectionType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSConditionalType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSConditionalType {\n if (!node) return false;\n\n if (node.type !== \"TSConditionalType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSInferType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSInferType {\n if (!node) return false;\n\n if (node.type !== \"TSInferType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSParenthesizedType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSParenthesizedType {\n if (!node) return false;\n\n if (node.type !== \"TSParenthesizedType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeOperator(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeOperator {\n if (!node) return false;\n\n if (node.type !== \"TSTypeOperator\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSIndexedAccessType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSIndexedAccessType {\n if (!node) return false;\n\n if (node.type !== \"TSIndexedAccessType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSMappedType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSMappedType {\n if (!node) return false;\n\n if (node.type !== \"TSMappedType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSLiteralType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSLiteralType {\n if (!node) return false;\n\n if (node.type !== \"TSLiteralType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSExpressionWithTypeArguments(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSExpressionWithTypeArguments {\n if (!node) return false;\n\n if (node.type !== \"TSExpressionWithTypeArguments\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSInterfaceDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSInterfaceDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSInterfaceDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSInterfaceBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSInterfaceBody {\n if (!node) return false;\n\n if (node.type !== \"TSInterfaceBody\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeAliasDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeAliasDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSTypeAliasDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSInstantiationExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSInstantiationExpression {\n if (!node) return false;\n\n if (node.type !== \"TSInstantiationExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSAsExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSAsExpression {\n if (!node) return false;\n\n if (node.type !== \"TSAsExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSSatisfiesExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSSatisfiesExpression {\n if (!node) return false;\n\n if (node.type !== \"TSSatisfiesExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeAssertion(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeAssertion {\n if (!node) return false;\n\n if (node.type !== \"TSTypeAssertion\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSEnumDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSEnumDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSEnumDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSEnumMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSEnumMember {\n if (!node) return false;\n\n if (node.type !== \"TSEnumMember\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSModuleDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSModuleDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSModuleDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSModuleBlock(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSModuleBlock {\n if (!node) return false;\n\n if (node.type !== \"TSModuleBlock\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSImportType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSImportType {\n if (!node) return false;\n\n if (node.type !== \"TSImportType\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSImportEqualsDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSImportEqualsDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSImportEqualsDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSExternalModuleReference(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSExternalModuleReference {\n if (!node) return false;\n\n if (node.type !== \"TSExternalModuleReference\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSNonNullExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSNonNullExpression {\n if (!node) return false;\n\n if (node.type !== \"TSNonNullExpression\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSExportAssignment(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSExportAssignment {\n if (!node) return false;\n\n if (node.type !== \"TSExportAssignment\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSNamespaceExportDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSNamespaceExportDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSNamespaceExportDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeAnnotation {\n if (!node) return false;\n\n if (node.type !== \"TSTypeAnnotation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeParameterInstantiation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeParameterInstantiation {\n if (!node) return false;\n\n if (node.type !== \"TSTypeParameterInstantiation\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeParameterDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeParameterDeclaration {\n if (!node) return false;\n\n if (node.type !== \"TSTypeParameterDeclaration\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeParameter(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeParameter {\n if (!node) return false;\n\n if (node.type !== \"TSTypeParameter\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isStandardized(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Standardized {\n if (!node) return false;\n\n switch (node.type) {\n case \"ArrayExpression\":\n case \"AssignmentExpression\":\n case \"BinaryExpression\":\n case \"InterpreterDirective\":\n case \"Directive\":\n case \"DirectiveLiteral\":\n case \"BlockStatement\":\n case \"BreakStatement\":\n case \"CallExpression\":\n case \"CatchClause\":\n case \"ConditionalExpression\":\n case \"ContinueStatement\":\n case \"DebuggerStatement\":\n case \"DoWhileStatement\":\n case \"EmptyStatement\":\n case \"ExpressionStatement\":\n case \"File\":\n case \"ForInStatement\":\n case \"ForStatement\":\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"Identifier\":\n case \"IfStatement\":\n case \"LabeledStatement\":\n case \"StringLiteral\":\n case \"NumericLiteral\":\n case \"NullLiteral\":\n case \"BooleanLiteral\":\n case \"RegExpLiteral\":\n case \"LogicalExpression\":\n case \"MemberExpression\":\n case \"NewExpression\":\n case \"Program\":\n case \"ObjectExpression\":\n case \"ObjectMethod\":\n case \"ObjectProperty\":\n case \"RestElement\":\n case \"ReturnStatement\":\n case \"SequenceExpression\":\n case \"ParenthesizedExpression\":\n case \"SwitchCase\":\n case \"SwitchStatement\":\n case \"ThisExpression\":\n case \"ThrowStatement\":\n case \"TryStatement\":\n case \"UnaryExpression\":\n case \"UpdateExpression\":\n case \"VariableDeclaration\":\n case \"VariableDeclarator\":\n case \"WhileStatement\":\n case \"WithStatement\":\n case \"AssignmentPattern\":\n case \"ArrayPattern\":\n case \"ArrowFunctionExpression\":\n case \"ClassBody\":\n case \"ClassExpression\":\n case \"ClassDeclaration\":\n case \"ExportAllDeclaration\":\n case \"ExportDefaultDeclaration\":\n case \"ExportNamedDeclaration\":\n case \"ExportSpecifier\":\n case \"ForOfStatement\":\n case \"ImportDeclaration\":\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n case \"MetaProperty\":\n case \"ClassMethod\":\n case \"ObjectPattern\":\n case \"SpreadElement\":\n case \"Super\":\n case \"TaggedTemplateExpression\":\n case \"TemplateElement\":\n case \"TemplateLiteral\":\n case \"YieldExpression\":\n case \"AwaitExpression\":\n case \"Import\":\n case \"BigIntLiteral\":\n case \"ExportNamespaceSpecifier\":\n case \"OptionalMemberExpression\":\n case \"OptionalCallExpression\":\n case \"ClassProperty\":\n case \"ClassAccessorProperty\":\n case \"ClassPrivateProperty\":\n case \"ClassPrivateMethod\":\n case \"PrivateName\":\n case \"StaticBlock\":\n break;\n case \"Placeholder\":\n switch (node.expectedNode) {\n case \"Identifier\":\n case \"StringLiteral\":\n case \"BlockStatement\":\n case \"ClassBody\":\n break;\n default:\n return false;\n }\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExpression(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Expression {\n if (!node) return false;\n\n switch (node.type) {\n case \"ArrayExpression\":\n case \"AssignmentExpression\":\n case \"BinaryExpression\":\n case \"CallExpression\":\n case \"ConditionalExpression\":\n case \"FunctionExpression\":\n case \"Identifier\":\n case \"StringLiteral\":\n case \"NumericLiteral\":\n case \"NullLiteral\":\n case \"BooleanLiteral\":\n case \"RegExpLiteral\":\n case \"LogicalExpression\":\n case \"MemberExpression\":\n case \"NewExpression\":\n case \"ObjectExpression\":\n case \"SequenceExpression\":\n case \"ParenthesizedExpression\":\n case \"ThisExpression\":\n case \"UnaryExpression\":\n case \"UpdateExpression\":\n case \"ArrowFunctionExpression\":\n case \"ClassExpression\":\n case \"MetaProperty\":\n case \"Super\":\n case \"TaggedTemplateExpression\":\n case \"TemplateLiteral\":\n case \"YieldExpression\":\n case \"AwaitExpression\":\n case \"Import\":\n case \"BigIntLiteral\":\n case \"OptionalMemberExpression\":\n case \"OptionalCallExpression\":\n case \"TypeCastExpression\":\n case \"JSXElement\":\n case \"JSXFragment\":\n case \"BindExpression\":\n case \"DoExpression\":\n case \"RecordExpression\":\n case \"TupleExpression\":\n case \"DecimalLiteral\":\n case \"ModuleExpression\":\n case \"TopicReference\":\n case \"PipelineTopicExpression\":\n case \"PipelineBareFunction\":\n case \"PipelinePrimaryTopicReference\":\n case \"TSInstantiationExpression\":\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n break;\n case \"Placeholder\":\n switch (node.expectedNode) {\n case \"Expression\":\n case \"Identifier\":\n case \"StringLiteral\":\n break;\n default:\n return false;\n }\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBinary(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Binary {\n if (!node) return false;\n\n switch (node.type) {\n case \"BinaryExpression\":\n case \"LogicalExpression\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isScopable(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Scopable {\n if (!node) return false;\n\n switch (node.type) {\n case \"BlockStatement\":\n case \"CatchClause\":\n case \"DoWhileStatement\":\n case \"ForInStatement\":\n case \"ForStatement\":\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"Program\":\n case \"ObjectMethod\":\n case \"SwitchStatement\":\n case \"WhileStatement\":\n case \"ArrowFunctionExpression\":\n case \"ClassExpression\":\n case \"ClassDeclaration\":\n case \"ForOfStatement\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"StaticBlock\":\n case \"TSModuleBlock\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"BlockStatement\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBlockParent(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.BlockParent {\n if (!node) return false;\n\n switch (node.type) {\n case \"BlockStatement\":\n case \"CatchClause\":\n case \"DoWhileStatement\":\n case \"ForInStatement\":\n case \"ForStatement\":\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"Program\":\n case \"ObjectMethod\":\n case \"SwitchStatement\":\n case \"WhileStatement\":\n case \"ArrowFunctionExpression\":\n case \"ForOfStatement\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"StaticBlock\":\n case \"TSModuleBlock\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"BlockStatement\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isBlock(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Block {\n if (!node) return false;\n\n switch (node.type) {\n case \"BlockStatement\":\n case \"Program\":\n case \"TSModuleBlock\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"BlockStatement\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Statement {\n if (!node) return false;\n\n switch (node.type) {\n case \"BlockStatement\":\n case \"BreakStatement\":\n case \"ContinueStatement\":\n case \"DebuggerStatement\":\n case \"DoWhileStatement\":\n case \"EmptyStatement\":\n case \"ExpressionStatement\":\n case \"ForInStatement\":\n case \"ForStatement\":\n case \"FunctionDeclaration\":\n case \"IfStatement\":\n case \"LabeledStatement\":\n case \"ReturnStatement\":\n case \"SwitchStatement\":\n case \"ThrowStatement\":\n case \"TryStatement\":\n case \"VariableDeclaration\":\n case \"WhileStatement\":\n case \"WithStatement\":\n case \"ClassDeclaration\":\n case \"ExportAllDeclaration\":\n case \"ExportDefaultDeclaration\":\n case \"ExportNamedDeclaration\":\n case \"ForOfStatement\":\n case \"ImportDeclaration\":\n case \"DeclareClass\":\n case \"DeclareFunction\":\n case \"DeclareInterface\":\n case \"DeclareModule\":\n case \"DeclareModuleExports\":\n case \"DeclareTypeAlias\":\n case \"DeclareOpaqueType\":\n case \"DeclareVariable\":\n case \"DeclareExportDeclaration\":\n case \"DeclareExportAllDeclaration\":\n case \"InterfaceDeclaration\":\n case \"OpaqueType\":\n case \"TypeAlias\":\n case \"EnumDeclaration\":\n case \"TSDeclareFunction\":\n case \"TSInterfaceDeclaration\":\n case \"TSTypeAliasDeclaration\":\n case \"TSEnumDeclaration\":\n case \"TSModuleDeclaration\":\n case \"TSImportEqualsDeclaration\":\n case \"TSExportAssignment\":\n case \"TSNamespaceExportDeclaration\":\n break;\n case \"Placeholder\":\n switch (node.expectedNode) {\n case \"Statement\":\n case \"Declaration\":\n case \"BlockStatement\":\n break;\n default:\n return false;\n }\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTerminatorless(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Terminatorless {\n if (!node) return false;\n\n switch (node.type) {\n case \"BreakStatement\":\n case \"ContinueStatement\":\n case \"ReturnStatement\":\n case \"ThrowStatement\":\n case \"YieldExpression\":\n case \"AwaitExpression\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isCompletionStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.CompletionStatement {\n if (!node) return false;\n\n switch (node.type) {\n case \"BreakStatement\":\n case \"ContinueStatement\":\n case \"ReturnStatement\":\n case \"ThrowStatement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isConditional(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Conditional {\n if (!node) return false;\n\n switch (node.type) {\n case \"ConditionalExpression\":\n case \"IfStatement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isLoop(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Loop {\n if (!node) return false;\n\n switch (node.type) {\n case \"DoWhileStatement\":\n case \"ForInStatement\":\n case \"ForStatement\":\n case \"WhileStatement\":\n case \"ForOfStatement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isWhile(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.While {\n if (!node) return false;\n\n switch (node.type) {\n case \"DoWhileStatement\":\n case \"WhileStatement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExpressionWrapper(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExpressionWrapper {\n if (!node) return false;\n\n switch (node.type) {\n case \"ExpressionStatement\":\n case \"ParenthesizedExpression\":\n case \"TypeCastExpression\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFor(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.For {\n if (!node) return false;\n\n switch (node.type) {\n case \"ForInStatement\":\n case \"ForStatement\":\n case \"ForOfStatement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isForXStatement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ForXStatement {\n if (!node) return false;\n\n switch (node.type) {\n case \"ForInStatement\":\n case \"ForOfStatement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFunction(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Function {\n if (!node) return false;\n\n switch (node.type) {\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ObjectMethod\":\n case \"ArrowFunctionExpression\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFunctionParent(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FunctionParent {\n if (!node) return false;\n\n switch (node.type) {\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ObjectMethod\":\n case \"ArrowFunctionExpression\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"StaticBlock\":\n case \"TSModuleBlock\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPureish(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Pureish {\n if (!node) return false;\n\n switch (node.type) {\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"StringLiteral\":\n case \"NumericLiteral\":\n case \"NullLiteral\":\n case \"BooleanLiteral\":\n case \"RegExpLiteral\":\n case \"ArrowFunctionExpression\":\n case \"BigIntLiteral\":\n case \"DecimalLiteral\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"StringLiteral\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Declaration {\n if (!node) return false;\n\n switch (node.type) {\n case \"FunctionDeclaration\":\n case \"VariableDeclaration\":\n case \"ClassDeclaration\":\n case \"ExportAllDeclaration\":\n case \"ExportDefaultDeclaration\":\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n case \"DeclareClass\":\n case \"DeclareFunction\":\n case \"DeclareInterface\":\n case \"DeclareModule\":\n case \"DeclareModuleExports\":\n case \"DeclareTypeAlias\":\n case \"DeclareOpaqueType\":\n case \"DeclareVariable\":\n case \"DeclareExportDeclaration\":\n case \"DeclareExportAllDeclaration\":\n case \"InterfaceDeclaration\":\n case \"OpaqueType\":\n case \"TypeAlias\":\n case \"EnumDeclaration\":\n case \"TSDeclareFunction\":\n case \"TSInterfaceDeclaration\":\n case \"TSTypeAliasDeclaration\":\n case \"TSEnumDeclaration\":\n case \"TSModuleDeclaration\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"Declaration\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPatternLike(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.PatternLike {\n if (!node) return false;\n\n switch (node.type) {\n case \"Identifier\":\n case \"RestElement\":\n case \"AssignmentPattern\":\n case \"ArrayPattern\":\n case \"ObjectPattern\":\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n break;\n case \"Placeholder\":\n switch (node.expectedNode) {\n case \"Pattern\":\n case \"Identifier\":\n break;\n default:\n return false;\n }\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isLVal(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.LVal {\n if (!node) return false;\n\n switch (node.type) {\n case \"Identifier\":\n case \"MemberExpression\":\n case \"RestElement\":\n case \"AssignmentPattern\":\n case \"ArrayPattern\":\n case \"ObjectPattern\":\n case \"TSParameterProperty\":\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n break;\n case \"Placeholder\":\n switch (node.expectedNode) {\n case \"Pattern\":\n case \"Identifier\":\n break;\n default:\n return false;\n }\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSEntityName(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSEntityName {\n if (!node) return false;\n\n switch (node.type) {\n case \"Identifier\":\n case \"TSQualifiedName\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"Identifier\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Literal {\n if (!node) return false;\n\n switch (node.type) {\n case \"StringLiteral\":\n case \"NumericLiteral\":\n case \"NullLiteral\":\n case \"BooleanLiteral\":\n case \"RegExpLiteral\":\n case \"TemplateLiteral\":\n case \"BigIntLiteral\":\n case \"DecimalLiteral\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"StringLiteral\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImmutable(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Immutable {\n if (!node) return false;\n\n switch (node.type) {\n case \"StringLiteral\":\n case \"NumericLiteral\":\n case \"NullLiteral\":\n case \"BooleanLiteral\":\n case \"BigIntLiteral\":\n case \"JSXAttribute\":\n case \"JSXClosingElement\":\n case \"JSXElement\":\n case \"JSXExpressionContainer\":\n case \"JSXSpreadChild\":\n case \"JSXOpeningElement\":\n case \"JSXText\":\n case \"JSXFragment\":\n case \"JSXOpeningFragment\":\n case \"JSXClosingFragment\":\n case \"DecimalLiteral\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"StringLiteral\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isUserWhitespacable(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.UserWhitespacable {\n if (!node) return false;\n\n switch (node.type) {\n case \"ObjectMethod\":\n case \"ObjectProperty\":\n case \"ObjectTypeInternalSlot\":\n case \"ObjectTypeCallProperty\":\n case \"ObjectTypeIndexer\":\n case \"ObjectTypeProperty\":\n case \"ObjectTypeSpreadProperty\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isMethod(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Method {\n if (!node) return false;\n\n switch (node.type) {\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isObjectMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ObjectMember {\n if (!node) return false;\n\n switch (node.type) {\n case \"ObjectMethod\":\n case \"ObjectProperty\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Property {\n if (!node) return false;\n\n switch (node.type) {\n case \"ObjectProperty\":\n case \"ClassProperty\":\n case \"ClassAccessorProperty\":\n case \"ClassPrivateProperty\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isUnaryLike(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.UnaryLike {\n if (!node) return false;\n\n switch (node.type) {\n case \"UnaryExpression\":\n case \"SpreadElement\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPattern(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Pattern {\n if (!node) return false;\n\n switch (node.type) {\n case \"AssignmentPattern\":\n case \"ArrayPattern\":\n case \"ObjectPattern\":\n break;\n case \"Placeholder\":\n if (node.expectedNode === \"Pattern\") break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isClass(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Class {\n if (!node) return false;\n\n switch (node.type) {\n case \"ClassExpression\":\n case \"ClassDeclaration\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isImportOrExportDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportOrExportDeclaration {\n if (!node) return false;\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n case \"ExportDefaultDeclaration\":\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isExportDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ExportDeclaration {\n if (!node) return false;\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n case \"ExportDefaultDeclaration\":\n case \"ExportNamedDeclaration\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isModuleSpecifier(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ModuleSpecifier {\n if (!node) return false;\n\n switch (node.type) {\n case \"ExportSpecifier\":\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isAccessor(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Accessor {\n if (!node) return false;\n\n switch (node.type) {\n case \"ClassAccessorProperty\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isPrivate(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Private {\n if (!node) return false;\n\n switch (node.type) {\n case \"ClassPrivateProperty\":\n case \"ClassPrivateMethod\":\n case \"PrivateName\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFlow(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Flow {\n if (!node) return false;\n\n switch (node.type) {\n case \"AnyTypeAnnotation\":\n case \"ArrayTypeAnnotation\":\n case \"BooleanTypeAnnotation\":\n case \"BooleanLiteralTypeAnnotation\":\n case \"NullLiteralTypeAnnotation\":\n case \"ClassImplements\":\n case \"DeclareClass\":\n case \"DeclareFunction\":\n case \"DeclareInterface\":\n case \"DeclareModule\":\n case \"DeclareModuleExports\":\n case \"DeclareTypeAlias\":\n case \"DeclareOpaqueType\":\n case \"DeclareVariable\":\n case \"DeclareExportDeclaration\":\n case \"DeclareExportAllDeclaration\":\n case \"DeclaredPredicate\":\n case \"ExistsTypeAnnotation\":\n case \"FunctionTypeAnnotation\":\n case \"FunctionTypeParam\":\n case \"GenericTypeAnnotation\":\n case \"InferredPredicate\":\n case \"InterfaceExtends\":\n case \"InterfaceDeclaration\":\n case \"InterfaceTypeAnnotation\":\n case \"IntersectionTypeAnnotation\":\n case \"MixedTypeAnnotation\":\n case \"EmptyTypeAnnotation\":\n case \"NullableTypeAnnotation\":\n case \"NumberLiteralTypeAnnotation\":\n case \"NumberTypeAnnotation\":\n case \"ObjectTypeAnnotation\":\n case \"ObjectTypeInternalSlot\":\n case \"ObjectTypeCallProperty\":\n case \"ObjectTypeIndexer\":\n case \"ObjectTypeProperty\":\n case \"ObjectTypeSpreadProperty\":\n case \"OpaqueType\":\n case \"QualifiedTypeIdentifier\":\n case \"StringLiteralTypeAnnotation\":\n case \"StringTypeAnnotation\":\n case \"SymbolTypeAnnotation\":\n case \"ThisTypeAnnotation\":\n case \"TupleTypeAnnotation\":\n case \"TypeofTypeAnnotation\":\n case \"TypeAlias\":\n case \"TypeAnnotation\":\n case \"TypeCastExpression\":\n case \"TypeParameter\":\n case \"TypeParameterDeclaration\":\n case \"TypeParameterInstantiation\":\n case \"UnionTypeAnnotation\":\n case \"Variance\":\n case \"VoidTypeAnnotation\":\n case \"EnumDeclaration\":\n case \"EnumBooleanBody\":\n case \"EnumNumberBody\":\n case \"EnumStringBody\":\n case \"EnumSymbolBody\":\n case \"EnumBooleanMember\":\n case \"EnumNumberMember\":\n case \"EnumStringMember\":\n case \"EnumDefaultedMember\":\n case \"IndexedAccessType\":\n case \"OptionalIndexedAccessType\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFlowType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FlowType {\n if (!node) return false;\n\n switch (node.type) {\n case \"AnyTypeAnnotation\":\n case \"ArrayTypeAnnotation\":\n case \"BooleanTypeAnnotation\":\n case \"BooleanLiteralTypeAnnotation\":\n case \"NullLiteralTypeAnnotation\":\n case \"ExistsTypeAnnotation\":\n case \"FunctionTypeAnnotation\":\n case \"GenericTypeAnnotation\":\n case \"InterfaceTypeAnnotation\":\n case \"IntersectionTypeAnnotation\":\n case \"MixedTypeAnnotation\":\n case \"EmptyTypeAnnotation\":\n case \"NullableTypeAnnotation\":\n case \"NumberLiteralTypeAnnotation\":\n case \"NumberTypeAnnotation\":\n case \"ObjectTypeAnnotation\":\n case \"StringLiteralTypeAnnotation\":\n case \"StringTypeAnnotation\":\n case \"SymbolTypeAnnotation\":\n case \"ThisTypeAnnotation\":\n case \"TupleTypeAnnotation\":\n case \"TypeofTypeAnnotation\":\n case \"UnionTypeAnnotation\":\n case \"VoidTypeAnnotation\":\n case \"IndexedAccessType\":\n case \"OptionalIndexedAccessType\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFlowBaseAnnotation(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FlowBaseAnnotation {\n if (!node) return false;\n\n switch (node.type) {\n case \"AnyTypeAnnotation\":\n case \"BooleanTypeAnnotation\":\n case \"NullLiteralTypeAnnotation\":\n case \"MixedTypeAnnotation\":\n case \"EmptyTypeAnnotation\":\n case \"NumberTypeAnnotation\":\n case \"StringTypeAnnotation\":\n case \"SymbolTypeAnnotation\":\n case \"ThisTypeAnnotation\":\n case \"VoidTypeAnnotation\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFlowDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FlowDeclaration {\n if (!node) return false;\n\n switch (node.type) {\n case \"DeclareClass\":\n case \"DeclareFunction\":\n case \"DeclareInterface\":\n case \"DeclareModule\":\n case \"DeclareModuleExports\":\n case \"DeclareTypeAlias\":\n case \"DeclareOpaqueType\":\n case \"DeclareVariable\":\n case \"DeclareExportDeclaration\":\n case \"DeclareExportAllDeclaration\":\n case \"InterfaceDeclaration\":\n case \"OpaqueType\":\n case \"TypeAlias\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isFlowPredicate(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.FlowPredicate {\n if (!node) return false;\n\n switch (node.type) {\n case \"DeclaredPredicate\":\n case \"InferredPredicate\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumBody(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumBody {\n if (!node) return false;\n\n switch (node.type) {\n case \"EnumBooleanBody\":\n case \"EnumNumberBody\":\n case \"EnumStringBody\":\n case \"EnumSymbolBody\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isEnumMember(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.EnumMember {\n if (!node) return false;\n\n switch (node.type) {\n case \"EnumBooleanMember\":\n case \"EnumNumberMember\":\n case \"EnumStringMember\":\n case \"EnumDefaultedMember\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isJSX(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.JSX {\n if (!node) return false;\n\n switch (node.type) {\n case \"JSXAttribute\":\n case \"JSXClosingElement\":\n case \"JSXElement\":\n case \"JSXEmptyExpression\":\n case \"JSXExpressionContainer\":\n case \"JSXSpreadChild\":\n case \"JSXIdentifier\":\n case \"JSXMemberExpression\":\n case \"JSXNamespacedName\":\n case \"JSXOpeningElement\":\n case \"JSXSpreadAttribute\":\n case \"JSXText\":\n case \"JSXFragment\":\n case \"JSXOpeningFragment\":\n case \"JSXClosingFragment\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isMiscellaneous(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.Miscellaneous {\n if (!node) return false;\n\n switch (node.type) {\n case \"Noop\":\n case \"Placeholder\":\n case \"V8IntrinsicIdentifier\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTypeScript(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TypeScript {\n if (!node) return false;\n\n switch (node.type) {\n case \"TSParameterProperty\":\n case \"TSDeclareFunction\":\n case \"TSDeclareMethod\":\n case \"TSQualifiedName\":\n case \"TSCallSignatureDeclaration\":\n case \"TSConstructSignatureDeclaration\":\n case \"TSPropertySignature\":\n case \"TSMethodSignature\":\n case \"TSIndexSignature\":\n case \"TSAnyKeyword\":\n case \"TSBooleanKeyword\":\n case \"TSBigIntKeyword\":\n case \"TSIntrinsicKeyword\":\n case \"TSNeverKeyword\":\n case \"TSNullKeyword\":\n case \"TSNumberKeyword\":\n case \"TSObjectKeyword\":\n case \"TSStringKeyword\":\n case \"TSSymbolKeyword\":\n case \"TSUndefinedKeyword\":\n case \"TSUnknownKeyword\":\n case \"TSVoidKeyword\":\n case \"TSThisType\":\n case \"TSFunctionType\":\n case \"TSConstructorType\":\n case \"TSTypeReference\":\n case \"TSTypePredicate\":\n case \"TSTypeQuery\":\n case \"TSTypeLiteral\":\n case \"TSArrayType\":\n case \"TSTupleType\":\n case \"TSOptionalType\":\n case \"TSRestType\":\n case \"TSNamedTupleMember\":\n case \"TSUnionType\":\n case \"TSIntersectionType\":\n case \"TSConditionalType\":\n case \"TSInferType\":\n case \"TSParenthesizedType\":\n case \"TSTypeOperator\":\n case \"TSIndexedAccessType\":\n case \"TSMappedType\":\n case \"TSLiteralType\":\n case \"TSExpressionWithTypeArguments\":\n case \"TSInterfaceDeclaration\":\n case \"TSInterfaceBody\":\n case \"TSTypeAliasDeclaration\":\n case \"TSInstantiationExpression\":\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSEnumDeclaration\":\n case \"TSEnumMember\":\n case \"TSModuleDeclaration\":\n case \"TSModuleBlock\":\n case \"TSImportType\":\n case \"TSImportEqualsDeclaration\":\n case \"TSExternalModuleReference\":\n case \"TSNonNullExpression\":\n case \"TSExportAssignment\":\n case \"TSNamespaceExportDeclaration\":\n case \"TSTypeAnnotation\":\n case \"TSTypeParameterInstantiation\":\n case \"TSTypeParameterDeclaration\":\n case \"TSTypeParameter\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSTypeElement(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSTypeElement {\n if (!node) return false;\n\n switch (node.type) {\n case \"TSCallSignatureDeclaration\":\n case \"TSConstructSignatureDeclaration\":\n case \"TSPropertySignature\":\n case \"TSMethodSignature\":\n case \"TSIndexSignature\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSType {\n if (!node) return false;\n\n switch (node.type) {\n case \"TSAnyKeyword\":\n case \"TSBooleanKeyword\":\n case \"TSBigIntKeyword\":\n case \"TSIntrinsicKeyword\":\n case \"TSNeverKeyword\":\n case \"TSNullKeyword\":\n case \"TSNumberKeyword\":\n case \"TSObjectKeyword\":\n case \"TSStringKeyword\":\n case \"TSSymbolKeyword\":\n case \"TSUndefinedKeyword\":\n case \"TSUnknownKeyword\":\n case \"TSVoidKeyword\":\n case \"TSThisType\":\n case \"TSFunctionType\":\n case \"TSConstructorType\":\n case \"TSTypeReference\":\n case \"TSTypePredicate\":\n case \"TSTypeQuery\":\n case \"TSTypeLiteral\":\n case \"TSArrayType\":\n case \"TSTupleType\":\n case \"TSOptionalType\":\n case \"TSRestType\":\n case \"TSUnionType\":\n case \"TSIntersectionType\":\n case \"TSConditionalType\":\n case \"TSInferType\":\n case \"TSParenthesizedType\":\n case \"TSTypeOperator\":\n case \"TSIndexedAccessType\":\n case \"TSMappedType\":\n case \"TSLiteralType\":\n case \"TSExpressionWithTypeArguments\":\n case \"TSImportType\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\nexport function isTSBaseType(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.TSBaseType {\n if (!node) return false;\n\n switch (node.type) {\n case \"TSAnyKeyword\":\n case \"TSBooleanKeyword\":\n case \"TSBigIntKeyword\":\n case \"TSIntrinsicKeyword\":\n case \"TSNeverKeyword\":\n case \"TSNullKeyword\":\n case \"TSNumberKeyword\":\n case \"TSObjectKeyword\":\n case \"TSStringKeyword\":\n case \"TSSymbolKeyword\":\n case \"TSUndefinedKeyword\":\n case \"TSUnknownKeyword\":\n case \"TSVoidKeyword\":\n case \"TSThisType\":\n case \"TSLiteralType\":\n break;\n default:\n return false;\n }\n\n return opts == null || shallowEqual(node, opts);\n}\n/**\n * @deprecated Use `isNumericLiteral`\n */\nexport function isNumberLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): boolean {\n deprecationWarning(\"isNumberLiteral\", \"isNumericLiteral\");\n if (!node) return false;\n\n if (node.type !== \"NumberLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\n/**\n * @deprecated Use `isRegExpLiteral`\n */\nexport function isRegexLiteral(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): boolean {\n deprecationWarning(\"isRegexLiteral\", \"isRegExpLiteral\");\n if (!node) return false;\n\n if (node.type !== \"RegexLiteral\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\n/**\n * @deprecated Use `isRestElement`\n */\nexport function isRestProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): boolean {\n deprecationWarning(\"isRestProperty\", \"isRestElement\");\n if (!node) return false;\n\n if (node.type !== \"RestProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\n/**\n * @deprecated Use `isSpreadElement`\n */\nexport function isSpreadProperty(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): boolean {\n deprecationWarning(\"isSpreadProperty\", \"isSpreadElement\");\n if (!node) return false;\n\n if (node.type !== \"SpreadProperty\") return false;\n\n return opts == null || shallowEqual(node, opts);\n}\n/**\n * @deprecated Use `isImportOrExportDeclaration`\n */\nexport function isModuleDeclaration(\n node: t.Node | null | undefined,\n opts?: Opts | null,\n): node is t.ImportOrExportDeclaration {\n deprecationWarning(\"isModuleDeclaration\", \"isImportOrExportDeclaration\");\n return isImportOrExportDeclaration(node, opts);\n}\n","import {\n isIdentifier,\n isMemberExpression,\n isStringLiteral,\n isThisExpression,\n} from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Determines whether or not the input node `member` matches the\n * input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function matchesPattern(\n member: t.Node | null | undefined,\n match: string | string[],\n allowPartial?: boolean,\n): boolean {\n // not a member expression\n if (!isMemberExpression(member)) return false;\n\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n\n let node;\n for (node = member; isMemberExpression(node); node = node.object) {\n nodes.push(node.property);\n }\n nodes.push(node);\n\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n if (isIdentifier(node)) {\n value = node.name;\n } else if (isStringLiteral(node)) {\n value = node.value;\n } else if (isThisExpression(node)) {\n value = \"this\";\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}\n","import matchesPattern from \"./matchesPattern\";\nimport type * as t from \"..\";\n\n/**\n * Build a function that when called will return whether or not the\n * input `node` `MemberExpression` matches the input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function buildMatchMemberExpression(\n match: string,\n allowPartial?: boolean,\n) {\n const parts = match.split(\".\");\n\n return (member: t.Node) => matchesPattern(member, parts, allowPartial);\n}\n","import buildMatchMemberExpression from \"../buildMatchMemberExpression\";\n\nconst isReactComponent = buildMatchMemberExpression(\"React.Component\");\n\nexport default isReactComponent;\n","export default function isCompatTag(tagName?: string): boolean {\n // Must start with a lowercase ASCII letter\n return !!tagName && /^[a-z]/.test(tagName);\n}\n","'use strict';\n\nlet fastProto = null;\n\n// Creates an object with permanently fast properties in V8. See Toon Verwaest's\n// post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62\n// for more details. Use %HasFastProperties(object) and the Node.js flag\n// --allow-natives-syntax to check whether an object has fast properties.\nfunction FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}\n\n// Initialize the inline property cache of FastObject\nFastObject();\n\nmodule.exports = function toFastproperties(o) {\n\treturn FastObject(o);\n};\n","import { FLIPPED_ALIAS_KEYS, ALIAS_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function isType(\n nodeType: string,\n targetType: T,\n): nodeType is T;\n\nexport default function isType(\n nodeType: string | null | undefined,\n targetType: string,\n): boolean;\n\n/**\n * Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.\n */\nexport default function isType(nodeType: string, targetType: string): boolean {\n if (nodeType === targetType) return true;\n\n // This is a fast-path. If the test above failed, but an alias key is found, then the\n // targetType was a primary node type, so there's no need to check the aliases.\n // @ts-expect-error targetType may not index ALIAS_KEYS\n if (ALIAS_KEYS[targetType]) return false;\n\n const aliases: Array | undefined = FLIPPED_ALIAS_KEYS[targetType];\n if (aliases) {\n if (aliases[0] === nodeType) return true;\n\n for (const alias of aliases) {\n if (nodeType === alias) return true;\n }\n }\n\n return false;\n}\n","import { PLACEHOLDERS_ALIAS } from \"../definitions\";\n\n/**\n * Test if a `placeholderType` is a `targetType` or if `targetType` is an alias of `placeholderType`.\n */\nexport default function isPlaceholderType(\n placeholderType: string,\n targetType: string,\n): boolean {\n if (placeholderType === targetType) return true;\n\n const aliases: Array | undefined =\n PLACEHOLDERS_ALIAS[placeholderType];\n if (aliases) {\n for (const alias of aliases) {\n if (targetType === alias) return true;\n }\n }\n\n return false;\n}\n","import shallowEqual from \"../utils/shallowEqual\";\nimport isType from \"./isType\";\nimport isPlaceholderType from \"./isPlaceholderType\";\nimport { FLIPPED_ALIAS_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function is(\n type: T,\n node: t.Node | null | undefined,\n opts?: undefined,\n): node is Extract;\n\nexport default function is<\n T extends t.Node[\"type\"],\n P extends Extract,\n>(type: T, n: t.Node | null | undefined, required: Partial

): n is P;\n\nexport default function is

(\n type: string,\n node: t.Node | null | undefined,\n opts: Partial

,\n): node is P;\n\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial,\n): node is t.Node;\n/**\n * Returns whether `node` is of given `type`.\n *\n * For better performance, use this instead of `is[Type]` when `type` is unknown.\n */\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial,\n): node is t.Node {\n if (!node) return false;\n\n const matches = isType(node.type, type);\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in FLIPPED_ALIAS_KEYS) {\n // We can only return true if the placeholder doesn't replace a real node,\n // but it replaces a category of nodes (an alias).\n //\n // t.is(\"Identifier\", node) gives some guarantees about node's shape, so we\n // can't say that Placeholder(expectedNode: \"Identifier\") is an identifier\n // because it doesn't have the same properties.\n // On the other hand, t.is(\"Expression\", node) doesn't say anything about\n // the shape of node because Expression can be many different nodes: we can,\n // and should, safely report expression placeholders as Expressions.\n return isPlaceholderType(node.expectedNode, type);\n }\n return false;\n }\n\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword\";\n","import {\n isIdentifierName,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\n/**\n * Check if the input `name` is a valid identifier name\n * and isn't a reserved word.\n */\nexport default function isValidIdentifier(\n name: string,\n reserved: boolean = true,\n): boolean {\n if (typeof name !== \"string\") return false;\n\n if (reserved) {\n // \"await\" is invalid in module, valid in script; better be safe (see #4952)\n if (isKeyword(name) || isStrictReservedWord(name, true)) {\n return false;\n }\n }\n\n return isIdentifierName(name);\n}\n","import * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = input.slice(startPos, pos + 2).match(/^[0-7]+/)!;\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","export const STATEMENT_OR_BLOCK_KEYS = [\"consequent\", \"body\", \"alternate\"];\nexport const FLATTENABLE_KEYS = [\"body\", \"expressions\"];\nexport const FOR_INIT_KEYS = [\"left\", \"init\"];\nexport const COMMENT_KEYS = [\n \"leadingComments\",\n \"trailingComments\",\n \"innerComments\",\n] as const;\n\nexport const LOGICAL_OPERATORS = [\"||\", \"&&\", \"??\"];\nexport const UPDATE_OPERATORS = [\"++\", \"--\"];\n\nexport const BOOLEAN_NUMBER_BINARY_OPERATORS = [\">\", \"<\", \">=\", \"<=\"];\nexport const EQUALITY_BINARY_OPERATORS = [\"==\", \"===\", \"!=\", \"!==\"];\nexport const COMPARISON_BINARY_OPERATORS = [\n ...EQUALITY_BINARY_OPERATORS,\n \"in\",\n \"instanceof\",\n];\nexport const BOOLEAN_BINARY_OPERATORS = [\n ...COMPARISON_BINARY_OPERATORS,\n ...BOOLEAN_NUMBER_BINARY_OPERATORS,\n];\nexport const NUMBER_BINARY_OPERATORS = [\n \"-\",\n \"/\",\n \"%\",\n \"*\",\n \"**\",\n \"&\",\n \"|\",\n \">>\",\n \">>>\",\n \"<<\",\n \"^\",\n];\nexport const BINARY_OPERATORS = [\n \"+\",\n ...NUMBER_BINARY_OPERATORS,\n ...BOOLEAN_BINARY_OPERATORS,\n \"|>\",\n];\n\nexport const ASSIGNMENT_OPERATORS = [\n \"=\",\n \"+=\",\n ...NUMBER_BINARY_OPERATORS.map(op => op + \"=\"),\n ...LOGICAL_OPERATORS.map(op => op + \"=\"),\n];\n\nexport const BOOLEAN_UNARY_OPERATORS = [\"delete\", \"!\"];\nexport const NUMBER_UNARY_OPERATORS = [\"+\", \"-\", \"~\"];\nexport const STRING_UNARY_OPERATORS = [\"typeof\"];\nexport const UNARY_OPERATORS = [\n \"void\",\n \"throw\",\n ...BOOLEAN_UNARY_OPERATORS,\n ...NUMBER_UNARY_OPERATORS,\n ...STRING_UNARY_OPERATORS,\n];\n\nexport const INHERIT_KEYS = {\n optional: [\"typeAnnotation\", \"typeParameters\", \"returnType\"],\n force: [\"start\", \"loc\", \"end\"],\n} as const;\n\nexport const BLOCK_SCOPED_SYMBOL = Symbol.for(\"var used to be block scoped\");\nexport const NOT_LOCAL_BINDING = Symbol.for(\n \"should not be considered a local binding\",\n);\n","import is from \"../validators/is\";\nimport { validateField, validateChild } from \"../validators/validate\";\nimport type * as t from \"..\";\n\nexport const VISITOR_KEYS: Record = {};\nexport const ALIAS_KEYS: Partial> =\n {};\nexport const FLIPPED_ALIAS_KEYS: Record = {};\nexport const NODE_FIELDS: Record = {};\nexport const BUILDER_KEYS: Record = {};\nexport const DEPRECATED_KEYS: Record = {};\nexport const NODE_PARENT_VALIDATIONS: Record = {};\n\nfunction getType(val: any) {\n if (Array.isArray(val)) {\n return \"array\";\n } else if (val === null) {\n return \"null\";\n } else {\n return typeof val;\n }\n}\n\ntype NodeTypesWithoutComment = t.Node[\"type\"] | keyof t.Aliases;\n\ntype NodeTypes = NodeTypesWithoutComment | t.Comment[\"type\"];\n\ntype PrimitiveTypes = ReturnType;\n\ntype FieldDefinitions = {\n [x: string]: FieldOptions;\n};\n\ntype DefineTypeOpts = {\n fields?: FieldDefinitions;\n visitor?: Array;\n aliases?: Array;\n builder?: Array;\n inherits?: NodeTypes;\n deprecatedAlias?: string;\n validate?: Validator;\n};\n\nexport type Validator = (\n | { type: PrimitiveTypes }\n | { each: Validator }\n | { chainOf: Validator[] }\n | { oneOf: any[] }\n | { oneOfNodeTypes: NodeTypes[] }\n | { oneOfNodeOrValueTypes: (NodeTypes | PrimitiveTypes)[] }\n | { shapeOf: { [x: string]: FieldOptions } }\n | {}\n) &\n ((node: t.Node, key: string, val: any) => void);\n\nexport type FieldOptions = {\n default?: string | number | boolean | [];\n optional?: boolean;\n deprecated?: boolean;\n validate?: Validator;\n};\n\nexport function validate(validate: Validator): FieldOptions {\n return { validate };\n}\n\nexport function typeIs(typeName: NodeTypes | NodeTypes[]) {\n return typeof typeName === \"string\"\n ? assertNodeType(typeName)\n : assertNodeType(...typeName);\n}\n\nexport function validateType(typeName: NodeTypes | NodeTypes[]) {\n return validate(typeIs(typeName));\n}\n\nexport function validateOptional(validate: Validator): FieldOptions {\n return { validate, optional: true };\n}\n\nexport function validateOptionalType(\n typeName: NodeTypes | NodeTypes[],\n): FieldOptions {\n return { validate: typeIs(typeName), optional: true };\n}\n\nexport function arrayOf(elementType: Validator): Validator {\n return chain(assertValueType(\"array\"), assertEach(elementType));\n}\n\nexport function arrayOfType(typeName: NodeTypes | NodeTypes[]) {\n return arrayOf(typeIs(typeName));\n}\n\nexport function validateArrayOfType(typeName: NodeTypes | NodeTypes[]) {\n return validate(arrayOfType(typeName));\n}\n\nexport function assertEach(callback: Validator): Validator {\n function validator(node: t.Node, key: string, val: any) {\n if (!Array.isArray(val)) return;\n\n for (let i = 0; i < val.length; i++) {\n const subkey = `${key}[${i}]`;\n const v = val[i];\n callback(node, subkey, v);\n if (process.env.BABEL_TYPES_8_BREAKING) validateChild(node, subkey, v);\n }\n }\n validator.each = callback;\n return validator;\n}\n\nexport function assertOneOf(...values: Array): Validator {\n function validate(node: any, key: string, val: any) {\n if (values.indexOf(val) < 0) {\n throw new TypeError(\n `Property ${key} expected value to be one of ${JSON.stringify(\n values,\n )} but got ${JSON.stringify(val)}`,\n );\n }\n }\n\n validate.oneOf = values;\n\n return validate;\n}\n\nexport function assertNodeType(...types: NodeTypes[]): Validator {\n function validate(node: t.Node, key: string, val: any) {\n for (const type of types) {\n if (is(type, val)) {\n validateChild(node, key, val);\n return;\n }\n }\n\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected node to be of a type ${JSON.stringify(\n types,\n )} but instead got ${JSON.stringify(val?.type)}`,\n );\n }\n\n validate.oneOfNodeTypes = types;\n\n return validate;\n}\n\nexport function assertNodeOrValueType(\n ...types: (NodeTypes | PrimitiveTypes)[]\n): Validator {\n function validate(node: t.Node, key: string, val: any) {\n for (const type of types) {\n if (getType(val) === type || is(type, val)) {\n validateChild(node, key, val);\n return;\n }\n }\n\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected node to be of a type ${JSON.stringify(\n types,\n )} but instead got ${JSON.stringify(val?.type)}`,\n );\n }\n\n validate.oneOfNodeOrValueTypes = types;\n\n return validate;\n}\n\nexport function assertValueType(type: PrimitiveTypes): Validator {\n function validate(node: t.Node, key: string, val: any) {\n const valid = getType(val) === type;\n\n if (!valid) {\n throw new TypeError(\n `Property ${key} expected type of ${type} but got ${getType(val)}`,\n );\n }\n }\n\n validate.type = type;\n\n return validate;\n}\n\nexport function assertShape(shape: { [x: string]: FieldOptions }): Validator {\n function validate(node: t.Node, key: string, val: any) {\n const errors = [];\n for (const property of Object.keys(shape)) {\n try {\n validateField(node, property, val[property], shape[property]);\n } catch (error) {\n if (error instanceof TypeError) {\n errors.push(error.message);\n continue;\n }\n throw error;\n }\n }\n if (errors.length) {\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected to have the following:\\n${errors.join(\"\\n\")}`,\n );\n }\n }\n\n validate.shapeOf = shape;\n\n return validate;\n}\n\nexport function assertOptionalChainStart(): Validator {\n function validate(node: t.Node) {\n let current = node;\n while (node) {\n const { type } = current;\n if (type === \"OptionalCallExpression\") {\n if (current.optional) return;\n current = current.callee;\n continue;\n }\n\n if (type === \"OptionalMemberExpression\") {\n if (current.optional) return;\n current = current.object;\n continue;\n }\n\n break;\n }\n\n throw new TypeError(\n `Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${current?.type}`,\n );\n }\n\n return validate;\n}\n\nexport function chain(...fns: Array): Validator {\n function validate(...args: Parameters) {\n for (const fn of fns) {\n fn(...args);\n }\n }\n validate.chainOf = fns;\n\n if (\n fns.length >= 2 &&\n \"type\" in fns[0] &&\n fns[0].type === \"array\" &&\n !(\"each\" in fns[1])\n ) {\n throw new Error(\n `An assertValueType(\"array\") validator can only be followed by an assertEach(...) validator.`,\n );\n }\n\n return validate;\n}\n\nconst validTypeOpts = [\n \"aliases\",\n \"builder\",\n \"deprecatedAlias\",\n \"fields\",\n \"inherits\",\n \"visitor\",\n \"validate\",\n];\nconst validFieldKeys = [\"default\", \"optional\", \"deprecated\", \"validate\"];\n\nconst store = {} as Record;\n\n// Wraps defineType to ensure these aliases are included.\nexport function defineAliasedType(...aliases: string[]) {\n return (type: string, opts: DefineTypeOpts = {}) => {\n let defined = opts.aliases;\n if (!defined) {\n if (opts.inherits) defined = store[opts.inherits].aliases?.slice();\n defined ??= [];\n opts.aliases = defined;\n }\n const additional = aliases.filter(a => !defined.includes(a));\n defined.unshift(...additional);\n defineType(type, opts);\n };\n}\n\nexport default function defineType(type: string, opts: DefineTypeOpts = {}) {\n const inherits = (opts.inherits && store[opts.inherits]) || {};\n\n let fields = opts.fields;\n if (!fields) {\n fields = {};\n if (inherits.fields) {\n const keys = Object.getOwnPropertyNames(inherits.fields);\n for (const key of keys) {\n const field = inherits.fields[key];\n const def = field.default;\n if (\n Array.isArray(def) ? def.length > 0 : def && typeof def === \"object\"\n ) {\n throw new Error(\n \"field defaults can only be primitives or empty arrays currently\",\n );\n }\n fields[key] = {\n default: Array.isArray(def) ? [] : def,\n optional: field.optional,\n deprecated: field.deprecated,\n validate: field.validate,\n };\n }\n }\n }\n\n const visitor: Array = opts.visitor || inherits.visitor || [];\n const aliases: Array = opts.aliases || inherits.aliases || [];\n const builder: Array =\n opts.builder || inherits.builder || opts.visitor || [];\n\n for (const k of Object.keys(opts)) {\n if (validTypeOpts.indexOf(k) === -1) {\n throw new Error(`Unknown type option \"${k}\" on ${type}`);\n }\n }\n\n if (opts.deprecatedAlias) {\n DEPRECATED_KEYS[opts.deprecatedAlias] = type as NodeTypesWithoutComment;\n }\n\n // ensure all field keys are represented in `fields`\n for (const key of visitor.concat(builder)) {\n fields[key] = fields[key] || {};\n }\n\n for (const key of Object.keys(fields)) {\n const field = fields[key];\n\n if (field.default !== undefined && builder.indexOf(key) === -1) {\n field.optional = true;\n }\n if (field.default === undefined) {\n field.default = null;\n } else if (!field.validate && field.default != null) {\n field.validate = assertValueType(getType(field.default));\n }\n\n for (const k of Object.keys(field)) {\n if (validFieldKeys.indexOf(k) === -1) {\n throw new Error(`Unknown field key \"${k}\" on ${type}.${key}`);\n }\n }\n }\n\n VISITOR_KEYS[type] = opts.visitor = visitor;\n BUILDER_KEYS[type] = opts.builder = builder;\n NODE_FIELDS[type] = opts.fields = fields;\n ALIAS_KEYS[type as NodeTypesWithoutComment] = opts.aliases = aliases;\n aliases.forEach(alias => {\n FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];\n FLIPPED_ALIAS_KEYS[alias].push(type as NodeTypesWithoutComment);\n });\n\n if (opts.validate) {\n NODE_PARENT_VALIDATIONS[type] = opts.validate;\n }\n\n store[type] = opts;\n}\n","import is from \"../validators/is\";\nimport isValidIdentifier from \"../validators/isValidIdentifier\";\nimport { isKeyword, isReservedWord } from \"@babel/helper-validator-identifier\";\nimport type * as t from \"..\";\nimport { readStringContents } from \"@babel/helper-string-parser\";\n\nimport {\n BINARY_OPERATORS,\n LOGICAL_OPERATORS,\n ASSIGNMENT_OPERATORS,\n UNARY_OPERATORS,\n UPDATE_OPERATORS,\n} from \"../constants\";\n\nimport {\n defineAliasedType,\n assertShape,\n assertOptionalChainStart,\n assertValueType,\n assertNodeType,\n assertNodeOrValueType,\n assertEach,\n chain,\n assertOneOf,\n validateOptional,\n type Validator,\n} from \"./utils\";\n\nconst defineType = defineAliasedType(\"Standardized\");\n\ndefineType(\"ArrayExpression\", {\n fields: {\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeOrValueType(\"null\", \"Expression\", \"SpreadElement\"),\n ),\n ),\n default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined,\n },\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"AssignmentExpression\", {\n fields: {\n operator: {\n validate: (function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertValueType(\"string\");\n }\n\n const identifier = assertOneOf(...ASSIGNMENT_OPERATORS);\n const pattern = assertOneOf(\"=\");\n\n return function (node: t.AssignmentExpression, key, val) {\n const validator = is(\"Pattern\", node.left) ? pattern : identifier;\n validator(node, key, val);\n };\n })(),\n },\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"LVal\")\n : assertNodeType(\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSTypeAssertion\",\n \"TSNonNullExpression\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"BinaryExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n fields: {\n operator: {\n validate: assertOneOf(...BINARY_OPERATORS),\n },\n left: {\n validate: (function () {\n const expression = assertNodeType(\"Expression\");\n const inOp = assertNodeType(\"Expression\", \"PrivateName\");\n\n const validator: Validator = Object.assign(\n function (node: t.BinaryExpression, key, val) {\n const validator = node.operator === \"in\" ? inOp : expression;\n validator(node, key, val);\n } as Validator,\n // todo(ts): can be discriminated union by `operator` property\n { oneOfNodeTypes: [\"Expression\", \"PrivateName\"] },\n );\n return validator;\n })(),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n});\n\ndefineType(\"InterpreterDirective\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"Directive\", {\n visitor: [\"value\"],\n fields: {\n value: {\n validate: assertNodeType(\"DirectiveLiteral\"),\n },\n },\n});\n\ndefineType(\"DirectiveLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"BlockStatement\", {\n builder: [\"body\", \"directives\"],\n visitor: [\"directives\", \"body\"],\n fields: {\n directives: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Directive\")),\n ),\n default: [],\n },\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\", \"Statement\"],\n});\n\ndefineType(\"BreakStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n});\n\ndefineType(\"CallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\", \"Super\", \"V8IntrinsicIdentifier\"),\n },\n arguments: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Expression\",\n \"SpreadElement\",\n \"JSXNamespacedName\",\n \"ArgumentPlaceholder\",\n ),\n ),\n ),\n },\n ...(!process.env.BABEL_TYPES_8_BREAKING\n ? {\n optional: {\n validate: assertOneOf(true, false),\n optional: true,\n },\n }\n : {}),\n typeArguments: {\n validate: assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"CatchClause\", {\n visitor: [\"param\", \"body\"],\n fields: {\n param: {\n validate: assertNodeType(\"Identifier\", \"ArrayPattern\", \"ObjectPattern\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\"],\n});\n\ndefineType(\"ConditionalExpression\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n consequent: {\n validate: assertNodeType(\"Expression\"),\n },\n alternate: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Expression\", \"Conditional\"],\n});\n\ndefineType(\"ContinueStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n});\n\ndefineType(\"DebuggerStatement\", {\n aliases: [\"Statement\"],\n});\n\ndefineType(\"DoWhileStatement\", {\n visitor: [\"test\", \"body\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n});\n\ndefineType(\"EmptyStatement\", {\n aliases: [\"Statement\"],\n});\n\ndefineType(\"ExpressionStatement\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Statement\", \"ExpressionWrapper\"],\n});\n\ndefineType(\"File\", {\n builder: [\"program\", \"comments\", \"tokens\"],\n visitor: [\"program\"],\n fields: {\n program: {\n validate: assertNodeType(\"Program\"),\n },\n comments: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? Object.assign(() => {}, {\n each: { oneOfNodeTypes: [\"CommentBlock\", \"CommentLine\"] },\n })\n : assertEach(assertNodeType(\"CommentBlock\", \"CommentLine\")),\n optional: true,\n },\n tokens: {\n // todo(ts): add Token type\n validate: assertEach(Object.assign(() => {}, { type: \"any\" })),\n optional: true,\n },\n },\n});\n\ndefineType(\"ForInStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n aliases: [\n \"Scopable\",\n \"Statement\",\n \"For\",\n \"BlockParent\",\n \"Loop\",\n \"ForXStatement\",\n ],\n fields: {\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"VariableDeclaration\", \"LVal\")\n : assertNodeType(\n \"VariableDeclaration\",\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSTypeAssertion\",\n \"TSNonNullExpression\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"ForStatement\", {\n visitor: [\"init\", \"test\", \"update\", \"body\"],\n aliases: [\"Scopable\", \"Statement\", \"For\", \"BlockParent\", \"Loop\"],\n fields: {\n init: {\n validate: assertNodeType(\"VariableDeclaration\", \"Expression\"),\n optional: true,\n },\n test: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n update: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\nexport const functionCommon = () => ({\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Identifier\", \"Pattern\", \"RestElement\")),\n ),\n },\n generator: {\n default: false,\n },\n async: {\n default: false,\n },\n});\n\nexport const functionTypeAnnotationCommon = () => ({\n returnType: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\")\n : assertNodeType(\n \"TypeAnnotation\",\n \"TSTypeAnnotation\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n typeParameters: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TypeParameterDeclaration\", \"TSTypeParameterDeclaration\")\n : assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n});\n\nexport const functionDeclarationCommon = () => ({\n ...functionCommon(),\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n id: {\n validate: assertNodeType(\"Identifier\"),\n optional: true, // May be null for `export default function`\n },\n});\n\ndefineType(\"FunctionDeclaration\", {\n builder: [\"id\", \"params\", \"body\", \"generator\", \"async\"],\n visitor: [\"id\", \"params\", \"body\", \"returnType\", \"typeParameters\"],\n fields: {\n ...functionDeclarationCommon(),\n ...functionTypeAnnotationCommon(),\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n predicate: {\n validate: assertNodeType(\"DeclaredPredicate\", \"InferredPredicate\"),\n optional: true,\n },\n },\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Statement\",\n \"Pureish\",\n \"Declaration\",\n ],\n validate: (function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};\n\n const identifier = assertNodeType(\"Identifier\");\n\n return function (parent, key, node) {\n if (!is(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n })(),\n});\n\ndefineType(\"FunctionExpression\", {\n inherits: \"FunctionDeclaration\",\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Expression\",\n \"Pureish\",\n ],\n fields: {\n ...functionCommon(),\n ...functionTypeAnnotationCommon(),\n id: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n predicate: {\n validate: assertNodeType(\"DeclaredPredicate\", \"InferredPredicate\"),\n optional: true,\n },\n },\n});\n\nexport const patternLikeCommon = () => ({\n typeAnnotation: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\")\n : assertNodeType(\n \"TypeAnnotation\",\n \"TSTypeAnnotation\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n});\n\ndefineType(\"Identifier\", {\n builder: [\"name\"],\n visitor: [\"typeAnnotation\", \"decorators\" /* for legacy param decorators */],\n aliases: [\"Expression\", \"PatternLike\", \"LVal\", \"TSEntityName\"],\n fields: {\n ...patternLikeCommon(),\n name: {\n validate: chain(\n assertValueType(\"string\"),\n Object.assign(\n function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!isValidIdentifier(val, false)) {\n throw new TypeError(`\"${val}\" is not a valid identifier name`);\n }\n } as Validator,\n { type: \"string\" },\n ),\n ),\n },\n },\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const match = /\\.(\\w+)$/.exec(key);\n if (!match) return;\n\n const [, parentKey] = match;\n const nonComp = { computed: false };\n\n // We can't check if `parent.property === node`, because nodes are validated\n // before replacing them in the AST.\n if (parentKey === \"property\") {\n if (is(\"MemberExpression\", parent, nonComp)) return;\n if (is(\"OptionalMemberExpression\", parent, nonComp)) return;\n } else if (parentKey === \"key\") {\n if (is(\"Property\", parent, nonComp)) return;\n if (is(\"Method\", parent, nonComp)) return;\n } else if (parentKey === \"exported\") {\n if (is(\"ExportSpecifier\", parent)) return;\n } else if (parentKey === \"imported\") {\n if (is(\"ImportSpecifier\", parent, { imported: node })) return;\n } else if (parentKey === \"meta\") {\n if (is(\"MetaProperty\", parent, { meta: node })) return;\n }\n\n if (\n // Ideally we should call isStrictReservedWord if this node is a descendant\n // of a block in strict mode. Also, we should pass the inModule option so\n // we can disable \"await\" in module.\n (isKeyword(node.name) || isReservedWord(node.name, false)) &&\n // Even if \"this\" is a keyword, we are using the Identifier\n // node to represent it.\n node.name !== \"this\"\n ) {\n throw new TypeError(`\"${node.name}\" is not a valid identifier`);\n }\n },\n});\n\ndefineType(\"IfStatement\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n aliases: [\"Statement\", \"Conditional\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n consequent: {\n validate: assertNodeType(\"Statement\"),\n },\n alternate: {\n optional: true,\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"LabeledStatement\", {\n visitor: [\"label\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"StringLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"NumericLiteral\", {\n builder: [\"value\"],\n deprecatedAlias: \"NumberLiteral\",\n fields: {\n value: {\n validate: assertValueType(\"number\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"NullLiteral\", {\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"BooleanLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"boolean\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"RegExpLiteral\", {\n builder: [\"pattern\", \"flags\"],\n deprecatedAlias: \"RegexLiteral\",\n aliases: [\"Expression\", \"Pureish\", \"Literal\"],\n fields: {\n pattern: {\n validate: assertValueType(\"string\"),\n },\n flags: {\n validate: chain(\n assertValueType(\"string\"),\n Object.assign(\n function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const invalid = /[^gimsuy]/.exec(val);\n if (invalid) {\n throw new TypeError(`\"${invalid[0]}\" is not a valid RegExp flag`);\n }\n } as Validator,\n { type: \"string\" },\n ),\n ),\n default: \"\",\n },\n },\n});\n\ndefineType(\"LogicalExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n fields: {\n operator: {\n validate: assertOneOf(...LOGICAL_OPERATORS),\n },\n left: {\n validate: assertNodeType(\"Expression\"),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"MemberExpression\", {\n builder: [\n \"object\",\n \"property\",\n \"computed\",\n ...(!process.env.BABEL_TYPES_8_BREAKING ? [\"optional\"] : []),\n ],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\", \"LVal\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\", \"Super\"),\n },\n property: {\n validate: (function () {\n const normal = assertNodeType(\"Identifier\", \"PrivateName\");\n const computed = assertNodeType(\"Expression\");\n\n const validator: Validator = function (\n node: t.MemberExpression,\n key,\n val,\n ) {\n const validator: Validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n // @ts-expect-error todo(ts): can be discriminated union by `computed` property\n validator.oneOfNodeTypes = [\"Expression\", \"Identifier\", \"PrivateName\"];\n return validator;\n })(),\n },\n computed: {\n default: false,\n },\n ...(!process.env.BABEL_TYPES_8_BREAKING\n ? {\n optional: {\n validate: assertOneOf(true, false),\n optional: true,\n },\n }\n : {}),\n },\n});\n\ndefineType(\"NewExpression\", { inherits: \"CallExpression\" });\n\ndefineType(\"Program\", {\n // Note: We explicitly leave 'interpreter' out here because it is\n // conceptually comment-like, and Babel does not traverse comments either.\n visitor: [\"directives\", \"body\"],\n builder: [\"body\", \"directives\", \"sourceType\", \"interpreter\"],\n fields: {\n sourceFile: {\n validate: assertValueType(\"string\"),\n },\n sourceType: {\n validate: assertOneOf(\"script\", \"module\"),\n default: \"script\",\n },\n interpreter: {\n validate: assertNodeType(\"InterpreterDirective\"),\n default: null,\n optional: true,\n },\n directives: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Directive\")),\n ),\n default: [],\n },\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\"],\n});\n\ndefineType(\"ObjectExpression\", {\n visitor: [\"properties\"],\n aliases: [\"Expression\"],\n fields: {\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"ObjectMethod\", \"ObjectProperty\", \"SpreadElement\"),\n ),\n ),\n },\n },\n});\n\ndefineType(\"ObjectMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"computed\", \"generator\", \"async\"],\n fields: {\n ...functionCommon(),\n ...functionTypeAnnotationCommon(),\n kind: {\n validate: assertOneOf(\"method\", \"get\", \"set\"),\n ...(!process.env.BABEL_TYPES_8_BREAKING ? { default: \"method\" } : {}),\n },\n computed: {\n default: false,\n },\n key: {\n validate: (function () {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n const validator: Validator = function (node: t.ObjectMethod, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n // @ts-expect-error todo(ts): can be discriminated union by `computed` property\n validator.oneOfNodeTypes = [\n \"Expression\",\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n ];\n return validator;\n })(),\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n aliases: [\n \"UserWhitespacable\",\n \"Function\",\n \"Scopable\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Method\",\n \"ObjectMember\",\n ],\n});\n\ndefineType(\"ObjectProperty\", {\n builder: [\n \"key\",\n \"value\",\n \"computed\",\n \"shorthand\",\n ...(!process.env.BABEL_TYPES_8_BREAKING ? [\"decorators\"] : []),\n ],\n fields: {\n computed: {\n default: false,\n },\n key: {\n validate: (function () {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n \"DecimalLiteral\",\n \"PrivateName\",\n );\n const computed = assertNodeType(\"Expression\");\n\n const validator: Validator = Object.assign(\n function (node: t.ObjectProperty, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n } as Validator,\n {\n // todo(ts): can be discriminated union by `computed` property\n oneOfNodeTypes: [\n \"Expression\",\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n \"DecimalLiteral\",\n \"PrivateName\",\n ],\n },\n );\n return validator;\n })(),\n },\n value: {\n // Value may be PatternLike if this is an AssignmentProperty\n // https://github.com/babel/babylon/issues/434\n validate: assertNodeType(\"Expression\", \"PatternLike\"),\n },\n shorthand: {\n validate: chain(\n assertValueType(\"boolean\"),\n Object.assign(\n function (node: t.ObjectProperty, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && node.computed) {\n throw new TypeError(\n \"Property shorthand of ObjectProperty cannot be true if computed is true\",\n );\n }\n } as Validator,\n { type: \"boolean\" },\n ),\n function (node: t.ObjectProperty, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !is(\"Identifier\", node.key)) {\n throw new TypeError(\n \"Property shorthand of ObjectProperty cannot be true if key is not an Identifier\",\n );\n }\n } as Validator,\n ),\n default: false,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n visitor: [\"key\", \"value\", \"decorators\"],\n aliases: [\"UserWhitespacable\", \"Property\", \"ObjectMember\"],\n validate: (function () {\n const pattern = assertNodeType(\n \"Identifier\",\n \"Pattern\",\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSNonNullExpression\",\n \"TSTypeAssertion\",\n );\n const expression = assertNodeType(\"Expression\");\n\n return function (parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const validator = is(\"ObjectPattern\", parent) ? pattern : expression;\n validator(node, \"value\", node.value);\n };\n })(),\n});\n\ndefineType(\"RestElement\", {\n visitor: [\"argument\", \"typeAnnotation\"],\n builder: [\"argument\"],\n aliases: [\"LVal\", \"PatternLike\"],\n deprecatedAlias: \"RestProperty\",\n fields: {\n ...patternLikeCommon(),\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"LVal\")\n : assertNodeType(\n \"Identifier\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n \"MemberExpression\",\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSTypeAssertion\",\n \"TSNonNullExpression\",\n ),\n },\n },\n validate(parent: t.ArrayPattern | t.ObjectPattern, key) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const match = /(\\w+)\\[(\\d+)\\]/.exec(key);\n if (!match) throw new Error(\"Internal Babel error: malformed key.\");\n\n const [, listKey, index] = match as unknown as [\n string,\n keyof typeof parent,\n string,\n ];\n if ((parent[listKey] as t.Node[]).length > +index + 1) {\n throw new TypeError(`RestElement must be last element of ${listKey}`);\n }\n },\n});\n\ndefineType(\"ReturnStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"SequenceExpression\", {\n visitor: [\"expressions\"],\n fields: {\n expressions: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Expression\")),\n ),\n },\n },\n aliases: [\"Expression\"],\n});\n\ndefineType(\"ParenthesizedExpression\", {\n visitor: [\"expression\"],\n aliases: [\"Expression\", \"ExpressionWrapper\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"SwitchCase\", {\n visitor: [\"test\", \"consequent\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n consequent: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n});\n\ndefineType(\"SwitchStatement\", {\n visitor: [\"discriminant\", \"cases\"],\n aliases: [\"Statement\", \"BlockParent\", \"Scopable\"],\n fields: {\n discriminant: {\n validate: assertNodeType(\"Expression\"),\n },\n cases: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"SwitchCase\")),\n ),\n },\n },\n});\n\ndefineType(\"ThisExpression\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"ThrowStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"TryStatement\", {\n visitor: [\"block\", \"handler\", \"finalizer\"],\n aliases: [\"Statement\"],\n fields: {\n block: {\n validate: chain(\n assertNodeType(\"BlockStatement\"),\n Object.assign(\n function (node: t.TryStatement) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (!node.handler && !node.finalizer) {\n throw new TypeError(\n \"TryStatement expects either a handler or finalizer, or both\",\n );\n }\n } as Validator,\n {\n oneOfNodeTypes: [\"BlockStatement\"],\n },\n ),\n ),\n },\n handler: {\n optional: true,\n validate: assertNodeType(\"CatchClause\"),\n },\n finalizer: {\n optional: true,\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"UnaryExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: true,\n },\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n operator: {\n validate: assertOneOf(...UNARY_OPERATORS),\n },\n },\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\", \"Expression\"],\n});\n\ndefineType(\"UpdateExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: false,\n },\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"Expression\")\n : assertNodeType(\"Identifier\", \"MemberExpression\"),\n },\n operator: {\n validate: assertOneOf(...UPDATE_OPERATORS),\n },\n },\n visitor: [\"argument\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"VariableDeclaration\", {\n builder: [\"kind\", \"declarations\"],\n visitor: [\"declarations\"],\n aliases: [\"Statement\", \"Declaration\"],\n fields: {\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n kind: {\n validate: assertOneOf(\n \"var\",\n \"let\",\n \"const\",\n // https://github.com/tc39/proposal-explicit-resource-management\n \"using\",\n // https://github.com/tc39/proposal-async-explicit-resource-management\n \"await using\",\n ),\n },\n declarations: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"VariableDeclarator\")),\n ),\n },\n },\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!is(\"ForXStatement\", parent, { left: node })) return;\n if (node.declarations.length !== 1) {\n throw new TypeError(\n `Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`,\n );\n }\n },\n});\n\ndefineType(\"VariableDeclarator\", {\n visitor: [\"id\", \"init\"],\n fields: {\n id: {\n validate: (function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertNodeType(\"LVal\");\n }\n\n const normal = assertNodeType(\n \"Identifier\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n );\n const without = assertNodeType(\"Identifier\");\n\n return function (node: t.VariableDeclarator, key, val) {\n const validator = node.init ? normal : without;\n validator(node, key, val);\n };\n })(),\n },\n definite: {\n optional: true,\n validate: assertValueType(\"boolean\"),\n },\n init: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"WhileStatement\", {\n visitor: [\"test\", \"body\"],\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"WithStatement\", {\n visitor: [\"object\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\n// --- ES2015 ---\ndefineType(\"AssignmentPattern\", {\n visitor: [\"left\", \"right\", \"decorators\" /* for legacy param decorators */],\n builder: [\"left\", \"right\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon(),\n left: {\n validate: assertNodeType(\n \"Identifier\",\n \"ObjectPattern\",\n \"ArrayPattern\",\n \"MemberExpression\",\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSTypeAssertion\",\n \"TSNonNullExpression\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n // For TypeScript\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ArrayPattern\", {\n visitor: [\"elements\", \"typeAnnotation\"],\n builder: [\"elements\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon(),\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeOrValueType(\"null\", \"PatternLike\", \"LVal\")),\n ),\n },\n },\n});\n\ndefineType(\"ArrowFunctionExpression\", {\n builder: [\"params\", \"body\", \"async\"],\n visitor: [\"params\", \"body\", \"returnType\", \"typeParameters\"],\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Expression\",\n \"Pureish\",\n ],\n fields: {\n ...functionCommon(),\n ...functionTypeAnnotationCommon(),\n expression: {\n // https://github.com/babel/babylon/issues/505\n validate: assertValueType(\"boolean\"),\n },\n body: {\n validate: assertNodeType(\"BlockStatement\", \"Expression\"),\n },\n predicate: {\n validate: assertNodeType(\"DeclaredPredicate\", \"InferredPredicate\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassBody\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"ClassMethod\",\n \"ClassPrivateMethod\",\n \"ClassProperty\",\n \"ClassPrivateProperty\",\n \"ClassAccessorProperty\",\n \"TSDeclareMethod\",\n \"TSIndexSignature\",\n \"StaticBlock\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"ClassExpression\", {\n builder: [\"id\", \"superClass\", \"body\", \"decorators\"],\n visitor: [\n \"id\",\n \"body\",\n \"superClass\",\n \"mixins\",\n \"typeParameters\",\n \"superTypeParameters\",\n \"implements\",\n \"decorators\",\n ],\n aliases: [\"Scopable\", \"Class\", \"Expression\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n // In declarations, this is missing if this is the\n // child of an ExportDefaultDeclaration.\n optional: true,\n },\n typeParameters: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n )\n : assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"ClassBody\"),\n },\n superClass: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n superTypeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n implements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"TSExpressionWithTypeArguments\", \"ClassImplements\"),\n ),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n mixins: {\n validate: assertNodeType(\"InterfaceExtends\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassDeclaration\", {\n inherits: \"ClassExpression\",\n aliases: [\"Scopable\", \"Class\", \"Statement\", \"Declaration\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n },\n typeParameters: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n )\n : assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"ClassBody\"),\n },\n superClass: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n superTypeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n implements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"TSExpressionWithTypeArguments\", \"ClassImplements\"),\n ),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n mixins: {\n validate: assertNodeType(\"InterfaceExtends\"),\n optional: true,\n },\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n abstract: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n validate: (function () {\n const identifier = assertNodeType(\"Identifier\");\n\n return function (parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!is(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n })(),\n});\n\ndefineType(\"ExportAllDeclaration\", {\n builder: [\"source\"],\n visitor: [\"source\", \"attributes\", \"assertions\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ImportOrExportDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n attributes: {\n optional: true,\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ImportAttribute\")),\n ),\n },\n // TODO(Babel 8): Deprecated\n assertions: {\n optional: true,\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ImportAttribute\")),\n ),\n },\n },\n});\n\ndefineType(\"ExportDefaultDeclaration\", {\n visitor: [\"declaration\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ImportOrExportDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n declaration: {\n validate: assertNodeType(\n \"TSDeclareFunction\",\n \"FunctionDeclaration\",\n \"ClassDeclaration\",\n \"Expression\",\n ),\n },\n exportKind: validateOptional(assertOneOf(\"value\")),\n },\n});\n\ndefineType(\"ExportNamedDeclaration\", {\n builder: [\"declaration\", \"specifiers\", \"source\"],\n visitor: [\"declaration\", \"specifiers\", \"source\", \"attributes\", \"assertions\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ImportOrExportDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n declaration: {\n optional: true,\n validate: chain(\n assertNodeType(\"Declaration\"),\n Object.assign(\n function (node: t.ExportNamedDeclaration, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (val && node.specifiers.length) {\n throw new TypeError(\n \"Only declaration or specifiers is allowed on ExportNamedDeclaration\",\n );\n }\n } as Validator,\n { oneOfNodeTypes: [\"Declaration\"] },\n ),\n function (node: t.ExportNamedDeclaration, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (val && node.source) {\n throw new TypeError(\"Cannot export a declaration from a source\");\n }\n },\n ),\n },\n attributes: {\n optional: true,\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ImportAttribute\")),\n ),\n },\n // TODO(Babel 8): Deprecated\n assertions: {\n optional: true,\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ImportAttribute\")),\n ),\n },\n specifiers: {\n default: [],\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n (function () {\n const sourced = assertNodeType(\n \"ExportSpecifier\",\n \"ExportDefaultSpecifier\",\n \"ExportNamespaceSpecifier\",\n );\n const sourceless = assertNodeType(\"ExportSpecifier\");\n\n if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;\n\n return function (node: t.ExportNamedDeclaration, key, val) {\n const validator = node.source ? sourced : sourceless;\n validator(node, key, val);\n } as Validator;\n })(),\n ),\n ),\n },\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n optional: true,\n },\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n },\n});\n\ndefineType(\"ExportSpecifier\", {\n visitor: [\"local\", \"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n exported: {\n validate: assertNodeType(\"Identifier\", \"StringLiteral\"),\n },\n exportKind: {\n // And TypeScript's \"export { type foo } from\"\n validate: assertOneOf(\"type\", \"value\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ForOfStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n builder: [\"left\", \"right\", \"body\", \"await\"],\n aliases: [\n \"Scopable\",\n \"Statement\",\n \"For\",\n \"BlockParent\",\n \"Loop\",\n \"ForXStatement\",\n ],\n fields: {\n left: {\n validate: (function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertNodeType(\"VariableDeclaration\", \"LVal\");\n }\n\n const declaration = assertNodeType(\"VariableDeclaration\");\n const lval = assertNodeType(\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSTypeAssertion\",\n \"TSNonNullExpression\",\n );\n\n return function (node, key, val) {\n if (is(\"VariableDeclaration\", val)) {\n declaration(node, key, val);\n } else {\n lval(node, key, val);\n }\n };\n })(),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n await: {\n default: false,\n },\n },\n});\n\ndefineType(\"ImportDeclaration\", {\n builder: [\"specifiers\", \"source\"],\n visitor: [\"specifiers\", \"source\", \"attributes\", \"assertions\"],\n aliases: [\"Statement\", \"Declaration\", \"ImportOrExportDeclaration\"],\n fields: {\n attributes: {\n optional: true,\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ImportAttribute\")),\n ),\n },\n // TODO(Babel 8): Deprecated\n assertions: {\n optional: true,\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ImportAttribute\")),\n ),\n },\n module: {\n optional: true,\n validate: assertValueType(\"boolean\"),\n },\n specifiers: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"ImportSpecifier\",\n \"ImportDefaultSpecifier\",\n \"ImportNamespaceSpecifier\",\n ),\n ),\n ),\n },\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n importKind: {\n // Handle TypeScript/Flowtype's extension \"import type foo from\"\n // TypeScript doesn't support typeof\n validate: assertOneOf(\"type\", \"typeof\", \"value\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ImportDefaultSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ImportNamespaceSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ImportSpecifier\", {\n visitor: [\"local\", \"imported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n imported: {\n validate: assertNodeType(\"Identifier\", \"StringLiteral\"),\n },\n importKind: {\n // Handle Flowtype's extension \"import {typeof foo} from\"\n // And TypeScript's \"import { type foo } from\"\n validate: assertOneOf(\"type\", \"typeof\", \"value\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"MetaProperty\", {\n visitor: [\"meta\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n meta: {\n validate: chain(\n assertNodeType(\"Identifier\"),\n Object.assign(\n function (node: t.MetaProperty, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n let property;\n switch (val.name) {\n case \"function\":\n property = \"sent\";\n break;\n case \"new\":\n property = \"target\";\n break;\n case \"import\":\n property = \"meta\";\n break;\n }\n if (!is(\"Identifier\", node.property, { name: property })) {\n throw new TypeError(\"Unrecognised MetaProperty\");\n }\n } as Validator,\n { oneOfNodeTypes: [\"Identifier\"] },\n ),\n ),\n },\n property: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\nexport const classMethodOrPropertyCommon = () => ({\n abstract: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n static: {\n default: false,\n },\n override: {\n default: false,\n },\n computed: {\n default: false,\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n key: {\n validate: chain(\n (function () {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function (node: any, key: string, val: any) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n \"Expression\",\n ),\n ),\n },\n});\n\nexport const classMethodOrDeclareMethodCommon = () => ({\n ...functionCommon(),\n ...classMethodOrPropertyCommon(),\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Identifier\",\n \"Pattern\",\n \"RestElement\",\n \"TSParameterProperty\",\n ),\n ),\n ),\n },\n kind: {\n validate: assertOneOf(\"get\", \"set\", \"method\", \"constructor\"),\n default: \"method\",\n },\n access: {\n validate: chain(\n assertValueType(\"string\"),\n assertOneOf(\"public\", \"private\", \"protected\"),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n});\n\ndefineType(\"ClassMethod\", {\n aliases: [\"Function\", \"Scopable\", \"BlockParent\", \"FunctionParent\", \"Method\"],\n builder: [\n \"kind\",\n \"key\",\n \"params\",\n \"body\",\n \"computed\",\n \"static\",\n \"generator\",\n \"async\",\n ],\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n fields: {\n ...classMethodOrDeclareMethodCommon(),\n ...functionTypeAnnotationCommon(),\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"ObjectPattern\", {\n visitor: [\n \"properties\",\n \"typeAnnotation\",\n \"decorators\" /* for legacy param decorators */,\n ],\n builder: [\"properties\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon(),\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"RestElement\", \"ObjectProperty\")),\n ),\n },\n },\n});\n\ndefineType(\"SpreadElement\", {\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\"],\n deprecatedAlias: \"SpreadProperty\",\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\n \"Super\",\n process.env.BABEL_8_BREAKING\n ? undefined\n : {\n aliases: [\"Expression\"],\n },\n);\n\ndefineType(\"TaggedTemplateExpression\", {\n visitor: [\"tag\", \"quasi\", \"typeParameters\"],\n builder: [\"tag\", \"quasi\"],\n aliases: [\"Expression\"],\n fields: {\n tag: {\n validate: assertNodeType(\"Expression\"),\n },\n quasi: {\n validate: assertNodeType(\"TemplateLiteral\"),\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"TemplateElement\", {\n builder: [\"value\", \"tail\"],\n fields: {\n value: {\n validate: chain(\n assertShape({\n raw: {\n validate: assertValueType(\"string\"),\n },\n cooked: {\n validate: assertValueType(\"string\"),\n optional: true,\n },\n }),\n function templateElementCookedValidator(node: t.TemplateElement) {\n const raw = node.value.raw;\n\n let unterminatedCalled = false;\n\n const error = () => {\n // unreachable\n throw new Error(\"Internal @babel/types error.\");\n };\n const { str, firstInvalidLoc } = readStringContents(\n \"template\",\n raw,\n 0,\n 0,\n 0,\n {\n unterminated() {\n unterminatedCalled = true;\n },\n strictNumericEscape: error,\n invalidEscapeSequence: error,\n numericSeparatorInEscapeSequence: error,\n unexpectedNumericSeparator: error,\n invalidDigit: error,\n invalidCodePoint: error,\n },\n );\n if (!unterminatedCalled) throw new Error(\"Invalid raw\");\n\n node.value.cooked = firstInvalidLoc ? null : str;\n },\n ),\n },\n tail: {\n default: false,\n },\n },\n});\n\ndefineType(\"TemplateLiteral\", {\n visitor: [\"quasis\", \"expressions\"],\n aliases: [\"Expression\", \"Literal\"],\n fields: {\n quasis: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TemplateElement\")),\n ),\n },\n expressions: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Expression\",\n // For TypeScript template literal types\n \"TSType\",\n ),\n ),\n function (node: t.TemplateLiteral, key, val) {\n if (node.quasis.length !== val.length + 1) {\n throw new TypeError(\n `Number of ${\n node.type\n } quasis should be exactly one more than the number of expressions.\\nExpected ${\n val.length + 1\n } quasis but got ${node.quasis.length}`,\n );\n }\n } as Validator,\n ),\n },\n },\n});\n\ndefineType(\"YieldExpression\", {\n builder: [\"argument\", \"delegate\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n delegate: {\n validate: chain(\n assertValueType(\"boolean\"),\n Object.assign(\n function (node: t.YieldExpression, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !node.argument) {\n throw new TypeError(\n \"Property delegate of YieldExpression cannot be true if there is no argument\",\n );\n }\n } as Validator,\n { type: \"boolean\" },\n ),\n ),\n default: false,\n },\n argument: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\n// --- ES2017 ---\ndefineType(\"AwaitExpression\", {\n builder: [\"argument\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\n// --- ES2019 ---\ndefineType(\"Import\", {\n aliases: [\"Expression\"],\n});\n\n// --- ES2020 ---\ndefineType(\"BigIntLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"ExportNamespaceSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"OptionalMemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n property: {\n validate: (function () {\n const normal = assertNodeType(\"Identifier\");\n const computed = assertNodeType(\"Expression\");\n\n const validator: Validator = Object.assign(\n function (node: t.OptionalMemberExpression, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n } as Validator,\n // todo(ts): can be discriminated union by `computed` property\n { oneOfNodeTypes: [\"Expression\", \"Identifier\"] },\n );\n return validator;\n })(),\n },\n computed: {\n default: false,\n },\n optional: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertValueType(\"boolean\")\n : chain(assertValueType(\"boolean\"), assertOptionalChainStart()),\n },\n },\n});\n\ndefineType(\"OptionalCallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\", \"optional\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n arguments: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Expression\",\n \"SpreadElement\",\n \"JSXNamespacedName\",\n \"ArgumentPlaceholder\",\n ),\n ),\n ),\n },\n optional: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertValueType(\"boolean\")\n : chain(assertValueType(\"boolean\"), assertOptionalChainStart()),\n },\n typeArguments: {\n validate: assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n },\n});\n\n// --- ES2022 ---\ndefineType(\"ClassProperty\", {\n visitor: [\"key\", \"value\", \"typeAnnotation\", \"decorators\"],\n builder: [\n \"key\",\n \"value\",\n \"typeAnnotation\",\n \"decorators\",\n \"computed\",\n \"static\",\n ],\n aliases: [\"Property\"],\n fields: {\n ...classMethodOrPropertyCommon(),\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n definite: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n typeAnnotation: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\")\n : assertNodeType(\n \"TypeAnnotation\",\n \"TSTypeAnnotation\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n variance: {\n validate: assertNodeType(\"Variance\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassAccessorProperty\", {\n visitor: [\"key\", \"value\", \"typeAnnotation\", \"decorators\"],\n builder: [\n \"key\",\n \"value\",\n \"typeAnnotation\",\n \"decorators\",\n \"computed\",\n \"static\",\n ],\n aliases: [\"Property\", \"Accessor\"],\n fields: {\n ...classMethodOrPropertyCommon(),\n key: {\n validate: chain(\n (function () {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n \"PrivateName\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function (node: any, key: string, val: any) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n \"Expression\",\n \"PrivateName\",\n ),\n ),\n },\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n definite: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n typeAnnotation: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\")\n : assertNodeType(\n \"TypeAnnotation\",\n \"TSTypeAnnotation\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n variance: {\n validate: assertNodeType(\"Variance\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassPrivateProperty\", {\n visitor: [\"key\", \"value\", \"decorators\", \"typeAnnotation\"],\n builder: [\"key\", \"value\", \"decorators\", \"static\"],\n aliases: [\"Property\", \"Private\"],\n fields: {\n key: {\n validate: assertNodeType(\"PrivateName\"),\n },\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n typeAnnotation: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\")\n : assertNodeType(\n \"TypeAnnotation\",\n \"TSTypeAnnotation\",\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n \"Noop\",\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n static: {\n validate: assertValueType(\"boolean\"),\n default: false,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n definite: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n variance: {\n validate: assertNodeType(\"Variance\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassPrivateMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"static\"],\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n aliases: [\n \"Function\",\n \"Scopable\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Method\",\n \"Private\",\n ],\n fields: {\n ...classMethodOrDeclareMethodCommon(),\n ...functionTypeAnnotationCommon(),\n kind: {\n validate: assertOneOf(\"get\", \"set\", \"method\"),\n default: \"method\",\n },\n key: {\n validate: assertNodeType(\"PrivateName\"),\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"PrivateName\", {\n visitor: [\"id\"],\n aliases: [\"Private\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"StaticBlock\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"FunctionParent\"],\n});\n","import {\n defineAliasedType,\n arrayOfType,\n assertOneOf,\n assertValueType,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n} from \"./utils\";\n\nconst defineType = defineAliasedType(\"Flow\");\n\nconst defineInterfaceishType = (\n name: \"DeclareClass\" | \"DeclareInterface\" | \"InterfaceDeclaration\",\n) => {\n const isDeclareClass = name === \"DeclareClass\";\n\n defineType(name, {\n builder: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n visitor: [\n \"id\",\n \"typeParameters\",\n \"extends\",\n ...(isDeclareClass ? [\"mixins\", \"implements\"] : []),\n \"body\",\n ],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n extends: validateOptional(arrayOfType(\"InterfaceExtends\")),\n ...(isDeclareClass\n ? {\n mixins: validateOptional(arrayOfType(\"InterfaceExtends\")),\n implements: validateOptional(arrayOfType(\"ClassImplements\")),\n }\n : {}),\n body: validateType(\"ObjectTypeAnnotation\"),\n },\n });\n};\n\ndefineType(\"AnyTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ArrayTypeAnnotation\", {\n visitor: [\"elementType\"],\n aliases: [\"FlowType\"],\n fields: {\n elementType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"BooleanTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"BooleanLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"FlowType\"],\n fields: {\n value: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"NullLiteralTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ClassImplements\", {\n visitor: [\"id\", \"typeParameters\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineInterfaceishType(\"DeclareClass\");\n\ndefineType(\"DeclareFunction\", {\n visitor: [\"id\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n predicate: validateOptionalType(\"DeclaredPredicate\"),\n },\n});\n\ndefineInterfaceishType(\"DeclareInterface\");\n\ndefineType(\"DeclareModule\", {\n builder: [\"id\", \"body\", \"kind\"],\n visitor: [\"id\", \"body\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n body: validateType(\"BlockStatement\"),\n kind: validateOptional(assertOneOf(\"CommonJS\", \"ES\")),\n },\n});\n\ndefineType(\"DeclareModuleExports\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n typeAnnotation: validateType(\"TypeAnnotation\"),\n },\n});\n\ndefineType(\"DeclareTypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n right: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"DeclareOpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n supertype: validateOptionalType(\"FlowType\"),\n impltype: validateOptionalType(\"FlowType\"),\n },\n});\n\ndefineType(\"DeclareVariable\", {\n visitor: [\"id\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"DeclareExportDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n declaration: validateOptionalType(\"Flow\"),\n specifiers: validateOptional(\n arrayOfType([\"ExportSpecifier\", \"ExportNamespaceSpecifier\"]),\n ),\n source: validateOptionalType(\"StringLiteral\"),\n default: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"DeclareExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n source: validateType(\"StringLiteral\"),\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n },\n});\n\ndefineType(\"DeclaredPredicate\", {\n visitor: [\"value\"],\n aliases: [\"FlowPredicate\"],\n fields: {\n value: validateType(\"Flow\"),\n },\n});\n\ndefineType(\"ExistsTypeAnnotation\", {\n aliases: [\"FlowType\"],\n});\n\ndefineType(\"FunctionTypeAnnotation\", {\n visitor: [\"typeParameters\", \"params\", \"rest\", \"returnType\"],\n aliases: [\"FlowType\"],\n fields: {\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n params: validate(arrayOfType(\"FunctionTypeParam\")),\n rest: validateOptionalType(\"FunctionTypeParam\"),\n this: validateOptionalType(\"FunctionTypeParam\"),\n returnType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"FunctionTypeParam\", {\n visitor: [\"name\", \"typeAnnotation\"],\n fields: {\n name: validateOptionalType(\"Identifier\"),\n typeAnnotation: validateType(\"FlowType\"),\n optional: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"GenericTypeAnnotation\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"FlowType\"],\n fields: {\n id: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"InferredPredicate\", {\n aliases: [\"FlowPredicate\"],\n});\n\ndefineType(\"InterfaceExtends\", {\n visitor: [\"id\", \"typeParameters\"],\n fields: {\n id: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineInterfaceishType(\"InterfaceDeclaration\");\n\ndefineType(\"InterfaceTypeAnnotation\", {\n visitor: [\"extends\", \"body\"],\n aliases: [\"FlowType\"],\n fields: {\n extends: validateOptional(arrayOfType(\"InterfaceExtends\")),\n body: validateType(\"ObjectTypeAnnotation\"),\n },\n});\n\ndefineType(\"IntersectionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"MixedTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"EmptyTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"NullableTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"FlowType\"],\n fields: {\n typeAnnotation: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"NumberLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"FlowType\"],\n fields: {\n value: validate(assertValueType(\"number\")),\n },\n});\n\ndefineType(\"NumberTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ObjectTypeAnnotation\", {\n visitor: [\"properties\", \"indexers\", \"callProperties\", \"internalSlots\"],\n aliases: [\"FlowType\"],\n builder: [\n \"properties\",\n \"indexers\",\n \"callProperties\",\n \"internalSlots\",\n \"exact\",\n ],\n fields: {\n properties: validate(\n arrayOfType([\"ObjectTypeProperty\", \"ObjectTypeSpreadProperty\"]),\n ),\n indexers: {\n validate: arrayOfType(\"ObjectTypeIndexer\"),\n optional: process.env.BABEL_8_BREAKING ? false : true,\n default: [],\n },\n callProperties: {\n validate: arrayOfType(\"ObjectTypeCallProperty\"),\n optional: process.env.BABEL_8_BREAKING ? false : true,\n default: [],\n },\n internalSlots: {\n validate: arrayOfType(\"ObjectTypeInternalSlot\"),\n optional: process.env.BABEL_8_BREAKING ? false : true,\n default: [],\n },\n exact: {\n validate: assertValueType(\"boolean\"),\n default: false,\n },\n // If the inexact flag is present then this is an object type, and not a\n // declare class, declare interface, or interface. If it is true, the\n // object uses ... to express that it is inexact.\n inexact: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeInternalSlot\", {\n visitor: [\"id\", \"value\", \"optional\", \"static\", \"method\"],\n aliases: [\"UserWhitespacable\"],\n fields: {\n id: validateType(\"Identifier\"),\n value: validateType(\"FlowType\"),\n optional: validate(assertValueType(\"boolean\")),\n static: validate(assertValueType(\"boolean\")),\n method: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeCallProperty\", {\n visitor: [\"value\"],\n aliases: [\"UserWhitespacable\"],\n fields: {\n value: validateType(\"FlowType\"),\n static: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeIndexer\", {\n visitor: [\"id\", \"key\", \"value\", \"variance\"],\n aliases: [\"UserWhitespacable\"],\n fields: {\n id: validateOptionalType(\"Identifier\"),\n key: validateType(\"FlowType\"),\n value: validateType(\"FlowType\"),\n static: validate(assertValueType(\"boolean\")),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"ObjectTypeProperty\", {\n visitor: [\"key\", \"value\", \"variance\"],\n aliases: [\"UserWhitespacable\"],\n fields: {\n key: validateType([\"Identifier\", \"StringLiteral\"]),\n value: validateType(\"FlowType\"),\n kind: validate(assertOneOf(\"init\", \"get\", \"set\")),\n static: validate(assertValueType(\"boolean\")),\n proto: validate(assertValueType(\"boolean\")),\n optional: validate(assertValueType(\"boolean\")),\n variance: validateOptionalType(\"Variance\"),\n method: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeSpreadProperty\", {\n visitor: [\"argument\"],\n aliases: [\"UserWhitespacable\"],\n fields: {\n argument: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"OpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\", \"impltype\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n supertype: validateOptionalType(\"FlowType\"),\n impltype: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"QualifiedTypeIdentifier\", {\n visitor: [\"id\", \"qualification\"],\n fields: {\n id: validateType(\"Identifier\"),\n qualification: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n },\n});\n\ndefineType(\"StringLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"FlowType\"],\n fields: {\n value: validate(assertValueType(\"string\")),\n },\n});\n\ndefineType(\"StringTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"SymbolTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ThisTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"TupleTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"TypeofTypeAnnotation\", {\n visitor: [\"argument\"],\n aliases: [\"FlowType\"],\n fields: {\n argument: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n right: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeCastExpression\", {\n visitor: [\"expression\", \"typeAnnotation\"],\n aliases: [\"ExpressionWrapper\", \"Expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeAnnotation: validateType(\"TypeAnnotation\"),\n },\n});\n\ndefineType(\"TypeParameter\", {\n visitor: [\"bound\", \"default\", \"variance\"],\n fields: {\n name: validate(assertValueType(\"string\")),\n bound: validateOptionalType(\"TypeAnnotation\"),\n default: validateOptionalType(\"FlowType\"),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"TypeParameterDeclaration\", {\n visitor: [\"params\"],\n fields: {\n params: validate(arrayOfType(\"TypeParameter\")),\n },\n});\n\ndefineType(\"TypeParameterInstantiation\", {\n visitor: [\"params\"],\n fields: {\n params: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"UnionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"Variance\", {\n builder: [\"kind\"],\n fields: {\n kind: validate(assertOneOf(\"minus\", \"plus\")),\n },\n});\n\ndefineType(\"VoidTypeAnnotation\", {\n aliases: [\"FlowType\", \"FlowBaseAnnotation\"],\n});\n\n// Enums\ndefineType(\"EnumDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n id: validateType(\"Identifier\"),\n body: validateType([\n \"EnumBooleanBody\",\n \"EnumNumberBody\",\n \"EnumStringBody\",\n \"EnumSymbolBody\",\n ]),\n },\n});\n\ndefineType(\"EnumBooleanBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicitType: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType(\"EnumBooleanMember\"),\n hasUnknownMembers: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"EnumNumberBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicitType: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType(\"EnumNumberMember\"),\n hasUnknownMembers: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"EnumStringBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicitType: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType([\"EnumStringMember\", \"EnumDefaultedMember\"]),\n hasUnknownMembers: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"EnumSymbolBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n members: validateArrayOfType(\"EnumDefaultedMember\"),\n hasUnknownMembers: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"EnumBooleanMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"BooleanLiteral\"),\n },\n});\n\ndefineType(\"EnumNumberMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"NumericLiteral\"),\n },\n});\n\ndefineType(\"EnumStringMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"StringLiteral\"),\n },\n});\n\ndefineType(\"EnumDefaultedMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"IndexedAccessType\", {\n visitor: [\"objectType\", \"indexType\"],\n aliases: [\"FlowType\"],\n fields: {\n objectType: validateType(\"FlowType\"),\n indexType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"OptionalIndexedAccessType\", {\n visitor: [\"objectType\", \"indexType\"],\n aliases: [\"FlowType\"],\n fields: {\n objectType: validateType(\"FlowType\"),\n indexType: validateType(\"FlowType\"),\n optional: validate(assertValueType(\"boolean\")),\n },\n});\n","import {\n defineAliasedType,\n assertNodeType,\n assertValueType,\n chain,\n assertEach,\n} from \"./utils\";\n\nconst defineType = defineAliasedType(\"JSX\");\n\ndefineType(\"JSXAttribute\", {\n visitor: [\"name\", \"value\"],\n aliases: [\"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\"JSXIdentifier\", \"JSXNamespacedName\"),\n },\n value: {\n optional: true,\n validate: assertNodeType(\n \"JSXElement\",\n \"JSXFragment\",\n \"StringLiteral\",\n \"JSXExpressionContainer\",\n ),\n },\n },\n});\n\ndefineType(\"JSXClosingElement\", {\n visitor: [\"name\"],\n aliases: [\"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n },\n});\n\ndefineType(\"JSXElement\", {\n builder: process.env.BABEL_8_BREAKING\n ? [\"openingElement\", \"closingElement\", \"children\"]\n : [\"openingElement\", \"closingElement\", \"children\", \"selfClosing\"],\n visitor: [\"openingElement\", \"children\", \"closingElement\"],\n aliases: [\"Immutable\", \"Expression\"],\n fields: {\n openingElement: {\n validate: assertNodeType(\"JSXOpeningElement\"),\n },\n closingElement: {\n optional: true,\n validate: assertNodeType(\"JSXClosingElement\"),\n },\n children: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ),\n ),\n },\n ...(process.env.BABEL_8_BREAKING\n ? {}\n : {\n selfClosing: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n }),\n },\n});\n\ndefineType(\"JSXEmptyExpression\", {});\n\ndefineType(\"JSXExpressionContainer\", {\n visitor: [\"expression\"],\n aliases: [\"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\", \"JSXEmptyExpression\"),\n },\n },\n});\n\ndefineType(\"JSXSpreadChild\", {\n visitor: [\"expression\"],\n aliases: [\"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXMemberExpression\", {\n visitor: [\"object\", \"property\"],\n fields: {\n object: {\n validate: assertNodeType(\"JSXMemberExpression\", \"JSXIdentifier\"),\n },\n property: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXNamespacedName\", {\n visitor: [\"namespace\", \"name\"],\n fields: {\n namespace: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n name: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXOpeningElement\", {\n builder: [\"name\", \"attributes\", \"selfClosing\"],\n visitor: [\"name\", \"attributes\"],\n aliases: [\"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n selfClosing: {\n default: false,\n },\n attributes: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"JSXAttribute\", \"JSXSpreadAttribute\")),\n ),\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"JSXSpreadAttribute\", {\n visitor: [\"argument\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXText\", {\n aliases: [\"Immutable\"],\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXFragment\", {\n builder: [\"openingFragment\", \"closingFragment\", \"children\"],\n visitor: [\"openingFragment\", \"children\", \"closingFragment\"],\n aliases: [\"Immutable\", \"Expression\"],\n fields: {\n openingFragment: {\n validate: assertNodeType(\"JSXOpeningFragment\"),\n },\n closingFragment: {\n validate: assertNodeType(\"JSXClosingFragment\"),\n },\n children: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"JSXOpeningFragment\", {\n aliases: [\"Immutable\"],\n});\n\ndefineType(\"JSXClosingFragment\", {\n aliases: [\"Immutable\"],\n});\n","import { ALIAS_KEYS } from \"./utils\";\n\nexport const PLACEHOLDERS = [\n \"Identifier\",\n \"StringLiteral\",\n \"Expression\",\n \"Statement\",\n \"Declaration\",\n \"BlockStatement\",\n \"ClassBody\",\n \"Pattern\",\n] as const;\n\nexport const PLACEHOLDERS_ALIAS: Record = {\n Declaration: [\"Statement\"],\n Pattern: [\"PatternLike\", \"LVal\"],\n};\n\nfor (const type of PLACEHOLDERS) {\n const alias = ALIAS_KEYS[type];\n if (alias?.length) PLACEHOLDERS_ALIAS[type] = alias;\n}\n\nexport const PLACEHOLDERS_FLIPPED_ALIAS: Record = {};\n\nObject.keys(PLACEHOLDERS_ALIAS).forEach(type => {\n PLACEHOLDERS_ALIAS[type].forEach(alias => {\n if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {\n PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];\n }\n PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);\n });\n});\n","import {\n defineAliasedType,\n assertNodeType,\n assertOneOf,\n assertValueType,\n} from \"./utils\";\nimport { PLACEHOLDERS } from \"./placeholders\";\n\nconst defineType = defineAliasedType(\"Miscellaneous\");\n\nif (!process.env.BABEL_8_BREAKING) {\n defineType(\"Noop\", {\n visitor: [],\n });\n}\n\ndefineType(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n // aliases: [], defined in placeholders.js\n fields: {\n name: {\n validate: assertNodeType(\"Identifier\"),\n },\n expectedNode: {\n validate: assertOneOf(...PLACEHOLDERS),\n },\n },\n});\n\ndefineType(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n","import defineType, {\n assertEach,\n assertNodeType,\n assertValueType,\n chain,\n} from \"./utils\";\n\ndefineType(\"ArgumentPlaceholder\", {});\n\ndefineType(\"BindExpression\", {\n visitor: [\"object\", \"callee\"],\n aliases: [\"Expression\"],\n fields: !process.env.BABEL_TYPES_8_BREAKING\n ? {\n object: {\n validate: Object.assign(() => {}, {\n oneOfNodeTypes: [\"Expression\"],\n }),\n },\n callee: {\n validate: Object.assign(() => {}, {\n oneOfNodeTypes: [\"Expression\"],\n }),\n },\n }\n : {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"ImportAttribute\", {\n visitor: [\"key\", \"value\"],\n fields: {\n key: {\n validate: assertNodeType(\"Identifier\", \"StringLiteral\"),\n },\n value: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n },\n});\n\ndefineType(\"Decorator\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"DoExpression\", {\n visitor: [\"body\"],\n builder: [\"body\", \"async\"],\n aliases: [\"Expression\"],\n fields: {\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n async: {\n validate: assertValueType(\"boolean\"),\n default: false,\n },\n },\n});\n\ndefineType(\"ExportDefaultSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"RecordExpression\", {\n visitor: [\"properties\"],\n aliases: [\"Expression\"],\n fields: {\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"ObjectProperty\", \"SpreadElement\")),\n ),\n },\n },\n});\n\ndefineType(\"TupleExpression\", {\n fields: {\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Expression\", \"SpreadElement\")),\n ),\n default: [],\n },\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"DecimalLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\n// https://github.com/tc39/proposal-js-module-blocks\ndefineType(\"ModuleExpression\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: assertNodeType(\"Program\"),\n },\n },\n aliases: [\"Expression\"],\n});\n\n// https://github.com/tc39/proposal-pipeline-operator\n// https://github.com/js-choi/proposal-hack-pipes\ndefineType(\"TopicReference\", {\n aliases: [\"Expression\"],\n});\n\n// https://github.com/tc39/proposal-pipeline-operator\n// https://github.com/js-choi/proposal-smart-pipes\ndefineType(\"PipelineTopicExpression\", {\n builder: [\"expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Expression\"],\n});\n\ndefineType(\"PipelineBareFunction\", {\n builder: [\"callee\"],\n visitor: [\"callee\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Expression\"],\n});\n\ndefineType(\"PipelinePrimaryTopicReference\", {\n aliases: [\"Expression\"],\n});\n","import {\n defineAliasedType,\n arrayOfType,\n assertEach,\n assertNodeType,\n assertOneOf,\n assertValueType,\n chain,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n} from \"./utils\";\nimport {\n functionDeclarationCommon,\n classMethodOrDeclareMethodCommon,\n} from \"./core\";\nimport is from \"../validators/is\";\n\nconst defineType = defineAliasedType(\"TypeScript\");\n\nconst bool = assertValueType(\"boolean\");\n\nconst tSFunctionTypeAnnotationCommon = () => ({\n returnType: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TSTypeAnnotation\")\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n assertNodeType(\"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n typeParameters: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TSTypeParameterDeclaration\")\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n assertNodeType(\"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true,\n },\n});\n\ndefineType(\"TSParameterProperty\", {\n aliases: [\"LVal\"], // TODO: This isn't usable in general as an LVal. Should have a \"Parameter\" alias.\n visitor: [\"parameter\"],\n fields: {\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n parameter: {\n validate: assertNodeType(\"Identifier\", \"AssignmentPattern\"),\n },\n override: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"TSDeclareFunction\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...functionDeclarationCommon(),\n ...tSFunctionTypeAnnotationCommon(),\n },\n});\n\ndefineType(\"TSDeclareMethod\", {\n visitor: [\"decorators\", \"key\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...classMethodOrDeclareMethodCommon(),\n ...tSFunctionTypeAnnotationCommon(),\n },\n});\n\ndefineType(\"TSQualifiedName\", {\n aliases: [\"TSEntityName\"],\n visitor: [\"left\", \"right\"],\n fields: {\n left: validateType(\"TSEntityName\"),\n right: validateType(\"Identifier\"),\n },\n});\n\nconst signatureDeclarationCommon = () => ({\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n [process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\"]: validateArrayOfType(\n [\"Identifier\", \"RestElement\"],\n ),\n [process.env.BABEL_8_BREAKING ? \"returnType\" : \"typeAnnotation\"]:\n validateOptionalType(\"TSTypeAnnotation\"),\n});\n\nconst callConstructSignatureDeclaration = {\n aliases: [\"TSTypeElement\"],\n visitor: [\n \"typeParameters\",\n process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\",\n process.env.BABEL_8_BREAKING ? \"returnType\" : \"typeAnnotation\",\n ],\n fields: signatureDeclarationCommon(),\n};\n\ndefineType(\"TSCallSignatureDeclaration\", callConstructSignatureDeclaration);\ndefineType(\n \"TSConstructSignatureDeclaration\",\n callConstructSignatureDeclaration,\n);\n\nconst namedTypeElementCommon = () => ({\n key: validateType(\"Expression\"),\n computed: { default: false },\n optional: validateOptional(bool),\n});\n\ndefineType(\"TSPropertySignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeAnnotation\", \"initializer\"],\n fields: {\n ...namedTypeElementCommon(),\n readonly: validateOptional(bool),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n initializer: validateOptionalType(\"Expression\"),\n kind: {\n validate: assertOneOf(\"get\", \"set\"),\n },\n },\n});\n\ndefineType(\"TSMethodSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\n \"key\",\n \"typeParameters\",\n process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\",\n process.env.BABEL_8_BREAKING ? \"returnType\" : \"typeAnnotation\",\n ],\n fields: {\n ...signatureDeclarationCommon(),\n ...namedTypeElementCommon(),\n kind: {\n validate: assertOneOf(\"method\", \"get\", \"set\"),\n },\n },\n});\n\ndefineType(\"TSIndexSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"parameters\", \"typeAnnotation\"],\n fields: {\n readonly: validateOptional(bool),\n static: validateOptional(bool),\n parameters: validateArrayOfType(\"Identifier\"), // Length must be 1\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n },\n});\n\nconst tsKeywordTypes = [\n \"TSAnyKeyword\",\n \"TSBooleanKeyword\",\n \"TSBigIntKeyword\",\n \"TSIntrinsicKeyword\",\n \"TSNeverKeyword\",\n \"TSNullKeyword\",\n \"TSNumberKeyword\",\n \"TSObjectKeyword\",\n \"TSStringKeyword\",\n \"TSSymbolKeyword\",\n \"TSUndefinedKeyword\",\n \"TSUnknownKeyword\",\n \"TSVoidKeyword\",\n] as const;\n\nfor (const type of tsKeywordTypes) {\n defineType(type, {\n aliases: [\"TSType\", \"TSBaseType\"],\n visitor: [],\n fields: {},\n });\n}\n\ndefineType(\"TSThisType\", {\n aliases: [\"TSType\", \"TSBaseType\"],\n visitor: [],\n fields: {},\n});\n\nconst fnOrCtrBase = {\n aliases: [\"TSType\"],\n visitor: [\n \"typeParameters\",\n process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\",\n process.env.BABEL_8_BREAKING ? \"returnType\" : \"typeAnnotation\",\n ],\n};\n\ndefineType(\"TSFunctionType\", {\n ...fnOrCtrBase,\n fields: signatureDeclarationCommon(),\n});\ndefineType(\"TSConstructorType\", {\n ...fnOrCtrBase,\n fields: {\n ...signatureDeclarationCommon(),\n abstract: validateOptional(bool),\n },\n});\n\ndefineType(\"TSTypeReference\", {\n aliases: [\"TSType\"],\n visitor: [\"typeName\", \"typeParameters\"],\n fields: {\n typeName: validateType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSTypePredicate\", {\n aliases: [\"TSType\"],\n visitor: [\"parameterName\", \"typeAnnotation\"],\n builder: [\"parameterName\", \"typeAnnotation\", \"asserts\"],\n fields: {\n parameterName: validateType([\"Identifier\", \"TSThisType\"]),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n asserts: validateOptional(bool),\n },\n});\n\ndefineType(\"TSTypeQuery\", {\n aliases: [\"TSType\"],\n visitor: [\"exprName\", \"typeParameters\"],\n fields: {\n exprName: validateType([\"TSEntityName\", \"TSImportType\"]),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSTypeLiteral\", {\n aliases: [\"TSType\"],\n visitor: [\"members\"],\n fields: {\n members: validateArrayOfType(\"TSTypeElement\"),\n },\n});\n\ndefineType(\"TSArrayType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementType\"],\n fields: {\n elementType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTupleType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementTypes\"],\n fields: {\n elementTypes: validateArrayOfType([\"TSType\", \"TSNamedTupleMember\"]),\n },\n});\n\ndefineType(\"TSOptionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSRestType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSNamedTupleMember\", {\n visitor: [\"label\", \"elementType\"],\n builder: [\"label\", \"elementType\", \"optional\"],\n fields: {\n label: validateType(\"Identifier\"),\n optional: {\n validate: bool,\n default: false,\n },\n elementType: validateType(\"TSType\"),\n },\n});\n\nconst unionOrIntersection = {\n aliases: [\"TSType\"],\n visitor: [\"types\"],\n fields: {\n types: validateArrayOfType(\"TSType\"),\n },\n};\n\ndefineType(\"TSUnionType\", unionOrIntersection);\ndefineType(\"TSIntersectionType\", unionOrIntersection);\n\ndefineType(\"TSConditionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"checkType\", \"extendsType\", \"trueType\", \"falseType\"],\n fields: {\n checkType: validateType(\"TSType\"),\n extendsType: validateType(\"TSType\"),\n trueType: validateType(\"TSType\"),\n falseType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSInferType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\"],\n fields: {\n typeParameter: validateType(\"TSTypeParameter\"),\n },\n});\n\ndefineType(\"TSParenthesizedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTypeOperator\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n operator: validate(assertValueType(\"string\")),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSIndexedAccessType\", {\n aliases: [\"TSType\"],\n visitor: [\"objectType\", \"indexType\"],\n fields: {\n objectType: validateType(\"TSType\"),\n indexType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSMappedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\", \"typeAnnotation\", \"nameType\"],\n fields: {\n readonly: validateOptional(assertOneOf(true, false, \"+\", \"-\")),\n typeParameter: validateType(\"TSTypeParameter\"),\n optional: validateOptional(assertOneOf(true, false, \"+\", \"-\")),\n typeAnnotation: validateOptionalType(\"TSType\"),\n nameType: validateOptionalType(\"TSType\"),\n },\n});\n\ndefineType(\"TSLiteralType\", {\n aliases: [\"TSType\", \"TSBaseType\"],\n visitor: [\"literal\"],\n fields: {\n literal: {\n validate: (function () {\n const unaryExpression = assertNodeType(\n \"NumericLiteral\",\n \"BigIntLiteral\",\n );\n const unaryOperator = assertOneOf(\"-\");\n\n const literal = assertNodeType(\n \"NumericLiteral\",\n \"StringLiteral\",\n \"BooleanLiteral\",\n \"BigIntLiteral\",\n \"TemplateLiteral\",\n );\n function validator(parent: any, key: string, node: any) {\n // type A = -1 | 1;\n if (is(\"UnaryExpression\", node)) {\n // check operator first\n unaryOperator(node, \"operator\", node.operator);\n unaryExpression(node, \"argument\", node.argument);\n } else {\n // type A = 'foo' | 'bar' | false | 1;\n literal(parent, key, node);\n }\n }\n\n validator.oneOfNodeTypes = [\n \"NumericLiteral\",\n \"StringLiteral\",\n \"BooleanLiteral\",\n \"BigIntLiteral\",\n \"TemplateLiteral\",\n \"UnaryExpression\",\n ];\n\n return validator;\n })(),\n },\n },\n});\n\ndefineType(\"TSExpressionWithTypeArguments\", {\n aliases: [\"TSType\"],\n visitor: [\"expression\", \"typeParameters\"],\n fields: {\n expression: validateType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSInterfaceDeclaration\", {\n // \"Statement\" alias prevents a semicolon from appearing after it in an export declaration.\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n fields: {\n declare: validateOptional(bool),\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n extends: validateOptional(arrayOfType(\"TSExpressionWithTypeArguments\")),\n body: validateType(\"TSInterfaceBody\"),\n },\n});\n\ndefineType(\"TSInterfaceBody\", {\n visitor: [\"body\"],\n fields: {\n body: validateArrayOfType(\"TSTypeElement\"),\n },\n});\n\ndefineType(\"TSTypeAliasDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"typeAnnotation\"],\n fields: {\n declare: validateOptional(bool),\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSInstantiationExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\", \"typeParameters\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\nconst TSTypeExpression = {\n aliases: [\"Expression\", \"LVal\", \"PatternLike\"],\n visitor: [\"expression\", \"typeAnnotation\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeAnnotation: validateType(\"TSType\"),\n },\n};\n\ndefineType(\"TSAsExpression\", TSTypeExpression);\ndefineType(\"TSSatisfiesExpression\", TSTypeExpression);\n\ndefineType(\"TSTypeAssertion\", {\n aliases: [\"Expression\", \"LVal\", \"PatternLike\"],\n visitor: [\"typeAnnotation\", \"expression\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSEnumDeclaration\", {\n // \"Statement\" alias prevents a semicolon from appearing after it in an export declaration.\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"members\"],\n fields: {\n declare: validateOptional(bool),\n const: validateOptional(bool),\n id: validateType(\"Identifier\"),\n members: validateArrayOfType(\"TSEnumMember\"),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSEnumMember\", {\n visitor: [\"id\", \"initializer\"],\n fields: {\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSModuleDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n declare: validateOptional(bool),\n global: validateOptional(bool),\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n body: validateType([\"TSModuleBlock\", \"TSModuleDeclaration\"]),\n },\n});\n\ndefineType(\"TSModuleBlock\", {\n aliases: [\"Scopable\", \"Block\", \"BlockParent\", \"FunctionParent\"],\n visitor: [\"body\"],\n fields: {\n body: validateArrayOfType(\"Statement\"),\n },\n});\n\ndefineType(\"TSImportType\", {\n aliases: [\"TSType\"],\n visitor: [\"argument\", \"qualifier\", \"typeParameters\"],\n fields: {\n argument: validateType(\"StringLiteral\"),\n qualifier: validateOptionalType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSImportEqualsDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\", \"moduleReference\"],\n fields: {\n isExport: validate(bool),\n id: validateType(\"Identifier\"),\n moduleReference: validateType([\n \"TSEntityName\",\n \"TSExternalModuleReference\",\n ]),\n importKind: {\n validate: assertOneOf(\"type\", \"value\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"TSExternalModuleReference\", {\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"StringLiteral\"),\n },\n});\n\ndefineType(\"TSNonNullExpression\", {\n aliases: [\"Expression\", \"LVal\", \"PatternLike\"],\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSExportAssignment\", {\n aliases: [\"Statement\"],\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSNamespaceExportDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"TSTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: {\n validate: assertNodeType(\"TSType\"),\n },\n },\n});\n\ndefineType(\"TSTypeParameterInstantiation\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TSType\")),\n ),\n },\n },\n});\n\ndefineType(\"TSTypeParameterDeclaration\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TSTypeParameter\")),\n ),\n },\n },\n});\n\ndefineType(\"TSTypeParameter\", {\n builder: [\"constraint\", \"default\", \"name\"],\n visitor: [\"constraint\", \"default\"],\n fields: {\n name: {\n validate: !process.env.BABEL_8_BREAKING\n ? assertValueType(\"string\")\n : assertNodeType(\"Identifier\"),\n },\n in: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n out: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n const: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n constraint: {\n validate: assertNodeType(\"TSType\"),\n optional: true,\n },\n default: {\n validate: assertNodeType(\"TSType\"),\n optional: true,\n },\n },\n});\n","export const DEPRECATED_ALIASES = {\n ModuleDeclaration: \"ImportOrExportDeclaration\",\n};\n","import toFastProperties from \"to-fast-properties\";\nimport \"./core\";\nimport \"./flow\";\nimport \"./jsx\";\nimport \"./misc\";\nimport \"./experimental\";\nimport \"./typescript\";\nimport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n} from \"./utils\";\nimport {\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n} from \"./placeholders\";\nimport { DEPRECATED_ALIASES } from \"./deprecated-aliases\";\n\n(\n Object.keys(DEPRECATED_ALIASES) as (keyof typeof DEPRECATED_ALIASES)[]\n).forEach(deprecatedAlias => {\n FLIPPED_ALIAS_KEYS[deprecatedAlias] =\n FLIPPED_ALIAS_KEYS[DEPRECATED_ALIASES[deprecatedAlias]];\n});\n\n// We do this here, because at this point the visitor keys should be ready and setup\ntoFastProperties(VISITOR_KEYS);\ntoFastProperties(ALIAS_KEYS);\ntoFastProperties(FLIPPED_ALIAS_KEYS);\ntoFastProperties(NODE_FIELDS);\ntoFastProperties(BUILDER_KEYS);\ntoFastProperties(DEPRECATED_KEYS);\n\ntoFastProperties(PLACEHOLDERS_ALIAS);\ntoFastProperties(PLACEHOLDERS_FLIPPED_ALIAS);\n\nconst TYPES: Array = [].concat(\n Object.keys(VISITOR_KEYS),\n Object.keys(FLIPPED_ALIAS_KEYS),\n Object.keys(DEPRECATED_KEYS),\n);\n\nexport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_ALIASES,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n TYPES,\n};\n\nexport type { FieldOptions } from \"./utils\";\n","import {\n NODE_FIELDS,\n NODE_PARENT_VALIDATIONS,\n type FieldOptions,\n} from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function validate(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateField(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n field: FieldOptions | undefined | null,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(\n node: t.Node | undefined | null,\n key: string,\n val?: t.Node | undefined | null,\n) {\n if (val == null) return;\n const validate = NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}\n","import validate from \"../validators/validate\";\nimport type * as t from \"..\";\nimport { BUILDER_KEYS } from \"..\";\n\nexport default function validateNode(node: N) {\n // todo: because keys not in BUILDER_KEYS are not validated - this actually allows invalid nodes in some cases\n const keys = BUILDER_KEYS[node.type] as (keyof N & string)[];\n for (const key of keys) {\n validate(node, key, node[key]);\n }\n return node;\n}\n","/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport validateNode from \"../validateNode\";\nimport type * as t from \"../..\";\nimport deprecationWarning from \"../../utils/deprecationWarning\";\nexport function arrayExpression(\n elements: Array = [],\n): t.ArrayExpression {\n return validateNode({\n type: \"ArrayExpression\",\n elements,\n });\n}\nexport function assignmentExpression(\n operator: string,\n left: t.LVal,\n right: t.Expression,\n): t.AssignmentExpression {\n return validateNode({\n type: \"AssignmentExpression\",\n operator,\n left,\n right,\n });\n}\nexport function binaryExpression(\n operator:\n | \"+\"\n | \"-\"\n | \"/\"\n | \"%\"\n | \"*\"\n | \"**\"\n | \"&\"\n | \"|\"\n | \">>\"\n | \">>>\"\n | \"<<\"\n | \"^\"\n | \"==\"\n | \"===\"\n | \"!=\"\n | \"!==\"\n | \"in\"\n | \"instanceof\"\n | \">\"\n | \"<\"\n | \">=\"\n | \"<=\"\n | \"|>\",\n left: t.Expression | t.PrivateName,\n right: t.Expression,\n): t.BinaryExpression {\n return validateNode({\n type: \"BinaryExpression\",\n operator,\n left,\n right,\n });\n}\nexport function interpreterDirective(value: string): t.InterpreterDirective {\n return validateNode({\n type: \"InterpreterDirective\",\n value,\n });\n}\nexport function directive(value: t.DirectiveLiteral): t.Directive {\n return validateNode({\n type: \"Directive\",\n value,\n });\n}\nexport function directiveLiteral(value: string): t.DirectiveLiteral {\n return validateNode({\n type: \"DirectiveLiteral\",\n value,\n });\n}\nexport function blockStatement(\n body: Array,\n directives: Array = [],\n): t.BlockStatement {\n return validateNode({\n type: \"BlockStatement\",\n body,\n directives,\n });\n}\nexport function breakStatement(\n label: t.Identifier | null = null,\n): t.BreakStatement {\n return validateNode({\n type: \"BreakStatement\",\n label,\n });\n}\nexport function callExpression(\n callee: t.Expression | t.Super | t.V8IntrinsicIdentifier,\n _arguments: Array<\n t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder\n >,\n): t.CallExpression {\n return validateNode({\n type: \"CallExpression\",\n callee,\n arguments: _arguments,\n });\n}\nexport function catchClause(\n param:\n | t.Identifier\n | t.ArrayPattern\n | t.ObjectPattern\n | null\n | undefined = null,\n body: t.BlockStatement,\n): t.CatchClause {\n return validateNode({\n type: \"CatchClause\",\n param,\n body,\n });\n}\nexport function conditionalExpression(\n test: t.Expression,\n consequent: t.Expression,\n alternate: t.Expression,\n): t.ConditionalExpression {\n return validateNode({\n type: \"ConditionalExpression\",\n test,\n consequent,\n alternate,\n });\n}\nexport function continueStatement(\n label: t.Identifier | null = null,\n): t.ContinueStatement {\n return validateNode({\n type: \"ContinueStatement\",\n label,\n });\n}\nexport function debuggerStatement(): t.DebuggerStatement {\n return {\n type: \"DebuggerStatement\",\n };\n}\nexport function doWhileStatement(\n test: t.Expression,\n body: t.Statement,\n): t.DoWhileStatement {\n return validateNode({\n type: \"DoWhileStatement\",\n test,\n body,\n });\n}\nexport function emptyStatement(): t.EmptyStatement {\n return {\n type: \"EmptyStatement\",\n };\n}\nexport function expressionStatement(\n expression: t.Expression,\n): t.ExpressionStatement {\n return validateNode({\n type: \"ExpressionStatement\",\n expression,\n });\n}\nexport function file(\n program: t.Program,\n comments: Array | null = null,\n tokens: Array | null = null,\n): t.File {\n return validateNode({\n type: \"File\",\n program,\n comments,\n tokens,\n });\n}\nexport function forInStatement(\n left: t.VariableDeclaration | t.LVal,\n right: t.Expression,\n body: t.Statement,\n): t.ForInStatement {\n return validateNode({\n type: \"ForInStatement\",\n left,\n right,\n body,\n });\n}\nexport function forStatement(\n init: t.VariableDeclaration | t.Expression | null | undefined = null,\n test: t.Expression | null | undefined = null,\n update: t.Expression | null | undefined = null,\n body: t.Statement,\n): t.ForStatement {\n return validateNode({\n type: \"ForStatement\",\n init,\n test,\n update,\n body,\n });\n}\nexport function functionDeclaration(\n id: t.Identifier | null | undefined = null,\n params: Array,\n body: t.BlockStatement,\n generator: boolean = false,\n async: boolean = false,\n): t.FunctionDeclaration {\n return validateNode({\n type: \"FunctionDeclaration\",\n id,\n params,\n body,\n generator,\n async,\n });\n}\nexport function functionExpression(\n id: t.Identifier | null | undefined = null,\n params: Array,\n body: t.BlockStatement,\n generator: boolean = false,\n async: boolean = false,\n): t.FunctionExpression {\n return validateNode({\n type: \"FunctionExpression\",\n id,\n params,\n body,\n generator,\n async,\n });\n}\nexport function identifier(name: string): t.Identifier {\n return validateNode({\n type: \"Identifier\",\n name,\n });\n}\nexport function ifStatement(\n test: t.Expression,\n consequent: t.Statement,\n alternate: t.Statement | null = null,\n): t.IfStatement {\n return validateNode({\n type: \"IfStatement\",\n test,\n consequent,\n alternate,\n });\n}\nexport function labeledStatement(\n label: t.Identifier,\n body: t.Statement,\n): t.LabeledStatement {\n return validateNode({\n type: \"LabeledStatement\",\n label,\n body,\n });\n}\nexport function stringLiteral(value: string): t.StringLiteral {\n return validateNode({\n type: \"StringLiteral\",\n value,\n });\n}\nexport function numericLiteral(value: number): t.NumericLiteral {\n return validateNode({\n type: \"NumericLiteral\",\n value,\n });\n}\nexport function nullLiteral(): t.NullLiteral {\n return {\n type: \"NullLiteral\",\n };\n}\nexport function booleanLiteral(value: boolean): t.BooleanLiteral {\n return validateNode({\n type: \"BooleanLiteral\",\n value,\n });\n}\nexport function regExpLiteral(\n pattern: string,\n flags: string = \"\",\n): t.RegExpLiteral {\n return validateNode({\n type: \"RegExpLiteral\",\n pattern,\n flags,\n });\n}\nexport function logicalExpression(\n operator: \"||\" | \"&&\" | \"??\",\n left: t.Expression,\n right: t.Expression,\n): t.LogicalExpression {\n return validateNode({\n type: \"LogicalExpression\",\n operator,\n left,\n right,\n });\n}\nexport function memberExpression(\n object: t.Expression | t.Super,\n property: t.Expression | t.Identifier | t.PrivateName,\n computed: boolean = false,\n optional: true | false | null = null,\n): t.MemberExpression {\n return validateNode({\n type: \"MemberExpression\",\n object,\n property,\n computed,\n optional,\n });\n}\nexport function newExpression(\n callee: t.Expression | t.Super | t.V8IntrinsicIdentifier,\n _arguments: Array<\n t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder\n >,\n): t.NewExpression {\n return validateNode({\n type: \"NewExpression\",\n callee,\n arguments: _arguments,\n });\n}\nexport function program(\n body: Array,\n directives: Array = [],\n sourceType: \"script\" | \"module\" = \"script\",\n interpreter: t.InterpreterDirective | null = null,\n): t.Program {\n return validateNode({\n type: \"Program\",\n body,\n directives,\n sourceType,\n interpreter,\n sourceFile: null,\n });\n}\nexport function objectExpression(\n properties: Array,\n): t.ObjectExpression {\n return validateNode({\n type: \"ObjectExpression\",\n properties,\n });\n}\nexport function objectMethod(\n kind: \"method\" | \"get\" | \"set\" | undefined = \"method\",\n key:\n | t.Expression\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral,\n params: Array,\n body: t.BlockStatement,\n computed: boolean = false,\n generator: boolean = false,\n async: boolean = false,\n): t.ObjectMethod {\n return validateNode({\n type: \"ObjectMethod\",\n kind,\n key,\n params,\n body,\n computed,\n generator,\n async,\n });\n}\nexport function objectProperty(\n key:\n | t.Expression\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.DecimalLiteral\n | t.PrivateName,\n value: t.Expression | t.PatternLike,\n computed: boolean = false,\n shorthand: boolean = false,\n decorators: Array | null = null,\n): t.ObjectProperty {\n return validateNode({\n type: \"ObjectProperty\",\n key,\n value,\n computed,\n shorthand,\n decorators,\n });\n}\nexport function restElement(argument: t.LVal): t.RestElement {\n return validateNode({\n type: \"RestElement\",\n argument,\n });\n}\nexport function returnStatement(\n argument: t.Expression | null = null,\n): t.ReturnStatement {\n return validateNode({\n type: \"ReturnStatement\",\n argument,\n });\n}\nexport function sequenceExpression(\n expressions: Array,\n): t.SequenceExpression {\n return validateNode({\n type: \"SequenceExpression\",\n expressions,\n });\n}\nexport function parenthesizedExpression(\n expression: t.Expression,\n): t.ParenthesizedExpression {\n return validateNode({\n type: \"ParenthesizedExpression\",\n expression,\n });\n}\nexport function switchCase(\n test: t.Expression | null | undefined = null,\n consequent: Array,\n): t.SwitchCase {\n return validateNode({\n type: \"SwitchCase\",\n test,\n consequent,\n });\n}\nexport function switchStatement(\n discriminant: t.Expression,\n cases: Array,\n): t.SwitchStatement {\n return validateNode({\n type: \"SwitchStatement\",\n discriminant,\n cases,\n });\n}\nexport function thisExpression(): t.ThisExpression {\n return {\n type: \"ThisExpression\",\n };\n}\nexport function throwStatement(argument: t.Expression): t.ThrowStatement {\n return validateNode({\n type: \"ThrowStatement\",\n argument,\n });\n}\nexport function tryStatement(\n block: t.BlockStatement,\n handler: t.CatchClause | null = null,\n finalizer: t.BlockStatement | null = null,\n): t.TryStatement {\n return validateNode({\n type: \"TryStatement\",\n block,\n handler,\n finalizer,\n });\n}\nexport function unaryExpression(\n operator: \"void\" | \"throw\" | \"delete\" | \"!\" | \"+\" | \"-\" | \"~\" | \"typeof\",\n argument: t.Expression,\n prefix: boolean = true,\n): t.UnaryExpression {\n return validateNode({\n type: \"UnaryExpression\",\n operator,\n argument,\n prefix,\n });\n}\nexport function updateExpression(\n operator: \"++\" | \"--\",\n argument: t.Expression,\n prefix: boolean = false,\n): t.UpdateExpression {\n return validateNode({\n type: \"UpdateExpression\",\n operator,\n argument,\n prefix,\n });\n}\nexport function variableDeclaration(\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n declarations: Array,\n): t.VariableDeclaration {\n return validateNode({\n type: \"VariableDeclaration\",\n kind,\n declarations,\n });\n}\nexport function variableDeclarator(\n id: t.LVal,\n init: t.Expression | null = null,\n): t.VariableDeclarator {\n return validateNode({\n type: \"VariableDeclarator\",\n id,\n init,\n });\n}\nexport function whileStatement(\n test: t.Expression,\n body: t.Statement,\n): t.WhileStatement {\n return validateNode({\n type: \"WhileStatement\",\n test,\n body,\n });\n}\nexport function withStatement(\n object: t.Expression,\n body: t.Statement,\n): t.WithStatement {\n return validateNode({\n type: \"WithStatement\",\n object,\n body,\n });\n}\nexport function assignmentPattern(\n left:\n | t.Identifier\n | t.ObjectPattern\n | t.ArrayPattern\n | t.MemberExpression\n | t.TSAsExpression\n | t.TSSatisfiesExpression\n | t.TSTypeAssertion\n | t.TSNonNullExpression,\n right: t.Expression,\n): t.AssignmentPattern {\n return validateNode({\n type: \"AssignmentPattern\",\n left,\n right,\n });\n}\nexport function arrayPattern(\n elements: Array,\n): t.ArrayPattern {\n return validateNode({\n type: \"ArrayPattern\",\n elements,\n });\n}\nexport function arrowFunctionExpression(\n params: Array,\n body: t.BlockStatement | t.Expression,\n async: boolean = false,\n): t.ArrowFunctionExpression {\n return validateNode({\n type: \"ArrowFunctionExpression\",\n params,\n body,\n async,\n expression: null,\n });\n}\nexport function classBody(\n body: Array<\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassAccessorProperty\n | t.TSDeclareMethod\n | t.TSIndexSignature\n | t.StaticBlock\n >,\n): t.ClassBody {\n return validateNode({\n type: \"ClassBody\",\n body,\n });\n}\nexport function classExpression(\n id: t.Identifier | null | undefined = null,\n superClass: t.Expression | null | undefined = null,\n body: t.ClassBody,\n decorators: Array | null = null,\n): t.ClassExpression {\n return validateNode({\n type: \"ClassExpression\",\n id,\n superClass,\n body,\n decorators,\n });\n}\nexport function classDeclaration(\n id: t.Identifier,\n superClass: t.Expression | null | undefined = null,\n body: t.ClassBody,\n decorators: Array | null = null,\n): t.ClassDeclaration {\n return validateNode({\n type: \"ClassDeclaration\",\n id,\n superClass,\n body,\n decorators,\n });\n}\nexport function exportAllDeclaration(\n source: t.StringLiteral,\n): t.ExportAllDeclaration {\n return validateNode({\n type: \"ExportAllDeclaration\",\n source,\n });\n}\nexport function exportDefaultDeclaration(\n declaration:\n | t.TSDeclareFunction\n | t.FunctionDeclaration\n | t.ClassDeclaration\n | t.Expression,\n): t.ExportDefaultDeclaration {\n return validateNode({\n type: \"ExportDefaultDeclaration\",\n declaration,\n });\n}\nexport function exportNamedDeclaration(\n declaration: t.Declaration | null = null,\n specifiers: Array<\n t.ExportSpecifier | t.ExportDefaultSpecifier | t.ExportNamespaceSpecifier\n > = [],\n source: t.StringLiteral | null = null,\n): t.ExportNamedDeclaration {\n return validateNode({\n type: \"ExportNamedDeclaration\",\n declaration,\n specifiers,\n source,\n });\n}\nexport function exportSpecifier(\n local: t.Identifier,\n exported: t.Identifier | t.StringLiteral,\n): t.ExportSpecifier {\n return validateNode({\n type: \"ExportSpecifier\",\n local,\n exported,\n });\n}\nexport function forOfStatement(\n left: t.VariableDeclaration | t.LVal,\n right: t.Expression,\n body: t.Statement,\n _await: boolean = false,\n): t.ForOfStatement {\n return validateNode({\n type: \"ForOfStatement\",\n left,\n right,\n body,\n await: _await,\n });\n}\nexport function importDeclaration(\n specifiers: Array<\n t.ImportSpecifier | t.ImportDefaultSpecifier | t.ImportNamespaceSpecifier\n >,\n source: t.StringLiteral,\n): t.ImportDeclaration {\n return validateNode({\n type: \"ImportDeclaration\",\n specifiers,\n source,\n });\n}\nexport function importDefaultSpecifier(\n local: t.Identifier,\n): t.ImportDefaultSpecifier {\n return validateNode({\n type: \"ImportDefaultSpecifier\",\n local,\n });\n}\nexport function importNamespaceSpecifier(\n local: t.Identifier,\n): t.ImportNamespaceSpecifier {\n return validateNode({\n type: \"ImportNamespaceSpecifier\",\n local,\n });\n}\nexport function importSpecifier(\n local: t.Identifier,\n imported: t.Identifier | t.StringLiteral,\n): t.ImportSpecifier {\n return validateNode({\n type: \"ImportSpecifier\",\n local,\n imported,\n });\n}\nexport function metaProperty(\n meta: t.Identifier,\n property: t.Identifier,\n): t.MetaProperty {\n return validateNode({\n type: \"MetaProperty\",\n meta,\n property,\n });\n}\nexport function classMethod(\n kind: \"get\" | \"set\" | \"method\" | \"constructor\" | undefined = \"method\",\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression,\n params: Array<\n t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty\n >,\n body: t.BlockStatement,\n computed: boolean = false,\n _static: boolean = false,\n generator: boolean = false,\n async: boolean = false,\n): t.ClassMethod {\n return validateNode({\n type: \"ClassMethod\",\n kind,\n key,\n params,\n body,\n computed,\n static: _static,\n generator,\n async,\n });\n}\nexport function objectPattern(\n properties: Array,\n): t.ObjectPattern {\n return validateNode({\n type: \"ObjectPattern\",\n properties,\n });\n}\nexport function spreadElement(argument: t.Expression): t.SpreadElement {\n return validateNode({\n type: \"SpreadElement\",\n argument,\n });\n}\nfunction _super(): t.Super {\n return {\n type: \"Super\",\n };\n}\nexport { _super as super };\nexport function taggedTemplateExpression(\n tag: t.Expression,\n quasi: t.TemplateLiteral,\n): t.TaggedTemplateExpression {\n return validateNode({\n type: \"TaggedTemplateExpression\",\n tag,\n quasi,\n });\n}\nexport function templateElement(\n value: { raw: string; cooked?: string },\n tail: boolean = false,\n): t.TemplateElement {\n return validateNode({\n type: \"TemplateElement\",\n value,\n tail,\n });\n}\nexport function templateLiteral(\n quasis: Array,\n expressions: Array,\n): t.TemplateLiteral {\n return validateNode({\n type: \"TemplateLiteral\",\n quasis,\n expressions,\n });\n}\nexport function yieldExpression(\n argument: t.Expression | null = null,\n delegate: boolean = false,\n): t.YieldExpression {\n return validateNode({\n type: \"YieldExpression\",\n argument,\n delegate,\n });\n}\nexport function awaitExpression(argument: t.Expression): t.AwaitExpression {\n return validateNode({\n type: \"AwaitExpression\",\n argument,\n });\n}\nfunction _import(): t.Import {\n return {\n type: \"Import\",\n };\n}\nexport { _import as import };\nexport function bigIntLiteral(value: string): t.BigIntLiteral {\n return validateNode({\n type: \"BigIntLiteral\",\n value,\n });\n}\nexport function exportNamespaceSpecifier(\n exported: t.Identifier,\n): t.ExportNamespaceSpecifier {\n return validateNode({\n type: \"ExportNamespaceSpecifier\",\n exported,\n });\n}\nexport function optionalMemberExpression(\n object: t.Expression,\n property: t.Expression | t.Identifier,\n computed: boolean | undefined = false,\n optional: boolean,\n): t.OptionalMemberExpression {\n return validateNode({\n type: \"OptionalMemberExpression\",\n object,\n property,\n computed,\n optional,\n });\n}\nexport function optionalCallExpression(\n callee: t.Expression,\n _arguments: Array<\n t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder\n >,\n optional: boolean,\n): t.OptionalCallExpression {\n return validateNode({\n type: \"OptionalCallExpression\",\n callee,\n arguments: _arguments,\n optional,\n });\n}\nexport function classProperty(\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression,\n value: t.Expression | null = null,\n typeAnnotation: t.TypeAnnotation | t.TSTypeAnnotation | t.Noop | null = null,\n decorators: Array | null = null,\n computed: boolean = false,\n _static: boolean = false,\n): t.ClassProperty {\n return validateNode({\n type: \"ClassProperty\",\n key,\n value,\n typeAnnotation,\n decorators,\n computed,\n static: _static,\n });\n}\nexport function classAccessorProperty(\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression\n | t.PrivateName,\n value: t.Expression | null = null,\n typeAnnotation: t.TypeAnnotation | t.TSTypeAnnotation | t.Noop | null = null,\n decorators: Array | null = null,\n computed: boolean = false,\n _static: boolean = false,\n): t.ClassAccessorProperty {\n return validateNode({\n type: \"ClassAccessorProperty\",\n key,\n value,\n typeAnnotation,\n decorators,\n computed,\n static: _static,\n });\n}\nexport function classPrivateProperty(\n key: t.PrivateName,\n value: t.Expression | null = null,\n decorators: Array | null = null,\n _static: boolean = false,\n): t.ClassPrivateProperty {\n return validateNode({\n type: \"ClassPrivateProperty\",\n key,\n value,\n decorators,\n static: _static,\n });\n}\nexport function classPrivateMethod(\n kind: \"get\" | \"set\" | \"method\" | undefined = \"method\",\n key: t.PrivateName,\n params: Array<\n t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty\n >,\n body: t.BlockStatement,\n _static: boolean = false,\n): t.ClassPrivateMethod {\n return validateNode({\n type: \"ClassPrivateMethod\",\n kind,\n key,\n params,\n body,\n static: _static,\n });\n}\nexport function privateName(id: t.Identifier): t.PrivateName {\n return validateNode({\n type: \"PrivateName\",\n id,\n });\n}\nexport function staticBlock(body: Array): t.StaticBlock {\n return validateNode({\n type: \"StaticBlock\",\n body,\n });\n}\nexport function anyTypeAnnotation(): t.AnyTypeAnnotation {\n return {\n type: \"AnyTypeAnnotation\",\n };\n}\nexport function arrayTypeAnnotation(\n elementType: t.FlowType,\n): t.ArrayTypeAnnotation {\n return validateNode({\n type: \"ArrayTypeAnnotation\",\n elementType,\n });\n}\nexport function booleanTypeAnnotation(): t.BooleanTypeAnnotation {\n return {\n type: \"BooleanTypeAnnotation\",\n };\n}\nexport function booleanLiteralTypeAnnotation(\n value: boolean,\n): t.BooleanLiteralTypeAnnotation {\n return validateNode({\n type: \"BooleanLiteralTypeAnnotation\",\n value,\n });\n}\nexport function nullLiteralTypeAnnotation(): t.NullLiteralTypeAnnotation {\n return {\n type: \"NullLiteralTypeAnnotation\",\n };\n}\nexport function classImplements(\n id: t.Identifier,\n typeParameters: t.TypeParameterInstantiation | null = null,\n): t.ClassImplements {\n return validateNode({\n type: \"ClassImplements\",\n id,\n typeParameters,\n });\n}\nexport function declareClass(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.DeclareClass {\n return validateNode({\n type: \"DeclareClass\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport function declareFunction(id: t.Identifier): t.DeclareFunction {\n return validateNode({\n type: \"DeclareFunction\",\n id,\n });\n}\nexport function declareInterface(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.DeclareInterface {\n return validateNode({\n type: \"DeclareInterface\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport function declareModule(\n id: t.Identifier | t.StringLiteral,\n body: t.BlockStatement,\n kind: \"CommonJS\" | \"ES\" | null = null,\n): t.DeclareModule {\n return validateNode({\n type: \"DeclareModule\",\n id,\n body,\n kind,\n });\n}\nexport function declareModuleExports(\n typeAnnotation: t.TypeAnnotation,\n): t.DeclareModuleExports {\n return validateNode({\n type: \"DeclareModuleExports\",\n typeAnnotation,\n });\n}\nexport function declareTypeAlias(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n right: t.FlowType,\n): t.DeclareTypeAlias {\n return validateNode({\n type: \"DeclareTypeAlias\",\n id,\n typeParameters,\n right,\n });\n}\nexport function declareOpaqueType(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null = null,\n supertype: t.FlowType | null = null,\n): t.DeclareOpaqueType {\n return validateNode({\n type: \"DeclareOpaqueType\",\n id,\n typeParameters,\n supertype,\n });\n}\nexport function declareVariable(id: t.Identifier): t.DeclareVariable {\n return validateNode({\n type: \"DeclareVariable\",\n id,\n });\n}\nexport function declareExportDeclaration(\n declaration: t.Flow | null = null,\n specifiers: Array<\n t.ExportSpecifier | t.ExportNamespaceSpecifier\n > | null = null,\n source: t.StringLiteral | null = null,\n): t.DeclareExportDeclaration {\n return validateNode({\n type: \"DeclareExportDeclaration\",\n declaration,\n specifiers,\n source,\n });\n}\nexport function declareExportAllDeclaration(\n source: t.StringLiteral,\n): t.DeclareExportAllDeclaration {\n return validateNode({\n type: \"DeclareExportAllDeclaration\",\n source,\n });\n}\nexport function declaredPredicate(value: t.Flow): t.DeclaredPredicate {\n return validateNode({\n type: \"DeclaredPredicate\",\n value,\n });\n}\nexport function existsTypeAnnotation(): t.ExistsTypeAnnotation {\n return {\n type: \"ExistsTypeAnnotation\",\n };\n}\nexport function functionTypeAnnotation(\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n params: Array,\n rest: t.FunctionTypeParam | null | undefined = null,\n returnType: t.FlowType,\n): t.FunctionTypeAnnotation {\n return validateNode({\n type: \"FunctionTypeAnnotation\",\n typeParameters,\n params,\n rest,\n returnType,\n });\n}\nexport function functionTypeParam(\n name: t.Identifier | null | undefined = null,\n typeAnnotation: t.FlowType,\n): t.FunctionTypeParam {\n return validateNode({\n type: \"FunctionTypeParam\",\n name,\n typeAnnotation,\n });\n}\nexport function genericTypeAnnotation(\n id: t.Identifier | t.QualifiedTypeIdentifier,\n typeParameters: t.TypeParameterInstantiation | null = null,\n): t.GenericTypeAnnotation {\n return validateNode({\n type: \"GenericTypeAnnotation\",\n id,\n typeParameters,\n });\n}\nexport function inferredPredicate(): t.InferredPredicate {\n return {\n type: \"InferredPredicate\",\n };\n}\nexport function interfaceExtends(\n id: t.Identifier | t.QualifiedTypeIdentifier,\n typeParameters: t.TypeParameterInstantiation | null = null,\n): t.InterfaceExtends {\n return validateNode({\n type: \"InterfaceExtends\",\n id,\n typeParameters,\n });\n}\nexport function interfaceDeclaration(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.InterfaceDeclaration {\n return validateNode({\n type: \"InterfaceDeclaration\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport function interfaceTypeAnnotation(\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.InterfaceTypeAnnotation {\n return validateNode({\n type: \"InterfaceTypeAnnotation\",\n extends: _extends,\n body,\n });\n}\nexport function intersectionTypeAnnotation(\n types: Array,\n): t.IntersectionTypeAnnotation {\n return validateNode({\n type: \"IntersectionTypeAnnotation\",\n types,\n });\n}\nexport function mixedTypeAnnotation(): t.MixedTypeAnnotation {\n return {\n type: \"MixedTypeAnnotation\",\n };\n}\nexport function emptyTypeAnnotation(): t.EmptyTypeAnnotation {\n return {\n type: \"EmptyTypeAnnotation\",\n };\n}\nexport function nullableTypeAnnotation(\n typeAnnotation: t.FlowType,\n): t.NullableTypeAnnotation {\n return validateNode({\n type: \"NullableTypeAnnotation\",\n typeAnnotation,\n });\n}\nexport function numberLiteralTypeAnnotation(\n value: number,\n): t.NumberLiteralTypeAnnotation {\n return validateNode({\n type: \"NumberLiteralTypeAnnotation\",\n value,\n });\n}\nexport function numberTypeAnnotation(): t.NumberTypeAnnotation {\n return {\n type: \"NumberTypeAnnotation\",\n };\n}\nexport function objectTypeAnnotation(\n properties: Array,\n indexers: Array = [],\n callProperties: Array = [],\n internalSlots: Array = [],\n exact: boolean = false,\n): t.ObjectTypeAnnotation {\n return validateNode({\n type: \"ObjectTypeAnnotation\",\n properties,\n indexers,\n callProperties,\n internalSlots,\n exact,\n });\n}\nexport function objectTypeInternalSlot(\n id: t.Identifier,\n value: t.FlowType,\n optional: boolean,\n _static: boolean,\n method: boolean,\n): t.ObjectTypeInternalSlot {\n return validateNode({\n type: \"ObjectTypeInternalSlot\",\n id,\n value,\n optional,\n static: _static,\n method,\n });\n}\nexport function objectTypeCallProperty(\n value: t.FlowType,\n): t.ObjectTypeCallProperty {\n return validateNode({\n type: \"ObjectTypeCallProperty\",\n value,\n static: null,\n });\n}\nexport function objectTypeIndexer(\n id: t.Identifier | null | undefined = null,\n key: t.FlowType,\n value: t.FlowType,\n variance: t.Variance | null = null,\n): t.ObjectTypeIndexer {\n return validateNode({\n type: \"ObjectTypeIndexer\",\n id,\n key,\n value,\n variance,\n static: null,\n });\n}\nexport function objectTypeProperty(\n key: t.Identifier | t.StringLiteral,\n value: t.FlowType,\n variance: t.Variance | null = null,\n): t.ObjectTypeProperty {\n return validateNode({\n type: \"ObjectTypeProperty\",\n key,\n value,\n variance,\n kind: null,\n method: null,\n optional: null,\n proto: null,\n static: null,\n });\n}\nexport function objectTypeSpreadProperty(\n argument: t.FlowType,\n): t.ObjectTypeSpreadProperty {\n return validateNode({\n type: \"ObjectTypeSpreadProperty\",\n argument,\n });\n}\nexport function opaqueType(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n supertype: t.FlowType | null | undefined = null,\n impltype: t.FlowType,\n): t.OpaqueType {\n return validateNode({\n type: \"OpaqueType\",\n id,\n typeParameters,\n supertype,\n impltype,\n });\n}\nexport function qualifiedTypeIdentifier(\n id: t.Identifier,\n qualification: t.Identifier | t.QualifiedTypeIdentifier,\n): t.QualifiedTypeIdentifier {\n return validateNode({\n type: \"QualifiedTypeIdentifier\",\n id,\n qualification,\n });\n}\nexport function stringLiteralTypeAnnotation(\n value: string,\n): t.StringLiteralTypeAnnotation {\n return validateNode({\n type: \"StringLiteralTypeAnnotation\",\n value,\n });\n}\nexport function stringTypeAnnotation(): t.StringTypeAnnotation {\n return {\n type: \"StringTypeAnnotation\",\n };\n}\nexport function symbolTypeAnnotation(): t.SymbolTypeAnnotation {\n return {\n type: \"SymbolTypeAnnotation\",\n };\n}\nexport function thisTypeAnnotation(): t.ThisTypeAnnotation {\n return {\n type: \"ThisTypeAnnotation\",\n };\n}\nexport function tupleTypeAnnotation(\n types: Array,\n): t.TupleTypeAnnotation {\n return validateNode({\n type: \"TupleTypeAnnotation\",\n types,\n });\n}\nexport function typeofTypeAnnotation(\n argument: t.FlowType,\n): t.TypeofTypeAnnotation {\n return validateNode({\n type: \"TypeofTypeAnnotation\",\n argument,\n });\n}\nexport function typeAlias(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n right: t.FlowType,\n): t.TypeAlias {\n return validateNode({\n type: \"TypeAlias\",\n id,\n typeParameters,\n right,\n });\n}\nexport function typeAnnotation(typeAnnotation: t.FlowType): t.TypeAnnotation {\n return validateNode({\n type: \"TypeAnnotation\",\n typeAnnotation,\n });\n}\nexport function typeCastExpression(\n expression: t.Expression,\n typeAnnotation: t.TypeAnnotation,\n): t.TypeCastExpression {\n return validateNode({\n type: \"TypeCastExpression\",\n expression,\n typeAnnotation,\n });\n}\nexport function typeParameter(\n bound: t.TypeAnnotation | null = null,\n _default: t.FlowType | null = null,\n variance: t.Variance | null = null,\n): t.TypeParameter {\n return validateNode({\n type: \"TypeParameter\",\n bound,\n default: _default,\n variance,\n name: null,\n });\n}\nexport function typeParameterDeclaration(\n params: Array,\n): t.TypeParameterDeclaration {\n return validateNode({\n type: \"TypeParameterDeclaration\",\n params,\n });\n}\nexport function typeParameterInstantiation(\n params: Array,\n): t.TypeParameterInstantiation {\n return validateNode({\n type: \"TypeParameterInstantiation\",\n params,\n });\n}\nexport function unionTypeAnnotation(\n types: Array,\n): t.UnionTypeAnnotation {\n return validateNode({\n type: \"UnionTypeAnnotation\",\n types,\n });\n}\nexport function variance(kind: \"minus\" | \"plus\"): t.Variance {\n return validateNode({\n type: \"Variance\",\n kind,\n });\n}\nexport function voidTypeAnnotation(): t.VoidTypeAnnotation {\n return {\n type: \"VoidTypeAnnotation\",\n };\n}\nexport function enumDeclaration(\n id: t.Identifier,\n body:\n | t.EnumBooleanBody\n | t.EnumNumberBody\n | t.EnumStringBody\n | t.EnumSymbolBody,\n): t.EnumDeclaration {\n return validateNode({\n type: \"EnumDeclaration\",\n id,\n body,\n });\n}\nexport function enumBooleanBody(\n members: Array,\n): t.EnumBooleanBody {\n return validateNode({\n type: \"EnumBooleanBody\",\n members,\n explicitType: null,\n hasUnknownMembers: null,\n });\n}\nexport function enumNumberBody(\n members: Array,\n): t.EnumNumberBody {\n return validateNode({\n type: \"EnumNumberBody\",\n members,\n explicitType: null,\n hasUnknownMembers: null,\n });\n}\nexport function enumStringBody(\n members: Array,\n): t.EnumStringBody {\n return validateNode({\n type: \"EnumStringBody\",\n members,\n explicitType: null,\n hasUnknownMembers: null,\n });\n}\nexport function enumSymbolBody(\n members: Array,\n): t.EnumSymbolBody {\n return validateNode({\n type: \"EnumSymbolBody\",\n members,\n hasUnknownMembers: null,\n });\n}\nexport function enumBooleanMember(id: t.Identifier): t.EnumBooleanMember {\n return validateNode({\n type: \"EnumBooleanMember\",\n id,\n init: null,\n });\n}\nexport function enumNumberMember(\n id: t.Identifier,\n init: t.NumericLiteral,\n): t.EnumNumberMember {\n return validateNode({\n type: \"EnumNumberMember\",\n id,\n init,\n });\n}\nexport function enumStringMember(\n id: t.Identifier,\n init: t.StringLiteral,\n): t.EnumStringMember {\n return validateNode({\n type: \"EnumStringMember\",\n id,\n init,\n });\n}\nexport function enumDefaultedMember(id: t.Identifier): t.EnumDefaultedMember {\n return validateNode({\n type: \"EnumDefaultedMember\",\n id,\n });\n}\nexport function indexedAccessType(\n objectType: t.FlowType,\n indexType: t.FlowType,\n): t.IndexedAccessType {\n return validateNode({\n type: \"IndexedAccessType\",\n objectType,\n indexType,\n });\n}\nexport function optionalIndexedAccessType(\n objectType: t.FlowType,\n indexType: t.FlowType,\n): t.OptionalIndexedAccessType {\n return validateNode({\n type: \"OptionalIndexedAccessType\",\n objectType,\n indexType,\n optional: null,\n });\n}\nexport function jsxAttribute(\n name: t.JSXIdentifier | t.JSXNamespacedName,\n value:\n | t.JSXElement\n | t.JSXFragment\n | t.StringLiteral\n | t.JSXExpressionContainer\n | null = null,\n): t.JSXAttribute {\n return validateNode({\n type: \"JSXAttribute\",\n name,\n value,\n });\n}\nexport { jsxAttribute as jSXAttribute };\nexport function jsxClosingElement(\n name: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,\n): t.JSXClosingElement {\n return validateNode({\n type: \"JSXClosingElement\",\n name,\n });\n}\nexport { jsxClosingElement as jSXClosingElement };\nexport function jsxElement(\n openingElement: t.JSXOpeningElement,\n closingElement: t.JSXClosingElement | null | undefined = null,\n children: Array<\n | t.JSXText\n | t.JSXExpressionContainer\n | t.JSXSpreadChild\n | t.JSXElement\n | t.JSXFragment\n >,\n selfClosing: boolean | null = null,\n): t.JSXElement {\n return validateNode({\n type: \"JSXElement\",\n openingElement,\n closingElement,\n children,\n selfClosing,\n });\n}\nexport { jsxElement as jSXElement };\nexport function jsxEmptyExpression(): t.JSXEmptyExpression {\n return {\n type: \"JSXEmptyExpression\",\n };\n}\nexport { jsxEmptyExpression as jSXEmptyExpression };\nexport function jsxExpressionContainer(\n expression: t.Expression | t.JSXEmptyExpression,\n): t.JSXExpressionContainer {\n return validateNode({\n type: \"JSXExpressionContainer\",\n expression,\n });\n}\nexport { jsxExpressionContainer as jSXExpressionContainer };\nexport function jsxSpreadChild(expression: t.Expression): t.JSXSpreadChild {\n return validateNode({\n type: \"JSXSpreadChild\",\n expression,\n });\n}\nexport { jsxSpreadChild as jSXSpreadChild };\nexport function jsxIdentifier(name: string): t.JSXIdentifier {\n return validateNode({\n type: \"JSXIdentifier\",\n name,\n });\n}\nexport { jsxIdentifier as jSXIdentifier };\nexport function jsxMemberExpression(\n object: t.JSXMemberExpression | t.JSXIdentifier,\n property: t.JSXIdentifier,\n): t.JSXMemberExpression {\n return validateNode({\n type: \"JSXMemberExpression\",\n object,\n property,\n });\n}\nexport { jsxMemberExpression as jSXMemberExpression };\nexport function jsxNamespacedName(\n namespace: t.JSXIdentifier,\n name: t.JSXIdentifier,\n): t.JSXNamespacedName {\n return validateNode({\n type: \"JSXNamespacedName\",\n namespace,\n name,\n });\n}\nexport { jsxNamespacedName as jSXNamespacedName };\nexport function jsxOpeningElement(\n name: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,\n attributes: Array,\n selfClosing: boolean = false,\n): t.JSXOpeningElement {\n return validateNode({\n type: \"JSXOpeningElement\",\n name,\n attributes,\n selfClosing,\n });\n}\nexport { jsxOpeningElement as jSXOpeningElement };\nexport function jsxSpreadAttribute(\n argument: t.Expression,\n): t.JSXSpreadAttribute {\n return validateNode({\n type: \"JSXSpreadAttribute\",\n argument,\n });\n}\nexport { jsxSpreadAttribute as jSXSpreadAttribute };\nexport function jsxText(value: string): t.JSXText {\n return validateNode({\n type: \"JSXText\",\n value,\n });\n}\nexport { jsxText as jSXText };\nexport function jsxFragment(\n openingFragment: t.JSXOpeningFragment,\n closingFragment: t.JSXClosingFragment,\n children: Array<\n | t.JSXText\n | t.JSXExpressionContainer\n | t.JSXSpreadChild\n | t.JSXElement\n | t.JSXFragment\n >,\n): t.JSXFragment {\n return validateNode({\n type: \"JSXFragment\",\n openingFragment,\n closingFragment,\n children,\n });\n}\nexport { jsxFragment as jSXFragment };\nexport function jsxOpeningFragment(): t.JSXOpeningFragment {\n return {\n type: \"JSXOpeningFragment\",\n };\n}\nexport { jsxOpeningFragment as jSXOpeningFragment };\nexport function jsxClosingFragment(): t.JSXClosingFragment {\n return {\n type: \"JSXClosingFragment\",\n };\n}\nexport { jsxClosingFragment as jSXClosingFragment };\nexport function noop(): t.Noop {\n return {\n type: \"Noop\",\n };\n}\nexport function placeholder(\n expectedNode:\n | \"Identifier\"\n | \"StringLiteral\"\n | \"Expression\"\n | \"Statement\"\n | \"Declaration\"\n | \"BlockStatement\"\n | \"ClassBody\"\n | \"Pattern\",\n name: t.Identifier,\n): t.Placeholder {\n return validateNode({\n type: \"Placeholder\",\n expectedNode,\n name,\n });\n}\nexport function v8IntrinsicIdentifier(name: string): t.V8IntrinsicIdentifier {\n return validateNode({\n type: \"V8IntrinsicIdentifier\",\n name,\n });\n}\nexport function argumentPlaceholder(): t.ArgumentPlaceholder {\n return {\n type: \"ArgumentPlaceholder\",\n };\n}\nexport function bindExpression(\n object: t.Expression,\n callee: t.Expression,\n): t.BindExpression {\n return validateNode({\n type: \"BindExpression\",\n object,\n callee,\n });\n}\nexport function importAttribute(\n key: t.Identifier | t.StringLiteral,\n value: t.StringLiteral,\n): t.ImportAttribute {\n return validateNode({\n type: \"ImportAttribute\",\n key,\n value,\n });\n}\nexport function decorator(expression: t.Expression): t.Decorator {\n return validateNode({\n type: \"Decorator\",\n expression,\n });\n}\nexport function doExpression(\n body: t.BlockStatement,\n async: boolean = false,\n): t.DoExpression {\n return validateNode({\n type: \"DoExpression\",\n body,\n async,\n });\n}\nexport function exportDefaultSpecifier(\n exported: t.Identifier,\n): t.ExportDefaultSpecifier {\n return validateNode({\n type: \"ExportDefaultSpecifier\",\n exported,\n });\n}\nexport function recordExpression(\n properties: Array,\n): t.RecordExpression {\n return validateNode({\n type: \"RecordExpression\",\n properties,\n });\n}\nexport function tupleExpression(\n elements: Array = [],\n): t.TupleExpression {\n return validateNode({\n type: \"TupleExpression\",\n elements,\n });\n}\nexport function decimalLiteral(value: string): t.DecimalLiteral {\n return validateNode({\n type: \"DecimalLiteral\",\n value,\n });\n}\nexport function moduleExpression(body: t.Program): t.ModuleExpression {\n return validateNode({\n type: \"ModuleExpression\",\n body,\n });\n}\nexport function topicReference(): t.TopicReference {\n return {\n type: \"TopicReference\",\n };\n}\nexport function pipelineTopicExpression(\n expression: t.Expression,\n): t.PipelineTopicExpression {\n return validateNode({\n type: \"PipelineTopicExpression\",\n expression,\n });\n}\nexport function pipelineBareFunction(\n callee: t.Expression,\n): t.PipelineBareFunction {\n return validateNode({\n type: \"PipelineBareFunction\",\n callee,\n });\n}\nexport function pipelinePrimaryTopicReference(): t.PipelinePrimaryTopicReference {\n return {\n type: \"PipelinePrimaryTopicReference\",\n };\n}\nexport function tsParameterProperty(\n parameter: t.Identifier | t.AssignmentPattern,\n): t.TSParameterProperty {\n return validateNode({\n type: \"TSParameterProperty\",\n parameter,\n });\n}\nexport { tsParameterProperty as tSParameterProperty };\nexport function tsDeclareFunction(\n id: t.Identifier | null | undefined = null,\n typeParameters:\n | t.TSTypeParameterDeclaration\n | t.Noop\n | null\n | undefined = null,\n params: Array,\n returnType: t.TSTypeAnnotation | t.Noop | null = null,\n): t.TSDeclareFunction {\n return validateNode({\n type: \"TSDeclareFunction\",\n id,\n typeParameters,\n params,\n returnType,\n });\n}\nexport { tsDeclareFunction as tSDeclareFunction };\nexport function tsDeclareMethod(\n decorators: Array | null | undefined = null,\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression,\n typeParameters:\n | t.TSTypeParameterDeclaration\n | t.Noop\n | null\n | undefined = null,\n params: Array<\n t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty\n >,\n returnType: t.TSTypeAnnotation | t.Noop | null = null,\n): t.TSDeclareMethod {\n return validateNode({\n type: \"TSDeclareMethod\",\n decorators,\n key,\n typeParameters,\n params,\n returnType,\n });\n}\nexport { tsDeclareMethod as tSDeclareMethod };\nexport function tsQualifiedName(\n left: t.TSEntityName,\n right: t.Identifier,\n): t.TSQualifiedName {\n return validateNode({\n type: \"TSQualifiedName\",\n left,\n right,\n });\n}\nexport { tsQualifiedName as tSQualifiedName };\nexport function tsCallSignatureDeclaration(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSCallSignatureDeclaration {\n return validateNode({\n type: \"TSCallSignatureDeclaration\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsCallSignatureDeclaration as tSCallSignatureDeclaration };\nexport function tsConstructSignatureDeclaration(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSConstructSignatureDeclaration {\n return validateNode({\n type: \"TSConstructSignatureDeclaration\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsConstructSignatureDeclaration as tSConstructSignatureDeclaration };\nexport function tsPropertySignature(\n key: t.Expression,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n initializer: t.Expression | null = null,\n): t.TSPropertySignature {\n return validateNode({\n type: \"TSPropertySignature\",\n key,\n typeAnnotation,\n initializer,\n kind: null,\n });\n}\nexport { tsPropertySignature as tSPropertySignature };\nexport function tsMethodSignature(\n key: t.Expression,\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSMethodSignature {\n return validateNode({\n type: \"TSMethodSignature\",\n key,\n typeParameters,\n parameters,\n typeAnnotation,\n kind: null,\n });\n}\nexport { tsMethodSignature as tSMethodSignature };\nexport function tsIndexSignature(\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSIndexSignature {\n return validateNode({\n type: \"TSIndexSignature\",\n parameters,\n typeAnnotation,\n });\n}\nexport { tsIndexSignature as tSIndexSignature };\nexport function tsAnyKeyword(): t.TSAnyKeyword {\n return {\n type: \"TSAnyKeyword\",\n };\n}\nexport { tsAnyKeyword as tSAnyKeyword };\nexport function tsBooleanKeyword(): t.TSBooleanKeyword {\n return {\n type: \"TSBooleanKeyword\",\n };\n}\nexport { tsBooleanKeyword as tSBooleanKeyword };\nexport function tsBigIntKeyword(): t.TSBigIntKeyword {\n return {\n type: \"TSBigIntKeyword\",\n };\n}\nexport { tsBigIntKeyword as tSBigIntKeyword };\nexport function tsIntrinsicKeyword(): t.TSIntrinsicKeyword {\n return {\n type: \"TSIntrinsicKeyword\",\n };\n}\nexport { tsIntrinsicKeyword as tSIntrinsicKeyword };\nexport function tsNeverKeyword(): t.TSNeverKeyword {\n return {\n type: \"TSNeverKeyword\",\n };\n}\nexport { tsNeverKeyword as tSNeverKeyword };\nexport function tsNullKeyword(): t.TSNullKeyword {\n return {\n type: \"TSNullKeyword\",\n };\n}\nexport { tsNullKeyword as tSNullKeyword };\nexport function tsNumberKeyword(): t.TSNumberKeyword {\n return {\n type: \"TSNumberKeyword\",\n };\n}\nexport { tsNumberKeyword as tSNumberKeyword };\nexport function tsObjectKeyword(): t.TSObjectKeyword {\n return {\n type: \"TSObjectKeyword\",\n };\n}\nexport { tsObjectKeyword as tSObjectKeyword };\nexport function tsStringKeyword(): t.TSStringKeyword {\n return {\n type: \"TSStringKeyword\",\n };\n}\nexport { tsStringKeyword as tSStringKeyword };\nexport function tsSymbolKeyword(): t.TSSymbolKeyword {\n return {\n type: \"TSSymbolKeyword\",\n };\n}\nexport { tsSymbolKeyword as tSSymbolKeyword };\nexport function tsUndefinedKeyword(): t.TSUndefinedKeyword {\n return {\n type: \"TSUndefinedKeyword\",\n };\n}\nexport { tsUndefinedKeyword as tSUndefinedKeyword };\nexport function tsUnknownKeyword(): t.TSUnknownKeyword {\n return {\n type: \"TSUnknownKeyword\",\n };\n}\nexport { tsUnknownKeyword as tSUnknownKeyword };\nexport function tsVoidKeyword(): t.TSVoidKeyword {\n return {\n type: \"TSVoidKeyword\",\n };\n}\nexport { tsVoidKeyword as tSVoidKeyword };\nexport function tsThisType(): t.TSThisType {\n return {\n type: \"TSThisType\",\n };\n}\nexport { tsThisType as tSThisType };\nexport function tsFunctionType(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSFunctionType {\n return validateNode({\n type: \"TSFunctionType\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsFunctionType as tSFunctionType };\nexport function tsConstructorType(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSConstructorType {\n return validateNode({\n type: \"TSConstructorType\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsConstructorType as tSConstructorType };\nexport function tsTypeReference(\n typeName: t.TSEntityName,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSTypeReference {\n return validateNode({\n type: \"TSTypeReference\",\n typeName,\n typeParameters,\n });\n}\nexport { tsTypeReference as tSTypeReference };\nexport function tsTypePredicate(\n parameterName: t.Identifier | t.TSThisType,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n asserts: boolean | null = null,\n): t.TSTypePredicate {\n return validateNode({\n type: \"TSTypePredicate\",\n parameterName,\n typeAnnotation,\n asserts,\n });\n}\nexport { tsTypePredicate as tSTypePredicate };\nexport function tsTypeQuery(\n exprName: t.TSEntityName | t.TSImportType,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSTypeQuery {\n return validateNode({\n type: \"TSTypeQuery\",\n exprName,\n typeParameters,\n });\n}\nexport { tsTypeQuery as tSTypeQuery };\nexport function tsTypeLiteral(\n members: Array,\n): t.TSTypeLiteral {\n return validateNode({\n type: \"TSTypeLiteral\",\n members,\n });\n}\nexport { tsTypeLiteral as tSTypeLiteral };\nexport function tsArrayType(elementType: t.TSType): t.TSArrayType {\n return validateNode({\n type: \"TSArrayType\",\n elementType,\n });\n}\nexport { tsArrayType as tSArrayType };\nexport function tsTupleType(\n elementTypes: Array,\n): t.TSTupleType {\n return validateNode({\n type: \"TSTupleType\",\n elementTypes,\n });\n}\nexport { tsTupleType as tSTupleType };\nexport function tsOptionalType(typeAnnotation: t.TSType): t.TSOptionalType {\n return validateNode({\n type: \"TSOptionalType\",\n typeAnnotation,\n });\n}\nexport { tsOptionalType as tSOptionalType };\nexport function tsRestType(typeAnnotation: t.TSType): t.TSRestType {\n return validateNode({\n type: \"TSRestType\",\n typeAnnotation,\n });\n}\nexport { tsRestType as tSRestType };\nexport function tsNamedTupleMember(\n label: t.Identifier,\n elementType: t.TSType,\n optional: boolean = false,\n): t.TSNamedTupleMember {\n return validateNode({\n type: \"TSNamedTupleMember\",\n label,\n elementType,\n optional,\n });\n}\nexport { tsNamedTupleMember as tSNamedTupleMember };\nexport function tsUnionType(types: Array): t.TSUnionType {\n return validateNode({\n type: \"TSUnionType\",\n types,\n });\n}\nexport { tsUnionType as tSUnionType };\nexport function tsIntersectionType(\n types: Array,\n): t.TSIntersectionType {\n return validateNode({\n type: \"TSIntersectionType\",\n types,\n });\n}\nexport { tsIntersectionType as tSIntersectionType };\nexport function tsConditionalType(\n checkType: t.TSType,\n extendsType: t.TSType,\n trueType: t.TSType,\n falseType: t.TSType,\n): t.TSConditionalType {\n return validateNode({\n type: \"TSConditionalType\",\n checkType,\n extendsType,\n trueType,\n falseType,\n });\n}\nexport { tsConditionalType as tSConditionalType };\nexport function tsInferType(typeParameter: t.TSTypeParameter): t.TSInferType {\n return validateNode({\n type: \"TSInferType\",\n typeParameter,\n });\n}\nexport { tsInferType as tSInferType };\nexport function tsParenthesizedType(\n typeAnnotation: t.TSType,\n): t.TSParenthesizedType {\n return validateNode({\n type: \"TSParenthesizedType\",\n typeAnnotation,\n });\n}\nexport { tsParenthesizedType as tSParenthesizedType };\nexport function tsTypeOperator(typeAnnotation: t.TSType): t.TSTypeOperator {\n return validateNode({\n type: \"TSTypeOperator\",\n typeAnnotation,\n operator: null,\n });\n}\nexport { tsTypeOperator as tSTypeOperator };\nexport function tsIndexedAccessType(\n objectType: t.TSType,\n indexType: t.TSType,\n): t.TSIndexedAccessType {\n return validateNode({\n type: \"TSIndexedAccessType\",\n objectType,\n indexType,\n });\n}\nexport { tsIndexedAccessType as tSIndexedAccessType };\nexport function tsMappedType(\n typeParameter: t.TSTypeParameter,\n typeAnnotation: t.TSType | null = null,\n nameType: t.TSType | null = null,\n): t.TSMappedType {\n return validateNode({\n type: \"TSMappedType\",\n typeParameter,\n typeAnnotation,\n nameType,\n });\n}\nexport { tsMappedType as tSMappedType };\nexport function tsLiteralType(\n literal:\n | t.NumericLiteral\n | t.StringLiteral\n | t.BooleanLiteral\n | t.BigIntLiteral\n | t.TemplateLiteral\n | t.UnaryExpression,\n): t.TSLiteralType {\n return validateNode({\n type: \"TSLiteralType\",\n literal,\n });\n}\nexport { tsLiteralType as tSLiteralType };\nexport function tsExpressionWithTypeArguments(\n expression: t.TSEntityName,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSExpressionWithTypeArguments {\n return validateNode({\n type: \"TSExpressionWithTypeArguments\",\n expression,\n typeParameters,\n });\n}\nexport { tsExpressionWithTypeArguments as tSExpressionWithTypeArguments };\nexport function tsInterfaceDeclaration(\n id: t.Identifier,\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.TSInterfaceBody,\n): t.TSInterfaceDeclaration {\n return validateNode({\n type: \"TSInterfaceDeclaration\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport { tsInterfaceDeclaration as tSInterfaceDeclaration };\nexport function tsInterfaceBody(\n body: Array,\n): t.TSInterfaceBody {\n return validateNode({\n type: \"TSInterfaceBody\",\n body,\n });\n}\nexport { tsInterfaceBody as tSInterfaceBody };\nexport function tsTypeAliasDeclaration(\n id: t.Identifier,\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n typeAnnotation: t.TSType,\n): t.TSTypeAliasDeclaration {\n return validateNode({\n type: \"TSTypeAliasDeclaration\",\n id,\n typeParameters,\n typeAnnotation,\n });\n}\nexport { tsTypeAliasDeclaration as tSTypeAliasDeclaration };\nexport function tsInstantiationExpression(\n expression: t.Expression,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSInstantiationExpression {\n return validateNode({\n type: \"TSInstantiationExpression\",\n expression,\n typeParameters,\n });\n}\nexport { tsInstantiationExpression as tSInstantiationExpression };\nexport function tsAsExpression(\n expression: t.Expression,\n typeAnnotation: t.TSType,\n): t.TSAsExpression {\n return validateNode({\n type: \"TSAsExpression\",\n expression,\n typeAnnotation,\n });\n}\nexport { tsAsExpression as tSAsExpression };\nexport function tsSatisfiesExpression(\n expression: t.Expression,\n typeAnnotation: t.TSType,\n): t.TSSatisfiesExpression {\n return validateNode({\n type: \"TSSatisfiesExpression\",\n expression,\n typeAnnotation,\n });\n}\nexport { tsSatisfiesExpression as tSSatisfiesExpression };\nexport function tsTypeAssertion(\n typeAnnotation: t.TSType,\n expression: t.Expression,\n): t.TSTypeAssertion {\n return validateNode({\n type: \"TSTypeAssertion\",\n typeAnnotation,\n expression,\n });\n}\nexport { tsTypeAssertion as tSTypeAssertion };\nexport function tsEnumDeclaration(\n id: t.Identifier,\n members: Array,\n): t.TSEnumDeclaration {\n return validateNode({\n type: \"TSEnumDeclaration\",\n id,\n members,\n });\n}\nexport { tsEnumDeclaration as tSEnumDeclaration };\nexport function tsEnumMember(\n id: t.Identifier | t.StringLiteral,\n initializer: t.Expression | null = null,\n): t.TSEnumMember {\n return validateNode({\n type: \"TSEnumMember\",\n id,\n initializer,\n });\n}\nexport { tsEnumMember as tSEnumMember };\nexport function tsModuleDeclaration(\n id: t.Identifier | t.StringLiteral,\n body: t.TSModuleBlock | t.TSModuleDeclaration,\n): t.TSModuleDeclaration {\n return validateNode({\n type: \"TSModuleDeclaration\",\n id,\n body,\n });\n}\nexport { tsModuleDeclaration as tSModuleDeclaration };\nexport function tsModuleBlock(body: Array): t.TSModuleBlock {\n return validateNode({\n type: \"TSModuleBlock\",\n body,\n });\n}\nexport { tsModuleBlock as tSModuleBlock };\nexport function tsImportType(\n argument: t.StringLiteral,\n qualifier: t.TSEntityName | null = null,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSImportType {\n return validateNode({\n type: \"TSImportType\",\n argument,\n qualifier,\n typeParameters,\n });\n}\nexport { tsImportType as tSImportType };\nexport function tsImportEqualsDeclaration(\n id: t.Identifier,\n moduleReference: t.TSEntityName | t.TSExternalModuleReference,\n): t.TSImportEqualsDeclaration {\n return validateNode({\n type: \"TSImportEqualsDeclaration\",\n id,\n moduleReference,\n isExport: null,\n });\n}\nexport { tsImportEqualsDeclaration as tSImportEqualsDeclaration };\nexport function tsExternalModuleReference(\n expression: t.StringLiteral,\n): t.TSExternalModuleReference {\n return validateNode({\n type: \"TSExternalModuleReference\",\n expression,\n });\n}\nexport { tsExternalModuleReference as tSExternalModuleReference };\nexport function tsNonNullExpression(\n expression: t.Expression,\n): t.TSNonNullExpression {\n return validateNode({\n type: \"TSNonNullExpression\",\n expression,\n });\n}\nexport { tsNonNullExpression as tSNonNullExpression };\nexport function tsExportAssignment(\n expression: t.Expression,\n): t.TSExportAssignment {\n return validateNode({\n type: \"TSExportAssignment\",\n expression,\n });\n}\nexport { tsExportAssignment as tSExportAssignment };\nexport function tsNamespaceExportDeclaration(\n id: t.Identifier,\n): t.TSNamespaceExportDeclaration {\n return validateNode({\n type: \"TSNamespaceExportDeclaration\",\n id,\n });\n}\nexport { tsNamespaceExportDeclaration as tSNamespaceExportDeclaration };\nexport function tsTypeAnnotation(typeAnnotation: t.TSType): t.TSTypeAnnotation {\n return validateNode({\n type: \"TSTypeAnnotation\",\n typeAnnotation,\n });\n}\nexport { tsTypeAnnotation as tSTypeAnnotation };\nexport function tsTypeParameterInstantiation(\n params: Array,\n): t.TSTypeParameterInstantiation {\n return validateNode({\n type: \"TSTypeParameterInstantiation\",\n params,\n });\n}\nexport { tsTypeParameterInstantiation as tSTypeParameterInstantiation };\nexport function tsTypeParameterDeclaration(\n params: Array,\n): t.TSTypeParameterDeclaration {\n return validateNode({\n type: \"TSTypeParameterDeclaration\",\n params,\n });\n}\nexport { tsTypeParameterDeclaration as tSTypeParameterDeclaration };\nexport function tsTypeParameter(\n constraint: t.TSType | null | undefined = null,\n _default: t.TSType | null | undefined = null,\n name: string,\n): t.TSTypeParameter {\n return validateNode({\n type: \"TSTypeParameter\",\n constraint,\n default: _default,\n name,\n });\n}\nexport { tsTypeParameter as tSTypeParameter };\n/** @deprecated */\nfunction NumberLiteral(value: number) {\n deprecationWarning(\"NumberLiteral\", \"NumericLiteral\", \"The node type \");\n return numericLiteral(value);\n}\nexport { NumberLiteral as numberLiteral };\n/** @deprecated */\nfunction RegexLiteral(pattern: string, flags: string = \"\") {\n deprecationWarning(\"RegexLiteral\", \"RegExpLiteral\", \"The node type \");\n return regExpLiteral(pattern, flags);\n}\nexport { RegexLiteral as regexLiteral };\n/** @deprecated */\nfunction RestProperty(argument: t.LVal) {\n deprecationWarning(\"RestProperty\", \"RestElement\", \"The node type \");\n return restElement(argument);\n}\nexport { RestProperty as restProperty };\n/** @deprecated */\nfunction SpreadProperty(argument: t.Expression) {\n deprecationWarning(\"SpreadProperty\", \"SpreadElement\", \"The node type \");\n return spreadElement(argument);\n}\nexport { SpreadProperty as spreadProperty };\n","import { stringLiteral } from \"../../builders/generated\";\nimport type * as t from \"../..\";\nimport { inherits } from \"../..\";\n\nexport default function cleanJSXElementLiteralChild(\n child: t.JSXText,\n args: Array,\n) {\n const lines = child.value.split(/\\r\\n|\\n|\\r/);\n\n let lastNonEmptyLine = 0;\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n let str = \"\";\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const isFirstLine = i === 0;\n const isLastLine = i === lines.length - 1;\n const isLastNonEmptyLine = i === lastNonEmptyLine;\n\n // replace rendered whitespace tabs with spaces\n let trimmedLine = line.replace(/\\t/g, \" \");\n\n // trim whitespace touching a newline\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n // trim whitespace touching an endline\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push(inherits(stringLiteral(str), child));\n}\n","import {\n isJSXText,\n isJSXExpressionContainer,\n isJSXEmptyExpression,\n} from \"../../validators/generated\";\nimport cleanJSXElementLiteralChild from \"../../utils/react/cleanJSXElementLiteralChild\";\nimport type * as t from \"../..\";\n\ntype ReturnedChild =\n | t.JSXSpreadChild\n | t.JSXElement\n | t.JSXFragment\n | t.Expression;\n\nexport default function buildChildren(\n node: t.JSXElement | t.JSXFragment,\n): ReturnedChild[] {\n const elements = [];\n\n for (let i = 0; i < node.children.length; i++) {\n let child: any = node.children[i];\n\n if (isJSXText(child)) {\n cleanJSXElementLiteralChild(child, elements);\n continue;\n }\n\n if (isJSXExpressionContainer(child)) child = child.expression;\n if (isJSXEmptyExpression(child)) continue;\n\n elements.push(child);\n }\n\n return elements;\n}\n","import { VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function isNode(node: any): node is t.Node {\n return !!(node && VISITOR_KEYS[node.type]);\n}\n","import isNode from \"../validators/isNode\";\nimport type * as t from \"..\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type}\"`);\n }\n}\n","/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport is from \"../../validators/is\";\nimport type * as t from \"../..\";\nimport deprecationWarning from \"../../utils/deprecationWarning\";\n\nfunction assert(type: string, node: any, opts?: any): void {\n if (!is(type, node, opts)) {\n throw new Error(\n `Expected type \"${type}\" with option ${JSON.stringify(opts)}, ` +\n `but instead got \"${node.type}\".`,\n );\n }\n}\n\nexport function assertArrayExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ArrayExpression {\n assert(\"ArrayExpression\", node, opts);\n}\nexport function assertAssignmentExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.AssignmentExpression {\n assert(\"AssignmentExpression\", node, opts);\n}\nexport function assertBinaryExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BinaryExpression {\n assert(\"BinaryExpression\", node, opts);\n}\nexport function assertInterpreterDirective(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.InterpreterDirective {\n assert(\"InterpreterDirective\", node, opts);\n}\nexport function assertDirective(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Directive {\n assert(\"Directive\", node, opts);\n}\nexport function assertDirectiveLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DirectiveLiteral {\n assert(\"DirectiveLiteral\", node, opts);\n}\nexport function assertBlockStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BlockStatement {\n assert(\"BlockStatement\", node, opts);\n}\nexport function assertBreakStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BreakStatement {\n assert(\"BreakStatement\", node, opts);\n}\nexport function assertCallExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.CallExpression {\n assert(\"CallExpression\", node, opts);\n}\nexport function assertCatchClause(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.CatchClause {\n assert(\"CatchClause\", node, opts);\n}\nexport function assertConditionalExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ConditionalExpression {\n assert(\"ConditionalExpression\", node, opts);\n}\nexport function assertContinueStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ContinueStatement {\n assert(\"ContinueStatement\", node, opts);\n}\nexport function assertDebuggerStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DebuggerStatement {\n assert(\"DebuggerStatement\", node, opts);\n}\nexport function assertDoWhileStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DoWhileStatement {\n assert(\"DoWhileStatement\", node, opts);\n}\nexport function assertEmptyStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EmptyStatement {\n assert(\"EmptyStatement\", node, opts);\n}\nexport function assertExpressionStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExpressionStatement {\n assert(\"ExpressionStatement\", node, opts);\n}\nexport function assertFile(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.File {\n assert(\"File\", node, opts);\n}\nexport function assertForInStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ForInStatement {\n assert(\"ForInStatement\", node, opts);\n}\nexport function assertForStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ForStatement {\n assert(\"ForStatement\", node, opts);\n}\nexport function assertFunctionDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FunctionDeclaration {\n assert(\"FunctionDeclaration\", node, opts);\n}\nexport function assertFunctionExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FunctionExpression {\n assert(\"FunctionExpression\", node, opts);\n}\nexport function assertIdentifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Identifier {\n assert(\"Identifier\", node, opts);\n}\nexport function assertIfStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.IfStatement {\n assert(\"IfStatement\", node, opts);\n}\nexport function assertLabeledStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.LabeledStatement {\n assert(\"LabeledStatement\", node, opts);\n}\nexport function assertStringLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.StringLiteral {\n assert(\"StringLiteral\", node, opts);\n}\nexport function assertNumericLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NumericLiteral {\n assert(\"NumericLiteral\", node, opts);\n}\nexport function assertNullLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NullLiteral {\n assert(\"NullLiteral\", node, opts);\n}\nexport function assertBooleanLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BooleanLiteral {\n assert(\"BooleanLiteral\", node, opts);\n}\nexport function assertRegExpLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.RegExpLiteral {\n assert(\"RegExpLiteral\", node, opts);\n}\nexport function assertLogicalExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.LogicalExpression {\n assert(\"LogicalExpression\", node, opts);\n}\nexport function assertMemberExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.MemberExpression {\n assert(\"MemberExpression\", node, opts);\n}\nexport function assertNewExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NewExpression {\n assert(\"NewExpression\", node, opts);\n}\nexport function assertProgram(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Program {\n assert(\"Program\", node, opts);\n}\nexport function assertObjectExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectExpression {\n assert(\"ObjectExpression\", node, opts);\n}\nexport function assertObjectMethod(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectMethod {\n assert(\"ObjectMethod\", node, opts);\n}\nexport function assertObjectProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectProperty {\n assert(\"ObjectProperty\", node, opts);\n}\nexport function assertRestElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.RestElement {\n assert(\"RestElement\", node, opts);\n}\nexport function assertReturnStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ReturnStatement {\n assert(\"ReturnStatement\", node, opts);\n}\nexport function assertSequenceExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.SequenceExpression {\n assert(\"SequenceExpression\", node, opts);\n}\nexport function assertParenthesizedExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ParenthesizedExpression {\n assert(\"ParenthesizedExpression\", node, opts);\n}\nexport function assertSwitchCase(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.SwitchCase {\n assert(\"SwitchCase\", node, opts);\n}\nexport function assertSwitchStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.SwitchStatement {\n assert(\"SwitchStatement\", node, opts);\n}\nexport function assertThisExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ThisExpression {\n assert(\"ThisExpression\", node, opts);\n}\nexport function assertThrowStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ThrowStatement {\n assert(\"ThrowStatement\", node, opts);\n}\nexport function assertTryStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TryStatement {\n assert(\"TryStatement\", node, opts);\n}\nexport function assertUnaryExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.UnaryExpression {\n assert(\"UnaryExpression\", node, opts);\n}\nexport function assertUpdateExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.UpdateExpression {\n assert(\"UpdateExpression\", node, opts);\n}\nexport function assertVariableDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.VariableDeclaration {\n assert(\"VariableDeclaration\", node, opts);\n}\nexport function assertVariableDeclarator(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.VariableDeclarator {\n assert(\"VariableDeclarator\", node, opts);\n}\nexport function assertWhileStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.WhileStatement {\n assert(\"WhileStatement\", node, opts);\n}\nexport function assertWithStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.WithStatement {\n assert(\"WithStatement\", node, opts);\n}\nexport function assertAssignmentPattern(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.AssignmentPattern {\n assert(\"AssignmentPattern\", node, opts);\n}\nexport function assertArrayPattern(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ArrayPattern {\n assert(\"ArrayPattern\", node, opts);\n}\nexport function assertArrowFunctionExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ArrowFunctionExpression {\n assert(\"ArrowFunctionExpression\", node, opts);\n}\nexport function assertClassBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassBody {\n assert(\"ClassBody\", node, opts);\n}\nexport function assertClassExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassExpression {\n assert(\"ClassExpression\", node, opts);\n}\nexport function assertClassDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassDeclaration {\n assert(\"ClassDeclaration\", node, opts);\n}\nexport function assertExportAllDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportAllDeclaration {\n assert(\"ExportAllDeclaration\", node, opts);\n}\nexport function assertExportDefaultDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportDefaultDeclaration {\n assert(\"ExportDefaultDeclaration\", node, opts);\n}\nexport function assertExportNamedDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportNamedDeclaration {\n assert(\"ExportNamedDeclaration\", node, opts);\n}\nexport function assertExportSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportSpecifier {\n assert(\"ExportSpecifier\", node, opts);\n}\nexport function assertForOfStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ForOfStatement {\n assert(\"ForOfStatement\", node, opts);\n}\nexport function assertImportDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ImportDeclaration {\n assert(\"ImportDeclaration\", node, opts);\n}\nexport function assertImportDefaultSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ImportDefaultSpecifier {\n assert(\"ImportDefaultSpecifier\", node, opts);\n}\nexport function assertImportNamespaceSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ImportNamespaceSpecifier {\n assert(\"ImportNamespaceSpecifier\", node, opts);\n}\nexport function assertImportSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ImportSpecifier {\n assert(\"ImportSpecifier\", node, opts);\n}\nexport function assertMetaProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.MetaProperty {\n assert(\"MetaProperty\", node, opts);\n}\nexport function assertClassMethod(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassMethod {\n assert(\"ClassMethod\", node, opts);\n}\nexport function assertObjectPattern(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectPattern {\n assert(\"ObjectPattern\", node, opts);\n}\nexport function assertSpreadElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.SpreadElement {\n assert(\"SpreadElement\", node, opts);\n}\nexport function assertSuper(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Super {\n assert(\"Super\", node, opts);\n}\nexport function assertTaggedTemplateExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TaggedTemplateExpression {\n assert(\"TaggedTemplateExpression\", node, opts);\n}\nexport function assertTemplateElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TemplateElement {\n assert(\"TemplateElement\", node, opts);\n}\nexport function assertTemplateLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TemplateLiteral {\n assert(\"TemplateLiteral\", node, opts);\n}\nexport function assertYieldExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.YieldExpression {\n assert(\"YieldExpression\", node, opts);\n}\nexport function assertAwaitExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.AwaitExpression {\n assert(\"AwaitExpression\", node, opts);\n}\nexport function assertImport(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Import {\n assert(\"Import\", node, opts);\n}\nexport function assertBigIntLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BigIntLiteral {\n assert(\"BigIntLiteral\", node, opts);\n}\nexport function assertExportNamespaceSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportNamespaceSpecifier {\n assert(\"ExportNamespaceSpecifier\", node, opts);\n}\nexport function assertOptionalMemberExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.OptionalMemberExpression {\n assert(\"OptionalMemberExpression\", node, opts);\n}\nexport function assertOptionalCallExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.OptionalCallExpression {\n assert(\"OptionalCallExpression\", node, opts);\n}\nexport function assertClassProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassProperty {\n assert(\"ClassProperty\", node, opts);\n}\nexport function assertClassAccessorProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassAccessorProperty {\n assert(\"ClassAccessorProperty\", node, opts);\n}\nexport function assertClassPrivateProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassPrivateProperty {\n assert(\"ClassPrivateProperty\", node, opts);\n}\nexport function assertClassPrivateMethod(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassPrivateMethod {\n assert(\"ClassPrivateMethod\", node, opts);\n}\nexport function assertPrivateName(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.PrivateName {\n assert(\"PrivateName\", node, opts);\n}\nexport function assertStaticBlock(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.StaticBlock {\n assert(\"StaticBlock\", node, opts);\n}\nexport function assertAnyTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.AnyTypeAnnotation {\n assert(\"AnyTypeAnnotation\", node, opts);\n}\nexport function assertArrayTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ArrayTypeAnnotation {\n assert(\"ArrayTypeAnnotation\", node, opts);\n}\nexport function assertBooleanTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BooleanTypeAnnotation {\n assert(\"BooleanTypeAnnotation\", node, opts);\n}\nexport function assertBooleanLiteralTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BooleanLiteralTypeAnnotation {\n assert(\"BooleanLiteralTypeAnnotation\", node, opts);\n}\nexport function assertNullLiteralTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NullLiteralTypeAnnotation {\n assert(\"NullLiteralTypeAnnotation\", node, opts);\n}\nexport function assertClassImplements(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ClassImplements {\n assert(\"ClassImplements\", node, opts);\n}\nexport function assertDeclareClass(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareClass {\n assert(\"DeclareClass\", node, opts);\n}\nexport function assertDeclareFunction(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareFunction {\n assert(\"DeclareFunction\", node, opts);\n}\nexport function assertDeclareInterface(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareInterface {\n assert(\"DeclareInterface\", node, opts);\n}\nexport function assertDeclareModule(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareModule {\n assert(\"DeclareModule\", node, opts);\n}\nexport function assertDeclareModuleExports(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareModuleExports {\n assert(\"DeclareModuleExports\", node, opts);\n}\nexport function assertDeclareTypeAlias(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareTypeAlias {\n assert(\"DeclareTypeAlias\", node, opts);\n}\nexport function assertDeclareOpaqueType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareOpaqueType {\n assert(\"DeclareOpaqueType\", node, opts);\n}\nexport function assertDeclareVariable(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareVariable {\n assert(\"DeclareVariable\", node, opts);\n}\nexport function assertDeclareExportDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareExportDeclaration {\n assert(\"DeclareExportDeclaration\", node, opts);\n}\nexport function assertDeclareExportAllDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclareExportAllDeclaration {\n assert(\"DeclareExportAllDeclaration\", node, opts);\n}\nexport function assertDeclaredPredicate(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DeclaredPredicate {\n assert(\"DeclaredPredicate\", node, opts);\n}\nexport function assertExistsTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExistsTypeAnnotation {\n assert(\"ExistsTypeAnnotation\", node, opts);\n}\nexport function assertFunctionTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FunctionTypeAnnotation {\n assert(\"FunctionTypeAnnotation\", node, opts);\n}\nexport function assertFunctionTypeParam(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FunctionTypeParam {\n assert(\"FunctionTypeParam\", node, opts);\n}\nexport function assertGenericTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.GenericTypeAnnotation {\n assert(\"GenericTypeAnnotation\", node, opts);\n}\nexport function assertInferredPredicate(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.InferredPredicate {\n assert(\"InferredPredicate\", node, opts);\n}\nexport function assertInterfaceExtends(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.InterfaceExtends {\n assert(\"InterfaceExtends\", node, opts);\n}\nexport function assertInterfaceDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.InterfaceDeclaration {\n assert(\"InterfaceDeclaration\", node, opts);\n}\nexport function assertInterfaceTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.InterfaceTypeAnnotation {\n assert(\"InterfaceTypeAnnotation\", node, opts);\n}\nexport function assertIntersectionTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.IntersectionTypeAnnotation {\n assert(\"IntersectionTypeAnnotation\", node, opts);\n}\nexport function assertMixedTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.MixedTypeAnnotation {\n assert(\"MixedTypeAnnotation\", node, opts);\n}\nexport function assertEmptyTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EmptyTypeAnnotation {\n assert(\"EmptyTypeAnnotation\", node, opts);\n}\nexport function assertNullableTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NullableTypeAnnotation {\n assert(\"NullableTypeAnnotation\", node, opts);\n}\nexport function assertNumberLiteralTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NumberLiteralTypeAnnotation {\n assert(\"NumberLiteralTypeAnnotation\", node, opts);\n}\nexport function assertNumberTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.NumberTypeAnnotation {\n assert(\"NumberTypeAnnotation\", node, opts);\n}\nexport function assertObjectTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectTypeAnnotation {\n assert(\"ObjectTypeAnnotation\", node, opts);\n}\nexport function assertObjectTypeInternalSlot(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectTypeInternalSlot {\n assert(\"ObjectTypeInternalSlot\", node, opts);\n}\nexport function assertObjectTypeCallProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectTypeCallProperty {\n assert(\"ObjectTypeCallProperty\", node, opts);\n}\nexport function assertObjectTypeIndexer(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectTypeIndexer {\n assert(\"ObjectTypeIndexer\", node, opts);\n}\nexport function assertObjectTypeProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectTypeProperty {\n assert(\"ObjectTypeProperty\", node, opts);\n}\nexport function assertObjectTypeSpreadProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectTypeSpreadProperty {\n assert(\"ObjectTypeSpreadProperty\", node, opts);\n}\nexport function assertOpaqueType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.OpaqueType {\n assert(\"OpaqueType\", node, opts);\n}\nexport function assertQualifiedTypeIdentifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.QualifiedTypeIdentifier {\n assert(\"QualifiedTypeIdentifier\", node, opts);\n}\nexport function assertStringLiteralTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.StringLiteralTypeAnnotation {\n assert(\"StringLiteralTypeAnnotation\", node, opts);\n}\nexport function assertStringTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.StringTypeAnnotation {\n assert(\"StringTypeAnnotation\", node, opts);\n}\nexport function assertSymbolTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.SymbolTypeAnnotation {\n assert(\"SymbolTypeAnnotation\", node, opts);\n}\nexport function assertThisTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ThisTypeAnnotation {\n assert(\"ThisTypeAnnotation\", node, opts);\n}\nexport function assertTupleTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TupleTypeAnnotation {\n assert(\"TupleTypeAnnotation\", node, opts);\n}\nexport function assertTypeofTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeofTypeAnnotation {\n assert(\"TypeofTypeAnnotation\", node, opts);\n}\nexport function assertTypeAlias(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeAlias {\n assert(\"TypeAlias\", node, opts);\n}\nexport function assertTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeAnnotation {\n assert(\"TypeAnnotation\", node, opts);\n}\nexport function assertTypeCastExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeCastExpression {\n assert(\"TypeCastExpression\", node, opts);\n}\nexport function assertTypeParameter(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeParameter {\n assert(\"TypeParameter\", node, opts);\n}\nexport function assertTypeParameterDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeParameterDeclaration {\n assert(\"TypeParameterDeclaration\", node, opts);\n}\nexport function assertTypeParameterInstantiation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeParameterInstantiation {\n assert(\"TypeParameterInstantiation\", node, opts);\n}\nexport function assertUnionTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.UnionTypeAnnotation {\n assert(\"UnionTypeAnnotation\", node, opts);\n}\nexport function assertVariance(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Variance {\n assert(\"Variance\", node, opts);\n}\nexport function assertVoidTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.VoidTypeAnnotation {\n assert(\"VoidTypeAnnotation\", node, opts);\n}\nexport function assertEnumDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumDeclaration {\n assert(\"EnumDeclaration\", node, opts);\n}\nexport function assertEnumBooleanBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumBooleanBody {\n assert(\"EnumBooleanBody\", node, opts);\n}\nexport function assertEnumNumberBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumNumberBody {\n assert(\"EnumNumberBody\", node, opts);\n}\nexport function assertEnumStringBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumStringBody {\n assert(\"EnumStringBody\", node, opts);\n}\nexport function assertEnumSymbolBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumSymbolBody {\n assert(\"EnumSymbolBody\", node, opts);\n}\nexport function assertEnumBooleanMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumBooleanMember {\n assert(\"EnumBooleanMember\", node, opts);\n}\nexport function assertEnumNumberMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumNumberMember {\n assert(\"EnumNumberMember\", node, opts);\n}\nexport function assertEnumStringMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumStringMember {\n assert(\"EnumStringMember\", node, opts);\n}\nexport function assertEnumDefaultedMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumDefaultedMember {\n assert(\"EnumDefaultedMember\", node, opts);\n}\nexport function assertIndexedAccessType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.IndexedAccessType {\n assert(\"IndexedAccessType\", node, opts);\n}\nexport function assertOptionalIndexedAccessType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.OptionalIndexedAccessType {\n assert(\"OptionalIndexedAccessType\", node, opts);\n}\nexport function assertJSXAttribute(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXAttribute {\n assert(\"JSXAttribute\", node, opts);\n}\nexport function assertJSXClosingElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXClosingElement {\n assert(\"JSXClosingElement\", node, opts);\n}\nexport function assertJSXElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXElement {\n assert(\"JSXElement\", node, opts);\n}\nexport function assertJSXEmptyExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXEmptyExpression {\n assert(\"JSXEmptyExpression\", node, opts);\n}\nexport function assertJSXExpressionContainer(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXExpressionContainer {\n assert(\"JSXExpressionContainer\", node, opts);\n}\nexport function assertJSXSpreadChild(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXSpreadChild {\n assert(\"JSXSpreadChild\", node, opts);\n}\nexport function assertJSXIdentifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXIdentifier {\n assert(\"JSXIdentifier\", node, opts);\n}\nexport function assertJSXMemberExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXMemberExpression {\n assert(\"JSXMemberExpression\", node, opts);\n}\nexport function assertJSXNamespacedName(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXNamespacedName {\n assert(\"JSXNamespacedName\", node, opts);\n}\nexport function assertJSXOpeningElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXOpeningElement {\n assert(\"JSXOpeningElement\", node, opts);\n}\nexport function assertJSXSpreadAttribute(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXSpreadAttribute {\n assert(\"JSXSpreadAttribute\", node, opts);\n}\nexport function assertJSXText(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXText {\n assert(\"JSXText\", node, opts);\n}\nexport function assertJSXFragment(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXFragment {\n assert(\"JSXFragment\", node, opts);\n}\nexport function assertJSXOpeningFragment(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXOpeningFragment {\n assert(\"JSXOpeningFragment\", node, opts);\n}\nexport function assertJSXClosingFragment(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSXClosingFragment {\n assert(\"JSXClosingFragment\", node, opts);\n}\nexport function assertNoop(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Noop {\n assert(\"Noop\", node, opts);\n}\nexport function assertPlaceholder(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Placeholder {\n assert(\"Placeholder\", node, opts);\n}\nexport function assertV8IntrinsicIdentifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.V8IntrinsicIdentifier {\n assert(\"V8IntrinsicIdentifier\", node, opts);\n}\nexport function assertArgumentPlaceholder(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ArgumentPlaceholder {\n assert(\"ArgumentPlaceholder\", node, opts);\n}\nexport function assertBindExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BindExpression {\n assert(\"BindExpression\", node, opts);\n}\nexport function assertImportAttribute(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ImportAttribute {\n assert(\"ImportAttribute\", node, opts);\n}\nexport function assertDecorator(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Decorator {\n assert(\"Decorator\", node, opts);\n}\nexport function assertDoExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DoExpression {\n assert(\"DoExpression\", node, opts);\n}\nexport function assertExportDefaultSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportDefaultSpecifier {\n assert(\"ExportDefaultSpecifier\", node, opts);\n}\nexport function assertRecordExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.RecordExpression {\n assert(\"RecordExpression\", node, opts);\n}\nexport function assertTupleExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TupleExpression {\n assert(\"TupleExpression\", node, opts);\n}\nexport function assertDecimalLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.DecimalLiteral {\n assert(\"DecimalLiteral\", node, opts);\n}\nexport function assertModuleExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ModuleExpression {\n assert(\"ModuleExpression\", node, opts);\n}\nexport function assertTopicReference(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TopicReference {\n assert(\"TopicReference\", node, opts);\n}\nexport function assertPipelineTopicExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.PipelineTopicExpression {\n assert(\"PipelineTopicExpression\", node, opts);\n}\nexport function assertPipelineBareFunction(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.PipelineBareFunction {\n assert(\"PipelineBareFunction\", node, opts);\n}\nexport function assertPipelinePrimaryTopicReference(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.PipelinePrimaryTopicReference {\n assert(\"PipelinePrimaryTopicReference\", node, opts);\n}\nexport function assertTSParameterProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSParameterProperty {\n assert(\"TSParameterProperty\", node, opts);\n}\nexport function assertTSDeclareFunction(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSDeclareFunction {\n assert(\"TSDeclareFunction\", node, opts);\n}\nexport function assertTSDeclareMethod(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSDeclareMethod {\n assert(\"TSDeclareMethod\", node, opts);\n}\nexport function assertTSQualifiedName(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSQualifiedName {\n assert(\"TSQualifiedName\", node, opts);\n}\nexport function assertTSCallSignatureDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSCallSignatureDeclaration {\n assert(\"TSCallSignatureDeclaration\", node, opts);\n}\nexport function assertTSConstructSignatureDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSConstructSignatureDeclaration {\n assert(\"TSConstructSignatureDeclaration\", node, opts);\n}\nexport function assertTSPropertySignature(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSPropertySignature {\n assert(\"TSPropertySignature\", node, opts);\n}\nexport function assertTSMethodSignature(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSMethodSignature {\n assert(\"TSMethodSignature\", node, opts);\n}\nexport function assertTSIndexSignature(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSIndexSignature {\n assert(\"TSIndexSignature\", node, opts);\n}\nexport function assertTSAnyKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSAnyKeyword {\n assert(\"TSAnyKeyword\", node, opts);\n}\nexport function assertTSBooleanKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSBooleanKeyword {\n assert(\"TSBooleanKeyword\", node, opts);\n}\nexport function assertTSBigIntKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSBigIntKeyword {\n assert(\"TSBigIntKeyword\", node, opts);\n}\nexport function assertTSIntrinsicKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSIntrinsicKeyword {\n assert(\"TSIntrinsicKeyword\", node, opts);\n}\nexport function assertTSNeverKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSNeverKeyword {\n assert(\"TSNeverKeyword\", node, opts);\n}\nexport function assertTSNullKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSNullKeyword {\n assert(\"TSNullKeyword\", node, opts);\n}\nexport function assertTSNumberKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSNumberKeyword {\n assert(\"TSNumberKeyword\", node, opts);\n}\nexport function assertTSObjectKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSObjectKeyword {\n assert(\"TSObjectKeyword\", node, opts);\n}\nexport function assertTSStringKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSStringKeyword {\n assert(\"TSStringKeyword\", node, opts);\n}\nexport function assertTSSymbolKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSSymbolKeyword {\n assert(\"TSSymbolKeyword\", node, opts);\n}\nexport function assertTSUndefinedKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSUndefinedKeyword {\n assert(\"TSUndefinedKeyword\", node, opts);\n}\nexport function assertTSUnknownKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSUnknownKeyword {\n assert(\"TSUnknownKeyword\", node, opts);\n}\nexport function assertTSVoidKeyword(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSVoidKeyword {\n assert(\"TSVoidKeyword\", node, opts);\n}\nexport function assertTSThisType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSThisType {\n assert(\"TSThisType\", node, opts);\n}\nexport function assertTSFunctionType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSFunctionType {\n assert(\"TSFunctionType\", node, opts);\n}\nexport function assertTSConstructorType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSConstructorType {\n assert(\"TSConstructorType\", node, opts);\n}\nexport function assertTSTypeReference(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeReference {\n assert(\"TSTypeReference\", node, opts);\n}\nexport function assertTSTypePredicate(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypePredicate {\n assert(\"TSTypePredicate\", node, opts);\n}\nexport function assertTSTypeQuery(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeQuery {\n assert(\"TSTypeQuery\", node, opts);\n}\nexport function assertTSTypeLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeLiteral {\n assert(\"TSTypeLiteral\", node, opts);\n}\nexport function assertTSArrayType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSArrayType {\n assert(\"TSArrayType\", node, opts);\n}\nexport function assertTSTupleType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTupleType {\n assert(\"TSTupleType\", node, opts);\n}\nexport function assertTSOptionalType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSOptionalType {\n assert(\"TSOptionalType\", node, opts);\n}\nexport function assertTSRestType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSRestType {\n assert(\"TSRestType\", node, opts);\n}\nexport function assertTSNamedTupleMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSNamedTupleMember {\n assert(\"TSNamedTupleMember\", node, opts);\n}\nexport function assertTSUnionType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSUnionType {\n assert(\"TSUnionType\", node, opts);\n}\nexport function assertTSIntersectionType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSIntersectionType {\n assert(\"TSIntersectionType\", node, opts);\n}\nexport function assertTSConditionalType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSConditionalType {\n assert(\"TSConditionalType\", node, opts);\n}\nexport function assertTSInferType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSInferType {\n assert(\"TSInferType\", node, opts);\n}\nexport function assertTSParenthesizedType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSParenthesizedType {\n assert(\"TSParenthesizedType\", node, opts);\n}\nexport function assertTSTypeOperator(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeOperator {\n assert(\"TSTypeOperator\", node, opts);\n}\nexport function assertTSIndexedAccessType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSIndexedAccessType {\n assert(\"TSIndexedAccessType\", node, opts);\n}\nexport function assertTSMappedType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSMappedType {\n assert(\"TSMappedType\", node, opts);\n}\nexport function assertTSLiteralType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSLiteralType {\n assert(\"TSLiteralType\", node, opts);\n}\nexport function assertTSExpressionWithTypeArguments(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSExpressionWithTypeArguments {\n assert(\"TSExpressionWithTypeArguments\", node, opts);\n}\nexport function assertTSInterfaceDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSInterfaceDeclaration {\n assert(\"TSInterfaceDeclaration\", node, opts);\n}\nexport function assertTSInterfaceBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSInterfaceBody {\n assert(\"TSInterfaceBody\", node, opts);\n}\nexport function assertTSTypeAliasDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeAliasDeclaration {\n assert(\"TSTypeAliasDeclaration\", node, opts);\n}\nexport function assertTSInstantiationExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSInstantiationExpression {\n assert(\"TSInstantiationExpression\", node, opts);\n}\nexport function assertTSAsExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSAsExpression {\n assert(\"TSAsExpression\", node, opts);\n}\nexport function assertTSSatisfiesExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSSatisfiesExpression {\n assert(\"TSSatisfiesExpression\", node, opts);\n}\nexport function assertTSTypeAssertion(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeAssertion {\n assert(\"TSTypeAssertion\", node, opts);\n}\nexport function assertTSEnumDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSEnumDeclaration {\n assert(\"TSEnumDeclaration\", node, opts);\n}\nexport function assertTSEnumMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSEnumMember {\n assert(\"TSEnumMember\", node, opts);\n}\nexport function assertTSModuleDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSModuleDeclaration {\n assert(\"TSModuleDeclaration\", node, opts);\n}\nexport function assertTSModuleBlock(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSModuleBlock {\n assert(\"TSModuleBlock\", node, opts);\n}\nexport function assertTSImportType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSImportType {\n assert(\"TSImportType\", node, opts);\n}\nexport function assertTSImportEqualsDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSImportEqualsDeclaration {\n assert(\"TSImportEqualsDeclaration\", node, opts);\n}\nexport function assertTSExternalModuleReference(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSExternalModuleReference {\n assert(\"TSExternalModuleReference\", node, opts);\n}\nexport function assertTSNonNullExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSNonNullExpression {\n assert(\"TSNonNullExpression\", node, opts);\n}\nexport function assertTSExportAssignment(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSExportAssignment {\n assert(\"TSExportAssignment\", node, opts);\n}\nexport function assertTSNamespaceExportDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSNamespaceExportDeclaration {\n assert(\"TSNamespaceExportDeclaration\", node, opts);\n}\nexport function assertTSTypeAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeAnnotation {\n assert(\"TSTypeAnnotation\", node, opts);\n}\nexport function assertTSTypeParameterInstantiation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeParameterInstantiation {\n assert(\"TSTypeParameterInstantiation\", node, opts);\n}\nexport function assertTSTypeParameterDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeParameterDeclaration {\n assert(\"TSTypeParameterDeclaration\", node, opts);\n}\nexport function assertTSTypeParameter(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeParameter {\n assert(\"TSTypeParameter\", node, opts);\n}\nexport function assertStandardized(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Standardized {\n assert(\"Standardized\", node, opts);\n}\nexport function assertExpression(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Expression {\n assert(\"Expression\", node, opts);\n}\nexport function assertBinary(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Binary {\n assert(\"Binary\", node, opts);\n}\nexport function assertScopable(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Scopable {\n assert(\"Scopable\", node, opts);\n}\nexport function assertBlockParent(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.BlockParent {\n assert(\"BlockParent\", node, opts);\n}\nexport function assertBlock(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Block {\n assert(\"Block\", node, opts);\n}\nexport function assertStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Statement {\n assert(\"Statement\", node, opts);\n}\nexport function assertTerminatorless(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Terminatorless {\n assert(\"Terminatorless\", node, opts);\n}\nexport function assertCompletionStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.CompletionStatement {\n assert(\"CompletionStatement\", node, opts);\n}\nexport function assertConditional(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Conditional {\n assert(\"Conditional\", node, opts);\n}\nexport function assertLoop(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Loop {\n assert(\"Loop\", node, opts);\n}\nexport function assertWhile(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.While {\n assert(\"While\", node, opts);\n}\nexport function assertExpressionWrapper(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExpressionWrapper {\n assert(\"ExpressionWrapper\", node, opts);\n}\nexport function assertFor(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.For {\n assert(\"For\", node, opts);\n}\nexport function assertForXStatement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ForXStatement {\n assert(\"ForXStatement\", node, opts);\n}\nexport function assertFunction(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Function {\n assert(\"Function\", node, opts);\n}\nexport function assertFunctionParent(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FunctionParent {\n assert(\"FunctionParent\", node, opts);\n}\nexport function assertPureish(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Pureish {\n assert(\"Pureish\", node, opts);\n}\nexport function assertDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Declaration {\n assert(\"Declaration\", node, opts);\n}\nexport function assertPatternLike(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.PatternLike {\n assert(\"PatternLike\", node, opts);\n}\nexport function assertLVal(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.LVal {\n assert(\"LVal\", node, opts);\n}\nexport function assertTSEntityName(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSEntityName {\n assert(\"TSEntityName\", node, opts);\n}\nexport function assertLiteral(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Literal {\n assert(\"Literal\", node, opts);\n}\nexport function assertImmutable(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Immutable {\n assert(\"Immutable\", node, opts);\n}\nexport function assertUserWhitespacable(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.UserWhitespacable {\n assert(\"UserWhitespacable\", node, opts);\n}\nexport function assertMethod(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Method {\n assert(\"Method\", node, opts);\n}\nexport function assertObjectMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ObjectMember {\n assert(\"ObjectMember\", node, opts);\n}\nexport function assertProperty(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Property {\n assert(\"Property\", node, opts);\n}\nexport function assertUnaryLike(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.UnaryLike {\n assert(\"UnaryLike\", node, opts);\n}\nexport function assertPattern(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Pattern {\n assert(\"Pattern\", node, opts);\n}\nexport function assertClass(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Class {\n assert(\"Class\", node, opts);\n}\nexport function assertImportOrExportDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ImportOrExportDeclaration {\n assert(\"ImportOrExportDeclaration\", node, opts);\n}\nexport function assertExportDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ExportDeclaration {\n assert(\"ExportDeclaration\", node, opts);\n}\nexport function assertModuleSpecifier(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.ModuleSpecifier {\n assert(\"ModuleSpecifier\", node, opts);\n}\nexport function assertAccessor(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Accessor {\n assert(\"Accessor\", node, opts);\n}\nexport function assertPrivate(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Private {\n assert(\"Private\", node, opts);\n}\nexport function assertFlow(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Flow {\n assert(\"Flow\", node, opts);\n}\nexport function assertFlowType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FlowType {\n assert(\"FlowType\", node, opts);\n}\nexport function assertFlowBaseAnnotation(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FlowBaseAnnotation {\n assert(\"FlowBaseAnnotation\", node, opts);\n}\nexport function assertFlowDeclaration(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FlowDeclaration {\n assert(\"FlowDeclaration\", node, opts);\n}\nexport function assertFlowPredicate(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.FlowPredicate {\n assert(\"FlowPredicate\", node, opts);\n}\nexport function assertEnumBody(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumBody {\n assert(\"EnumBody\", node, opts);\n}\nexport function assertEnumMember(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.EnumMember {\n assert(\"EnumMember\", node, opts);\n}\nexport function assertJSX(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.JSX {\n assert(\"JSX\", node, opts);\n}\nexport function assertMiscellaneous(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.Miscellaneous {\n assert(\"Miscellaneous\", node, opts);\n}\nexport function assertTypeScript(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TypeScript {\n assert(\"TypeScript\", node, opts);\n}\nexport function assertTSTypeElement(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSTypeElement {\n assert(\"TSTypeElement\", node, opts);\n}\nexport function assertTSType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSType {\n assert(\"TSType\", node, opts);\n}\nexport function assertTSBaseType(\n node: object | null | undefined,\n opts?: object | null,\n): asserts node is t.TSBaseType {\n assert(\"TSBaseType\", node, opts);\n}\nexport function assertNumberLiteral(node: any, opts: any): void {\n deprecationWarning(\"assertNumberLiteral\", \"assertNumericLiteral\");\n assert(\"NumberLiteral\", node, opts);\n}\nexport function assertRegexLiteral(node: any, opts: any): void {\n deprecationWarning(\"assertRegexLiteral\", \"assertRegExpLiteral\");\n assert(\"RegexLiteral\", node, opts);\n}\nexport function assertRestProperty(node: any, opts: any): void {\n deprecationWarning(\"assertRestProperty\", \"assertRestElement\");\n assert(\"RestProperty\", node, opts);\n}\nexport function assertSpreadProperty(node: any, opts: any): void {\n deprecationWarning(\"assertSpreadProperty\", \"assertSpreadElement\");\n assert(\"SpreadProperty\", node, opts);\n}\nexport function assertModuleDeclaration(node: any, opts: any): void {\n deprecationWarning(\n \"assertModuleDeclaration\",\n \"assertImportOrExportDeclaration\",\n );\n assert(\"ModuleDeclaration\", node, opts);\n}\n","import {\n anyTypeAnnotation,\n stringTypeAnnotation,\n numberTypeAnnotation,\n voidTypeAnnotation,\n booleanTypeAnnotation,\n genericTypeAnnotation,\n identifier,\n} from \"../generated\";\nimport type * as t from \"../..\";\n\nexport default createTypeAnnotationBasedOnTypeof as {\n (type: \"string\"): t.StringTypeAnnotation;\n (type: \"number\"): t.NumberTypeAnnotation;\n (type: \"undefined\"): t.VoidTypeAnnotation;\n (type: \"boolean\"): t.BooleanTypeAnnotation;\n (type: \"function\"): t.GenericTypeAnnotation;\n (type: \"object\"): t.GenericTypeAnnotation;\n (type: \"symbol\"): t.GenericTypeAnnotation;\n (type: \"bigint\"): t.AnyTypeAnnotation;\n};\n\n/**\n * Create a type annotation based on typeof expression.\n */\nfunction createTypeAnnotationBasedOnTypeof(type: string): t.FlowType {\n switch (type) {\n case \"string\":\n return stringTypeAnnotation();\n case \"number\":\n return numberTypeAnnotation();\n case \"undefined\":\n return voidTypeAnnotation();\n case \"boolean\":\n return booleanTypeAnnotation();\n case \"function\":\n return genericTypeAnnotation(identifier(\"Function\"));\n case \"object\":\n return genericTypeAnnotation(identifier(\"Object\"));\n case \"symbol\":\n return genericTypeAnnotation(identifier(\"Symbol\"));\n case \"bigint\":\n // todo: use BigInt annotation when Flow supports BigInt\n // https://github.com/facebook/flow/issues/6639\n return anyTypeAnnotation();\n }\n throw new Error(\"Invalid typeof value: \" + type);\n}\n","import {\n isAnyTypeAnnotation,\n isGenericTypeAnnotation,\n isUnionTypeAnnotation,\n isFlowBaseAnnotation,\n isIdentifier,\n} from \"../../validators/generated\";\nimport type * as t from \"../..\";\n\nfunction getQualifiedName(node: t.GenericTypeAnnotation[\"id\"]): string {\n return isIdentifier(node)\n ? node.name\n : `${node.id.name}.${getQualifiedName(node.qualification)}`;\n}\n\n/**\n * Dedupe type annotations.\n */\nexport default function removeTypeDuplicates(\n nodesIn: ReadonlyArray,\n): t.FlowType[] {\n const nodes = Array.from(nodesIn);\n\n const generics = new Map();\n const bases = new Map();\n\n // store union type groups to circular references\n const typeGroups = new Set();\n\n const types: t.FlowType[] = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // detect duplicates\n if (types.indexOf(node) >= 0) {\n continue;\n }\n\n // this type matches anything\n if (isAnyTypeAnnotation(node)) {\n return [node];\n }\n\n if (isFlowBaseAnnotation(node)) {\n bases.set(node.type, node);\n continue;\n }\n\n if (isUnionTypeAnnotation(node)) {\n if (!typeGroups.has(node.types)) {\n nodes.push(...node.types);\n typeGroups.add(node.types);\n }\n continue;\n }\n\n // find a matching generic type and merge and deduplicate the type parameters\n if (isGenericTypeAnnotation(node)) {\n const name = getQualifiedName(node.id);\n\n if (generics.has(name)) {\n let existing: t.Flow = generics.get(name);\n if (existing.typeParameters) {\n if (node.typeParameters) {\n existing.typeParameters.params.push(...node.typeParameters.params);\n existing.typeParameters.params = removeTypeDuplicates(\n existing.typeParameters.params,\n );\n }\n } else {\n existing = node.typeParameters;\n }\n } else {\n generics.set(name, node);\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n // add back in bases\n for (const [, baseType] of bases) {\n types.push(baseType);\n }\n\n // add back in generics\n for (const [, genericName] of generics) {\n types.push(genericName);\n }\n\n return types;\n}\n","import { unionTypeAnnotation } from \"../generated\";\nimport removeTypeDuplicates from \"../../modifications/flow/removeTypeDuplicates\";\nimport type * as t from \"../..\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createFlowUnionType(\n types: [T] | Array,\n): T | t.UnionTypeAnnotation {\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0] as T;\n } else {\n return unionTypeAnnotation(flattened);\n }\n}\n","import {\n isIdentifier,\n isTSAnyKeyword,\n isTSTypeReference,\n isTSUnionType,\n isTSBaseType,\n} from \"../../validators/generated\";\nimport type * as t from \"../..\";\n\nfunction getQualifiedName(node: t.TSTypeReference[\"typeName\"]): string {\n return isIdentifier(node)\n ? node.name\n : `${node.right.name}.${getQualifiedName(node.left)}`;\n}\n\n/**\n * Dedupe type annotations.\n */\nexport default function removeTypeDuplicates(\n nodesIn: ReadonlyArray,\n): Array {\n const nodes = Array.from(nodesIn);\n\n const generics = new Map();\n const bases = new Map();\n\n // store union type groups to circular references\n const typeGroups = new Set();\n\n const types: t.TSType[] = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // detect duplicates\n if (types.indexOf(node) >= 0) {\n continue;\n }\n\n // this type matches anything\n if (isTSAnyKeyword(node)) {\n return [node];\n }\n\n // Analogue of FlowBaseAnnotation\n if (isTSBaseType(node)) {\n bases.set(node.type, node);\n continue;\n }\n\n if (isTSUnionType(node)) {\n if (!typeGroups.has(node.types)) {\n nodes.push(...node.types);\n typeGroups.add(node.types);\n }\n continue;\n }\n\n // todo: support merging tuples: number[]\n if (isTSTypeReference(node) && node.typeParameters) {\n const name = getQualifiedName(node.typeName);\n\n if (generics.has(name)) {\n let existing: t.TypeScript = generics.get(name);\n if (existing.typeParameters) {\n if (node.typeParameters) {\n existing.typeParameters.params.push(...node.typeParameters.params);\n existing.typeParameters.params = removeTypeDuplicates(\n existing.typeParameters.params,\n );\n }\n } else {\n existing = node.typeParameters;\n }\n } else {\n generics.set(name, node);\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n // add back in bases\n for (const [, baseType] of bases) {\n types.push(baseType);\n }\n\n // add back in generics\n for (const [, genericName] of generics) {\n types.push(genericName);\n }\n\n return types;\n}\n","import { tsUnionType } from \"../generated\";\nimport removeTypeDuplicates from \"../../modifications/typescript/removeTypeDuplicates\";\nimport { isTSTypeAnnotation } from \"../../validators/generated/index\";\nimport type * as t from \"../..\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createTSUnionType(\n typeAnnotations: Array,\n): t.TSType {\n const types = typeAnnotations.map(type => {\n return isTSTypeAnnotation(type) ? type.typeAnnotation : type;\n });\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return tsUnionType(flattened);\n }\n}\n","/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\n\n/**\n * This file is written in JavaScript and not TypeScript because uppercase builders\n * conflict with AST types. TypeScript reads the uppercase.d.ts file instead.\n */\n\nexport {\n arrayExpression as ArrayExpression,\n assignmentExpression as AssignmentExpression,\n binaryExpression as BinaryExpression,\n interpreterDirective as InterpreterDirective,\n directive as Directive,\n directiveLiteral as DirectiveLiteral,\n blockStatement as BlockStatement,\n breakStatement as BreakStatement,\n callExpression as CallExpression,\n catchClause as CatchClause,\n conditionalExpression as ConditionalExpression,\n continueStatement as ContinueStatement,\n debuggerStatement as DebuggerStatement,\n doWhileStatement as DoWhileStatement,\n emptyStatement as EmptyStatement,\n expressionStatement as ExpressionStatement,\n file as File,\n forInStatement as ForInStatement,\n forStatement as ForStatement,\n functionDeclaration as FunctionDeclaration,\n functionExpression as FunctionExpression,\n identifier as Identifier,\n ifStatement as IfStatement,\n labeledStatement as LabeledStatement,\n stringLiteral as StringLiteral,\n numericLiteral as NumericLiteral,\n nullLiteral as NullLiteral,\n booleanLiteral as BooleanLiteral,\n regExpLiteral as RegExpLiteral,\n logicalExpression as LogicalExpression,\n memberExpression as MemberExpression,\n newExpression as NewExpression,\n program as Program,\n objectExpression as ObjectExpression,\n objectMethod as ObjectMethod,\n objectProperty as ObjectProperty,\n restElement as RestElement,\n returnStatement as ReturnStatement,\n sequenceExpression as SequenceExpression,\n parenthesizedExpression as ParenthesizedExpression,\n switchCase as SwitchCase,\n switchStatement as SwitchStatement,\n thisExpression as ThisExpression,\n throwStatement as ThrowStatement,\n tryStatement as TryStatement,\n unaryExpression as UnaryExpression,\n updateExpression as UpdateExpression,\n variableDeclaration as VariableDeclaration,\n variableDeclarator as VariableDeclarator,\n whileStatement as WhileStatement,\n withStatement as WithStatement,\n assignmentPattern as AssignmentPattern,\n arrayPattern as ArrayPattern,\n arrowFunctionExpression as ArrowFunctionExpression,\n classBody as ClassBody,\n classExpression as ClassExpression,\n classDeclaration as ClassDeclaration,\n exportAllDeclaration as ExportAllDeclaration,\n exportDefaultDeclaration as ExportDefaultDeclaration,\n exportNamedDeclaration as ExportNamedDeclaration,\n exportSpecifier as ExportSpecifier,\n forOfStatement as ForOfStatement,\n importDeclaration as ImportDeclaration,\n importDefaultSpecifier as ImportDefaultSpecifier,\n importNamespaceSpecifier as ImportNamespaceSpecifier,\n importSpecifier as ImportSpecifier,\n metaProperty as MetaProperty,\n classMethod as ClassMethod,\n objectPattern as ObjectPattern,\n spreadElement as SpreadElement,\n super as Super,\n taggedTemplateExpression as TaggedTemplateExpression,\n templateElement as TemplateElement,\n templateLiteral as TemplateLiteral,\n yieldExpression as YieldExpression,\n awaitExpression as AwaitExpression,\n import as Import,\n bigIntLiteral as BigIntLiteral,\n exportNamespaceSpecifier as ExportNamespaceSpecifier,\n optionalMemberExpression as OptionalMemberExpression,\n optionalCallExpression as OptionalCallExpression,\n classProperty as ClassProperty,\n classAccessorProperty as ClassAccessorProperty,\n classPrivateProperty as ClassPrivateProperty,\n classPrivateMethod as ClassPrivateMethod,\n privateName as PrivateName,\n staticBlock as StaticBlock,\n anyTypeAnnotation as AnyTypeAnnotation,\n arrayTypeAnnotation as ArrayTypeAnnotation,\n booleanTypeAnnotation as BooleanTypeAnnotation,\n booleanLiteralTypeAnnotation as BooleanLiteralTypeAnnotation,\n nullLiteralTypeAnnotation as NullLiteralTypeAnnotation,\n classImplements as ClassImplements,\n declareClass as DeclareClass,\n declareFunction as DeclareFunction,\n declareInterface as DeclareInterface,\n declareModule as DeclareModule,\n declareModuleExports as DeclareModuleExports,\n declareTypeAlias as DeclareTypeAlias,\n declareOpaqueType as DeclareOpaqueType,\n declareVariable as DeclareVariable,\n declareExportDeclaration as DeclareExportDeclaration,\n declareExportAllDeclaration as DeclareExportAllDeclaration,\n declaredPredicate as DeclaredPredicate,\n existsTypeAnnotation as ExistsTypeAnnotation,\n functionTypeAnnotation as FunctionTypeAnnotation,\n functionTypeParam as FunctionTypeParam,\n genericTypeAnnotation as GenericTypeAnnotation,\n inferredPredicate as InferredPredicate,\n interfaceExtends as InterfaceExtends,\n interfaceDeclaration as InterfaceDeclaration,\n interfaceTypeAnnotation as InterfaceTypeAnnotation,\n intersectionTypeAnnotation as IntersectionTypeAnnotation,\n mixedTypeAnnotation as MixedTypeAnnotation,\n emptyTypeAnnotation as EmptyTypeAnnotation,\n nullableTypeAnnotation as NullableTypeAnnotation,\n numberLiteralTypeAnnotation as NumberLiteralTypeAnnotation,\n numberTypeAnnotation as NumberTypeAnnotation,\n objectTypeAnnotation as ObjectTypeAnnotation,\n objectTypeInternalSlot as ObjectTypeInternalSlot,\n objectTypeCallProperty as ObjectTypeCallProperty,\n objectTypeIndexer as ObjectTypeIndexer,\n objectTypeProperty as ObjectTypeProperty,\n objectTypeSpreadProperty as ObjectTypeSpreadProperty,\n opaqueType as OpaqueType,\n qualifiedTypeIdentifier as QualifiedTypeIdentifier,\n stringLiteralTypeAnnotation as StringLiteralTypeAnnotation,\n stringTypeAnnotation as StringTypeAnnotation,\n symbolTypeAnnotation as SymbolTypeAnnotation,\n thisTypeAnnotation as ThisTypeAnnotation,\n tupleTypeAnnotation as TupleTypeAnnotation,\n typeofTypeAnnotation as TypeofTypeAnnotation,\n typeAlias as TypeAlias,\n typeAnnotation as TypeAnnotation,\n typeCastExpression as TypeCastExpression,\n typeParameter as TypeParameter,\n typeParameterDeclaration as TypeParameterDeclaration,\n typeParameterInstantiation as TypeParameterInstantiation,\n unionTypeAnnotation as UnionTypeAnnotation,\n variance as Variance,\n voidTypeAnnotation as VoidTypeAnnotation,\n enumDeclaration as EnumDeclaration,\n enumBooleanBody as EnumBooleanBody,\n enumNumberBody as EnumNumberBody,\n enumStringBody as EnumStringBody,\n enumSymbolBody as EnumSymbolBody,\n enumBooleanMember as EnumBooleanMember,\n enumNumberMember as EnumNumberMember,\n enumStringMember as EnumStringMember,\n enumDefaultedMember as EnumDefaultedMember,\n indexedAccessType as IndexedAccessType,\n optionalIndexedAccessType as OptionalIndexedAccessType,\n jsxAttribute as JSXAttribute,\n jsxClosingElement as JSXClosingElement,\n jsxElement as JSXElement,\n jsxEmptyExpression as JSXEmptyExpression,\n jsxExpressionContainer as JSXExpressionContainer,\n jsxSpreadChild as JSXSpreadChild,\n jsxIdentifier as JSXIdentifier,\n jsxMemberExpression as JSXMemberExpression,\n jsxNamespacedName as JSXNamespacedName,\n jsxOpeningElement as JSXOpeningElement,\n jsxSpreadAttribute as JSXSpreadAttribute,\n jsxText as JSXText,\n jsxFragment as JSXFragment,\n jsxOpeningFragment as JSXOpeningFragment,\n jsxClosingFragment as JSXClosingFragment,\n noop as Noop,\n placeholder as Placeholder,\n v8IntrinsicIdentifier as V8IntrinsicIdentifier,\n argumentPlaceholder as ArgumentPlaceholder,\n bindExpression as BindExpression,\n importAttribute as ImportAttribute,\n decorator as Decorator,\n doExpression as DoExpression,\n exportDefaultSpecifier as ExportDefaultSpecifier,\n recordExpression as RecordExpression,\n tupleExpression as TupleExpression,\n decimalLiteral as DecimalLiteral,\n moduleExpression as ModuleExpression,\n topicReference as TopicReference,\n pipelineTopicExpression as PipelineTopicExpression,\n pipelineBareFunction as PipelineBareFunction,\n pipelinePrimaryTopicReference as PipelinePrimaryTopicReference,\n tsParameterProperty as TSParameterProperty,\n tsDeclareFunction as TSDeclareFunction,\n tsDeclareMethod as TSDeclareMethod,\n tsQualifiedName as TSQualifiedName,\n tsCallSignatureDeclaration as TSCallSignatureDeclaration,\n tsConstructSignatureDeclaration as TSConstructSignatureDeclaration,\n tsPropertySignature as TSPropertySignature,\n tsMethodSignature as TSMethodSignature,\n tsIndexSignature as TSIndexSignature,\n tsAnyKeyword as TSAnyKeyword,\n tsBooleanKeyword as TSBooleanKeyword,\n tsBigIntKeyword as TSBigIntKeyword,\n tsIntrinsicKeyword as TSIntrinsicKeyword,\n tsNeverKeyword as TSNeverKeyword,\n tsNullKeyword as TSNullKeyword,\n tsNumberKeyword as TSNumberKeyword,\n tsObjectKeyword as TSObjectKeyword,\n tsStringKeyword as TSStringKeyword,\n tsSymbolKeyword as TSSymbolKeyword,\n tsUndefinedKeyword as TSUndefinedKeyword,\n tsUnknownKeyword as TSUnknownKeyword,\n tsVoidKeyword as TSVoidKeyword,\n tsThisType as TSThisType,\n tsFunctionType as TSFunctionType,\n tsConstructorType as TSConstructorType,\n tsTypeReference as TSTypeReference,\n tsTypePredicate as TSTypePredicate,\n tsTypeQuery as TSTypeQuery,\n tsTypeLiteral as TSTypeLiteral,\n tsArrayType as TSArrayType,\n tsTupleType as TSTupleType,\n tsOptionalType as TSOptionalType,\n tsRestType as TSRestType,\n tsNamedTupleMember as TSNamedTupleMember,\n tsUnionType as TSUnionType,\n tsIntersectionType as TSIntersectionType,\n tsConditionalType as TSConditionalType,\n tsInferType as TSInferType,\n tsParenthesizedType as TSParenthesizedType,\n tsTypeOperator as TSTypeOperator,\n tsIndexedAccessType as TSIndexedAccessType,\n tsMappedType as TSMappedType,\n tsLiteralType as TSLiteralType,\n tsExpressionWithTypeArguments as TSExpressionWithTypeArguments,\n tsInterfaceDeclaration as TSInterfaceDeclaration,\n tsInterfaceBody as TSInterfaceBody,\n tsTypeAliasDeclaration as TSTypeAliasDeclaration,\n tsInstantiationExpression as TSInstantiationExpression,\n tsAsExpression as TSAsExpression,\n tsSatisfiesExpression as TSSatisfiesExpression,\n tsTypeAssertion as TSTypeAssertion,\n tsEnumDeclaration as TSEnumDeclaration,\n tsEnumMember as TSEnumMember,\n tsModuleDeclaration as TSModuleDeclaration,\n tsModuleBlock as TSModuleBlock,\n tsImportType as TSImportType,\n tsImportEqualsDeclaration as TSImportEqualsDeclaration,\n tsExternalModuleReference as TSExternalModuleReference,\n tsNonNullExpression as TSNonNullExpression,\n tsExportAssignment as TSExportAssignment,\n tsNamespaceExportDeclaration as TSNamespaceExportDeclaration,\n tsTypeAnnotation as TSTypeAnnotation,\n tsTypeParameterInstantiation as TSTypeParameterInstantiation,\n tsTypeParameterDeclaration as TSTypeParameterDeclaration,\n tsTypeParameter as TSTypeParameter,\n numberLiteral as NumberLiteral,\n regexLiteral as RegexLiteral,\n restProperty as RestProperty,\n spreadProperty as SpreadProperty,\n} from \"./index\";\n","import { NODE_FIELDS } from \"../definitions\";\nimport type * as t from \"..\";\nimport { isFile, isIdentifier } from \"../validators/generated\";\n\nconst has = Function.call.bind(Object.prototype.hasOwnProperty);\n\ntype CommentCache = Map;\n\n// This function will never be called for comments, only for real nodes.\nfunction cloneIfNode(\n obj: t.Node | undefined | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (obj && typeof obj.type === \"string\") {\n return cloneNodeInternal(obj, deep, withoutLoc, commentsCache);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(\n obj: t.Node | undefined | null | (t.Node | undefined | null)[],\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache));\n }\n return cloneIfNode(obj, deep, withoutLoc, commentsCache);\n}\n\n/**\n * Create a clone of a `node` including only properties belonging to the node.\n * If the second parameter is `false`, cloneNode performs a shallow clone.\n * If the third parameter is true, the cloned nodes exclude location properties.\n */\nexport default function cloneNode(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n): T {\n return cloneNodeInternal(node, deep, withoutLoc, new Map());\n}\n\nfunction cloneNodeInternal(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n commentsCache: CommentCache,\n): T {\n if (!node) return node;\n\n const { type } = node;\n const newNode: any = { type: node.type };\n\n // Special-case identifiers since they are the most cloned nodes.\n if (isIdentifier(node)) {\n newNode.name = node.name;\n\n if (has(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (has(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep\n ? cloneIfNodeOrArray(\n node.typeAnnotation,\n true,\n withoutLoc,\n commentsCache,\n )\n : node.typeAnnotation;\n }\n } else if (!has(NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(NODE_FIELDS[type])) {\n if (has(node, field)) {\n if (deep) {\n newNode[field] =\n isFile(node) && field === \"comments\"\n ? maybeCloneComments(\n node.comments,\n deep,\n withoutLoc,\n commentsCache,\n )\n : cloneIfNodeOrArray(\n // @ts-expect-error node[field] has been guarded by has check\n node[field],\n true,\n withoutLoc,\n commentsCache,\n );\n } else {\n newNode[field] =\n // @ts-expect-error node[field] has been guarded by has check\n node[field];\n }\n }\n }\n }\n\n if (has(node, \"loc\")) {\n if (withoutLoc) {\n newNode.loc = null;\n } else {\n newNode.loc = node.loc;\n }\n }\n if (has(node, \"leadingComments\")) {\n newNode.leadingComments = maybeCloneComments(\n node.leadingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"innerComments\")) {\n newNode.innerComments = maybeCloneComments(\n node.innerComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"trailingComments\")) {\n newNode.trailingComments = maybeCloneComments(\n node.trailingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (has(node, \"extra\")) {\n newNode.extra = {\n ...node.extra,\n };\n }\n\n return newNode;\n}\n\nfunction maybeCloneComments(\n comments: ReadonlyArray | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: Map,\n): ReadonlyArray | null {\n if (!comments || !deep) {\n return comments;\n }\n return comments.map(comment => {\n const cache = commentsCache.get(comment);\n if (cache) return cache;\n\n const { type, value, loc } = comment;\n\n const ret = { type, value, loc } as T;\n if (withoutLoc) {\n ret.loc = null;\n }\n\n commentsCache.set(comment, ret);\n\n return ret;\n });\n}\n","import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n\n/**\n * Create a shallow clone of a `node`, including only\n * properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function clone(node: T): T {\n return cloneNode(node, /* deep */ false);\n}\n","import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function cloneDeep(node: T): T {\n return cloneNode(node);\n}\n","import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * excluding `_private` and location properties.\n */\nexport default function cloneDeepWithoutLoc(node: T): T {\n return cloneNode(node, /* deep */ true, /* withoutLoc */ true);\n}\n","import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n\n/**\n * Create a shallow clone of a `node` excluding `_private` and location properties.\n */\nexport default function cloneWithoutLoc(node: T): T {\n return cloneNode(node, /* deep */ false, /* withoutLoc */ true);\n}\n","import type * as t from \"..\";\n\n/**\n * Add comments of certain type to a node.\n */\nexport default function addComments(\n node: T,\n type: t.CommentTypeShorthand,\n comments: Array,\n): T {\n if (!comments || !node) return node;\n\n const key = `${type}Comments` as const;\n\n if (node[key]) {\n if (type === \"leading\") {\n node[key] = comments.concat(node[key]);\n } else {\n node[key].push(...comments);\n }\n } else {\n node[key] = comments;\n }\n\n return node;\n}\n","import addComments from \"./addComments\";\nimport type * as t from \"..\";\n\n/**\n * Add comment of certain type to a node.\n */\nexport default function addComment(\n node: T,\n type: t.CommentTypeShorthand,\n content: string,\n line?: boolean,\n): T {\n return addComments(node, type, [\n {\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content,\n } as t.Comment,\n ]);\n}\n","import type * as t from \"..\";\n\nexport default function inherit<\n C extends t.Node | undefined,\n P extends t.Node | undefined,\n>(key: keyof C & keyof P, child: C, parent: P): void {\n if (child && parent) {\n // @ts-expect-error Could further refine key definitions\n child[key] = Array.from(\n new Set([].concat(child[key], parent[key]).filter(Boolean)),\n );\n }\n}\n","import inherit from \"../utils/inherit\";\nimport type * as t from \"..\";\n\nexport default function inheritInnerComments(\n child: t.Node,\n parent: t.Node,\n): void {\n inherit(\"innerComments\", child, parent);\n}\n","import inherit from \"../utils/inherit\";\nimport type * as t from \"..\";\n\nexport default function inheritLeadingComments(\n child: t.Node,\n parent: t.Node,\n): void {\n inherit(\"leadingComments\", child, parent);\n}\n","import inherit from \"../utils/inherit\";\nimport type * as t from \"..\";\n\nexport default function inheritTrailingComments(\n child: t.Node,\n parent: t.Node,\n): void {\n inherit(\"trailingComments\", child, parent);\n}\n","import inheritTrailingComments from \"./inheritTrailingComments\";\nimport inheritLeadingComments from \"./inheritLeadingComments\";\nimport inheritInnerComments from \"./inheritInnerComments\";\nimport type * as t from \"..\";\n\n/**\n * Inherit all unique comments from `parent` node to `child` node.\n */\nexport default function inheritsComments(\n child: T,\n parent: t.Node,\n): T {\n inheritTrailingComments(child, parent);\n inheritLeadingComments(child, parent);\n inheritInnerComments(child, parent);\n\n return child;\n}\n","import { COMMENT_KEYS } from \"../constants\";\nimport type * as t from \"..\";\n\n/**\n * Remove comment properties from a node.\n */\nexport default function removeComments(node: T): T {\n COMMENT_KEYS.forEach(key => {\n node[key] = null;\n });\n\n return node;\n}\n","/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport { FLIPPED_ALIAS_KEYS } from \"../../definitions\";\n\nexport const STANDARDIZED_TYPES = FLIPPED_ALIAS_KEYS[\"Standardized\"];\nexport const EXPRESSION_TYPES = FLIPPED_ALIAS_KEYS[\"Expression\"];\nexport const BINARY_TYPES = FLIPPED_ALIAS_KEYS[\"Binary\"];\nexport const SCOPABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Scopable\"];\nexport const BLOCKPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"BlockParent\"];\nexport const BLOCK_TYPES = FLIPPED_ALIAS_KEYS[\"Block\"];\nexport const STATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"Statement\"];\nexport const TERMINATORLESS_TYPES = FLIPPED_ALIAS_KEYS[\"Terminatorless\"];\nexport const COMPLETIONSTATEMENT_TYPES =\n FLIPPED_ALIAS_KEYS[\"CompletionStatement\"];\nexport const CONDITIONAL_TYPES = FLIPPED_ALIAS_KEYS[\"Conditional\"];\nexport const LOOP_TYPES = FLIPPED_ALIAS_KEYS[\"Loop\"];\nexport const WHILE_TYPES = FLIPPED_ALIAS_KEYS[\"While\"];\nexport const EXPRESSIONWRAPPER_TYPES = FLIPPED_ALIAS_KEYS[\"ExpressionWrapper\"];\nexport const FOR_TYPES = FLIPPED_ALIAS_KEYS[\"For\"];\nexport const FORXSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"ForXStatement\"];\nexport const FUNCTION_TYPES = FLIPPED_ALIAS_KEYS[\"Function\"];\nexport const FUNCTIONPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"FunctionParent\"];\nexport const PUREISH_TYPES = FLIPPED_ALIAS_KEYS[\"Pureish\"];\nexport const DECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"Declaration\"];\nexport const PATTERNLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"PatternLike\"];\nexport const LVAL_TYPES = FLIPPED_ALIAS_KEYS[\"LVal\"];\nexport const TSENTITYNAME_TYPES = FLIPPED_ALIAS_KEYS[\"TSEntityName\"];\nexport const LITERAL_TYPES = FLIPPED_ALIAS_KEYS[\"Literal\"];\nexport const IMMUTABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Immutable\"];\nexport const USERWHITESPACABLE_TYPES = FLIPPED_ALIAS_KEYS[\"UserWhitespacable\"];\nexport const METHOD_TYPES = FLIPPED_ALIAS_KEYS[\"Method\"];\nexport const OBJECTMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"ObjectMember\"];\nexport const PROPERTY_TYPES = FLIPPED_ALIAS_KEYS[\"Property\"];\nexport const UNARYLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"UnaryLike\"];\nexport const PATTERN_TYPES = FLIPPED_ALIAS_KEYS[\"Pattern\"];\nexport const CLASS_TYPES = FLIPPED_ALIAS_KEYS[\"Class\"];\nexport const IMPORTOREXPORTDECLARATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"ImportOrExportDeclaration\"];\nexport const EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ExportDeclaration\"];\nexport const MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleSpecifier\"];\nexport const ACCESSOR_TYPES = FLIPPED_ALIAS_KEYS[\"Accessor\"];\nexport const PRIVATE_TYPES = FLIPPED_ALIAS_KEYS[\"Private\"];\nexport const FLOW_TYPES = FLIPPED_ALIAS_KEYS[\"Flow\"];\nexport const FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowType\"];\nexport const FLOWBASEANNOTATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"FlowBaseAnnotation\"];\nexport const FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"FlowDeclaration\"];\nexport const FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowPredicate\"];\nexport const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS[\"EnumBody\"];\nexport const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"EnumMember\"];\nexport const JSX_TYPES = FLIPPED_ALIAS_KEYS[\"JSX\"];\nexport const MISCELLANEOUS_TYPES = FLIPPED_ALIAS_KEYS[\"Miscellaneous\"];\nexport const TYPESCRIPT_TYPES = FLIPPED_ALIAS_KEYS[\"TypeScript\"];\nexport const TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"TSTypeElement\"];\nexport const TSTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"TSType\"];\nexport const TSBASETYPE_TYPES = FLIPPED_ALIAS_KEYS[\"TSBaseType\"];\n/**\n * @deprecated migrate to IMPORTOREXPORTDECLARATION_TYPES.\n */\nexport const MODULEDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES;\n","import {\n isBlockStatement,\n isFunction,\n isEmptyStatement,\n isStatement,\n} from \"../validators/generated\";\nimport {\n returnStatement,\n expressionStatement,\n blockStatement,\n} from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default function toBlock(\n node: t.Statement | t.Expression,\n parent?: t.Node,\n): t.BlockStatement {\n if (isBlockStatement(node)) {\n return node;\n }\n\n let blockNodes: t.Statement[] = [];\n\n if (isEmptyStatement(node)) {\n blockNodes = [];\n } else {\n if (!isStatement(node)) {\n if (isFunction(parent)) {\n node = returnStatement(node);\n } else {\n node = expressionStatement(node);\n }\n }\n\n blockNodes = [node];\n }\n\n return blockStatement(blockNodes);\n}\n","import toBlock from \"./toBlock\";\nimport type * as t from \"..\";\n\n/**\n * Ensure the `key` (defaults to \"body\") of a `node` is a block.\n * Casting it to a block if it is not.\n *\n * Returns the BlockStatement\n */\nexport default function ensureBlock(\n node: t.Node,\n key: string = \"body\",\n): t.BlockStatement {\n // @ts-expect-error Fixme: key may not exist in node, consider remove key = \"body\"\n const result = toBlock(node[key], node);\n // @ts-expect-error Fixme: key may not exist in node, consider remove key = \"body\"\n node[key] = result;\n return result;\n}\n","import isValidIdentifier from \"../validators/isValidIdentifier\";\nimport { isIdentifierChar } from \"@babel/helper-validator-identifier\";\n\nexport default function toIdentifier(input: string): string {\n input = input + \"\";\n\n // replace all non-valid identifiers with dashes\n let name = \"\";\n for (const c of input) {\n name += isIdentifierChar(c.codePointAt(0)) ? c : \"-\";\n }\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!isValidIdentifier(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}\n","import toIdentifier from \"./toIdentifier\";\n\nexport default function toBindingIdentifierName(name: string): string {\n name = toIdentifier(name);\n if (name === \"eval\" || name === \"arguments\") name = \"_\" + name;\n\n return name;\n}\n","import { isIdentifier } from \"../validators/generated\";\nimport { stringLiteral } from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default function toComputedKey(\n node:\n | t.ObjectMember\n | t.ObjectProperty\n | t.ClassMethod\n | t.ClassProperty\n | t.ClassAccessorProperty\n | t.MemberExpression\n | t.OptionalMemberExpression,\n // @ts-expect-error todo(flow->ts): maybe check the type of node before accessing .key and .property\n key: t.Expression | t.PrivateName = node.key || node.property,\n) {\n if (!node.computed && isIdentifier(key)) key = stringLiteral(key.name);\n\n return key;\n}\n","import {\n isExpression,\n isFunction,\n isClass,\n isExpressionStatement,\n} from \"../validators/generated\";\nimport type * as t from \"..\";\n\nexport default toExpression as {\n (node: t.Function): t.FunctionExpression;\n (node: t.Class): t.ClassExpression;\n (\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n ): t.Expression;\n};\n\nfunction toExpression(\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n): t.Expression {\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n // return unmodified node\n // important for things like ArrowFunctions where\n // type change from ArrowFunction to FunctionExpression\n // produces bugs like -> `()=>a` to `function () a`\n // without generating a BlockStatement for it\n // ref: https://github.com/babel/babili/issues/130\n if (isExpression(node)) {\n return node;\n }\n\n // convert all classes and functions\n // ClassDeclaration -> ClassExpression\n // FunctionDeclaration, ObjectMethod, ClassMethod -> FunctionExpression\n if (isClass(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"ClassExpression\";\n } else if (isFunction(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"FunctionExpression\";\n }\n\n // if it's still not an expression\n if (!isExpression(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}\n","import { VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\n/**\n * A prefix AST traversal implementation meant for simple searching\n * and processing.\n */\nexport default function traverseFast(\n node: t.Node | null | undefined,\n enter: (node: t.Node, opts?: Options) => void,\n opts?: Options,\n): void {\n if (!node) return;\n\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n opts = opts || ({} as Options);\n enter(node, opts);\n\n for (const key of keys) {\n const subNode: t.Node | undefined | null =\n // @ts-expect-error key must present in node\n node[key];\n\n if (Array.isArray(subNode)) {\n for (const node of subNode) {\n traverseFast(node, enter, opts);\n }\n } else {\n traverseFast(subNode, enter, opts);\n }\n }\n}\n","import { COMMENT_KEYS } from \"../constants\";\nimport type * as t from \"..\";\n\nconst CLEAR_KEYS = [\n \"tokens\", // only exist in t.File\n \"start\",\n \"end\",\n \"loc\",\n // Fixme: should be extra.raw / extra.rawValue?\n \"raw\",\n \"rawValue\",\n] as const;\n\nconst CLEAR_KEYS_PLUS_COMMENTS = [\n ...COMMENT_KEYS,\n \"comments\",\n ...CLEAR_KEYS,\n] as const;\n\nexport type Options = { preserveComments?: boolean };\n/**\n * Remove all of the _* properties from a node along with the additional metadata\n * properties like location data and raw token data.\n */\nexport default function removeProperties(\n node: t.Node,\n opts: Options = {},\n): void {\n const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;\n for (const key of map) {\n // @ts-expect-error tokens only exist in t.File\n if (node[key] != null) node[key] = undefined;\n }\n\n for (const key of Object.keys(node)) {\n // @ts-expect-error string can not index node\n if (key[0] === \"_\" && node[key] != null) node[key] = undefined;\n }\n\n const symbols: Array = Object.getOwnPropertySymbols(node);\n for (const sym of symbols) {\n // @ts-expect-error Fixme: document symbol properties\n node[sym] = null;\n }\n}\n","import traverseFast from \"../traverse/traverseFast\";\nimport removeProperties from \"./removeProperties\";\nimport type * as t from \"..\";\n\nexport default function removePropertiesDeep(\n tree: T,\n opts?: { preserveComments: boolean } | null,\n): T {\n traverseFast(tree, removeProperties, opts);\n\n return tree;\n}\n","import { isIdentifier, isStringLiteral } from \"../validators/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep\";\nimport type * as t from \"..\";\n\nexport default function toKeyAlias(\n node: t.Method | t.Property,\n key: t.Node = node.key,\n): string {\n let alias;\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.kind`\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.computed`\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.static`\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n","import {\n isExportDeclaration,\n isIdentifier,\n isDeclaration,\n isFunctionDeclaration,\n isFunctionExpression,\n isExportAllDeclaration,\n} from \"../validators/generated\";\nimport type * as t from \"..\";\n\nexport { getBindingIdentifiers as default };\n\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates: true,\n outerOnly?: boolean,\n): Record>;\n\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates?: false,\n outerOnly?: boolean,\n): Record;\n\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates?: boolean,\n outerOnly?: boolean,\n): Record | Record>;\n\n/**\n * Return a list of binding identifiers associated with the input `node`.\n */\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates?: boolean,\n outerOnly?: boolean,\n): Record | Record> {\n const search: t.Node[] = [].concat(node);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n\n const keys =\n // @ts-expect-error getBindingIdentifiers.keys do not cover all AST types\n getBindingIdentifiers.keys[id.type];\n\n if (isIdentifier(id)) {\n if (duplicates) {\n const _ids = (ids[id.name] = ids[id.name] || []);\n _ids.push(id);\n } else {\n ids[id.name] = id;\n }\n continue;\n }\n\n if (isExportDeclaration(id) && !isExportAllDeclaration(id)) {\n if (isDeclaration(id.declaration)) {\n search.push(id.declaration);\n }\n continue;\n }\n\n if (outerOnly) {\n if (isFunctionDeclaration(id)) {\n search.push(id.id);\n continue;\n }\n\n if (isFunctionExpression(id)) {\n continue;\n }\n }\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const nodes =\n // @ts-expect-error key must present in id\n id[key] as t.Node[] | t.Node | undefined | null;\n if (nodes) {\n Array.isArray(nodes) ? search.push(...nodes) : search.push(nodes);\n }\n }\n }\n }\n\n // $FlowIssue Object.create() seems broken\n return ids;\n}\n\n/**\n * Mapping of types to their identifier keys.\n */\ngetBindingIdentifiers.keys = {\n DeclareClass: [\"id\"],\n DeclareFunction: [\"id\"],\n DeclareModule: [\"id\"],\n DeclareVariable: [\"id\"],\n DeclareInterface: [\"id\"],\n DeclareTypeAlias: [\"id\"],\n DeclareOpaqueType: [\"id\"],\n InterfaceDeclaration: [\"id\"],\n TypeAlias: [\"id\"],\n OpaqueType: [\"id\"],\n\n CatchClause: [\"param\"],\n LabeledStatement: [\"label\"],\n UnaryExpression: [\"argument\"],\n AssignmentExpression: [\"left\"],\n\n ImportSpecifier: [\"local\"],\n ImportNamespaceSpecifier: [\"local\"],\n ImportDefaultSpecifier: [\"local\"],\n ImportDeclaration: [\"specifiers\"],\n\n ExportSpecifier: [\"exported\"],\n ExportNamespaceSpecifier: [\"exported\"],\n ExportDefaultSpecifier: [\"exported\"],\n\n FunctionDeclaration: [\"id\", \"params\"],\n FunctionExpression: [\"id\", \"params\"],\n ArrowFunctionExpression: [\"params\"],\n ObjectMethod: [\"params\"],\n ClassMethod: [\"params\"],\n ClassPrivateMethod: [\"params\"],\n\n ForInStatement: [\"left\"],\n ForOfStatement: [\"left\"],\n\n ClassDeclaration: [\"id\"],\n ClassExpression: [\"id\"],\n\n RestElement: [\"argument\"],\n UpdateExpression: [\"argument\"],\n\n ObjectProperty: [\"value\"],\n\n AssignmentPattern: [\"left\"],\n ArrayPattern: [\"elements\"],\n ObjectPattern: [\"properties\"],\n\n VariableDeclaration: [\"declarations\"],\n VariableDeclarator: [\"id\"],\n};\n","import getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport {\n isExpression,\n isExpressionStatement,\n isVariableDeclaration,\n isIfStatement,\n isBlockStatement,\n isEmptyStatement,\n} from \"../validators/generated\";\nimport {\n sequenceExpression,\n assignmentExpression,\n conditionalExpression,\n} from \"../builders/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport type * as t from \"..\";\nimport type { Scope } from \"@babel/traverse\";\n\nexport type DeclarationInfo = {\n kind: t.VariableDeclaration[\"kind\"];\n id: t.Identifier;\n};\n\nexport default function gatherSequenceExpressions(\n nodes: ReadonlyArray,\n scope: Scope,\n declars: Array,\n) {\n const exprs: t.Expression[] = [];\n let ensureLastUndefined = true;\n\n for (const node of nodes) {\n // if we encounter emptyStatement before a non-emptyStatement\n // we want to disregard that\n if (!isEmptyStatement(node)) {\n ensureLastUndefined = false;\n }\n\n if (isExpression(node)) {\n exprs.push(node);\n } else if (isExpressionStatement(node)) {\n exprs.push(node.expression);\n } else if (isVariableDeclaration(node)) {\n if (node.kind !== \"var\") return; // bailed\n\n for (const declar of node.declarations) {\n const bindings = getBindingIdentifiers(declar);\n for (const key of Object.keys(bindings)) {\n declars.push({\n kind: node.kind,\n id: cloneNode(bindings[key]),\n });\n }\n\n if (declar.init) {\n exprs.push(assignmentExpression(\"=\", declar.id, declar.init));\n }\n }\n\n ensureLastUndefined = true;\n } else if (isIfStatement(node)) {\n const consequent = node.consequent\n ? gatherSequenceExpressions([node.consequent], scope, declars)\n : scope.buildUndefinedNode();\n const alternate = node.alternate\n ? gatherSequenceExpressions([node.alternate], scope, declars)\n : scope.buildUndefinedNode();\n if (!consequent || !alternate) return; // bailed\n\n exprs.push(conditionalExpression(node.test, consequent, alternate));\n } else if (isBlockStatement(node)) {\n const body = gatherSequenceExpressions(node.body, scope, declars);\n if (!body) return; // bailed\n\n exprs.push(body);\n } else if (isEmptyStatement(node)) {\n // empty statement so ensure the last item is undefined if we're last\n // checks if emptyStatement is first\n if (nodes.indexOf(node) === 0) {\n ensureLastUndefined = true;\n }\n } else {\n // bailed, we can't turn this statement into an expression\n return;\n }\n }\n\n if (ensureLastUndefined) {\n exprs.push(scope.buildUndefinedNode());\n }\n\n if (exprs.length === 1) {\n return exprs[0];\n } else {\n return sequenceExpression(exprs);\n }\n}\n","import gatherSequenceExpressions from \"./gatherSequenceExpressions\";\nimport type * as t from \"..\";\nimport type { DeclarationInfo } from \"./gatherSequenceExpressions\";\n\n/**\n * Turn an array of statement `nodes` into a `SequenceExpression`.\n *\n * Variable declarations are turned into simple assignments and their\n * declarations hoisted to the top of the current scope.\n *\n * Expression statements are just resolved to their expression.\n */\nexport default function toSequenceExpression(\n nodes: ReadonlyArray,\n scope: any,\n): t.SequenceExpression | undefined {\n if (!nodes?.length) return;\n\n const declars: DeclarationInfo[] = [];\n const result = gatherSequenceExpressions(nodes, scope, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n // @ts-expect-error fixme: gatherSequenceExpressions will return an Expression when there are only one element\n return result;\n}\n","import {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated\";\nimport { expressionStatement } from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default toStatement as {\n (node: t.AssignmentExpression, ignore?: boolean): t.ExpressionStatement;\n\n (node: T, ignore: false): T;\n (node: T, ignore?: boolean): T | false;\n\n (node: t.Class, ignore: false): t.ClassDeclaration;\n (node: t.Class, ignore?: boolean): t.ClassDeclaration | false;\n\n (node: t.Function, ignore: false): t.FunctionDeclaration;\n (node: t.Function, ignore?: boolean): t.FunctionDeclaration | false;\n\n (node: t.Node, ignore: false): t.Statement;\n (node: t.Node, ignore?: boolean): t.Statement | false;\n};\n\nfunction toStatement(node: t.Node, ignore?: boolean): t.Statement | false {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\" as const;\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\" as const;\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n // @ts-expect-error todo(flow->ts): node.id might be missing\n if (mustHaveId && !node.id) {\n newType = false as false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n // @ts-expect-error manipulating node.type\n node.type = newType;\n\n // @ts-expect-error todo(flow->ts) refactor to avoid type unsafe mutations like reassigning node type above\n return node;\n}\n","import isValidIdentifier from \"../validators/isValidIdentifier\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated\";\nimport type * as t from \"..\";\n\nexport default valueToNode as {\n (value: undefined): t.Identifier; // TODO: This should return \"void 0\"\n (value: boolean): t.BooleanLiteral;\n (value: null): t.NullLiteral;\n (value: string): t.StringLiteral;\n // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression\n (value: number): t.NumericLiteral | t.BinaryExpression | t.UnaryExpression;\n (value: RegExp): t.RegExpLiteral;\n (value: ReadonlyArray): t.ArrayExpression;\n\n // this throws with objects that are not plain objects,\n // or if there are non-valueToNode-able values\n (value: object): t.ObjectExpression;\n\n (value: unknown): t.Expression;\n};\n\n// @ts-expect-error: Object.prototype.toString must return a string\nconst objectToString: (value: unknown) => string = Function.call.bind(\n Object.prototype.toString,\n);\n\nfunction isRegExp(value: unknown): value is RegExp {\n return objectToString(value) === \"[object RegExp]\";\n}\n\nfunction isPlainObject(value: unknown): value is object {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.prototype.toString.call(value) !== \"[object Object]\"\n ) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n // Object.prototype's __proto__ is null. Every other class's __proto__.__proto__ is\n // not null by default. We cannot check if proto === Object.prototype because it\n // could come from another realm.\n return proto === null || Object.getPrototypeOf(proto) === null;\n}\n\nfunction valueToNode(value: unknown): t.Expression {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = value.toString().match(/\\/([a-z]+|)$/)[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey;\n if (isValidIdentifier(key)) {\n nodeKey = identifier(key);\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(\n objectProperty(\n nodeKey,\n valueToNode(\n // @ts-expect-error key must present in value\n value[key],\n ),\n ),\n );\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n","import { memberExpression } from \"../builders/generated\";\nimport type * as t from \"..\";\n\n/**\n * Append a node to a member expression.\n */\nexport default function appendToMemberExpression(\n member: t.MemberExpression,\n append: t.MemberExpression[\"property\"],\n computed: boolean = false,\n): t.MemberExpression {\n member.object = memberExpression(\n member.object,\n member.property,\n member.computed,\n );\n member.property = append;\n member.computed = !!computed;\n\n return member;\n}\n","import { INHERIT_KEYS } from \"../constants\";\nimport inheritsComments from \"../comments/inheritsComments\";\nimport type * as t from \"..\";\n\n/**\n * Inherit all contextual properties from `parent` node to `child` node.\n */\nexport default function inherits(\n child: T,\n parent: t.Node | null | undefined,\n): T {\n if (!child || !parent) return child;\n\n // optionally inherit specific properties if not null\n for (const key of INHERIT_KEYS.optional) {\n // @ts-expect-error Fixme: refine parent types\n if (child[key] == null) {\n // @ts-expect-error Fixme: refine parent types\n child[key] = parent[key];\n }\n }\n\n // force inherit \"private\" properties\n for (const key of Object.keys(parent)) {\n if (key[0] === \"_\" && key !== \"__clone\") {\n // @ts-expect-error Fixme: refine parent types\n child[key] = parent[key];\n }\n }\n\n // force inherit select properties\n for (const key of INHERIT_KEYS.force) {\n // @ts-expect-error Fixme: refine parent types\n child[key] = parent[key];\n }\n\n inheritsComments(child, parent);\n\n return child;\n}\n","import { memberExpression } from \"../builders/generated\";\nimport { isSuper } from \"..\";\nimport type * as t from \"..\";\n\n/**\n * Prepend a node to a member expression.\n */\nexport default function prependToMemberExpression<\n T extends Pick,\n>(member: T, prepend: t.MemberExpression[\"object\"]): T {\n if (isSuper(member.object)) {\n throw new Error(\n \"Cannot prepend node to super property access (`super.foo`).\",\n );\n }\n member.object = memberExpression(prepend, member.object);\n\n return member;\n}\n","import getBindingIdentifiers from \"./getBindingIdentifiers\";\nimport type * as t from \"..\";\n\nexport default getOuterBindingIdentifiers as {\n (node: t.Node, duplicates: true): Record>;\n (node: t.Node, duplicates?: false): Record;\n (\n node: t.Node,\n duplicates?: boolean,\n ): Record | Record>;\n};\n\nfunction getOuterBindingIdentifiers(\n node: t.Node,\n duplicates: boolean,\n): Record | Record> {\n return getBindingIdentifiers(node, duplicates, true);\n}\n","import { VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport type TraversalAncestors = Array<{\n node: t.Node;\n key: string;\n index?: number;\n}>;\n\nexport type TraversalHandler = (\n this: undefined,\n node: t.Node,\n parent: TraversalAncestors,\n state: T,\n) => void;\n\nexport type TraversalHandlers = {\n enter?: TraversalHandler;\n exit?: TraversalHandler;\n};\n\n/**\n * A general AST traversal with both prefix and postfix handlers, and a\n * state object. Exposes ancestry data to each handler so that more complex\n * AST data can be taken into account.\n */\nexport default function traverse(\n node: t.Node,\n handlers: TraversalHandler | TraversalHandlers,\n state?: T,\n): void {\n if (typeof handlers === \"function\") {\n handlers = { enter: handlers };\n }\n\n const { enter, exit } = handlers;\n\n traverseSimpleImpl(node, enter, exit, state, []);\n}\n\nfunction traverseSimpleImpl(\n node: any,\n enter: Function | undefined,\n exit: Function | undefined,\n state: T | undefined,\n ancestors: TraversalAncestors,\n) {\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n if (enter) enter(node, ancestors, state);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (let i = 0; i < subNode.length; i++) {\n const child = subNode[i];\n if (!child) continue;\n\n ancestors.push({\n node,\n key,\n index: i,\n });\n\n traverseSimpleImpl(child, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n } else if (subNode) {\n ancestors.push({\n node,\n key,\n });\n\n traverseSimpleImpl(subNode, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n }\n\n if (exit) exit(node, ancestors, state);\n}\n","import getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport type * as t from \"..\";\n/**\n * Check if the input `node` is a binding identifier.\n */\nexport default function isBinding(\n node: t.Node,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n if (\n grandparent &&\n node.type === \"Identifier\" &&\n parent.type === \"ObjectProperty\" &&\n grandparent.type === \"ObjectExpression\"\n ) {\n // We need to special-case this, because getBindingIdentifiers\n // has an ObjectProperty->value entry for destructuring patterns.\n return false;\n }\n\n const keys =\n // @ts-expect-error getBindingIdentifiers.keys does not cover all AST types\n getBindingIdentifiers.keys[parent.type];\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val =\n // @ts-expect-error key must present in parent\n parent[key];\n if (Array.isArray(val)) {\n if (val.indexOf(node) >= 0) return true;\n } else {\n if (val === node) return true;\n }\n }\n }\n\n return false;\n}\n","import { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a `let` variable declaration.\n */\nexport default function isLet(node: t.Node): boolean {\n return (\n isVariableDeclaration(node) &&\n (node.kind !== \"var\" ||\n // @ts-expect-error Fixme: document private properties\n node[BLOCK_SCOPED_SYMBOL])\n );\n}\n","import { isClassDeclaration, isFunctionDeclaration } from \"./generated\";\nimport isLet from \"./isLet\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is block scoped.\n */\nexport default function isBlockScoped(node: t.Node): boolean {\n return isFunctionDeclaration(node) || isClassDeclaration(node) || isLet(node);\n}\n","import isType from \"./isType\";\nimport { isIdentifier } from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is definitely immutable.\n */\nexport default function isImmutable(node: t.Node): boolean {\n if (isType(node.type, \"Immutable\")) return true;\n\n if (isIdentifier(node)) {\n if (node.name === \"undefined\") {\n // immutable!\n return true;\n } else {\n // no idea...\n return false;\n }\n }\n\n return false;\n}\n","import { NODE_FIELDS, VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\n/**\n * Check if two nodes are equivalent\n */\nexport default function isNodesEquivalent>(\n a: T,\n b: any,\n): b is T {\n if (\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n a == null ||\n b == null\n ) {\n return a === b;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n const fields = Object.keys(NODE_FIELDS[a.type] || a.type);\n const visitorKeys = VISITOR_KEYS[a.type];\n\n for (const field of fields) {\n const val_a =\n // @ts-expect-error field must present in a\n a[field];\n const val_b = b[field];\n if (typeof val_a !== typeof val_b) {\n return false;\n }\n if (val_a == null && val_b == null) {\n continue;\n } else if (val_a == null || val_b == null) {\n return false;\n }\n\n if (Array.isArray(val_a)) {\n if (!Array.isArray(val_b)) {\n return false;\n }\n if (val_a.length !== val_b.length) {\n return false;\n }\n\n for (let i = 0; i < val_a.length; i++) {\n if (!isNodesEquivalent(val_a[i], val_b[i])) {\n return false;\n }\n }\n continue;\n }\n\n if (typeof val_a === \"object\" && !visitorKeys?.includes(field)) {\n for (const key of Object.keys(val_a)) {\n if (val_a[key] !== val_b[key]) {\n return false;\n }\n }\n continue;\n }\n\n if (!isNodesEquivalent(val_a, val_b)) {\n return false;\n }\n }\n\n return true;\n}\n","import type * as t from \"..\";\n\n/**\n * Check if the input `node` is a reference to a bound variable.\n */\nexport default function isReferenced(\n node: t.Node,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n\n case \"JSXMemberExpression\":\n return parent.object === node;\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n // no: class { foo(NODE) {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return false;\n\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n // parent.value === node\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n case \"ClassAccessorProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n case \"ClassPrivateProperty\":\n return parent.key !== node;\n\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n // @ts-expect-error todo(flow->ts): Property 'source' does not exist on type 'AnyTypeAnnotation'.\n if (grandparent?.source) {\n return false;\n }\n return parent.local === node;\n\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n // no: import \"foo\" assert { NODE: \"json\" }\n case \"ImportAttribute\":\n return false;\n\n // no:

\n case \"JSXAttribute\":\n return false;\n\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n\n // yes: type X = { someProperty: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n return true;\n }\n\n return true;\n}\n","import {\n isFunction,\n isCatchClause,\n isBlockStatement,\n isScopable,\n isPattern,\n} from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a scope.\n */\nexport default function isScope(node: t.Node, parent: t.Node): boolean {\n // If a BlockStatement is an immediate descendent of a Function/CatchClause, it must be in the body.\n // Hence we skipped the parentKey === \"params\" check\n if (isBlockStatement(node) && (isFunction(parent) || isCatchClause(parent))) {\n return false;\n }\n\n // If a Pattern is an immediate descendent of a Function/CatchClause, it must be in the params.\n // Hence we skipped the parentKey === \"params\" check\n if (isPattern(node) && (isFunction(parent) || isCatchClause(parent))) {\n return true;\n }\n\n return isScopable(node);\n}\n","import { isIdentifier, isImportDefaultSpecifier } from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `specifier` is a `default` import or export.\n */\nexport default function isSpecifierDefault(\n specifier: t.ModuleSpecifier,\n): boolean {\n return (\n isImportDefaultSpecifier(specifier) ||\n // @ts-expect-error todo(flow->ts): stricter type for specifier\n isIdentifier(specifier.imported || specifier.exported, {\n name: \"default\",\n })\n );\n}\n","import isValidIdentifier from \"./isValidIdentifier\";\n\nconst RESERVED_WORDS_ES3_ONLY: Set = new Set([\n \"abstract\",\n \"boolean\",\n \"byte\",\n \"char\",\n \"double\",\n \"enum\",\n \"final\",\n \"float\",\n \"goto\",\n \"implements\",\n \"int\",\n \"interface\",\n \"long\",\n \"native\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"short\",\n \"static\",\n \"synchronized\",\n \"throws\",\n \"transient\",\n \"volatile\",\n]);\n\n/**\n * Check if the input `name` is a valid identifier name according to the ES3 specification.\n *\n * Additional ES3 reserved words are\n */\nexport default function isValidES3Identifier(name: string): boolean {\n return isValidIdentifier(name) && !RESERVED_WORDS_ES3_ONLY.has(name);\n}\n","import { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: t.Node): boolean {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) &&\n !(\n // @ts-expect-error document private properties\n node[BLOCK_SCOPED_SYMBOL]\n )\n );\n}\n","import isReactComponent from \"./validators/react/isReactComponent\";\nimport isCompatTag from \"./validators/react/isCompatTag\";\nimport buildChildren from \"./builders/react/buildChildren\";\n\n// asserts\nexport { default as assertNode } from \"./asserts/assertNode\";\nexport * from \"./asserts/generated\";\n\n// builders\nexport { default as createTypeAnnotationBasedOnTypeof } from \"./builders/flow/createTypeAnnotationBasedOnTypeof\";\n/** @deprecated use createFlowUnionType instead */\nexport { default as createUnionTypeAnnotation } from \"./builders/flow/createFlowUnionType\";\nexport { default as createFlowUnionType } from \"./builders/flow/createFlowUnionType\";\nexport { default as createTSUnionType } from \"./builders/typescript/createTSUnionType\";\nexport * from \"./builders/generated\";\nexport * from \"./builders/generated/uppercase\";\n\n// clone\nexport { default as cloneNode } from \"./clone/cloneNode\";\nexport { default as clone } from \"./clone/clone\";\nexport { default as cloneDeep } from \"./clone/cloneDeep\";\nexport { default as cloneDeepWithoutLoc } from \"./clone/cloneDeepWithoutLoc\";\nexport { default as cloneWithoutLoc } from \"./clone/cloneWithoutLoc\";\n\n// comments\nexport { default as addComment } from \"./comments/addComment\";\nexport { default as addComments } from \"./comments/addComments\";\nexport { default as inheritInnerComments } from \"./comments/inheritInnerComments\";\nexport { default as inheritLeadingComments } from \"./comments/inheritLeadingComments\";\nexport { default as inheritsComments } from \"./comments/inheritsComments\";\nexport { default as inheritTrailingComments } from \"./comments/inheritTrailingComments\";\nexport { default as removeComments } from \"./comments/removeComments\";\n\n// constants\nexport * from \"./constants/generated\";\nexport * from \"./constants\";\n\n// converters\nexport { default as ensureBlock } from \"./converters/ensureBlock\";\nexport { default as toBindingIdentifierName } from \"./converters/toBindingIdentifierName\";\nexport { default as toBlock } from \"./converters/toBlock\";\nexport { default as toComputedKey } from \"./converters/toComputedKey\";\nexport { default as toExpression } from \"./converters/toExpression\";\nexport { default as toIdentifier } from \"./converters/toIdentifier\";\nexport { default as toKeyAlias } from \"./converters/toKeyAlias\";\nexport { default as toSequenceExpression } from \"./converters/toSequenceExpression\";\nexport { default as toStatement } from \"./converters/toStatement\";\nexport { default as valueToNode } from \"./converters/valueToNode\";\n\n// definitions\nexport * from \"./definitions\";\n\n// modifications\nexport { default as appendToMemberExpression } from \"./modifications/appendToMemberExpression\";\nexport { default as inherits } from \"./modifications/inherits\";\nexport { default as prependToMemberExpression } from \"./modifications/prependToMemberExpression\";\nexport {\n default as removeProperties,\n type Options as RemovePropertiesOptions,\n} from \"./modifications/removeProperties\";\nexport { default as removePropertiesDeep } from \"./modifications/removePropertiesDeep\";\nexport { default as removeTypeDuplicates } from \"./modifications/flow/removeTypeDuplicates\";\n\n// retrievers\nexport { default as getBindingIdentifiers } from \"./retrievers/getBindingIdentifiers\";\nexport { default as getOuterBindingIdentifiers } from \"./retrievers/getOuterBindingIdentifiers\";\n\n// traverse\nexport { default as traverse } from \"./traverse/traverse\";\nexport * from \"./traverse/traverse\";\nexport { default as traverseFast } from \"./traverse/traverseFast\";\n\n// utils\nexport { default as shallowEqual } from \"./utils/shallowEqual\";\n\n// validators\nexport { default as is } from \"./validators/is\";\nexport { default as isBinding } from \"./validators/isBinding\";\nexport { default as isBlockScoped } from \"./validators/isBlockScoped\";\nexport { default as isImmutable } from \"./validators/isImmutable\";\nexport { default as isLet } from \"./validators/isLet\";\nexport { default as isNode } from \"./validators/isNode\";\nexport { default as isNodesEquivalent } from \"./validators/isNodesEquivalent\";\nexport { default as isPlaceholderType } from \"./validators/isPlaceholderType\";\nexport { default as isReferenced } from \"./validators/isReferenced\";\nexport { default as isScope } from \"./validators/isScope\";\nexport { default as isSpecifierDefault } from \"./validators/isSpecifierDefault\";\nexport { default as isType } from \"./validators/isType\";\nexport { default as isValidES3Identifier } from \"./validators/isValidES3Identifier\";\nexport { default as isValidIdentifier } from \"./validators/isValidIdentifier\";\nexport { default as isVar } from \"./validators/isVar\";\nexport { default as matchesPattern } from \"./validators/matchesPattern\";\nexport { default as validate } from \"./validators/validate\";\nexport { default as buildMatchMemberExpression } from \"./validators/buildMatchMemberExpression\";\nexport * from \"./validators/generated\";\n\n// react\nexport const react = {\n isReactComponent,\n isCompatTag,\n buildChildren,\n};\n\nexport type * from \"./ast-types/generated\";\n\n// this is used by @babel/traverse to warn about deprecated visitors\nexport { default as __internal__deprecationWarning } from \"./utils/deprecationWarning\";\n","import * as virtualTypes from \"./path/lib/virtual-types\";\nimport type { Node } from \"@babel/types\";\nimport {\n DEPRECATED_KEYS,\n DEPRECATED_ALIASES,\n FLIPPED_ALIAS_KEYS,\n TYPES,\n __internal__deprecationWarning as deprecationWarning,\n} from \"@babel/types\";\nimport type { ExplodedVisitor, NodePath, Visitor } from \"./index\";\nimport type { ExplVisitNode, VisitNodeFunction, VisitPhase } from \"./types\";\n\ntype VIRTUAL_TYPES = keyof typeof virtualTypes;\nfunction isVirtualType(type: string): type is VIRTUAL_TYPES {\n return type in virtualTypes;\n}\nexport type VisitWrapper = (\n stateName: string | undefined,\n visitorType: VisitPhase,\n callback: VisitNodeFunction,\n) => VisitNodeFunction;\n\nexport function isExplodedVisitor(\n visitor: Visitor,\n): visitor is ExplodedVisitor {\n // @ts-expect-error _exploded is not defined on non-exploded Visitor\n return visitor?._exploded;\n}\n\n/**\n * explode() will take a visitor object with all of the various shorthands\n * that we support, and validates & normalizes it into a common format, ready\n * to be used in traversal\n *\n * The various shorthands are:\n * * `Identifier() { ... }` -> `Identifier: { enter() { ... } }`\n * * `\"Identifier|NumericLiteral\": { ... }` -> `Identifier: { ... }, NumericLiteral: { ... }`\n * * Aliases in `@babel/types`: e.g. `Property: { ... }` -> `ObjectProperty: { ... }, ClassProperty: { ... }`\n * Other normalizations are:\n * * Visitors of virtual types are wrapped, so that they are only visited when\n * their dynamic check passes\n * * `enter` and `exit` functions are wrapped in arrays, to ease merging of\n * visitors\n */\nexport function explode(visitor: Visitor): ExplodedVisitor {\n if (isExplodedVisitor(visitor)) return visitor;\n // @ts-expect-error `visitor` will be cast to ExplodedVisitor by this function\n visitor._exploded = true;\n\n // normalise pipes\n for (const nodeType of Object.keys(visitor) as (keyof Visitor)[]) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n const parts: Array = nodeType.split(\"|\");\n if (parts.length === 1) continue;\n\n const fns = visitor[nodeType];\n delete visitor[nodeType];\n\n for (const part of parts) {\n // @ts-expect-error part will be verified by `verify` later\n visitor[part] = fns;\n }\n }\n\n // verify data structure\n verify(visitor);\n\n // make sure there's no __esModule type since this is because we're using loose mode\n // and it sets __esModule to be enumerable on all modules :(\n // @ts-expect-error ESModule interop\n delete visitor.__esModule;\n\n // ensure visitors are objects\n ensureEntranceObjects(visitor);\n\n // ensure enter/exit callbacks are arrays\n ensureCallbackArrays(visitor);\n\n // add type wrappers\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n if (!isVirtualType(nodeType)) continue;\n\n // wrap all the functions\n const fns = visitor[nodeType];\n for (const type of Object.keys(fns)) {\n // @ts-expect-error normalised as VisitNodeObject\n fns[type] = wrapCheck(nodeType, fns[type]);\n }\n\n // clear it from the visitor\n delete visitor[nodeType];\n\n const types = virtualTypes[nodeType];\n if (types !== null) {\n for (const type of types) {\n // merge the visitor if necessary or just put it back in\n if (visitor[type]) {\n mergePair(visitor[type], fns);\n } else {\n // @ts-expect-error Expression produces too complex union\n visitor[type] = fns;\n }\n }\n } else {\n mergePair(visitor, fns);\n }\n }\n\n // add aliases\n for (const nodeType of Object.keys(visitor) as (keyof Visitor)[]) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n let aliases = FLIPPED_ALIAS_KEYS[nodeType];\n\n if (nodeType in DEPRECATED_KEYS) {\n const deprecatedKey = DEPRECATED_KEYS[nodeType];\n deprecationWarning(nodeType, deprecatedKey, \"Visitor \");\n aliases = [deprecatedKey];\n } else if (nodeType in DEPRECATED_ALIASES) {\n const deprecatedAlias =\n DEPRECATED_ALIASES[nodeType as keyof typeof DEPRECATED_ALIASES];\n deprecationWarning(nodeType, deprecatedAlias, \"Visitor \");\n aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias];\n }\n\n if (!aliases) continue;\n\n const fns = visitor[nodeType];\n // clear it from the visitor\n delete visitor[nodeType];\n\n for (const alias of aliases) {\n const existing = visitor[alias];\n if (existing) {\n mergePair(existing, fns);\n } else {\n // @ts-expect-error Expression produces a union type that is too complex to represent.\n visitor[alias] = { ...fns };\n }\n }\n }\n\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n ensureCallbackArrays(\n // @ts-expect-error nodeType must present in visitor after previous validations\n visitor[nodeType],\n );\n }\n\n // @ts-expect-error explosion has been performed\n return visitor as ExplodedVisitor;\n}\n\nexport function verify(visitor: Visitor) {\n // @ts-expect-error _verified is not defined on non-verified Visitor.\n // TODO: unify _verified and _exploded.\n if (visitor._verified) return;\n\n if (typeof visitor === \"function\") {\n throw new Error(\n \"You passed `traverse()` a function when it expected a visitor object, \" +\n \"are you sure you didn't mean `{ enter: Function }`?\",\n );\n }\n\n for (const nodeType of Object.keys(visitor) as (keyof Visitor)[]) {\n if (nodeType === \"enter\" || nodeType === \"exit\") {\n validateVisitorMethods(nodeType, visitor[nodeType]);\n }\n\n if (shouldIgnoreKey(nodeType)) continue;\n\n if (TYPES.indexOf(nodeType) < 0) {\n throw new Error(\n `You gave us a visitor for the node type ${nodeType} but it's not a valid type`,\n );\n }\n\n const visitors = visitor[nodeType];\n if (typeof visitors === \"object\") {\n for (const visitorKey of Object.keys(visitors)) {\n if (visitorKey === \"enter\" || visitorKey === \"exit\") {\n // verify that it just contains functions\n validateVisitorMethods(\n `${nodeType}.${visitorKey}`,\n visitors[visitorKey],\n );\n } else {\n throw new Error(\n \"You passed `traverse()` a visitor object with the property \" +\n `${nodeType} that has the invalid property ${visitorKey}`,\n );\n }\n }\n }\n }\n\n // @ts-expect-error _verified is not defined on non-verified Visitor.\n // TODO: unify _verified and _exploded.\n visitor._verified = true;\n}\n\nfunction validateVisitorMethods(\n path: string,\n val: any,\n): asserts val is Function | Function[] {\n const fns = [].concat(val);\n for (const fn of fns) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\n `Non-function found defined in ${path} with type ${typeof fn}`,\n );\n }\n }\n}\n\nexport function merge(\n visitors: Visitor[],\n): ExplodedVisitor;\nexport function merge(\n visitors: Visitor[],\n states?: any[],\n wrapper?: Function | null,\n): ExplodedVisitor;\nexport function merge(\n visitors: any[],\n states: any[] = [],\n wrapper?: VisitWrapper | null,\n): ExplodedVisitor {\n // @ts-expect-error don't bother with internal flags so it can work with earlier @babel/core validations\n const mergedVisitor: ExplodedVisitor = {};\n\n for (let i = 0; i < visitors.length; i++) {\n const visitor = explode(visitors[i]);\n const state = states[i];\n\n let topVisitor: ExplVisitNode = visitor;\n if (state || wrapper) {\n topVisitor = wrapWithStateOrWrapper(topVisitor, state, wrapper);\n }\n mergePair(mergedVisitor, topVisitor);\n\n for (const key of Object.keys(visitor) as (keyof ExplodedVisitor)[]) {\n if (shouldIgnoreKey(key)) continue;\n\n let typeVisitor = visitor[key];\n\n // if we have state or wrapper then overload the callbacks to take it\n if (state || wrapper) {\n typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper);\n }\n\n const nodeVisitor = (mergedVisitor[key] ||= {});\n mergePair(nodeVisitor, typeVisitor);\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return {\n ...mergedVisitor,\n _exploded: true,\n _verified: true,\n };\n }\n\n return mergedVisitor;\n}\n\nfunction wrapWithStateOrWrapper(\n oldVisitor: ExplVisitNode,\n state: State | null,\n wrapper?: VisitWrapper | null,\n): ExplVisitNode {\n const newVisitor: ExplVisitNode = {};\n\n for (const phase of [\"enter\", \"exit\"] as VisitPhase[]) {\n let fns = oldVisitor[phase];\n\n // not an enter/exit array of callbacks\n if (!Array.isArray(fns)) continue;\n\n fns = fns.map(function (fn) {\n let newFn = fn;\n\n if (state) {\n newFn = function (path: NodePath) {\n fn.call(state, path, state);\n };\n }\n\n if (wrapper) {\n // @ts-expect-error Fixme: actually PluginPass.key (aka pluginAlias)?\n newFn = wrapper(state?.key, phase, newFn);\n }\n\n // Override toString in case this function is printed, we want to print the wrapped function, same as we do in `wrapCheck`\n if (newFn !== fn) {\n newFn.toString = () => fn.toString();\n }\n\n return newFn;\n });\n\n newVisitor[phase] = fns;\n }\n\n return newVisitor;\n}\n\nfunction ensureEntranceObjects(obj: Visitor) {\n for (const key of Object.keys(obj) as (keyof Visitor)[]) {\n if (shouldIgnoreKey(key)) continue;\n\n const fns = obj[key];\n if (typeof fns === \"function\") {\n // @ts-expect-error: Expression produces a union type that is too complex to represent.\n obj[key] = { enter: fns };\n }\n }\n}\n\nfunction ensureCallbackArrays(obj: Visitor) {\n if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];\n if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];\n}\n\nfunction wrapCheck(nodeType: VIRTUAL_TYPES, fn: Function) {\n const newFn = function (this: unknown, path: NodePath) {\n if (path[`is${nodeType}`]()) {\n return fn.apply(this, arguments);\n }\n };\n newFn.toString = () => fn.toString();\n return newFn;\n}\n\nfunction shouldIgnoreKey(\n key: string,\n): key is\n | `_${string}`\n | \"enter\"\n | \"exit\"\n | \"shouldSkip\"\n | \"denylist\"\n | \"noScope\"\n | \"skipKeys\"\n | \"blacklist\" {\n // internal/hidden key\n if (key[0] === \"_\") return true;\n\n // ignore function keys\n if (key === \"enter\" || key === \"exit\" || key === \"shouldSkip\") return true;\n\n // ignore other options\n if (key === \"denylist\" || key === \"noScope\" || key === \"skipKeys\") {\n return true;\n }\n\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"blacklist\") {\n return true;\n }\n }\n\n return false;\n}\n\n/*\nfunction mergePair(\n dest: ExplVisitNode,\n src: ExplVisitNode,\n);\n*/\nfunction mergePair(dest: any, src: any) {\n for (const phase of [\"enter\", \"exit\"] as VisitPhase[]) {\n if (!src[phase]) continue;\n dest[phase] = [].concat(dest[phase] || [], src[phase]);\n }\n}\n","import type { Node } from \"@babel/types\";\nimport type NodePath from \"./path\";\nimport type Scope from \"./scope\";\n\nexport let path: WeakMap> = new WeakMap();\nexport let scope: WeakMap = new WeakMap();\n\nexport function clear() {\n clearPath();\n clearScope();\n}\n\nexport function clearPath() {\n path = new WeakMap();\n}\n\nexport function clearScope() {\n scope = new WeakMap();\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","'use strict';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n","'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","import {\n cloneNode,\n exportNamedDeclaration,\n exportSpecifier,\n identifier,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function splitExportDeclaration(\n exportDeclaration: NodePath<\n t.ExportDefaultDeclaration | t.ExportNamedDeclaration\n >,\n) {\n if (\n !exportDeclaration.isExportDeclaration() ||\n exportDeclaration.isExportAllDeclaration()\n ) {\n throw new Error(\"Only default and named export declarations can be split.\");\n }\n\n // build specifiers that point back to this export declaration\n\n if (exportDeclaration.isExportDefaultDeclaration()) {\n const declaration = exportDeclaration.get(\"declaration\");\n const standaloneDeclaration =\n declaration.isFunctionDeclaration() || declaration.isClassDeclaration();\n const exportExpr =\n declaration.isFunctionExpression() || declaration.isClassExpression();\n\n const scope = declaration.isScope()\n ? declaration.scope.parent\n : declaration.scope;\n\n // @ts-expect-error id is not defined in expressions other than function/class\n let id = declaration.node.id;\n let needBindingRegistration = false;\n\n if (!id) {\n needBindingRegistration = true;\n\n id = scope.generateUidIdentifier(\"default\");\n\n if (standaloneDeclaration || exportExpr) {\n declaration.node.id = cloneNode(id);\n }\n } else if (exportExpr && scope.hasBinding(id.name)) {\n needBindingRegistration = true;\n\n id = scope.generateUidIdentifier(id.name);\n }\n\n const updatedDeclaration = standaloneDeclaration\n ? declaration.node\n : variableDeclaration(\"var\", [\n variableDeclarator(\n cloneNode(id),\n // @ts-expect-error When `standaloneDeclaration` is false, declaration must not be a Function/ClassDeclaration\n declaration.node,\n ),\n ]);\n\n const updatedExportDeclaration = exportNamedDeclaration(null, [\n exportSpecifier(cloneNode(id), identifier(\"default\")),\n ]);\n\n exportDeclaration.insertAfter(updatedExportDeclaration);\n exportDeclaration.replaceWith(updatedDeclaration);\n\n if (needBindingRegistration) {\n scope.registerDeclaration(exportDeclaration);\n }\n\n return exportDeclaration;\n } else if (\n // @ts-expect-error TS can not narrow down to NodePath\n exportDeclaration.get(\"specifiers\").length > 0\n ) {\n throw new Error(\"It doesn't make sense to split exported specifiers.\");\n }\n\n const declaration = exportDeclaration.get(\"declaration\");\n const bindingIdentifiers = declaration.getOuterBindingIdentifiers();\n\n const specifiers = Object.keys(bindingIdentifiers).map(name => {\n return exportSpecifier(identifier(name), identifier(name));\n });\n\n const aliasDeclar = exportNamedDeclaration(null, specifiers);\n\n exportDeclaration.insertAfter(aliasDeclar);\n exportDeclaration.replaceWith(declaration.node);\n return exportDeclaration;\n}\n","import type { NodePath, Visitor } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\nif (!process.env.BABEL_8_BREAKING) {\n if (!USE_ESM) {\n if (!IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.skipAllButComputedKey = function skipAllButComputedKey(\n path: NodePath,\n ) {\n path.skip();\n if (path.node.computed) {\n // requeue the computed key\n path.context.maybeQueue(path.get(\"key\"));\n }\n };\n }\n }\n}\n\nexport function requeueComputedKeyAndDecorators(\n path: NodePath,\n) {\n const { context, node } = path;\n // @ts-expect-error ClassPrivateProperty does not have computed\n if (node.computed) {\n // requeue the computed key\n context.maybeQueue(path.get(\"key\"));\n }\n if (node.decorators) {\n for (const decorator of path.get(\"decorators\")) {\n // requeue the decorators\n context.maybeQueue(decorator);\n }\n }\n}\n\n// environmentVisitor should be used when traversing the whole class and not for specific class elements/methods.\n// For perf reasons, the environmentVisitor might be traversed with `{ noScope: true }`, which means `path.scope` is undefined.\n// Avoid using `path.scope` here\nconst visitor: Visitor = {\n FunctionParent(path) {\n if (path.isArrowFunctionExpression()) {\n // arrows are not skipped because they inherit the context.\n return;\n } else {\n path.skip();\n if (path.isMethod()) {\n requeueComputedKeyAndDecorators(path);\n }\n }\n },\n Property(path) {\n if (path.isObjectProperty()) {\n return;\n }\n path.skip();\n requeueComputedKeyAndDecorators(path);\n },\n};\n\nexport default visitor;\n","import type Binding from \"../binding\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as t from \"@babel/types\";\nimport type { NodePath, Visitor } from \"../..\";\nimport { requeueComputedKeyAndDecorators } from \"@babel/helper-environment-visitor\";\nimport { traverseNode } from \"../../traverse-node\";\nimport { explode } from \"../../visitors\";\nimport type { Identifier } from \"@babel/types\";\n\nconst renameVisitor: Visitor = {\n ReferencedIdentifier({ node }, state) {\n if (node.name === state.oldName) {\n node.name = state.newName;\n }\n },\n\n Scope(path, state) {\n if (\n !path.scope.bindingIdentifierEquals(\n state.oldName,\n state.binding.identifier,\n )\n ) {\n path.skip();\n if (path.isMethod()) {\n requeueComputedKeyAndDecorators(path);\n }\n }\n },\n\n ObjectProperty({ node, scope }, state) {\n const { name } = node.key as Identifier;\n if (\n node.shorthand &&\n // In destructuring the identifier is already renamed by the\n // AssignmentExpression|Declaration|VariableDeclarator visitor,\n // while in object literals it's renamed later by the\n // ReferencedIdentifier visitor.\n (name === state.oldName || name === state.newName) &&\n // Ignore shadowed bindings\n scope.getBindingIdentifier(name) === state.binding.identifier\n ) {\n node.shorthand = false;\n if (node.extra?.shorthand) node.extra.shorthand = false;\n }\n },\n\n \"AssignmentExpression|Declaration|VariableDeclarator\"(\n path: NodePath,\n state,\n ) {\n if (path.isVariableDeclaration()) return;\n const ids = path.getOuterBindingIdentifiers();\n\n for (const name in ids) {\n if (name === state.oldName) ids[name].name = state.newName;\n }\n },\n};\n\nexport default class Renamer {\n constructor(binding: Binding, oldName: string, newName: string) {\n this.newName = newName;\n this.oldName = oldName;\n this.binding = binding;\n }\n\n declare oldName: string;\n declare newName: string;\n declare binding: Binding;\n\n maybeConvertFromExportDeclaration(parentDeclar: NodePath) {\n const maybeExportDeclar = parentDeclar.parentPath;\n\n if (!maybeExportDeclar.isExportDeclaration()) {\n return;\n }\n\n if (maybeExportDeclar.isExportDefaultDeclaration()) {\n const { declaration } = maybeExportDeclar.node;\n if (t.isDeclaration(declaration) && !declaration.id) {\n return;\n }\n }\n\n if (maybeExportDeclar.isExportAllDeclaration()) {\n return;\n }\n\n splitExportDeclaration(\n maybeExportDeclar as NodePath<\n Exclude\n >,\n );\n }\n\n maybeConvertFromClassFunctionDeclaration(path: NodePath) {\n return path; // TODO\n\n // // retain the `name` of a class/function declaration\n\n // if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;\n // if (this.binding.kind !== \"hoisted\") return;\n\n // path.node.id = identifier(this.oldName);\n // path.node._blockHoist = 3;\n\n // path.replaceWith(\n // variableDeclaration(\"let\", [\n // variableDeclarator(identifier(this.newName), toExpression(path.node)),\n // ]),\n // );\n }\n\n maybeConvertFromClassFunctionExpression(path: NodePath) {\n return path; // TODO\n\n // // retain the `name` of a class/function expression\n\n // if (!path.isFunctionExpression() && !path.isClassExpression()) return;\n // if (this.binding.kind !== \"local\") return;\n\n // path.node.id = identifier(this.oldName);\n\n // this.binding.scope.parent.push({\n // id: identifier(this.newName),\n // });\n\n // path.replaceWith(\n // assignmentExpression(\"=\", identifier(this.newName), path.node),\n // );\n }\n\n rename(/* Babel 7 - block?: t.Pattern | t.Scopable */) {\n const { binding, oldName, newName } = this;\n const { scope, path } = binding;\n\n const parentDeclar = path.find(\n path =>\n path.isDeclaration() ||\n path.isFunctionExpression() ||\n path.isClassExpression(),\n );\n if (parentDeclar) {\n const bindingIds = parentDeclar.getOuterBindingIdentifiers();\n if (bindingIds[oldName] === binding.identifier) {\n // When we are renaming an exported identifier, we need to ensure that\n // the exported binding keeps the old name.\n this.maybeConvertFromExportDeclaration(parentDeclar);\n }\n }\n\n const blockToTraverse = process.env.BABEL_8_BREAKING\n ? scope.block\n : (arguments[0] as t.Pattern | t.Scopable) || scope.block;\n traverseNode(\n blockToTraverse,\n explode(renameVisitor),\n scope,\n this,\n scope.path,\n // When blockToTraverse is a SwitchStatement, the discriminant\n // is not part of the current scope and thus should be skipped.\n { discriminant: true },\n );\n\n if (process.env.BABEL_8_BREAKING) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n } else if (!arguments[0]) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n }\n\n if (parentDeclar) {\n this.maybeConvertFromClassFunctionDeclaration(path);\n this.maybeConvertFromClassFunctionExpression(path);\n }\n }\n}\n","import type NodePath from \"../path\";\nimport type * as t from \"@babel/types\";\nimport type Scope from \"./index\";\n\nexport type BindingKind =\n | \"var\" /* var declarator */\n | \"let\" /* let declarator, class declaration id, catch clause parameters */\n | \"const\" /* const/using declarator */\n | \"module\" /* import specifiers */\n | \"hoisted\" /* function declaration id */\n | \"param\" /* function declaration parameters */\n | \"local\" /* function expression id, class expression id */\n | \"unknown\"; /* export specifiers */\n/**\n * This class is responsible for a binding inside of a scope.\n *\n * It tracks the following:\n *\n * * Node path.\n * * Amount of times referenced by other nodes.\n * * Paths to nodes that reassign or modify this binding.\n * * The kind of binding. (Is it a parameter, declaration etc)\n */\n\nexport default class Binding {\n identifier: t.Identifier;\n scope: Scope;\n path: NodePath;\n kind: BindingKind;\n\n constructor({\n identifier,\n scope,\n path,\n kind,\n }: {\n identifier: t.Identifier;\n scope: Scope;\n path: NodePath;\n kind: BindingKind;\n }) {\n this.identifier = identifier;\n this.scope = scope;\n this.path = path;\n this.kind = kind;\n\n if (\n (kind === \"var\" || kind === \"hoisted\") &&\n // https://github.com/rollup/rollup/issues/4654\n // Rollup removes the path argument from this call. Add an\n // unreachable IIFE (that rollup doesn't know is unreachable)\n // with side effects, to prevent it from messing up with arguments.\n // You can reproduce this with\n // BABEL_8_BREAKING=true make prepublish-build\n isDeclaredInLoop(\n path ||\n (() => {\n throw new Error(\"Internal Babel error: unreachable \");\n })(),\n )\n ) {\n this.reassign(path);\n }\n\n this.clearValue();\n }\n\n constantViolations: Array = [];\n constant: boolean = true;\n\n referencePaths: Array = [];\n referenced: boolean = false;\n references: number = 0;\n\n declare hasDeoptedValue: boolean;\n declare hasValue: boolean;\n declare value: any;\n\n deoptValue() {\n this.clearValue();\n this.hasDeoptedValue = true;\n }\n\n setValue(value: any) {\n if (this.hasDeoptedValue) return;\n this.hasValue = true;\n this.value = value;\n }\n\n clearValue() {\n this.hasDeoptedValue = false;\n this.hasValue = false;\n this.value = null;\n }\n\n /**\n * Register a constant violation with the provided `path`.\n */\n\n reassign(path: NodePath) {\n this.constant = false;\n if (this.constantViolations.indexOf(path) !== -1) {\n return;\n }\n this.constantViolations.push(path);\n }\n\n /**\n * Increment the amount of references to this binding.\n */\n\n reference(path: NodePath) {\n if (this.referencePaths.indexOf(path) !== -1) {\n return;\n }\n this.referenced = true;\n this.references++;\n this.referencePaths.push(path);\n }\n\n /**\n * Decrement the amount of references to this binding.\n */\n\n dereference() {\n this.references--;\n this.referenced = !!this.references;\n }\n}\n\nfunction isDeclaredInLoop(path: NodePath) {\n for (\n let { parentPath, key } = path;\n parentPath;\n { parentPath, key } = parentPath\n ) {\n if (parentPath.isFunctionParent()) return false;\n if (\n parentPath.isWhile() ||\n parentPath.isForXStatement() ||\n (parentPath.isForStatement() && key === \"body\")\n ) {\n return true;\n }\n }\n return false;\n}\n","{\n\t\"builtin\": {\n\t\t\"Array\": false,\n\t\t\"ArrayBuffer\": false,\n\t\t\"Atomics\": false,\n\t\t\"BigInt\": false,\n\t\t\"BigInt64Array\": false,\n\t\t\"BigUint64Array\": false,\n\t\t\"Boolean\": false,\n\t\t\"constructor\": false,\n\t\t\"DataView\": false,\n\t\t\"Date\": false,\n\t\t\"decodeURI\": false,\n\t\t\"decodeURIComponent\": false,\n\t\t\"encodeURI\": false,\n\t\t\"encodeURIComponent\": false,\n\t\t\"Error\": false,\n\t\t\"escape\": false,\n\t\t\"eval\": false,\n\t\t\"EvalError\": false,\n\t\t\"Float32Array\": false,\n\t\t\"Float64Array\": false,\n\t\t\"Function\": false,\n\t\t\"globalThis\": false,\n\t\t\"hasOwnProperty\": false,\n\t\t\"Infinity\": false,\n\t\t\"Int16Array\": false,\n\t\t\"Int32Array\": false,\n\t\t\"Int8Array\": false,\n\t\t\"isFinite\": false,\n\t\t\"isNaN\": false,\n\t\t\"isPrototypeOf\": false,\n\t\t\"JSON\": false,\n\t\t\"Map\": false,\n\t\t\"Math\": false,\n\t\t\"NaN\": false,\n\t\t\"Number\": false,\n\t\t\"Object\": false,\n\t\t\"parseFloat\": false,\n\t\t\"parseInt\": false,\n\t\t\"Promise\": false,\n\t\t\"propertyIsEnumerable\": false,\n\t\t\"Proxy\": false,\n\t\t\"RangeError\": false,\n\t\t\"ReferenceError\": false,\n\t\t\"Reflect\": false,\n\t\t\"RegExp\": false,\n\t\t\"Set\": false,\n\t\t\"SharedArrayBuffer\": false,\n\t\t\"String\": false,\n\t\t\"Symbol\": false,\n\t\t\"SyntaxError\": false,\n\t\t\"toLocaleString\": false,\n\t\t\"toString\": false,\n\t\t\"TypeError\": false,\n\t\t\"Uint16Array\": false,\n\t\t\"Uint32Array\": false,\n\t\t\"Uint8Array\": false,\n\t\t\"Uint8ClampedArray\": false,\n\t\t\"undefined\": false,\n\t\t\"unescape\": false,\n\t\t\"URIError\": false,\n\t\t\"valueOf\": false,\n\t\t\"WeakMap\": false,\n\t\t\"WeakSet\": false\n\t},\n\t\"es5\": {\n\t\t\"Array\": false,\n\t\t\"Boolean\": false,\n\t\t\"constructor\": false,\n\t\t\"Date\": false,\n\t\t\"decodeURI\": false,\n\t\t\"decodeURIComponent\": false,\n\t\t\"encodeURI\": false,\n\t\t\"encodeURIComponent\": false,\n\t\t\"Error\": false,\n\t\t\"escape\": false,\n\t\t\"eval\": false,\n\t\t\"EvalError\": false,\n\t\t\"Function\": false,\n\t\t\"hasOwnProperty\": false,\n\t\t\"Infinity\": false,\n\t\t\"isFinite\": false,\n\t\t\"isNaN\": false,\n\t\t\"isPrototypeOf\": false,\n\t\t\"JSON\": false,\n\t\t\"Math\": false,\n\t\t\"NaN\": false,\n\t\t\"Number\": false,\n\t\t\"Object\": false,\n\t\t\"parseFloat\": false,\n\t\t\"parseInt\": false,\n\t\t\"propertyIsEnumerable\": false,\n\t\t\"RangeError\": false,\n\t\t\"ReferenceError\": false,\n\t\t\"RegExp\": false,\n\t\t\"String\": false,\n\t\t\"SyntaxError\": false,\n\t\t\"toLocaleString\": false,\n\t\t\"toString\": false,\n\t\t\"TypeError\": false,\n\t\t\"undefined\": false,\n\t\t\"unescape\": false,\n\t\t\"URIError\": false,\n\t\t\"valueOf\": false\n\t},\n\t\"es2015\": {\n\t\t\"Array\": false,\n\t\t\"ArrayBuffer\": false,\n\t\t\"Boolean\": false,\n\t\t\"constructor\": false,\n\t\t\"DataView\": false,\n\t\t\"Date\": false,\n\t\t\"decodeURI\": false,\n\t\t\"decodeURIComponent\": false,\n\t\t\"encodeURI\": false,\n\t\t\"encodeURIComponent\": false,\n\t\t\"Error\": false,\n\t\t\"escape\": false,\n\t\t\"eval\": false,\n\t\t\"EvalError\": false,\n\t\t\"Float32Array\": false,\n\t\t\"Float64Array\": false,\n\t\t\"Function\": false,\n\t\t\"hasOwnProperty\": false,\n\t\t\"Infinity\": false,\n\t\t\"Int16Array\": false,\n\t\t\"Int32Array\": false,\n\t\t\"Int8Array\": false,\n\t\t\"isFinite\": false,\n\t\t\"isNaN\": false,\n\t\t\"isPrototypeOf\": false,\n\t\t\"JSON\": false,\n\t\t\"Map\": false,\n\t\t\"Math\": false,\n\t\t\"NaN\": false,\n\t\t\"Number\": false,\n\t\t\"Object\": false,\n\t\t\"parseFloat\": false,\n\t\t\"parseInt\": false,\n\t\t\"Promise\": false,\n\t\t\"propertyIsEnumerable\": false,\n\t\t\"Proxy\": false,\n\t\t\"RangeError\": false,\n\t\t\"ReferenceError\": false,\n\t\t\"Reflect\": false,\n\t\t\"RegExp\": false,\n\t\t\"Set\": false,\n\t\t\"String\": false,\n\t\t\"Symbol\": false,\n\t\t\"SyntaxError\": false,\n\t\t\"toLocaleString\": false,\n\t\t\"toString\": false,\n\t\t\"TypeError\": false,\n\t\t\"Uint16Array\": false,\n\t\t\"Uint32Array\": false,\n\t\t\"Uint8Array\": false,\n\t\t\"Uint8ClampedArray\": false,\n\t\t\"undefined\": false,\n\t\t\"unescape\": false,\n\t\t\"URIError\": false,\n\t\t\"valueOf\": false,\n\t\t\"WeakMap\": false,\n\t\t\"WeakSet\": false\n\t},\n\t\"es2017\": {\n\t\t\"Array\": false,\n\t\t\"ArrayBuffer\": false,\n\t\t\"Atomics\": false,\n\t\t\"Boolean\": false,\n\t\t\"constructor\": false,\n\t\t\"DataView\": false,\n\t\t\"Date\": false,\n\t\t\"decodeURI\": false,\n\t\t\"decodeURIComponent\": false,\n\t\t\"encodeURI\": false,\n\t\t\"encodeURIComponent\": false,\n\t\t\"Error\": false,\n\t\t\"escape\": false,\n\t\t\"eval\": false,\n\t\t\"EvalError\": false,\n\t\t\"Float32Array\": false,\n\t\t\"Float64Array\": false,\n\t\t\"Function\": false,\n\t\t\"hasOwnProperty\": false,\n\t\t\"Infinity\": false,\n\t\t\"Int16Array\": false,\n\t\t\"Int32Array\": false,\n\t\t\"Int8Array\": false,\n\t\t\"isFinite\": false,\n\t\t\"isNaN\": false,\n\t\t\"isPrototypeOf\": false,\n\t\t\"JSON\": false,\n\t\t\"Map\": false,\n\t\t\"Math\": false,\n\t\t\"NaN\": false,\n\t\t\"Number\": false,\n\t\t\"Object\": false,\n\t\t\"parseFloat\": false,\n\t\t\"parseInt\": false,\n\t\t\"Promise\": false,\n\t\t\"propertyIsEnumerable\": false,\n\t\t\"Proxy\": false,\n\t\t\"RangeError\": false,\n\t\t\"ReferenceError\": false,\n\t\t\"Reflect\": false,\n\t\t\"RegExp\": false,\n\t\t\"Set\": false,\n\t\t\"SharedArrayBuffer\": false,\n\t\t\"String\": false,\n\t\t\"Symbol\": false,\n\t\t\"SyntaxError\": false,\n\t\t\"toLocaleString\": false,\n\t\t\"toString\": false,\n\t\t\"TypeError\": false,\n\t\t\"Uint16Array\": false,\n\t\t\"Uint32Array\": false,\n\t\t\"Uint8Array\": false,\n\t\t\"Uint8ClampedArray\": false,\n\t\t\"undefined\": false,\n\t\t\"unescape\": false,\n\t\t\"URIError\": false,\n\t\t\"valueOf\": false,\n\t\t\"WeakMap\": false,\n\t\t\"WeakSet\": false\n\t},\n\t\"browser\": {\n\t\t\"AbortController\": false,\n\t\t\"AbortSignal\": false,\n\t\t\"addEventListener\": false,\n\t\t\"alert\": false,\n\t\t\"AnalyserNode\": false,\n\t\t\"Animation\": false,\n\t\t\"AnimationEffectReadOnly\": false,\n\t\t\"AnimationEffectTiming\": false,\n\t\t\"AnimationEffectTimingReadOnly\": false,\n\t\t\"AnimationEvent\": false,\n\t\t\"AnimationPlaybackEvent\": false,\n\t\t\"AnimationTimeline\": false,\n\t\t\"applicationCache\": false,\n\t\t\"ApplicationCache\": false,\n\t\t\"ApplicationCacheErrorEvent\": false,\n\t\t\"atob\": false,\n\t\t\"Attr\": false,\n\t\t\"Audio\": false,\n\t\t\"AudioBuffer\": false,\n\t\t\"AudioBufferSourceNode\": false,\n\t\t\"AudioContext\": false,\n\t\t\"AudioDestinationNode\": false,\n\t\t\"AudioListener\": false,\n\t\t\"AudioNode\": false,\n\t\t\"AudioParam\": false,\n\t\t\"AudioProcessingEvent\": false,\n\t\t\"AudioScheduledSourceNode\": false,\n\t\t\"AudioWorkletGlobalScope \": false,\n\t\t\"AudioWorkletNode\": false,\n\t\t\"AudioWorkletProcessor\": false,\n\t\t\"BarProp\": false,\n\t\t\"BaseAudioContext\": false,\n\t\t\"BatteryManager\": false,\n\t\t\"BeforeUnloadEvent\": false,\n\t\t\"BiquadFilterNode\": false,\n\t\t\"Blob\": false,\n\t\t\"BlobEvent\": false,\n\t\t\"blur\": false,\n\t\t\"BroadcastChannel\": false,\n\t\t\"btoa\": false,\n\t\t\"BudgetService\": false,\n\t\t\"ByteLengthQueuingStrategy\": false,\n\t\t\"Cache\": false,\n\t\t\"caches\": false,\n\t\t\"CacheStorage\": false,\n\t\t\"cancelAnimationFrame\": false,\n\t\t\"cancelIdleCallback\": false,\n\t\t\"CanvasCaptureMediaStreamTrack\": false,\n\t\t\"CanvasGradient\": false,\n\t\t\"CanvasPattern\": false,\n\t\t\"CanvasRenderingContext2D\": false,\n\t\t\"ChannelMergerNode\": false,\n\t\t\"ChannelSplitterNode\": false,\n\t\t\"CharacterData\": false,\n\t\t\"clearInterval\": false,\n\t\t\"clearTimeout\": false,\n\t\t\"clientInformation\": false,\n\t\t\"ClipboardEvent\": false,\n\t\t\"close\": false,\n\t\t\"closed\": false,\n\t\t\"CloseEvent\": false,\n\t\t\"Comment\": false,\n\t\t\"CompositionEvent\": false,\n\t\t\"confirm\": false,\n\t\t\"console\": false,\n\t\t\"ConstantSourceNode\": false,\n\t\t\"ConvolverNode\": false,\n\t\t\"CountQueuingStrategy\": false,\n\t\t\"createImageBitmap\": false,\n\t\t\"Credential\": false,\n\t\t\"CredentialsContainer\": false,\n\t\t\"crypto\": false,\n\t\t\"Crypto\": false,\n\t\t\"CryptoKey\": false,\n\t\t\"CSS\": false,\n\t\t\"CSSConditionRule\": false,\n\t\t\"CSSFontFaceRule\": false,\n\t\t\"CSSGroupingRule\": false,\n\t\t\"CSSImportRule\": false,\n\t\t\"CSSKeyframeRule\": false,\n\t\t\"CSSKeyframesRule\": false,\n\t\t\"CSSMediaRule\": false,\n\t\t\"CSSNamespaceRule\": false,\n\t\t\"CSSPageRule\": false,\n\t\t\"CSSRule\": false,\n\t\t\"CSSRuleList\": false,\n\t\t\"CSSStyleDeclaration\": false,\n\t\t\"CSSStyleRule\": false,\n\t\t\"CSSStyleSheet\": false,\n\t\t\"CSSSupportsRule\": false,\n\t\t\"CustomElementRegistry\": false,\n\t\t\"customElements\": false,\n\t\t\"CustomEvent\": false,\n\t\t\"DataTransfer\": false,\n\t\t\"DataTransferItem\": false,\n\t\t\"DataTransferItemList\": false,\n\t\t\"defaultstatus\": false,\n\t\t\"defaultStatus\": false,\n\t\t\"DelayNode\": false,\n\t\t\"DeviceMotionEvent\": false,\n\t\t\"DeviceOrientationEvent\": false,\n\t\t\"devicePixelRatio\": false,\n\t\t\"dispatchEvent\": false,\n\t\t\"document\": false,\n\t\t\"Document\": false,\n\t\t\"DocumentFragment\": false,\n\t\t\"DocumentType\": false,\n\t\t\"DOMError\": false,\n\t\t\"DOMException\": false,\n\t\t\"DOMImplementation\": false,\n\t\t\"DOMMatrix\": false,\n\t\t\"DOMMatrixReadOnly\": false,\n\t\t\"DOMParser\": false,\n\t\t\"DOMPoint\": false,\n\t\t\"DOMPointReadOnly\": false,\n\t\t\"DOMQuad\": false,\n\t\t\"DOMRect\": false,\n\t\t\"DOMRectReadOnly\": false,\n\t\t\"DOMStringList\": false,\n\t\t\"DOMStringMap\": false,\n\t\t\"DOMTokenList\": false,\n\t\t\"DragEvent\": false,\n\t\t\"DynamicsCompressorNode\": false,\n\t\t\"Element\": false,\n\t\t\"ErrorEvent\": false,\n\t\t\"event\": false,\n\t\t\"Event\": false,\n\t\t\"EventSource\": false,\n\t\t\"EventTarget\": false,\n\t\t\"external\": false,\n\t\t\"fetch\": false,\n\t\t\"File\": false,\n\t\t\"FileList\": false,\n\t\t\"FileReader\": false,\n\t\t\"find\": false,\n\t\t\"focus\": false,\n\t\t\"FocusEvent\": false,\n\t\t\"FontFace\": false,\n\t\t\"FontFaceSetLoadEvent\": false,\n\t\t\"FormData\": false,\n\t\t\"frameElement\": false,\n\t\t\"frames\": false,\n\t\t\"GainNode\": false,\n\t\t\"Gamepad\": false,\n\t\t\"GamepadButton\": false,\n\t\t\"GamepadEvent\": false,\n\t\t\"getComputedStyle\": false,\n\t\t\"getSelection\": false,\n\t\t\"HashChangeEvent\": false,\n\t\t\"Headers\": false,\n\t\t\"history\": false,\n\t\t\"History\": false,\n\t\t\"HTMLAllCollection\": false,\n\t\t\"HTMLAnchorElement\": false,\n\t\t\"HTMLAreaElement\": false,\n\t\t\"HTMLAudioElement\": false,\n\t\t\"HTMLBaseElement\": false,\n\t\t\"HTMLBodyElement\": false,\n\t\t\"HTMLBRElement\": false,\n\t\t\"HTMLButtonElement\": false,\n\t\t\"HTMLCanvasElement\": false,\n\t\t\"HTMLCollection\": false,\n\t\t\"HTMLContentElement\": false,\n\t\t\"HTMLDataElement\": false,\n\t\t\"HTMLDataListElement\": false,\n\t\t\"HTMLDetailsElement\": false,\n\t\t\"HTMLDialogElement\": false,\n\t\t\"HTMLDirectoryElement\": false,\n\t\t\"HTMLDivElement\": false,\n\t\t\"HTMLDListElement\": false,\n\t\t\"HTMLDocument\": false,\n\t\t\"HTMLElement\": false,\n\t\t\"HTMLEmbedElement\": false,\n\t\t\"HTMLFieldSetElement\": false,\n\t\t\"HTMLFontElement\": false,\n\t\t\"HTMLFormControlsCollection\": false,\n\t\t\"HTMLFormElement\": false,\n\t\t\"HTMLFrameElement\": false,\n\t\t\"HTMLFrameSetElement\": false,\n\t\t\"HTMLHeadElement\": false,\n\t\t\"HTMLHeadingElement\": false,\n\t\t\"HTMLHRElement\": false,\n\t\t\"HTMLHtmlElement\": false,\n\t\t\"HTMLIFrameElement\": false,\n\t\t\"HTMLImageElement\": false,\n\t\t\"HTMLInputElement\": false,\n\t\t\"HTMLLabelElement\": false,\n\t\t\"HTMLLegendElement\": false,\n\t\t\"HTMLLIElement\": false,\n\t\t\"HTMLLinkElement\": false,\n\t\t\"HTMLMapElement\": false,\n\t\t\"HTMLMarqueeElement\": false,\n\t\t\"HTMLMediaElement\": false,\n\t\t\"HTMLMenuElement\": false,\n\t\t\"HTMLMetaElement\": false,\n\t\t\"HTMLMeterElement\": false,\n\t\t\"HTMLModElement\": false,\n\t\t\"HTMLObjectElement\": false,\n\t\t\"HTMLOListElement\": false,\n\t\t\"HTMLOptGroupElement\": false,\n\t\t\"HTMLOptionElement\": false,\n\t\t\"HTMLOptionsCollection\": false,\n\t\t\"HTMLOutputElement\": false,\n\t\t\"HTMLParagraphElement\": false,\n\t\t\"HTMLParamElement\": false,\n\t\t\"HTMLPictureElement\": false,\n\t\t\"HTMLPreElement\": false,\n\t\t\"HTMLProgressElement\": false,\n\t\t\"HTMLQuoteElement\": false,\n\t\t\"HTMLScriptElement\": false,\n\t\t\"HTMLSelectElement\": false,\n\t\t\"HTMLShadowElement\": false,\n\t\t\"HTMLSlotElement\": false,\n\t\t\"HTMLSourceElement\": false,\n\t\t\"HTMLSpanElement\": false,\n\t\t\"HTMLStyleElement\": false,\n\t\t\"HTMLTableCaptionElement\": false,\n\t\t\"HTMLTableCellElement\": false,\n\t\t\"HTMLTableColElement\": false,\n\t\t\"HTMLTableElement\": false,\n\t\t\"HTMLTableRowElement\": false,\n\t\t\"HTMLTableSectionElement\": false,\n\t\t\"HTMLTemplateElement\": false,\n\t\t\"HTMLTextAreaElement\": false,\n\t\t\"HTMLTimeElement\": false,\n\t\t\"HTMLTitleElement\": false,\n\t\t\"HTMLTrackElement\": false,\n\t\t\"HTMLUListElement\": false,\n\t\t\"HTMLUnknownElement\": false,\n\t\t\"HTMLVideoElement\": false,\n\t\t\"IDBCursor\": false,\n\t\t\"IDBCursorWithValue\": false,\n\t\t\"IDBDatabase\": false,\n\t\t\"IDBFactory\": false,\n\t\t\"IDBIndex\": false,\n\t\t\"IDBKeyRange\": false,\n\t\t\"IDBObjectStore\": false,\n\t\t\"IDBOpenDBRequest\": false,\n\t\t\"IDBRequest\": false,\n\t\t\"IDBTransaction\": false,\n\t\t\"IDBVersionChangeEvent\": false,\n\t\t\"IdleDeadline\": false,\n\t\t\"IIRFilterNode\": false,\n\t\t\"Image\": false,\n\t\t\"ImageBitmap\": false,\n\t\t\"ImageBitmapRenderingContext\": false,\n\t\t\"ImageCapture\": false,\n\t\t\"ImageData\": false,\n\t\t\"indexedDB\": false,\n\t\t\"innerHeight\": false,\n\t\t\"innerWidth\": false,\n\t\t\"InputEvent\": false,\n\t\t\"IntersectionObserver\": false,\n\t\t\"IntersectionObserverEntry\": false,\n\t\t\"Intl\": false,\n\t\t\"isSecureContext\": false,\n\t\t\"KeyboardEvent\": false,\n\t\t\"KeyframeEffect\": false,\n\t\t\"KeyframeEffectReadOnly\": false,\n\t\t\"length\": false,\n\t\t\"localStorage\": false,\n\t\t\"location\": true,\n\t\t\"Location\": false,\n\t\t\"locationbar\": false,\n\t\t\"matchMedia\": false,\n\t\t\"MediaDeviceInfo\": false,\n\t\t\"MediaDevices\": false,\n\t\t\"MediaElementAudioSourceNode\": false,\n\t\t\"MediaEncryptedEvent\": false,\n\t\t\"MediaError\": false,\n\t\t\"MediaKeyMessageEvent\": false,\n\t\t\"MediaKeySession\": false,\n\t\t\"MediaKeyStatusMap\": false,\n\t\t\"MediaKeySystemAccess\": false,\n\t\t\"MediaList\": false,\n\t\t\"MediaQueryList\": false,\n\t\t\"MediaQueryListEvent\": false,\n\t\t\"MediaRecorder\": false,\n\t\t\"MediaSettingsRange\": false,\n\t\t\"MediaSource\": false,\n\t\t\"MediaStream\": false,\n\t\t\"MediaStreamAudioDestinationNode\": false,\n\t\t\"MediaStreamAudioSourceNode\": false,\n\t\t\"MediaStreamEvent\": false,\n\t\t\"MediaStreamTrack\": false,\n\t\t\"MediaStreamTrackEvent\": false,\n\t\t\"menubar\": false,\n\t\t\"MessageChannel\": false,\n\t\t\"MessageEvent\": false,\n\t\t\"MessagePort\": false,\n\t\t\"MIDIAccess\": false,\n\t\t\"MIDIConnectionEvent\": false,\n\t\t\"MIDIInput\": false,\n\t\t\"MIDIInputMap\": false,\n\t\t\"MIDIMessageEvent\": false,\n\t\t\"MIDIOutput\": false,\n\t\t\"MIDIOutputMap\": false,\n\t\t\"MIDIPort\": false,\n\t\t\"MimeType\": false,\n\t\t\"MimeTypeArray\": false,\n\t\t\"MouseEvent\": false,\n\t\t\"moveBy\": false,\n\t\t\"moveTo\": false,\n\t\t\"MutationEvent\": false,\n\t\t\"MutationObserver\": false,\n\t\t\"MutationRecord\": false,\n\t\t\"name\": false,\n\t\t\"NamedNodeMap\": false,\n\t\t\"NavigationPreloadManager\": false,\n\t\t\"navigator\": false,\n\t\t\"Navigator\": false,\n\t\t\"NetworkInformation\": false,\n\t\t\"Node\": false,\n\t\t\"NodeFilter\": false,\n\t\t\"NodeIterator\": false,\n\t\t\"NodeList\": false,\n\t\t\"Notification\": false,\n\t\t\"OfflineAudioCompletionEvent\": false,\n\t\t\"OfflineAudioContext\": false,\n\t\t\"offscreenBuffering\": false,\n\t\t\"OffscreenCanvas\": true,\n\t\t\"onabort\": true,\n\t\t\"onafterprint\": true,\n\t\t\"onanimationend\": true,\n\t\t\"onanimationiteration\": true,\n\t\t\"onanimationstart\": true,\n\t\t\"onappinstalled\": true,\n\t\t\"onauxclick\": true,\n\t\t\"onbeforeinstallprompt\": true,\n\t\t\"onbeforeprint\": true,\n\t\t\"onbeforeunload\": true,\n\t\t\"onblur\": true,\n\t\t\"oncancel\": true,\n\t\t\"oncanplay\": true,\n\t\t\"oncanplaythrough\": true,\n\t\t\"onchange\": true,\n\t\t\"onclick\": true,\n\t\t\"onclose\": true,\n\t\t\"oncontextmenu\": true,\n\t\t\"oncuechange\": true,\n\t\t\"ondblclick\": true,\n\t\t\"ondevicemotion\": true,\n\t\t\"ondeviceorientation\": true,\n\t\t\"ondeviceorientationabsolute\": true,\n\t\t\"ondrag\": true,\n\t\t\"ondragend\": true,\n\t\t\"ondragenter\": true,\n\t\t\"ondragleave\": true,\n\t\t\"ondragover\": true,\n\t\t\"ondragstart\": true,\n\t\t\"ondrop\": true,\n\t\t\"ondurationchange\": true,\n\t\t\"onemptied\": true,\n\t\t\"onended\": true,\n\t\t\"onerror\": true,\n\t\t\"onfocus\": true,\n\t\t\"ongotpointercapture\": true,\n\t\t\"onhashchange\": true,\n\t\t\"oninput\": true,\n\t\t\"oninvalid\": true,\n\t\t\"onkeydown\": true,\n\t\t\"onkeypress\": true,\n\t\t\"onkeyup\": true,\n\t\t\"onlanguagechange\": true,\n\t\t\"onload\": true,\n\t\t\"onloadeddata\": true,\n\t\t\"onloadedmetadata\": true,\n\t\t\"onloadstart\": true,\n\t\t\"onlostpointercapture\": true,\n\t\t\"onmessage\": true,\n\t\t\"onmessageerror\": true,\n\t\t\"onmousedown\": true,\n\t\t\"onmouseenter\": true,\n\t\t\"onmouseleave\": true,\n\t\t\"onmousemove\": true,\n\t\t\"onmouseout\": true,\n\t\t\"onmouseover\": true,\n\t\t\"onmouseup\": true,\n\t\t\"onmousewheel\": true,\n\t\t\"onoffline\": true,\n\t\t\"ononline\": true,\n\t\t\"onpagehide\": true,\n\t\t\"onpageshow\": true,\n\t\t\"onpause\": true,\n\t\t\"onplay\": true,\n\t\t\"onplaying\": true,\n\t\t\"onpointercancel\": true,\n\t\t\"onpointerdown\": true,\n\t\t\"onpointerenter\": true,\n\t\t\"onpointerleave\": true,\n\t\t\"onpointermove\": true,\n\t\t\"onpointerout\": true,\n\t\t\"onpointerover\": true,\n\t\t\"onpointerup\": true,\n\t\t\"onpopstate\": true,\n\t\t\"onprogress\": true,\n\t\t\"onratechange\": true,\n\t\t\"onrejectionhandled\": true,\n\t\t\"onreset\": true,\n\t\t\"onresize\": true,\n\t\t\"onscroll\": true,\n\t\t\"onsearch\": true,\n\t\t\"onseeked\": true,\n\t\t\"onseeking\": true,\n\t\t\"onselect\": true,\n\t\t\"onstalled\": true,\n\t\t\"onstorage\": true,\n\t\t\"onsubmit\": true,\n\t\t\"onsuspend\": true,\n\t\t\"ontimeupdate\": true,\n\t\t\"ontoggle\": true,\n\t\t\"ontransitionend\": true,\n\t\t\"onunhandledrejection\": true,\n\t\t\"onunload\": true,\n\t\t\"onvolumechange\": true,\n\t\t\"onwaiting\": true,\n\t\t\"onwheel\": true,\n\t\t\"open\": false,\n\t\t\"openDatabase\": false,\n\t\t\"opener\": false,\n\t\t\"Option\": false,\n\t\t\"origin\": false,\n\t\t\"OscillatorNode\": false,\n\t\t\"outerHeight\": false,\n\t\t\"outerWidth\": false,\n\t\t\"PageTransitionEvent\": false,\n\t\t\"pageXOffset\": false,\n\t\t\"pageYOffset\": false,\n\t\t\"PannerNode\": false,\n\t\t\"parent\": false,\n\t\t\"Path2D\": false,\n\t\t\"PaymentAddress\": false,\n\t\t\"PaymentRequest\": false,\n\t\t\"PaymentRequestUpdateEvent\": false,\n\t\t\"PaymentResponse\": false,\n\t\t\"performance\": false,\n\t\t\"Performance\": false,\n\t\t\"PerformanceEntry\": false,\n\t\t\"PerformanceLongTaskTiming\": false,\n\t\t\"PerformanceMark\": false,\n\t\t\"PerformanceMeasure\": false,\n\t\t\"PerformanceNavigation\": false,\n\t\t\"PerformanceNavigationTiming\": false,\n\t\t\"PerformanceObserver\": false,\n\t\t\"PerformanceObserverEntryList\": false,\n\t\t\"PerformancePaintTiming\": false,\n\t\t\"PerformanceResourceTiming\": false,\n\t\t\"PerformanceTiming\": false,\n\t\t\"PeriodicWave\": false,\n\t\t\"Permissions\": false,\n\t\t\"PermissionStatus\": false,\n\t\t\"personalbar\": false,\n\t\t\"PhotoCapabilities\": false,\n\t\t\"Plugin\": false,\n\t\t\"PluginArray\": false,\n\t\t\"PointerEvent\": false,\n\t\t\"PopStateEvent\": false,\n\t\t\"postMessage\": false,\n\t\t\"Presentation\": false,\n\t\t\"PresentationAvailability\": false,\n\t\t\"PresentationConnection\": false,\n\t\t\"PresentationConnectionAvailableEvent\": false,\n\t\t\"PresentationConnectionCloseEvent\": false,\n\t\t\"PresentationConnectionList\": false,\n\t\t\"PresentationReceiver\": false,\n\t\t\"PresentationRequest\": false,\n\t\t\"print\": false,\n\t\t\"ProcessingInstruction\": false,\n\t\t\"ProgressEvent\": false,\n\t\t\"PromiseRejectionEvent\": false,\n\t\t\"prompt\": false,\n\t\t\"PushManager\": false,\n\t\t\"PushSubscription\": false,\n\t\t\"PushSubscriptionOptions\": false,\n\t\t\"queueMicrotask\": false,\n\t\t\"RadioNodeList\": false,\n\t\t\"Range\": false,\n\t\t\"ReadableStream\": false,\n\t\t\"registerProcessor\": false,\n\t\t\"RemotePlayback\": false,\n\t\t\"removeEventListener\": false,\n\t\t\"Request\": false,\n\t\t\"requestAnimationFrame\": false,\n\t\t\"requestIdleCallback\": false,\n\t\t\"resizeBy\": false,\n\t\t\"ResizeObserver\": false,\n\t\t\"ResizeObserverEntry\": false,\n\t\t\"resizeTo\": false,\n\t\t\"Response\": false,\n\t\t\"RTCCertificate\": false,\n\t\t\"RTCDataChannel\": false,\n\t\t\"RTCDataChannelEvent\": false,\n\t\t\"RTCDtlsTransport\": false,\n\t\t\"RTCIceCandidate\": false,\n\t\t\"RTCIceGatherer\": false,\n\t\t\"RTCIceTransport\": false,\n\t\t\"RTCPeerConnection\": false,\n\t\t\"RTCPeerConnectionIceEvent\": false,\n\t\t\"RTCRtpContributingSource\": false,\n\t\t\"RTCRtpReceiver\": false,\n\t\t\"RTCRtpSender\": false,\n\t\t\"RTCSctpTransport\": false,\n\t\t\"RTCSessionDescription\": false,\n\t\t\"RTCStatsReport\": false,\n\t\t\"RTCTrackEvent\": false,\n\t\t\"screen\": false,\n\t\t\"Screen\": false,\n\t\t\"screenLeft\": false,\n\t\t\"ScreenOrientation\": false,\n\t\t\"screenTop\": false,\n\t\t\"screenX\": false,\n\t\t\"screenY\": false,\n\t\t\"ScriptProcessorNode\": false,\n\t\t\"scroll\": false,\n\t\t\"scrollbars\": false,\n\t\t\"scrollBy\": false,\n\t\t\"scrollTo\": false,\n\t\t\"scrollX\": false,\n\t\t\"scrollY\": false,\n\t\t\"SecurityPolicyViolationEvent\": false,\n\t\t\"Selection\": false,\n\t\t\"self\": false,\n\t\t\"ServiceWorker\": false,\n\t\t\"ServiceWorkerContainer\": false,\n\t\t\"ServiceWorkerRegistration\": false,\n\t\t\"sessionStorage\": false,\n\t\t\"setInterval\": false,\n\t\t\"setTimeout\": false,\n\t\t\"ShadowRoot\": false,\n\t\t\"SharedWorker\": false,\n\t\t\"SourceBuffer\": false,\n\t\t\"SourceBufferList\": false,\n\t\t\"speechSynthesis\": false,\n\t\t\"SpeechSynthesisEvent\": false,\n\t\t\"SpeechSynthesisUtterance\": false,\n\t\t\"StaticRange\": false,\n\t\t\"status\": false,\n\t\t\"statusbar\": false,\n\t\t\"StereoPannerNode\": false,\n\t\t\"stop\": false,\n\t\t\"Storage\": false,\n\t\t\"StorageEvent\": false,\n\t\t\"StorageManager\": false,\n\t\t\"styleMedia\": false,\n\t\t\"StyleSheet\": false,\n\t\t\"StyleSheetList\": false,\n\t\t\"SubtleCrypto\": false,\n\t\t\"SVGAElement\": false,\n\t\t\"SVGAngle\": false,\n\t\t\"SVGAnimatedAngle\": false,\n\t\t\"SVGAnimatedBoolean\": false,\n\t\t\"SVGAnimatedEnumeration\": false,\n\t\t\"SVGAnimatedInteger\": false,\n\t\t\"SVGAnimatedLength\": false,\n\t\t\"SVGAnimatedLengthList\": false,\n\t\t\"SVGAnimatedNumber\": false,\n\t\t\"SVGAnimatedNumberList\": false,\n\t\t\"SVGAnimatedPreserveAspectRatio\": false,\n\t\t\"SVGAnimatedRect\": false,\n\t\t\"SVGAnimatedString\": false,\n\t\t\"SVGAnimatedTransformList\": false,\n\t\t\"SVGAnimateElement\": false,\n\t\t\"SVGAnimateMotionElement\": false,\n\t\t\"SVGAnimateTransformElement\": false,\n\t\t\"SVGAnimationElement\": false,\n\t\t\"SVGCircleElement\": false,\n\t\t\"SVGClipPathElement\": false,\n\t\t\"SVGComponentTransferFunctionElement\": false,\n\t\t\"SVGDefsElement\": false,\n\t\t\"SVGDescElement\": false,\n\t\t\"SVGDiscardElement\": false,\n\t\t\"SVGElement\": false,\n\t\t\"SVGEllipseElement\": false,\n\t\t\"SVGFEBlendElement\": false,\n\t\t\"SVGFEColorMatrixElement\": false,\n\t\t\"SVGFEComponentTransferElement\": false,\n\t\t\"SVGFECompositeElement\": false,\n\t\t\"SVGFEConvolveMatrixElement\": false,\n\t\t\"SVGFEDiffuseLightingElement\": false,\n\t\t\"SVGFEDisplacementMapElement\": false,\n\t\t\"SVGFEDistantLightElement\": false,\n\t\t\"SVGFEDropShadowElement\": false,\n\t\t\"SVGFEFloodElement\": false,\n\t\t\"SVGFEFuncAElement\": false,\n\t\t\"SVGFEFuncBElement\": false,\n\t\t\"SVGFEFuncGElement\": false,\n\t\t\"SVGFEFuncRElement\": false,\n\t\t\"SVGFEGaussianBlurElement\": false,\n\t\t\"SVGFEImageElement\": false,\n\t\t\"SVGFEMergeElement\": false,\n\t\t\"SVGFEMergeNodeElement\": false,\n\t\t\"SVGFEMorphologyElement\": false,\n\t\t\"SVGFEOffsetElement\": false,\n\t\t\"SVGFEPointLightElement\": false,\n\t\t\"SVGFESpecularLightingElement\": false,\n\t\t\"SVGFESpotLightElement\": false,\n\t\t\"SVGFETileElement\": false,\n\t\t\"SVGFETurbulenceElement\": false,\n\t\t\"SVGFilterElement\": false,\n\t\t\"SVGForeignObjectElement\": false,\n\t\t\"SVGGElement\": false,\n\t\t\"SVGGeometryElement\": false,\n\t\t\"SVGGradientElement\": false,\n\t\t\"SVGGraphicsElement\": false,\n\t\t\"SVGImageElement\": false,\n\t\t\"SVGLength\": false,\n\t\t\"SVGLengthList\": false,\n\t\t\"SVGLinearGradientElement\": false,\n\t\t\"SVGLineElement\": false,\n\t\t\"SVGMarkerElement\": false,\n\t\t\"SVGMaskElement\": false,\n\t\t\"SVGMatrix\": false,\n\t\t\"SVGMetadataElement\": false,\n\t\t\"SVGMPathElement\": false,\n\t\t\"SVGNumber\": false,\n\t\t\"SVGNumberList\": false,\n\t\t\"SVGPathElement\": false,\n\t\t\"SVGPatternElement\": false,\n\t\t\"SVGPoint\": false,\n\t\t\"SVGPointList\": false,\n\t\t\"SVGPolygonElement\": false,\n\t\t\"SVGPolylineElement\": false,\n\t\t\"SVGPreserveAspectRatio\": false,\n\t\t\"SVGRadialGradientElement\": false,\n\t\t\"SVGRect\": false,\n\t\t\"SVGRectElement\": false,\n\t\t\"SVGScriptElement\": false,\n\t\t\"SVGSetElement\": false,\n\t\t\"SVGStopElement\": false,\n\t\t\"SVGStringList\": false,\n\t\t\"SVGStyleElement\": false,\n\t\t\"SVGSVGElement\": false,\n\t\t\"SVGSwitchElement\": false,\n\t\t\"SVGSymbolElement\": false,\n\t\t\"SVGTextContentElement\": false,\n\t\t\"SVGTextElement\": false,\n\t\t\"SVGTextPathElement\": false,\n\t\t\"SVGTextPositioningElement\": false,\n\t\t\"SVGTitleElement\": false,\n\t\t\"SVGTransform\": false,\n\t\t\"SVGTransformList\": false,\n\t\t\"SVGTSpanElement\": false,\n\t\t\"SVGUnitTypes\": false,\n\t\t\"SVGUseElement\": false,\n\t\t\"SVGViewElement\": false,\n\t\t\"TaskAttributionTiming\": false,\n\t\t\"Text\": false,\n\t\t\"TextDecoder\": false,\n\t\t\"TextEncoder\": false,\n\t\t\"TextEvent\": false,\n\t\t\"TextMetrics\": false,\n\t\t\"TextTrack\": false,\n\t\t\"TextTrackCue\": false,\n\t\t\"TextTrackCueList\": false,\n\t\t\"TextTrackList\": false,\n\t\t\"TimeRanges\": false,\n\t\t\"toolbar\": false,\n\t\t\"top\": false,\n\t\t\"Touch\": false,\n\t\t\"TouchEvent\": false,\n\t\t\"TouchList\": false,\n\t\t\"TrackEvent\": false,\n\t\t\"TransitionEvent\": false,\n\t\t\"TreeWalker\": false,\n\t\t\"UIEvent\": false,\n\t\t\"URL\": false,\n\t\t\"URLSearchParams\": false,\n\t\t\"ValidityState\": false,\n\t\t\"visualViewport\": false,\n\t\t\"VisualViewport\": false,\n\t\t\"VTTCue\": false,\n\t\t\"WaveShaperNode\": false,\n\t\t\"WebAssembly\": false,\n\t\t\"WebGL2RenderingContext\": false,\n\t\t\"WebGLActiveInfo\": false,\n\t\t\"WebGLBuffer\": false,\n\t\t\"WebGLContextEvent\": false,\n\t\t\"WebGLFramebuffer\": false,\n\t\t\"WebGLProgram\": false,\n\t\t\"WebGLQuery\": false,\n\t\t\"WebGLRenderbuffer\": false,\n\t\t\"WebGLRenderingContext\": false,\n\t\t\"WebGLSampler\": false,\n\t\t\"WebGLShader\": false,\n\t\t\"WebGLShaderPrecisionFormat\": false,\n\t\t\"WebGLSync\": false,\n\t\t\"WebGLTexture\": false,\n\t\t\"WebGLTransformFeedback\": false,\n\t\t\"WebGLUniformLocation\": false,\n\t\t\"WebGLVertexArrayObject\": false,\n\t\t\"WebSocket\": false,\n\t\t\"WheelEvent\": false,\n\t\t\"window\": false,\n\t\t\"Window\": false,\n\t\t\"Worker\": false,\n\t\t\"WritableStream\": false,\n\t\t\"XMLDocument\": false,\n\t\t\"XMLHttpRequest\": false,\n\t\t\"XMLHttpRequestEventTarget\": false,\n\t\t\"XMLHttpRequestUpload\": false,\n\t\t\"XMLSerializer\": false,\n\t\t\"XPathEvaluator\": false,\n\t\t\"XPathExpression\": false,\n\t\t\"XPathResult\": false,\n\t\t\"XSLTProcessor\": false\n\t},\n\t\"worker\": {\n\t\t\"addEventListener\": false,\n\t\t\"applicationCache\": false,\n\t\t\"atob\": false,\n\t\t\"Blob\": false,\n\t\t\"BroadcastChannel\": false,\n\t\t\"btoa\": false,\n\t\t\"Cache\": false,\n\t\t\"caches\": false,\n\t\t\"clearInterval\": false,\n\t\t\"clearTimeout\": false,\n\t\t\"close\": true,\n\t\t\"console\": false,\n\t\t\"fetch\": false,\n\t\t\"FileReaderSync\": false,\n\t\t\"FormData\": false,\n\t\t\"Headers\": false,\n\t\t\"IDBCursor\": false,\n\t\t\"IDBCursorWithValue\": false,\n\t\t\"IDBDatabase\": false,\n\t\t\"IDBFactory\": false,\n\t\t\"IDBIndex\": false,\n\t\t\"IDBKeyRange\": false,\n\t\t\"IDBObjectStore\": false,\n\t\t\"IDBOpenDBRequest\": false,\n\t\t\"IDBRequest\": false,\n\t\t\"IDBTransaction\": false,\n\t\t\"IDBVersionChangeEvent\": false,\n\t\t\"ImageData\": false,\n\t\t\"importScripts\": true,\n\t\t\"indexedDB\": false,\n\t\t\"location\": false,\n\t\t\"MessageChannel\": false,\n\t\t\"MessagePort\": false,\n\t\t\"name\": false,\n\t\t\"navigator\": false,\n\t\t\"Notification\": false,\n\t\t\"onclose\": true,\n\t\t\"onconnect\": true,\n\t\t\"onerror\": true,\n\t\t\"onlanguagechange\": true,\n\t\t\"onmessage\": true,\n\t\t\"onoffline\": true,\n\t\t\"ononline\": true,\n\t\t\"onrejectionhandled\": true,\n\t\t\"onunhandledrejection\": true,\n\t\t\"performance\": false,\n\t\t\"Performance\": false,\n\t\t\"PerformanceEntry\": false,\n\t\t\"PerformanceMark\": false,\n\t\t\"PerformanceMeasure\": false,\n\t\t\"PerformanceNavigation\": false,\n\t\t\"PerformanceResourceTiming\": false,\n\t\t\"PerformanceTiming\": false,\n\t\t\"postMessage\": true,\n\t\t\"Promise\": false,\n\t\t\"queueMicrotask\": false,\n\t\t\"removeEventListener\": false,\n\t\t\"Request\": false,\n\t\t\"Response\": false,\n\t\t\"self\": true,\n\t\t\"ServiceWorkerRegistration\": false,\n\t\t\"setInterval\": false,\n\t\t\"setTimeout\": false,\n\t\t\"TextDecoder\": false,\n\t\t\"TextEncoder\": false,\n\t\t\"URL\": false,\n\t\t\"URLSearchParams\": false,\n\t\t\"WebSocket\": false,\n\t\t\"Worker\": false,\n\t\t\"WorkerGlobalScope\": false,\n\t\t\"XMLHttpRequest\": false\n\t},\n\t\"node\": {\n\t\t\"__dirname\": false,\n\t\t\"__filename\": false,\n\t\t\"Buffer\": false,\n\t\t\"clearImmediate\": false,\n\t\t\"clearInterval\": false,\n\t\t\"clearTimeout\": false,\n\t\t\"console\": false,\n\t\t\"exports\": true,\n\t\t\"global\": false,\n\t\t\"Intl\": false,\n\t\t\"module\": false,\n\t\t\"process\": false,\n\t\t\"queueMicrotask\": false,\n\t\t\"require\": false,\n\t\t\"setImmediate\": false,\n\t\t\"setInterval\": false,\n\t\t\"setTimeout\": false,\n\t\t\"TextDecoder\": false,\n\t\t\"TextEncoder\": false,\n\t\t\"URL\": false,\n\t\t\"URLSearchParams\": false\n\t},\n\t\"commonjs\": {\n\t\t\"exports\": true,\n\t\t\"global\": false,\n\t\t\"module\": false,\n\t\t\"require\": false\n\t},\n\t\"amd\": {\n\t\t\"define\": false,\n\t\t\"require\": false\n\t},\n\t\"mocha\": {\n\t\t\"after\": false,\n\t\t\"afterEach\": false,\n\t\t\"before\": false,\n\t\t\"beforeEach\": false,\n\t\t\"context\": false,\n\t\t\"describe\": false,\n\t\t\"it\": false,\n\t\t\"mocha\": false,\n\t\t\"run\": false,\n\t\t\"setup\": false,\n\t\t\"specify\": false,\n\t\t\"suite\": false,\n\t\t\"suiteSetup\": false,\n\t\t\"suiteTeardown\": false,\n\t\t\"teardown\": false,\n\t\t\"test\": false,\n\t\t\"xcontext\": false,\n\t\t\"xdescribe\": false,\n\t\t\"xit\": false,\n\t\t\"xspecify\": false\n\t},\n\t\"jasmine\": {\n\t\t\"afterAll\": false,\n\t\t\"afterEach\": false,\n\t\t\"beforeAll\": false,\n\t\t\"beforeEach\": false,\n\t\t\"describe\": false,\n\t\t\"expect\": false,\n\t\t\"fail\": false,\n\t\t\"fdescribe\": false,\n\t\t\"fit\": false,\n\t\t\"it\": false,\n\t\t\"jasmine\": false,\n\t\t\"pending\": false,\n\t\t\"runs\": false,\n\t\t\"spyOn\": false,\n\t\t\"spyOnProperty\": false,\n\t\t\"waits\": false,\n\t\t\"waitsFor\": false,\n\t\t\"xdescribe\": false,\n\t\t\"xit\": false\n\t},\n\t\"jest\": {\n\t\t\"afterAll\": false,\n\t\t\"afterEach\": false,\n\t\t\"beforeAll\": false,\n\t\t\"beforeEach\": false,\n\t\t\"describe\": false,\n\t\t\"expect\": false,\n\t\t\"fdescribe\": false,\n\t\t\"fit\": false,\n\t\t\"it\": false,\n\t\t\"jest\": false,\n\t\t\"pit\": false,\n\t\t\"require\": false,\n\t\t\"test\": false,\n\t\t\"xdescribe\": false,\n\t\t\"xit\": false,\n\t\t\"xtest\": false\n\t},\n\t\"qunit\": {\n\t\t\"asyncTest\": false,\n\t\t\"deepEqual\": false,\n\t\t\"equal\": false,\n\t\t\"expect\": false,\n\t\t\"module\": false,\n\t\t\"notDeepEqual\": false,\n\t\t\"notEqual\": false,\n\t\t\"notOk\": false,\n\t\t\"notPropEqual\": false,\n\t\t\"notStrictEqual\": false,\n\t\t\"ok\": false,\n\t\t\"propEqual\": false,\n\t\t\"QUnit\": false,\n\t\t\"raises\": false,\n\t\t\"start\": false,\n\t\t\"stop\": false,\n\t\t\"strictEqual\": false,\n\t\t\"test\": false,\n\t\t\"throws\": false\n\t},\n\t\"phantomjs\": {\n\t\t\"console\": true,\n\t\t\"exports\": true,\n\t\t\"phantom\": true,\n\t\t\"require\": true,\n\t\t\"WebPage\": true\n\t},\n\t\"couch\": {\n\t\t\"emit\": false,\n\t\t\"exports\": false,\n\t\t\"getRow\": false,\n\t\t\"log\": false,\n\t\t\"module\": false,\n\t\t\"provides\": false,\n\t\t\"require\": false,\n\t\t\"respond\": false,\n\t\t\"send\": false,\n\t\t\"start\": false,\n\t\t\"sum\": false\n\t},\n\t\"rhino\": {\n\t\t\"defineClass\": false,\n\t\t\"deserialize\": false,\n\t\t\"gc\": false,\n\t\t\"help\": false,\n\t\t\"importClass\": false,\n\t\t\"importPackage\": false,\n\t\t\"java\": false,\n\t\t\"load\": false,\n\t\t\"loadClass\": false,\n\t\t\"Packages\": false,\n\t\t\"print\": false,\n\t\t\"quit\": false,\n\t\t\"readFile\": false,\n\t\t\"readUrl\": false,\n\t\t\"runCommand\": false,\n\t\t\"seal\": false,\n\t\t\"serialize\": false,\n\t\t\"spawn\": false,\n\t\t\"sync\": false,\n\t\t\"toint32\": false,\n\t\t\"version\": false\n\t},\n\t\"nashorn\": {\n\t\t\"__DIR__\": false,\n\t\t\"__FILE__\": false,\n\t\t\"__LINE__\": false,\n\t\t\"com\": false,\n\t\t\"edu\": false,\n\t\t\"exit\": false,\n\t\t\"java\": false,\n\t\t\"Java\": false,\n\t\t\"javafx\": false,\n\t\t\"JavaImporter\": false,\n\t\t\"javax\": false,\n\t\t\"JSAdapter\": false,\n\t\t\"load\": false,\n\t\t\"loadWithNewGlobal\": false,\n\t\t\"org\": false,\n\t\t\"Packages\": false,\n\t\t\"print\": false,\n\t\t\"quit\": false\n\t},\n\t\"wsh\": {\n\t\t\"ActiveXObject\": true,\n\t\t\"Enumerator\": true,\n\t\t\"GetObject\": true,\n\t\t\"ScriptEngine\": true,\n\t\t\"ScriptEngineBuildVersion\": true,\n\t\t\"ScriptEngineMajorVersion\": true,\n\t\t\"ScriptEngineMinorVersion\": true,\n\t\t\"VBArray\": true,\n\t\t\"WScript\": true,\n\t\t\"WSH\": true,\n\t\t\"XDomainRequest\": true\n\t},\n\t\"jquery\": {\n\t\t\"$\": false,\n\t\t\"jQuery\": false\n\t},\n\t\"yui\": {\n\t\t\"YAHOO\": false,\n\t\t\"YAHOO_config\": false,\n\t\t\"YUI\": false,\n\t\t\"YUI_config\": false\n\t},\n\t\"shelljs\": {\n\t\t\"cat\": false,\n\t\t\"cd\": false,\n\t\t\"chmod\": false,\n\t\t\"config\": false,\n\t\t\"cp\": false,\n\t\t\"dirs\": false,\n\t\t\"echo\": false,\n\t\t\"env\": false,\n\t\t\"error\": false,\n\t\t\"exec\": false,\n\t\t\"exit\": false,\n\t\t\"find\": false,\n\t\t\"grep\": false,\n\t\t\"ln\": false,\n\t\t\"ls\": false,\n\t\t\"mkdir\": false,\n\t\t\"mv\": false,\n\t\t\"popd\": false,\n\t\t\"pushd\": false,\n\t\t\"pwd\": false,\n\t\t\"rm\": false,\n\t\t\"sed\": false,\n\t\t\"set\": false,\n\t\t\"target\": false,\n\t\t\"tempdir\": false,\n\t\t\"test\": false,\n\t\t\"touch\": false,\n\t\t\"which\": false\n\t},\n\t\"prototypejs\": {\n\t\t\"$\": false,\n\t\t\"$$\": false,\n\t\t\"$A\": false,\n\t\t\"$break\": false,\n\t\t\"$continue\": false,\n\t\t\"$F\": false,\n\t\t\"$H\": false,\n\t\t\"$R\": false,\n\t\t\"$w\": false,\n\t\t\"Abstract\": false,\n\t\t\"Ajax\": false,\n\t\t\"Autocompleter\": false,\n\t\t\"Builder\": false,\n\t\t\"Class\": false,\n\t\t\"Control\": false,\n\t\t\"Draggable\": false,\n\t\t\"Draggables\": false,\n\t\t\"Droppables\": false,\n\t\t\"Effect\": false,\n\t\t\"Element\": false,\n\t\t\"Enumerable\": false,\n\t\t\"Event\": false,\n\t\t\"Field\": false,\n\t\t\"Form\": false,\n\t\t\"Hash\": false,\n\t\t\"Insertion\": false,\n\t\t\"ObjectRange\": false,\n\t\t\"PeriodicalExecuter\": false,\n\t\t\"Position\": false,\n\t\t\"Prototype\": false,\n\t\t\"Scriptaculous\": false,\n\t\t\"Selector\": false,\n\t\t\"Sortable\": false,\n\t\t\"SortableObserver\": false,\n\t\t\"Sound\": false,\n\t\t\"Template\": false,\n\t\t\"Toggle\": false,\n\t\t\"Try\": false\n\t},\n\t\"meteor\": {\n\t\t\"_\": false,\n\t\t\"$\": false,\n\t\t\"Accounts\": false,\n\t\t\"AccountsClient\": false,\n\t\t\"AccountsCommon\": false,\n\t\t\"AccountsServer\": false,\n\t\t\"App\": false,\n\t\t\"Assets\": false,\n\t\t\"Blaze\": false,\n\t\t\"check\": false,\n\t\t\"Cordova\": false,\n\t\t\"DDP\": false,\n\t\t\"DDPRateLimiter\": false,\n\t\t\"DDPServer\": false,\n\t\t\"Deps\": false,\n\t\t\"EJSON\": false,\n\t\t\"Email\": false,\n\t\t\"HTTP\": false,\n\t\t\"Log\": false,\n\t\t\"Match\": false,\n\t\t\"Meteor\": false,\n\t\t\"Mongo\": false,\n\t\t\"MongoInternals\": false,\n\t\t\"Npm\": false,\n\t\t\"Package\": false,\n\t\t\"Plugin\": false,\n\t\t\"process\": false,\n\t\t\"Random\": false,\n\t\t\"ReactiveDict\": false,\n\t\t\"ReactiveVar\": false,\n\t\t\"Router\": false,\n\t\t\"ServiceConfiguration\": false,\n\t\t\"Session\": false,\n\t\t\"share\": false,\n\t\t\"Spacebars\": false,\n\t\t\"Template\": false,\n\t\t\"Tinytest\": false,\n\t\t\"Tracker\": false,\n\t\t\"UI\": false,\n\t\t\"Utils\": false,\n\t\t\"WebApp\": false,\n\t\t\"WebAppInternals\": false\n\t},\n\t\"mongo\": {\n\t\t\"_isWindows\": false,\n\t\t\"_rand\": false,\n\t\t\"BulkWriteResult\": false,\n\t\t\"cat\": false,\n\t\t\"cd\": false,\n\t\t\"connect\": false,\n\t\t\"db\": false,\n\t\t\"getHostName\": false,\n\t\t\"getMemInfo\": false,\n\t\t\"hostname\": false,\n\t\t\"ISODate\": false,\n\t\t\"listFiles\": false,\n\t\t\"load\": false,\n\t\t\"ls\": false,\n\t\t\"md5sumFile\": false,\n\t\t\"mkdir\": false,\n\t\t\"Mongo\": false,\n\t\t\"NumberInt\": false,\n\t\t\"NumberLong\": false,\n\t\t\"ObjectId\": false,\n\t\t\"PlanCache\": false,\n\t\t\"print\": false,\n\t\t\"printjson\": false,\n\t\t\"pwd\": false,\n\t\t\"quit\": false,\n\t\t\"removeFile\": false,\n\t\t\"rs\": false,\n\t\t\"sh\": false,\n\t\t\"UUID\": false,\n\t\t\"version\": false,\n\t\t\"WriteResult\": false\n\t},\n\t\"applescript\": {\n\t\t\"$\": false,\n\t\t\"Application\": false,\n\t\t\"Automation\": false,\n\t\t\"console\": false,\n\t\t\"delay\": false,\n\t\t\"Library\": false,\n\t\t\"ObjC\": false,\n\t\t\"ObjectSpecifier\": false,\n\t\t\"Path\": false,\n\t\t\"Progress\": false,\n\t\t\"Ref\": false\n\t},\n\t\"serviceworker\": {\n\t\t\"addEventListener\": false,\n\t\t\"applicationCache\": false,\n\t\t\"atob\": false,\n\t\t\"Blob\": false,\n\t\t\"BroadcastChannel\": false,\n\t\t\"btoa\": false,\n\t\t\"Cache\": false,\n\t\t\"caches\": false,\n\t\t\"CacheStorage\": false,\n\t\t\"clearInterval\": false,\n\t\t\"clearTimeout\": false,\n\t\t\"Client\": false,\n\t\t\"clients\": false,\n\t\t\"Clients\": false,\n\t\t\"close\": true,\n\t\t\"console\": false,\n\t\t\"ExtendableEvent\": false,\n\t\t\"ExtendableMessageEvent\": false,\n\t\t\"fetch\": false,\n\t\t\"FetchEvent\": false,\n\t\t\"FileReaderSync\": false,\n\t\t\"FormData\": false,\n\t\t\"Headers\": false,\n\t\t\"IDBCursor\": false,\n\t\t\"IDBCursorWithValue\": false,\n\t\t\"IDBDatabase\": false,\n\t\t\"IDBFactory\": false,\n\t\t\"IDBIndex\": false,\n\t\t\"IDBKeyRange\": false,\n\t\t\"IDBObjectStore\": false,\n\t\t\"IDBOpenDBRequest\": false,\n\t\t\"IDBRequest\": false,\n\t\t\"IDBTransaction\": false,\n\t\t\"IDBVersionChangeEvent\": false,\n\t\t\"ImageData\": false,\n\t\t\"importScripts\": false,\n\t\t\"indexedDB\": false,\n\t\t\"location\": false,\n\t\t\"MessageChannel\": false,\n\t\t\"MessagePort\": false,\n\t\t\"name\": false,\n\t\t\"navigator\": false,\n\t\t\"Notification\": false,\n\t\t\"onclose\": true,\n\t\t\"onconnect\": true,\n\t\t\"onerror\": true,\n\t\t\"onfetch\": true,\n\t\t\"oninstall\": true,\n\t\t\"onlanguagechange\": true,\n\t\t\"onmessage\": true,\n\t\t\"onmessageerror\": true,\n\t\t\"onnotificationclick\": true,\n\t\t\"onnotificationclose\": true,\n\t\t\"onoffline\": true,\n\t\t\"ononline\": true,\n\t\t\"onpush\": true,\n\t\t\"onpushsubscriptionchange\": true,\n\t\t\"onrejectionhandled\": true,\n\t\t\"onsync\": true,\n\t\t\"onunhandledrejection\": true,\n\t\t\"performance\": false,\n\t\t\"Performance\": false,\n\t\t\"PerformanceEntry\": false,\n\t\t\"PerformanceMark\": false,\n\t\t\"PerformanceMeasure\": false,\n\t\t\"PerformanceNavigation\": false,\n\t\t\"PerformanceResourceTiming\": false,\n\t\t\"PerformanceTiming\": false,\n\t\t\"postMessage\": true,\n\t\t\"Promise\": false,\n\t\t\"queueMicrotask\": false,\n\t\t\"registration\": false,\n\t\t\"removeEventListener\": false,\n\t\t\"Request\": false,\n\t\t\"Response\": false,\n\t\t\"self\": false,\n\t\t\"ServiceWorker\": false,\n\t\t\"ServiceWorkerContainer\": false,\n\t\t\"ServiceWorkerGlobalScope\": false,\n\t\t\"ServiceWorkerMessageEvent\": false,\n\t\t\"ServiceWorkerRegistration\": false,\n\t\t\"setInterval\": false,\n\t\t\"setTimeout\": false,\n\t\t\"skipWaiting\": false,\n\t\t\"TextDecoder\": false,\n\t\t\"TextEncoder\": false,\n\t\t\"URL\": false,\n\t\t\"URLSearchParams\": false,\n\t\t\"WebSocket\": false,\n\t\t\"WindowClient\": false,\n\t\t\"Worker\": false,\n\t\t\"WorkerGlobalScope\": false,\n\t\t\"XMLHttpRequest\": false\n\t},\n\t\"atomtest\": {\n\t\t\"advanceClock\": false,\n\t\t\"fakeClearInterval\": false,\n\t\t\"fakeClearTimeout\": false,\n\t\t\"fakeSetInterval\": false,\n\t\t\"fakeSetTimeout\": false,\n\t\t\"resetTimeouts\": false,\n\t\t\"waitsForPromise\": false\n\t},\n\t\"embertest\": {\n\t\t\"andThen\": false,\n\t\t\"click\": false,\n\t\t\"currentPath\": false,\n\t\t\"currentRouteName\": false,\n\t\t\"currentURL\": false,\n\t\t\"fillIn\": false,\n\t\t\"find\": false,\n\t\t\"findAll\": false,\n\t\t\"findWithAssert\": false,\n\t\t\"keyEvent\": false,\n\t\t\"pauseTest\": false,\n\t\t\"resumeTest\": false,\n\t\t\"triggerEvent\": false,\n\t\t\"visit\": false,\n\t\t\"wait\": false\n\t},\n\t\"protractor\": {\n\t\t\"$\": false,\n\t\t\"$$\": false,\n\t\t\"browser\": false,\n\t\t\"by\": false,\n\t\t\"By\": false,\n\t\t\"DartObject\": false,\n\t\t\"element\": false,\n\t\t\"protractor\": false\n\t},\n\t\"shared-node-browser\": {\n\t\t\"clearInterval\": false,\n\t\t\"clearTimeout\": false,\n\t\t\"console\": false,\n\t\t\"setInterval\": false,\n\t\t\"setTimeout\": false,\n\t\t\"URL\": false,\n\t\t\"URLSearchParams\": false\n\t},\n\t\"webextensions\": {\n\t\t\"browser\": false,\n\t\t\"chrome\": false,\n\t\t\"opr\": false\n\t},\n\t\"greasemonkey\": {\n\t\t\"cloneInto\": false,\n\t\t\"createObjectIn\": false,\n\t\t\"exportFunction\": false,\n\t\t\"GM\": false,\n\t\t\"GM_addStyle\": false,\n\t\t\"GM_deleteValue\": false,\n\t\t\"GM_getResourceText\": false,\n\t\t\"GM_getResourceURL\": false,\n\t\t\"GM_getValue\": false,\n\t\t\"GM_info\": false,\n\t\t\"GM_listValues\": false,\n\t\t\"GM_log\": false,\n\t\t\"GM_openInTab\": false,\n\t\t\"GM_registerMenuCommand\": false,\n\t\t\"GM_setClipboard\": false,\n\t\t\"GM_setValue\": false,\n\t\t\"GM_xmlhttpRequest\": false,\n\t\t\"unsafeWindow\": false\n\t},\n\t\"devtools\": {\n\t\t\"$\": false,\n\t\t\"$_\": false,\n\t\t\"$$\": false,\n\t\t\"$0\": false,\n\t\t\"$1\": false,\n\t\t\"$2\": false,\n\t\t\"$3\": false,\n\t\t\"$4\": false,\n\t\t\"$x\": false,\n\t\t\"chrome\": false,\n\t\t\"clear\": false,\n\t\t\"copy\": false,\n\t\t\"debug\": false,\n\t\t\"dir\": false,\n\t\t\"dirxml\": false,\n\t\t\"getEventListeners\": false,\n\t\t\"inspect\": false,\n\t\t\"keys\": false,\n\t\t\"monitor\": false,\n\t\t\"monitorEvents\": false,\n\t\t\"profile\": false,\n\t\t\"profileEnd\": false,\n\t\t\"queryObjects\": false,\n\t\t\"table\": false,\n\t\t\"undebug\": false,\n\t\t\"unmonitor\": false,\n\t\t\"unmonitorEvents\": false,\n\t\t\"values\": false\n\t}\n}\n","'use strict';\nmodule.exports = require('./globals.json');\n","import Renamer from \"./lib/renamer\";\nimport type NodePath from \"../path\";\nimport traverse from \"../index\";\nimport type { TraverseOptions } from \"../index\";\nimport Binding from \"./binding\";\nimport type { BindingKind } from \"./binding\";\nimport globals from \"globals\";\nimport {\n NOT_LOCAL_BINDING,\n callExpression,\n cloneNode,\n getBindingIdentifiers,\n identifier,\n isArrayExpression,\n isBinary,\n isClass,\n isClassBody,\n isClassDeclaration,\n isExportAllDeclaration,\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n isFunctionDeclaration,\n isIdentifier,\n isImportDeclaration,\n isLiteral,\n isMethod,\n isModuleSpecifier,\n isNullLiteral,\n isObjectExpression,\n isProperty,\n isPureish,\n isRegExpLiteral,\n isSuper,\n isTaggedTemplateExpression,\n isTemplateLiteral,\n isThisExpression,\n isUnaryExpression,\n isVariableDeclaration,\n matchesPattern,\n memberExpression,\n numericLiteral,\n toIdentifier,\n unaryExpression,\n variableDeclaration,\n variableDeclarator,\n isRecordExpression,\n isTupleExpression,\n isObjectProperty,\n isTopicReference,\n isMetaProperty,\n isPrivateName,\n isExportDeclaration,\n} from \"@babel/types\";\nimport * as t from \"@babel/types\";\nimport { scope as scopeCache } from \"../cache\";\nimport type { Visitor } from \"../types\";\nimport { isExplodedVisitor } from \"../visitors\";\n\ntype NodePart = string | number | boolean;\n// Recursively gathers the identifying names of a node.\nfunction gatherNodeParts(node: t.Node, parts: NodePart[]) {\n switch (node?.type) {\n default:\n if (isImportDeclaration(node) || isExportDeclaration(node)) {\n if (\n (isExportAllDeclaration(node) ||\n isExportNamedDeclaration(node) ||\n isImportDeclaration(node)) &&\n node.source\n ) {\n gatherNodeParts(node.source, parts);\n } else if (\n (isExportNamedDeclaration(node) || isImportDeclaration(node)) &&\n node.specifiers &&\n node.specifiers.length\n ) {\n for (const e of node.specifiers) gatherNodeParts(e, parts);\n } else if (\n (isExportDefaultDeclaration(node) ||\n isExportNamedDeclaration(node)) &&\n node.declaration\n ) {\n gatherNodeParts(node.declaration, parts);\n }\n } else if (isModuleSpecifier(node)) {\n // todo(flow->ts): should condition instead be:\n // ```\n // t.isExportSpecifier(node) ||\n // t.isImportDefaultSpecifier(node) ||\n // t.isImportNamespaceSpecifier(node) ||\n // t.isImportSpecifier(node)\n // ```\n // allowing only nodes with `.local`?\n // @ts-expect-error todo(flow->ts)\n gatherNodeParts(node.local, parts);\n } else if (\n isLiteral(node) &&\n !isNullLiteral(node) &&\n !isRegExpLiteral(node) &&\n !isTemplateLiteral(node)\n ) {\n parts.push(node.value);\n }\n break;\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n case \"JSXMemberExpression\":\n gatherNodeParts(node.object, parts);\n gatherNodeParts(node.property, parts);\n break;\n\n case \"Identifier\":\n case \"JSXIdentifier\":\n parts.push(node.name);\n break;\n\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n case \"NewExpression\":\n gatherNodeParts(node.callee, parts);\n break;\n\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n for (const e of node.properties) {\n gatherNodeParts(e, parts);\n }\n break;\n\n case \"SpreadElement\":\n case \"RestElement\":\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"ObjectProperty\":\n case \"ObjectMethod\":\n case \"ClassProperty\":\n case \"ClassMethod\":\n case \"ClassPrivateProperty\":\n case \"ClassPrivateMethod\":\n gatherNodeParts(node.key, parts);\n break;\n\n case \"ThisExpression\":\n parts.push(\"this\");\n break;\n\n case \"Super\":\n parts.push(\"super\");\n break;\n\n case \"Import\":\n parts.push(\"import\");\n break;\n\n case \"DoExpression\":\n parts.push(\"do\");\n break;\n\n case \"YieldExpression\":\n parts.push(\"yield\");\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"AwaitExpression\":\n parts.push(\"await\");\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"AssignmentExpression\":\n gatherNodeParts(node.left, parts);\n break;\n\n case \"VariableDeclarator\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"FunctionExpression\":\n case \"FunctionDeclaration\":\n case \"ClassExpression\":\n case \"ClassDeclaration\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"PrivateName\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"ParenthesizedExpression\":\n gatherNodeParts(node.expression, parts);\n break;\n\n case \"UnaryExpression\":\n case \"UpdateExpression\":\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"MetaProperty\":\n gatherNodeParts(node.meta, parts);\n gatherNodeParts(node.property, parts);\n break;\n\n case \"JSXElement\":\n gatherNodeParts(node.openingElement, parts);\n break;\n\n case \"JSXOpeningElement\":\n gatherNodeParts(node.name, parts);\n break;\n\n case \"JSXFragment\":\n gatherNodeParts(node.openingFragment, parts);\n break;\n\n case \"JSXOpeningFragment\":\n parts.push(\"Fragment\");\n break;\n\n case \"JSXNamespacedName\":\n gatherNodeParts(node.namespace, parts);\n gatherNodeParts(node.name, parts);\n break;\n }\n}\n\n//\ninterface CollectVisitorState {\n assignments: NodePath[];\n references: NodePath[];\n constantViolations: NodePath[];\n}\n\nconst collectorVisitor: Visitor = {\n ForStatement(path) {\n const declar = path.get(\"init\");\n // delegate block scope handling to the `BlockScoped` method\n if (declar.isVar()) {\n const { scope } = path;\n const parentScope = scope.getFunctionParent() || scope.getProgramParent();\n parentScope.registerBinding(\"var\", declar);\n }\n },\n\n Declaration(path) {\n // delegate block scope handling to the `BlockScoped` method\n if (path.isBlockScoped()) return;\n\n // delegate import handing to the `ImportDeclaration` method\n if (path.isImportDeclaration()) return;\n\n // this will be hit again once we traverse into it after this iteration\n if (path.isExportDeclaration()) return;\n\n // we've ran into a declaration!\n const parent =\n path.scope.getFunctionParent() || path.scope.getProgramParent();\n parent.registerDeclaration(path);\n },\n\n ImportDeclaration(path) {\n // import may only appear in the top level or inside a module/namespace (for TS/flow)\n const parent = path.scope.getBlockParent();\n\n parent.registerDeclaration(path);\n },\n\n ReferencedIdentifier(path, state) {\n state.references.push(path);\n },\n\n ForXStatement(path, state) {\n const left = path.get(\"left\");\n if (left.isPattern() || left.isIdentifier()) {\n state.constantViolations.push(path);\n }\n // delegate block scope handling to the `BlockScoped` method\n else if (left.isVar()) {\n const { scope } = path;\n const parentScope = scope.getFunctionParent() || scope.getProgramParent();\n parentScope.registerBinding(\"var\", left);\n }\n },\n\n ExportDeclaration: {\n exit(path) {\n const { node, scope } = path;\n // ExportAllDeclaration does not have `declaration`\n if (isExportAllDeclaration(node)) return;\n const declar = node.declaration;\n if (isClassDeclaration(declar) || isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (!id) return;\n\n const binding = scope.getBinding(id.name);\n binding?.reference(path);\n } else if (isVariableDeclaration(declar)) {\n for (const decl of declar.declarations) {\n for (const name of Object.keys(getBindingIdentifiers(decl))) {\n const binding = scope.getBinding(name);\n binding?.reference(path);\n }\n }\n }\n },\n },\n\n LabeledStatement(path) {\n path.scope.getBlockParent().registerDeclaration(path);\n },\n\n AssignmentExpression(path, state) {\n state.assignments.push(path);\n },\n\n UpdateExpression(path, state) {\n state.constantViolations.push(path);\n },\n\n UnaryExpression(path, state) {\n if (path.node.operator === \"delete\") {\n state.constantViolations.push(path);\n }\n },\n\n BlockScoped(path) {\n let scope = path.scope;\n if (scope.path === path) scope = scope.parent;\n\n const parent = scope.getBlockParent();\n parent.registerDeclaration(path);\n\n // Register class identifier in class' scope if this is a class declaration.\n if (path.isClassDeclaration() && path.node.id) {\n const id = path.node.id;\n const name = id.name;\n\n path.scope.bindings[name] = path.scope.parent.getBinding(name);\n }\n },\n\n CatchClause(path) {\n path.scope.registerBinding(\"let\", path);\n },\n\n Function(path) {\n const params: Array = path.get(\"params\");\n for (const param of params) {\n path.scope.registerBinding(\"param\", param);\n }\n\n // Register function expression id after params. When the id\n // collides with a function param, the id effectively can't be\n // referenced: here we registered it as a constantViolation\n if (\n path.isFunctionExpression() &&\n path.has(\"id\") &&\n // @ts-expect-error Fixme: document symbol ast properties\n !path.get(\"id\").node[NOT_LOCAL_BINDING]\n ) {\n path.scope.registerBinding(\"local\", path.get(\"id\"), path);\n }\n },\n\n ClassExpression(path) {\n if (\n path.has(\"id\") &&\n // @ts-expect-error Fixme: document symbol ast properties\n !path.get(\"id\").node[NOT_LOCAL_BINDING]\n ) {\n path.scope.registerBinding(\"local\", path);\n }\n },\n};\n\nlet uid = 0;\n\nexport type { Binding };\n\nexport default class Scope {\n uid;\n\n path: NodePath;\n block: t.Pattern | t.Scopable;\n\n labels;\n inited;\n\n bindings: { [name: string]: Binding };\n references: { [name: string]: true };\n globals: { [name: string]: t.Identifier | t.JSXIdentifier };\n uids: { [name: string]: boolean };\n data: { [key: string | symbol]: unknown };\n crawling: boolean;\n\n /**\n * This searches the current \"scope\" and collects all references/bindings\n * within.\n */\n constructor(path: NodePath) {\n const { node } = path;\n const cached = scopeCache.get(node);\n // Sometimes, a scopable path is placed higher in the AST tree.\n // In these cases, have to create a new Scope.\n if (cached?.path === path) {\n return cached;\n }\n scopeCache.set(node, this);\n\n this.uid = uid++;\n\n this.block = node;\n this.path = path;\n\n this.labels = new Map();\n this.inited = false;\n }\n\n /**\n * Globals.\n */\n\n static globals = Object.keys(globals.builtin);\n\n /**\n * Variables available in current context.\n */\n\n static contextVariables = [\"arguments\", \"undefined\", \"Infinity\", \"NaN\"];\n\n get parent() {\n let parent,\n path = this.path;\n do {\n // Skip method scope if coming from inside computed key or decorator expression\n const shouldSkip = path.key === \"key\" || path.listKey === \"decorators\";\n path = path.parentPath;\n if (shouldSkip && path.isMethod()) path = path.parentPath;\n if (path && path.isScope()) parent = path;\n } while (path && !parent);\n\n return parent?.scope;\n }\n\n get parentBlock() {\n return this.path.parent;\n }\n\n get hub() {\n return this.path.hub;\n }\n\n traverse(\n node: t.Node | t.Node[],\n opts: TraverseOptions,\n state: S,\n ): void;\n traverse(node: t.Node | t.Node[], opts?: TraverseOptions, state?: any): void;\n /**\n * Traverse node with current scope and path.\n *\n * !!! WARNING !!!\n * This method assumes that `this.path` is the NodePath representing `node`.\n * After running the traversal, the `.parentPath` of the NodePaths\n * corresponding to `node`'s children will be set to `this.path`.\n *\n * There is no good reason to use this method, since the only safe way to use\n * it is equivalent to `scope.path.traverse(opts, state)`.\n */\n traverse(node: any, opts: any, state?: S) {\n traverse(node, opts, this, state, this.path);\n }\n\n /**\n * Generate a unique identifier and add it to the current scope.\n */\n\n generateDeclaredUidIdentifier(name?: string) {\n const id = this.generateUidIdentifier(name);\n this.push({ id });\n return cloneNode(id);\n }\n\n /**\n * Generate a unique identifier.\n */\n\n generateUidIdentifier(name?: string) {\n return identifier(this.generateUid(name));\n }\n\n /**\n * Generate a unique `_id1` binding.\n */\n\n generateUid(name: string = \"temp\"): string {\n name = toIdentifier(name)\n .replace(/^_+/, \"\")\n .replace(/[0-9]+$/g, \"\");\n\n let uid;\n let i = 1;\n do {\n uid = this._generateUid(name, i);\n i++;\n } while (\n this.hasLabel(uid) ||\n this.hasBinding(uid) ||\n this.hasGlobal(uid) ||\n this.hasReference(uid)\n );\n\n const program = this.getProgramParent();\n program.references[uid] = true;\n program.uids[uid] = true;\n\n return uid;\n }\n\n /**\n * Generate an `_id1`.\n */\n\n _generateUid(name: string, i: number) {\n let id = name;\n if (i > 1) id += i;\n return `_${id}`;\n }\n\n generateUidBasedOnNode(node: t.Node, defaultName?: string) {\n const parts: NodePart[] = [];\n gatherNodeParts(node, parts);\n\n let id = parts.join(\"$\");\n id = id.replace(/^_/, \"\") || defaultName || \"ref\";\n\n return this.generateUid(id.slice(0, 20));\n }\n\n /**\n * Generate a unique identifier based on a node.\n */\n\n generateUidIdentifierBasedOnNode(node: t.Node, defaultName?: string) {\n return identifier(this.generateUidBasedOnNode(node, defaultName));\n }\n\n /**\n * Determine whether evaluating the specific input `node` is a consequenceless reference. ie.\n * evaluating it wont result in potentially arbitrary code from being ran. The following are\n * allowed and determined not to cause side effects:\n *\n * - `this` expressions\n * - `super` expressions\n * - Bound identifiers\n */\n\n isStatic(node: t.Node): boolean {\n if (isThisExpression(node) || isSuper(node) || isTopicReference(node)) {\n return true;\n }\n\n if (isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding) {\n return binding.constant;\n } else {\n return this.hasBinding(node.name);\n }\n }\n\n return false;\n }\n\n /**\n * Possibly generate a memoised identifier if it is not static and has consequences.\n */\n\n maybeGenerateMemoised(node: t.Node, dontPush?: boolean) {\n if (this.isStatic(node)) {\n return null;\n } else {\n const id = this.generateUidIdentifierBasedOnNode(node);\n if (!dontPush) {\n this.push({ id });\n return cloneNode(id);\n }\n return id;\n }\n }\n\n checkBlockScopedCollisions(\n local: Binding,\n kind: BindingKind,\n name: string,\n id: any,\n ) {\n // ignore parameters\n if (kind === \"param\") return;\n\n // Ignore existing binding if it's the name of the current function or\n // class expression\n if (local.kind === \"local\") return;\n\n const duplicate =\n // don't allow duplicate bindings to exist alongside\n kind === \"let\" ||\n local.kind === \"let\" ||\n local.kind === \"const\" ||\n local.kind === \"module\" ||\n // don't allow a local of param with a kind of let\n (local.kind === \"param\" && kind === \"const\");\n\n if (duplicate) {\n throw this.hub.buildError(\n id,\n `Duplicate declaration \"${name}\"`,\n TypeError,\n );\n }\n }\n\n rename(\n oldName: string,\n newName?: string,\n // prettier-ignore\n /* Babel 7 - block?: t.Pattern | t.Scopable */\n ) {\n const binding = this.getBinding(oldName);\n if (binding) {\n newName ||= this.generateUidIdentifier(oldName).name;\n const renamer = new Renamer(binding, oldName, newName);\n if (process.env.BABEL_8_BREAKING) {\n renamer.rename();\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) TODO: Delete this\n renamer.rename(arguments[2]);\n }\n }\n }\n\n /** @deprecated Not used in our codebase */\n _renameFromMap(\n map: Record,\n oldName: string | symbol,\n newName: string | symbol,\n value: unknown,\n ) {\n if (map[oldName]) {\n map[newName] = value;\n map[oldName] = null;\n }\n }\n\n dump() {\n const sep = \"-\".repeat(60);\n console.log(sep);\n let scope: Scope = this;\n do {\n console.log(\"#\", scope.block.type);\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n console.log(\" -\", name, {\n constant: binding.constant,\n references: binding.references,\n violations: binding.constantViolations.length,\n kind: binding.kind,\n });\n }\n } while ((scope = scope.parent));\n console.log(sep);\n }\n\n // TODO: (Babel 8) Split i in two parameters, and use an object of flags\n toArray(\n node: t.Node,\n i?: number | boolean,\n arrayLikeIsIterable?: boolean | void,\n ) {\n if (isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding?.constant && binding.path.isGenericType(\"Array\")) {\n return node;\n }\n }\n\n if (isArrayExpression(node)) {\n return node;\n }\n\n if (isIdentifier(node, { name: \"arguments\" })) {\n return callExpression(\n memberExpression(\n memberExpression(\n memberExpression(identifier(\"Array\"), identifier(\"prototype\")),\n identifier(\"slice\"),\n ),\n identifier(\"call\"),\n ),\n [node],\n );\n }\n\n let helperName;\n const args = [node];\n if (i === true) {\n // Used in array-spread to create an array.\n helperName = \"toConsumableArray\";\n } else if (typeof i === \"number\") {\n args.push(numericLiteral(i));\n\n // Used in array-rest to create an array from a subset of an iterable.\n helperName = \"slicedToArray\";\n // TODO if (this.hub.isLoose(\"es6.forOf\")) helperName += \"-loose\";\n } else {\n // Used in array-rest to create an array\n helperName = \"toArray\";\n }\n\n if (arrayLikeIsIterable) {\n args.unshift(this.hub.addHelper(helperName));\n helperName = \"maybeArrayLike\";\n }\n\n // @ts-expect-error todo(flow->ts): t.Node is not valid to use in args, function argument typeneeds to be clarified\n return callExpression(this.hub.addHelper(helperName), args);\n }\n\n hasLabel(name: string) {\n return !!this.getLabel(name);\n }\n\n getLabel(name: string) {\n return this.labels.get(name);\n }\n\n registerLabel(path: NodePath) {\n this.labels.set(path.node.label.name, path);\n }\n\n registerDeclaration(path: NodePath) {\n if (path.isLabeledStatement()) {\n this.registerLabel(path);\n } else if (path.isFunctionDeclaration()) {\n this.registerBinding(\"hoisted\", path.get(\"id\"), path);\n } else if (path.isVariableDeclaration()) {\n const declarations = path.get(\"declarations\");\n const { kind } = path.node;\n for (const declar of declarations) {\n this.registerBinding(\n kind === \"using\" || kind === \"await using\" ? \"const\" : kind,\n declar,\n );\n }\n } else if (path.isClassDeclaration()) {\n if (path.node.declare) return;\n this.registerBinding(\"let\", path);\n } else if (path.isImportDeclaration()) {\n const isTypeDeclaration =\n path.node.importKind === \"type\" || path.node.importKind === \"typeof\";\n const specifiers = path.get(\"specifiers\");\n for (const specifier of specifiers) {\n const isTypeSpecifier =\n isTypeDeclaration ||\n (specifier.isImportSpecifier() &&\n (specifier.node.importKind === \"type\" ||\n specifier.node.importKind === \"typeof\"));\n\n this.registerBinding(isTypeSpecifier ? \"unknown\" : \"module\", specifier);\n }\n } else if (path.isExportDeclaration()) {\n // todo: improve babel-types\n const declar = path.get(\"declaration\") as NodePath;\n if (\n declar.isClassDeclaration() ||\n declar.isFunctionDeclaration() ||\n declar.isVariableDeclaration()\n ) {\n this.registerDeclaration(declar);\n }\n } else {\n this.registerBinding(\"unknown\", path);\n }\n }\n\n buildUndefinedNode() {\n return unaryExpression(\"void\", numericLiteral(0), true);\n }\n\n registerConstantViolation(path: NodePath) {\n const ids = path.getBindingIdentifiers();\n for (const name of Object.keys(ids)) {\n this.getBinding(name)?.reassign(path);\n }\n }\n\n registerBinding(\n kind: Binding[\"kind\"],\n path: NodePath,\n bindingPath: NodePath = path,\n ) {\n if (!kind) throw new ReferenceError(\"no `kind`\");\n\n if (path.isVariableDeclaration()) {\n const declarators: Array = path.get(\"declarations\");\n for (const declar of declarators) {\n this.registerBinding(kind, declar);\n }\n return;\n }\n\n const parent = this.getProgramParent();\n const ids = path.getOuterBindingIdentifiers(true);\n\n for (const name of Object.keys(ids)) {\n parent.references[name] = true;\n\n for (const id of ids[name]) {\n const local = this.getOwnBinding(name);\n\n if (local) {\n // same identifier so continue safely as we're likely trying to register it\n // multiple times\n if (local.identifier === id) continue;\n\n this.checkBlockScopedCollisions(local, kind, name, id);\n }\n\n // A redeclaration of an existing variable is a modification\n if (local) {\n this.registerConstantViolation(bindingPath);\n } else {\n this.bindings[name] = new Binding({\n identifier: id,\n scope: this,\n path: bindingPath,\n kind: kind,\n });\n }\n }\n }\n }\n\n addGlobal(node: t.Identifier | t.JSXIdentifier) {\n this.globals[node.name] = node;\n }\n\n hasUid(name: string): boolean {\n let scope: Scope = this;\n\n do {\n if (scope.uids[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasGlobal(name: string): boolean {\n let scope: Scope = this;\n\n do {\n if (scope.globals[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasReference(name: string): boolean {\n return !!this.getProgramParent().references[name];\n }\n\n isPure(node: t.Node, constantsOnly?: boolean): boolean {\n if (isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (!binding) return false;\n if (constantsOnly) return binding.constant;\n return true;\n } else if (\n isThisExpression(node) ||\n isMetaProperty(node) ||\n isTopicReference(node) ||\n isPrivateName(node)\n ) {\n return true;\n } else if (isClass(node)) {\n if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {\n return false;\n }\n if (node.decorators?.length > 0) {\n return false;\n }\n return this.isPure(node.body, constantsOnly);\n } else if (isClassBody(node)) {\n for (const method of node.body) {\n if (!this.isPure(method, constantsOnly)) return false;\n }\n return true;\n } else if (isBinary(node)) {\n return (\n this.isPure(node.left, constantsOnly) &&\n this.isPure(node.right, constantsOnly)\n );\n } else if (isArrayExpression(node) || isTupleExpression(node)) {\n for (const elem of node.elements) {\n if (elem !== null && !this.isPure(elem, constantsOnly)) return false;\n }\n return true;\n } else if (isObjectExpression(node) || isRecordExpression(node)) {\n for (const prop of node.properties) {\n if (!this.isPure(prop, constantsOnly)) return false;\n }\n return true;\n } else if (isMethod(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.decorators?.length > 0) {\n return false;\n }\n return true;\n } else if (isProperty(node)) {\n // @ts-expect-error todo(flow->ts): computed in not present on private properties\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.decorators?.length > 0) {\n return false;\n }\n if (isObjectProperty(node) || node.static) {\n if (node.value !== null && !this.isPure(node.value, constantsOnly)) {\n return false;\n }\n }\n return true;\n } else if (isUnaryExpression(node)) {\n return this.isPure(node.argument, constantsOnly);\n } else if (isTaggedTemplateExpression(node)) {\n return (\n matchesPattern(node.tag, \"String.raw\") &&\n !this.hasBinding(\"String\", true) &&\n this.isPure(node.quasi, constantsOnly)\n );\n } else if (isTemplateLiteral(node)) {\n for (const expression of node.expressions) {\n if (!this.isPure(expression, constantsOnly)) return false;\n }\n return true;\n } else {\n return isPureish(node);\n }\n }\n\n /**\n * Set some arbitrary data on the current scope.\n */\n\n setData(key: string | symbol, val: any) {\n return (this.data[key] = val);\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key`.\n */\n\n getData(key: string | symbol): any {\n let scope: Scope = this;\n do {\n const data = scope.data[key];\n if (data != null) return data;\n } while ((scope = scope.parent));\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key` and if it exists,\n * remove it.\n */\n\n removeData(key: string) {\n let scope: Scope = this;\n do {\n const data = scope.data[key];\n if (data != null) scope.data[key] = null;\n } while ((scope = scope.parent));\n }\n\n init() {\n if (!this.inited) {\n this.inited = true;\n this.crawl();\n }\n }\n\n crawl() {\n const path = this.path;\n\n this.references = Object.create(null);\n this.bindings = Object.create(null);\n this.globals = Object.create(null);\n this.uids = Object.create(null);\n this.data = Object.create(null);\n\n const programParent = this.getProgramParent();\n if (programParent.crawling) return;\n\n const state: CollectVisitorState = {\n references: [],\n constantViolations: [],\n assignments: [],\n };\n\n this.crawling = true;\n // traverse does not visit the root node, here we explicitly collect\n // root node binding info when the root is not a Program.\n if (path.type !== \"Program\" && isExplodedVisitor(collectorVisitor)) {\n for (const visit of collectorVisitor.enter) {\n visit.call(state, path, state);\n }\n const typeVisitors = collectorVisitor[path.type];\n if (typeVisitors) {\n for (const visit of typeVisitors.enter) {\n visit.call(state, path, state);\n }\n }\n }\n path.traverse(collectorVisitor, state);\n this.crawling = false;\n\n // register assignments\n for (const path of state.assignments) {\n // register undeclared bindings as globals\n const ids = path.getBindingIdentifiers();\n for (const name of Object.keys(ids)) {\n if (path.scope.getBinding(name)) continue;\n programParent.addGlobal(ids[name]);\n }\n\n // register as constant violation\n path.scope.registerConstantViolation(path);\n }\n\n // register references\n for (const ref of state.references) {\n const binding = ref.scope.getBinding(ref.node.name);\n if (binding) {\n binding.reference(ref);\n } else {\n programParent.addGlobal(ref.node);\n }\n }\n\n // register constant violations\n for (const path of state.constantViolations) {\n path.scope.registerConstantViolation(path);\n }\n }\n\n push(opts: {\n id: t.LVal;\n init?: t.Expression;\n unique?: boolean;\n _blockHoist?: number | undefined;\n kind?: \"var\" | \"let\" | \"const\";\n }) {\n let path = this.path;\n\n if (path.isPattern()) {\n path = this.getPatternParent().path;\n } else if (!path.isBlockStatement() && !path.isProgram()) {\n path = this.getBlockParent().path;\n }\n\n if (path.isSwitchStatement()) {\n path = (this.getFunctionParent() || this.getProgramParent()).path;\n }\n\n const { init, unique, kind = \"var\", id } = opts;\n\n // When injecting a non-const non-initialized binding inside\n // an IIFE, if the number of call arguments is less than or\n // equal to the number of function parameters, we can safely\n // inject the binding into the parameter list.\n if (\n !init &&\n !unique &&\n (kind === \"var\" || kind === \"let\") &&\n path.isFunction() &&\n // @ts-expect-error ArrowFunctionExpression never has a name\n !path.node.name &&\n t.isCallExpression(path.parent, { callee: path.node }) &&\n path.parent.arguments.length <= path.node.params.length &&\n t.isIdentifier(id)\n ) {\n path.pushContainer(\"params\", id);\n path.scope.registerBinding(\n \"param\",\n path.get(\"params\")[path.node.params.length - 1],\n );\n return;\n }\n\n if (path.isLoop() || path.isCatchClause() || path.isFunction()) {\n // @ts-expect-error TS can not infer NodePath | NodePath as NodePath\n path.ensureBlock();\n // @ts-expect-error todo(flow->ts): improve types\n path = path.get(\"body\");\n }\n\n const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;\n\n const dataKey = `declaration:${kind}:${blockHoist}`;\n let declarPath = !unique && path.getData(dataKey);\n\n if (!declarPath) {\n const declar = variableDeclaration(kind, []);\n // @ts-expect-error todo(flow->ts): avoid modifying nodes\n declar._blockHoist = blockHoist;\n\n [declarPath] = (path as NodePath).unshiftContainer(\n \"body\",\n [declar],\n );\n if (!unique) path.setData(dataKey, declarPath);\n }\n\n const declarator = variableDeclarator(id, init);\n const len = declarPath.node.declarations.push(declarator);\n path.scope.registerBinding(kind, declarPath.get(\"declarations\")[len - 1]);\n }\n\n /**\n * Walk up to the top of the scope tree and get the `Program`.\n */\n\n getProgramParent() {\n let scope: Scope = this;\n do {\n if (scope.path.isProgram()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\"Couldn't find a Program\");\n }\n\n /**\n * Walk up the scope tree until we hit either a Function or return null.\n */\n\n getFunctionParent(): Scope | null {\n let scope: Scope = this;\n do {\n if (scope.path.isFunctionParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n return null;\n }\n\n /**\n * Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the\n * very top and hit Program.\n */\n\n getBlockParent() {\n let scope: Scope = this;\n do {\n if (scope.path.isBlockParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\n \"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\",\n );\n }\n\n /**\n * Walk up from a pattern scope (function param initializer) until we hit a non-pattern scope,\n * then returns its block parent\n * @returns An ancestry scope whose path is a block parent\n */\n getPatternParent() {\n let scope: Scope = this;\n do {\n if (!scope.path.isPattern()) {\n return scope.getBlockParent();\n }\n } while ((scope = scope.parent.parent));\n throw new Error(\n \"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\",\n );\n }\n\n /**\n * Walks the scope tree and gathers **all** bindings.\n */\n\n getAllBindings(): Record {\n const ids = Object.create(null);\n\n let scope: Scope = this;\n do {\n for (const key of Object.keys(scope.bindings)) {\n if (key in ids === false) {\n ids[key] = scope.bindings[key];\n }\n }\n scope = scope.parent;\n } while (scope);\n\n return ids;\n }\n\n /**\n * Walks the scope tree and gathers all declarations of `kind`.\n */\n\n getAllBindingsOfKind(...kinds: string[]): Record {\n const ids = Object.create(null);\n\n for (const kind of kinds) {\n let scope: Scope = this;\n do {\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind === kind) ids[name] = binding;\n }\n scope = scope.parent;\n } while (scope);\n }\n\n return ids;\n }\n\n bindingIdentifierEquals(name: string, node: t.Node): boolean {\n return this.getBindingIdentifier(name) === node;\n }\n\n getBinding(name: string): Binding | undefined {\n let scope: Scope = this;\n let previousPath;\n\n do {\n const binding = scope.getOwnBinding(name);\n if (binding) {\n // Check if a pattern is a part of parameter expressions.\n // Note: for performance reason we skip checking previousPath.parentPath.isFunction()\n // because `scope.path` is validated as scope in packages/babel-types/src/validators/isScope.js\n // That is, if a scope path is pattern, its parent must be Function/CatchClause\n\n // Spec 9.2.10.28: The closure created by this expression should not have visibility of\n // declarations in the function body. If the binding is not a `param`-kind (as function parameters)\n // or `local`-kind (as id in function expression),\n // then it must be defined inside the function body, thus it should be skipped\n if (\n previousPath?.isPattern() &&\n binding.kind !== \"param\" &&\n binding.kind !== \"local\"\n ) {\n // do nothing\n } else {\n return binding;\n }\n } else if (\n !binding &&\n name === \"arguments\" &&\n scope.path.isFunction() &&\n !scope.path.isArrowFunctionExpression()\n ) {\n break;\n }\n previousPath = scope.path;\n } while ((scope = scope.parent));\n }\n\n getOwnBinding(name: string): Binding | undefined {\n return this.bindings[name];\n }\n\n // todo: return probably can be undefined…\n getBindingIdentifier(name: string): t.Identifier {\n return this.getBinding(name)?.identifier;\n }\n\n // todo: flow->ts return probably can be undefined\n getOwnBindingIdentifier(name: string): t.Identifier {\n const binding = this.bindings[name];\n return binding?.identifier;\n }\n\n hasOwnBinding(name: string) {\n return !!this.getOwnBinding(name);\n }\n\n // By default, we consider generated UIDs as bindings.\n // This is because they are almost always used to declare variables,\n // and since the scope isn't always up-to-date it's better to assume that\n // there is a variable with that name. The `noUids` option can be used to\n // turn off this behavior, for example if you know that the generate UID\n // was used to declare a variable in a different scope.\n hasBinding(\n name: string,\n opts?: boolean | { noGlobals?: boolean; noUids?: boolean },\n ) {\n if (!name) return false;\n if (this.hasOwnBinding(name)) return true;\n {\n // TODO: Only accept the object form.\n if (typeof opts === \"boolean\") opts = { noGlobals: opts };\n }\n if (this.parentHasBinding(name, opts)) return true;\n if (!opts?.noUids && this.hasUid(name)) return true;\n if (!opts?.noGlobals && Scope.globals.includes(name)) return true;\n if (!opts?.noGlobals && Scope.contextVariables.includes(name)) return true;\n return false;\n }\n\n parentHasBinding(\n name: string,\n opts?: { noGlobals?: boolean; noUids?: boolean },\n ) {\n return this.parent?.hasBinding(name, opts);\n }\n\n /**\n * Move a binding of `name` to another `scope`.\n */\n\n moveBindingTo(name: string, scope: Scope) {\n const info = this.getBinding(name);\n if (info) {\n info.scope.removeOwnBinding(name);\n info.scope = scope;\n scope.bindings[name] = info;\n }\n }\n\n removeOwnBinding(name: string) {\n delete this.bindings[name];\n }\n\n removeBinding(name: string) {\n // clear literal binding\n this.getBinding(name)?.scope.removeOwnBinding(name);\n\n // clear uids with this name - https://github.com/babel/babel/issues/2101\n let scope: Scope = this;\n do {\n if (scope.uids[name]) {\n scope.uids[name] = false;\n }\n } while ((scope = scope.parent));\n }\n}\n","/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n","export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n","export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n","import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMapInput,\n SectionedSourceMapInput,\n DecodedSourceMap,\n EncodedSourceMap,\n SectionedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping as Mapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n EachMapping,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,\n original.column,\n name,\n content,\n );\n}\n","import {\n GenMapping,\n maybeAddMapping,\n setSourceContent,\n allMappings,\n toEncodedMap,\n toDecodedMap,\n} from \"@jridgewell/gen-mapping\";\n\nimport type {\n EncodedSourceMap,\n DecodedSourceMap,\n Mapping,\n} from \"@jridgewell/gen-mapping\";\n\nimport {\n type SourceMapInput,\n originalPositionFor,\n TraceMap,\n} from \"@jridgewell/trace-mapping\";\n\n/**\n * Build a sourcemap.\n */\n\nexport default class SourceMap {\n private _map: GenMapping;\n private _rawMappings: Mapping[] | undefined;\n private _sourceFileName: string | undefined;\n\n // Any real line is > 0, so init to 0 is fine.\n private _lastGenLine = 0;\n private _lastSourceLine = 0;\n\n // Source columns can be 0, but we ony check in unison with sourceLine, which\n // inits to an impossible value. So init to 0 is fine.\n private _lastSourceColumn = 0;\n\n public _inputMap: TraceMap;\n\n constructor(\n opts: {\n sourceFileName?: string;\n sourceRoot?: string;\n inputSourceMap?: SourceMapInput;\n },\n code: string | { [sourceFileName: string]: string },\n ) {\n const map = (this._map = new GenMapping({ sourceRoot: opts.sourceRoot }));\n this._sourceFileName = opts.sourceFileName?.replace(/\\\\/g, \"/\");\n this._rawMappings = undefined;\n\n if (opts.inputSourceMap) {\n this._inputMap = new TraceMap(opts.inputSourceMap);\n const resolvedSources = this._inputMap.resolvedSources;\n if (resolvedSources.length) {\n for (let i = 0; i < resolvedSources.length; i++) {\n setSourceContent(\n map,\n resolvedSources[i],\n this._inputMap.sourcesContent?.[i],\n );\n }\n }\n }\n\n if (typeof code === \"string\" && !opts.inputSourceMap) {\n setSourceContent(map, this._sourceFileName, code);\n } else if (typeof code === \"object\") {\n for (const sourceFileName of Object.keys(code)) {\n setSourceContent(\n map,\n sourceFileName.replace(/\\\\/g, \"/\"),\n code[sourceFileName],\n );\n }\n }\n }\n\n /**\n * Get the sourcemap.\n */\n get(): EncodedSourceMap {\n return toEncodedMap(this._map);\n }\n\n getDecoded(): DecodedSourceMap {\n return toDecodedMap(this._map);\n }\n\n getRawMappings(): Mapping[] {\n return (this._rawMappings ||= allMappings(this._map));\n }\n\n /**\n * Mark the current generated position with a source position. May also be passed null line/column\n * values to insert a mapping to nothing.\n */\n\n mark(\n generated: { line: number; column: number },\n line: number,\n column: number,\n identifierName?: string | null,\n identifierNamePos?: { line: number; column: number },\n filename?: string | null,\n ) {\n this._rawMappings = undefined;\n\n let originalMapping: {\n source: string | null;\n name?: string | null;\n line: number | null;\n column: number | null;\n };\n\n if (line != null) {\n if (this._inputMap) {\n // This is the lookup for this mark\n originalMapping = originalPositionFor(this._inputMap, {\n line,\n column,\n });\n\n // If the we found a name, nothing else needs to be done\n // Maybe we're marking a `(` and the input map already had a name attached there,\n // or we're marking a `(` and the sourcemap spanned a `foo(`,\n // or we're marking an identifier, etc.\n if (!originalMapping.name && identifierNamePos) {\n // We're trying to mark a `(` (as that's the only thing that provides\n // an identifierNamePos currently), and we the AST had an identifier attached.\n // Lookup it's original name.\n const originalIdentifierMapping = originalPositionFor(\n this._inputMap,\n identifierNamePos,\n );\n if (originalIdentifierMapping.name) {\n identifierName = originalIdentifierMapping.name;\n }\n }\n } else {\n originalMapping = {\n source: filename?.replace(/\\\\/g, \"/\") || this._sourceFileName,\n line: line,\n column: column,\n };\n }\n }\n\n maybeAddMapping(this._map, {\n name: identifierName,\n generated,\n source: originalMapping?.source,\n original: originalMapping,\n });\n }\n}\n","import type SourceMap from \"./source-map\";\nimport * as charcodes from \"charcodes\";\n\nexport type Pos = {\n line: number;\n column: number;\n};\nexport type Loc = {\n start?: Pos;\n end?: Pos;\n filename?: string;\n};\ntype SourcePos = {\n line: number | undefined;\n column: number | undefined;\n identifierName: string | undefined;\n filename: string | undefined;\n};\ntype InternalSourcePos = SourcePos & { identifierNamePos: Pos };\n\ntype QueueItem = {\n char: number;\n repeat: number;\n line: number | undefined;\n column: number | undefined;\n identifierName: undefined; // Not used, it always undefined.\n identifierNamePos: undefined; // Not used, it always undefined.\n filename: string | undefined;\n};\n\nexport default class Buffer {\n constructor(map?: SourceMap | null) {\n this._map = map;\n\n this._allocQueue();\n }\n\n _map: SourceMap = null;\n _buf = \"\";\n _str = \"\";\n _appendCount = 0;\n _last = 0;\n _queue: QueueItem[] = [];\n _queueCursor = 0;\n _canMarkIdName = true;\n\n _position = {\n line: 1,\n column: 0,\n };\n _sourcePosition: InternalSourcePos = {\n identifierName: undefined,\n identifierNamePos: undefined,\n line: undefined,\n column: undefined,\n filename: undefined,\n };\n\n _allocQueue() {\n const queue = this._queue;\n\n for (let i = 0; i < 16; i++) {\n queue.push({\n char: 0,\n repeat: 1,\n line: undefined,\n column: undefined,\n identifierName: undefined,\n identifierNamePos: undefined,\n filename: \"\",\n });\n }\n }\n\n _pushQueue(\n char: number,\n repeat: number,\n line: number | undefined,\n column: number | undefined,\n filename: string | undefined,\n ) {\n const cursor = this._queueCursor;\n if (cursor === this._queue.length) {\n this._allocQueue();\n }\n const item = this._queue[cursor];\n item.char = char;\n item.repeat = repeat;\n item.line = line;\n item.column = column;\n item.filename = filename;\n\n this._queueCursor++;\n }\n\n _popQueue(): QueueItem {\n if (this._queueCursor === 0) {\n throw new Error(\"Cannot pop from empty queue\");\n }\n return this._queue[--this._queueCursor];\n }\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get() {\n this._flush();\n\n const map = this._map;\n const result = {\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n code: (this._buf + this._str).trimRight(),\n // Decoded sourcemap is free to generate.\n decodedMap: map?.getDecoded(),\n // Used as a marker for backwards compatibility. We moved input map merging\n // into the generator. We cannot merge the input map a second time, so the\n // presence of this field tells us we've already done the work.\n get __mergedMap() {\n return this.map;\n },\n // Encoding the sourcemap is moderately CPU expensive.\n get map() {\n const resultMap = map ? map.get() : null;\n result.map = resultMap;\n return resultMap;\n },\n set map(value) {\n Object.defineProperty(result, \"map\", { value, writable: true });\n },\n // Retrieving the raw mappings is very memory intensive.\n get rawMappings() {\n const mappings = map?.getRawMappings();\n result.rawMappings = mappings;\n return mappings;\n },\n set rawMappings(value) {\n Object.defineProperty(result, \"rawMappings\", { value, writable: true });\n },\n };\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(str: string, maybeNewline: boolean): void {\n this._flush();\n\n this._append(str, this._sourcePosition, maybeNewline);\n }\n\n appendChar(char: number): void {\n this._flush();\n this._appendChar(char, 1, this._sourcePosition);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n queue(char: number): void {\n // Drop trailing spaces when a newline is inserted.\n if (char === charcodes.lineFeed) {\n while (this._queueCursor !== 0) {\n const char = this._queue[this._queueCursor - 1].char;\n if (char !== charcodes.space && char !== charcodes.tab) {\n break;\n }\n\n this._queueCursor--;\n }\n }\n\n const sourcePosition = this._sourcePosition;\n this._pushQueue(\n char,\n 1,\n sourcePosition.line,\n sourcePosition.column,\n sourcePosition.filename,\n );\n }\n\n /**\n * Same as queue, but this indentation will never have a sourcemap marker.\n */\n queueIndentation(char: number, repeat: number): void {\n this._pushQueue(char, repeat, undefined, undefined, undefined);\n }\n\n _flush(): void {\n const queueCursor = this._queueCursor;\n const queue = this._queue;\n for (let i = 0; i < queueCursor; i++) {\n const item: QueueItem = queue[i];\n this._appendChar(item.char, item.repeat, item);\n }\n this._queueCursor = 0;\n }\n\n _appendChar(\n char: number,\n repeat: number,\n sourcePos: InternalSourcePos,\n ): void {\n this._last = char;\n\n this._str +=\n repeat > 1\n ? String.fromCharCode(char).repeat(repeat)\n : String.fromCharCode(char);\n\n if (char !== charcodes.lineFeed) {\n this._mark(\n sourcePos.line,\n sourcePos.column,\n sourcePos.identifierName,\n sourcePos.identifierNamePos,\n sourcePos.filename,\n );\n this._position.column += repeat;\n } else {\n this._position.line++;\n this._position.column = 0;\n }\n\n if (this._canMarkIdName) {\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n }\n\n _append(\n str: string,\n sourcePos: InternalSourcePos,\n maybeNewline: boolean,\n ): void {\n const len = str.length;\n const position = this._position;\n\n this._last = str.charCodeAt(len - 1);\n\n if (++this._appendCount > 4096) {\n +this._str; // Unexplainable huge performance boost. Ref: https://github.com/davidmarkclements/flatstr License: MIT\n this._buf += this._str;\n this._str = str;\n this._appendCount = 0;\n } else {\n this._str += str;\n }\n\n if (!maybeNewline && !this._map) {\n position.column += len;\n return;\n }\n\n const { column, identifierName, identifierNamePos, filename } = sourcePos;\n let line = sourcePos.line;\n\n if (\n (identifierName != null || identifierNamePos != null) &&\n this._canMarkIdName\n ) {\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n\n // Search for newline chars. We search only for `\\n`, since both `\\r` and\n // `\\r\\n` are normalized to `\\n` during parse. We exclude `\\u2028` and\n // `\\u2029` for performance reasons, they're so uncommon that it's probably\n // ok. It's also unclear how other sourcemap utilities handle them...\n let i = str.indexOf(\"\\n\");\n let last = 0;\n\n // If the string starts with a newline char, then adding a mark is redundant.\n // This catches both \"no newlines\" and \"newline after several chars\".\n if (i !== 0) {\n this._mark(line, column, identifierName, identifierNamePos, filename);\n }\n\n // Now, find each remaining newline char in the string.\n while (i !== -1) {\n position.line++;\n position.column = 0;\n last = i + 1;\n\n // We mark the start of each line, which happens directly after this newline char\n // unless this is the last char.\n // When manually adding multi-line content (such as a comment), `line` will be `undefined`.\n if (last < len && line !== undefined) {\n this._mark(++line, 0, null, null, filename);\n }\n i = str.indexOf(\"\\n\", last);\n }\n position.column += len - last;\n }\n\n _mark(\n line: number | undefined,\n column: number | undefined,\n identifierName: string | undefined,\n identifierNamePos: Pos | undefined,\n filename: string | undefined,\n ): void {\n this._map?.mark(\n this._position,\n line,\n column,\n identifierName,\n identifierNamePos,\n filename,\n );\n }\n\n removeTrailingNewline(): void {\n const queueCursor = this._queueCursor;\n if (\n queueCursor !== 0 &&\n this._queue[queueCursor - 1].char === charcodes.lineFeed\n ) {\n this._queueCursor--;\n }\n }\n\n removeLastSemicolon(): void {\n const queueCursor = this._queueCursor;\n if (\n queueCursor !== 0 &&\n this._queue[queueCursor - 1].char === charcodes.semicolon\n ) {\n this._queueCursor--;\n }\n }\n\n getLastChar(): number {\n const queueCursor = this._queueCursor;\n return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last;\n }\n\n /**\n * This will only detect at most 1 newline after a call to `flush()`,\n * but this has not been found so far, and an accurate count can be achieved if needed later.\n */\n getNewlineCount(): number {\n const queueCursor = this._queueCursor;\n let count = 0;\n if (queueCursor === 0) return this._last === charcodes.lineFeed ? 1 : 0;\n for (let i = queueCursor - 1; i >= 0; i--) {\n if (this._queue[i].char !== charcodes.lineFeed) {\n break;\n }\n count++;\n }\n return count === queueCursor && this._last === charcodes.lineFeed\n ? count + 1\n : count;\n }\n\n /**\n * check if current _last + queue ends with newline, return the character before newline\n *\n * @param {*} ch\n * @memberof Buffer\n */\n endsWithCharAndNewline(): number {\n const queue = this._queue;\n const queueCursor = this._queueCursor;\n if (queueCursor !== 0) {\n // every element in queue is one-length whitespace string\n const lastCp = queue[queueCursor - 1].char;\n if (lastCp !== charcodes.lineFeed) return;\n if (queueCursor > 1) {\n return queue[queueCursor - 2].char;\n } else {\n return this._last;\n }\n }\n // We assume that everything being matched is at most a single token plus some whitespace,\n // which everything currently is, but otherwise we'd have to expand _last or check _buf.\n }\n\n hasContent(): boolean {\n return this._queueCursor !== 0 || !!this._last;\n }\n\n /**\n * Certain sourcemap usecases expect mappings to be more accurate than\n * Babel's generic sourcemap handling allows. For now, we special-case\n * identifiers to allow for the primary cases to work.\n * The goal of this line is to ensure that the map output from Babel will\n * have an exact range on identifiers in the output code. Without this\n * line, Babel would potentially include some number of trailing tokens\n * that are printed after the identifier, but before another location has\n * been assigned.\n * This allows tooling like Rollup and Webpack to more accurately perform\n * their own transformations. Most importantly, this allows the import/export\n * transformations performed by those tools to loose less information when\n * applying their own transformations on top of the code and map results\n * generated by Babel itself.\n *\n * The primary example of this is the snippet:\n *\n * import mod from \"mod\";\n * mod();\n *\n * With this line, there will be one mapping range over \"mod\" and another\n * over \"();\", where previously it would have been a single mapping.\n */\n exactSource(loc: Loc | undefined, cb: () => void) {\n if (!this._map) {\n cb();\n return;\n }\n\n this.source(\"start\", loc);\n // @ts-expect-error identifierName is not defined\n const identifierName = loc.identifierName;\n const sourcePos = this._sourcePosition;\n if (identifierName) {\n this._canMarkIdName = false;\n sourcePos.identifierName = identifierName;\n }\n cb();\n\n if (identifierName) {\n this._canMarkIdName = true;\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n this.source(\"end\", loc);\n }\n\n /**\n * Sets a given position as the current source location so generated code after this call\n * will be given this position in the sourcemap.\n */\n\n source(prop: \"start\" | \"end\", loc: Loc | undefined): void {\n if (!this._map) return;\n\n // Since this is called extremely often, we re-use the same _sourcePosition\n // object for the whole lifetime of the buffer.\n this._normalizePosition(prop, loc, 0);\n }\n\n sourceWithOffset(\n prop: \"start\" | \"end\",\n loc: Loc | undefined,\n columnOffset: number,\n ): void {\n if (!this._map) return;\n\n this._normalizePosition(prop, loc, columnOffset);\n }\n\n /**\n * Call a callback with a specific source location\n */\n\n withSource(prop: \"start\" | \"end\", loc: Loc, cb: () => void): void {\n if (this._map) {\n this.source(prop, loc);\n }\n\n cb();\n }\n\n _normalizePosition(prop: \"start\" | \"end\", loc: Loc, columnOffset: number) {\n const pos = loc[prop];\n const target = this._sourcePosition;\n\n if (pos) {\n target.line = pos.line;\n // TODO: Fix https://github.com/babel/babel/issues/15712 in downstream\n target.column = Math.max(pos.column + columnOffset, 0);\n target.filename = loc.filename;\n }\n }\n\n getCurrentColumn(): number {\n const queue = this._queue;\n const queueCursor = this._queueCursor;\n\n let lastIndex = -1;\n let len = 0;\n for (let i = 0; i < queueCursor; i++) {\n const item = queue[i];\n if (item.char === charcodes.lineFeed) {\n lastIndex = len;\n }\n len += item.repeat;\n }\n\n return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex;\n }\n\n getCurrentLine(): number {\n let count = 0;\n\n const queue = this._queue;\n for (let i = 0; i < this._queueCursor; i++) {\n if (queue[i].char === charcodes.lineFeed) {\n count++;\n }\n }\n\n return this._position.line + count;\n }\n}\n","import {\n FLIPPED_ALIAS_KEYS,\n isArrayExpression,\n isAssignmentExpression,\n isBinary,\n isBlockStatement,\n isCallExpression,\n isFunction,\n isIdentifier,\n isLiteral,\n isMemberExpression,\n isObjectExpression,\n isOptionalCallExpression,\n isOptionalMemberExpression,\n isStringLiteral,\n} from \"@babel/types\";\nimport * as charCodes from \"charcodes\";\n\nimport type { NodeHandlers } from \"./index\";\n\nimport type * as t from \"@babel/types\";\n\nconst enum WhitespaceFlag {\n before = 1 << 0,\n after = 1 << 1,\n}\n\nexport type { WhitespaceFlag };\n\nfunction crawlInternal(\n node: t.Node,\n state: { hasCall: boolean; hasFunction: boolean; hasHelper: boolean },\n) {\n if (!node) return state;\n\n if (isMemberExpression(node) || isOptionalMemberExpression(node)) {\n crawlInternal(node.object, state);\n if (node.computed) crawlInternal(node.property, state);\n } else if (isBinary(node) || isAssignmentExpression(node)) {\n crawlInternal(node.left, state);\n crawlInternal(node.right, state);\n } else if (isCallExpression(node) || isOptionalCallExpression(node)) {\n state.hasCall = true;\n crawlInternal(node.callee, state);\n } else if (isFunction(node)) {\n state.hasFunction = true;\n } else if (isIdentifier(node)) {\n state.hasHelper =\n // @ts-expect-error todo(flow->ts): node.callee is not really expected here…\n state.hasHelper || (node.callee && isHelper(node.callee));\n }\n\n return state;\n}\n\n/**\n * Crawl a node to test if it contains a CallExpression, a Function, or a Helper.\n *\n * @example\n * crawl(node)\n * // { hasCall: false, hasFunction: true, hasHelper: false }\n */\n\nfunction crawl(node: t.Node) {\n return crawlInternal(node, {\n hasCall: false,\n hasFunction: false,\n hasHelper: false,\n });\n}\n\n/**\n * Test if a node is or has a helper.\n */\n\nfunction isHelper(node: t.Node): boolean {\n if (!node) return false;\n\n if (isMemberExpression(node)) {\n return isHelper(node.object) || isHelper(node.property);\n } else if (isIdentifier(node)) {\n return (\n node.name === \"require\" ||\n node.name.charCodeAt(0) === charCodes.underscore\n );\n } else if (isCallExpression(node)) {\n return isHelper(node.callee);\n } else if (isBinary(node) || isAssignmentExpression(node)) {\n return (\n (isIdentifier(node.left) && isHelper(node.left)) || isHelper(node.right)\n );\n } else {\n return false;\n }\n}\n\nfunction isType(node: t.Node) {\n return (\n isLiteral(node) ||\n isObjectExpression(node) ||\n isArrayExpression(node) ||\n isIdentifier(node) ||\n isMemberExpression(node)\n );\n}\n\n/**\n * Tests for node types that need whitespace.\n */\n\nexport const nodes: NodeHandlers = {\n /**\n * Test if AssignmentExpression needs whitespace.\n */\n\n AssignmentExpression(node: t.AssignmentExpression): WhitespaceFlag {\n const state = crawl(node.right);\n if ((state.hasCall && state.hasHelper) || state.hasFunction) {\n return state.hasFunction\n ? WhitespaceFlag.before | WhitespaceFlag.after\n : WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if SwitchCase needs whitespace.\n */\n\n SwitchCase(node: t.SwitchCase, parent: t.SwitchStatement): WhitespaceFlag {\n return (\n (!!node.consequent.length || parent.cases[0] === node\n ? WhitespaceFlag.before\n : 0) |\n (!node.consequent.length && parent.cases[parent.cases.length - 1] === node\n ? WhitespaceFlag.after\n : 0)\n );\n },\n\n /**\n * Test if LogicalExpression needs whitespace.\n */\n\n LogicalExpression(node: t.LogicalExpression): WhitespaceFlag {\n if (isFunction(node.left) || isFunction(node.right)) {\n return WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if Literal needs whitespace.\n */\n\n Literal(node: t.Literal): WhitespaceFlag {\n if (isStringLiteral(node) && node.value === \"use strict\") {\n return WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if CallExpressionish needs whitespace.\n */\n\n CallExpression(node: t.CallExpression): WhitespaceFlag {\n if (isFunction(node.callee) || isHelper(node)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n },\n\n OptionalCallExpression(node: t.OptionalCallExpression): WhitespaceFlag {\n if (isFunction(node.callee)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if VariableDeclaration needs whitespace.\n */\n\n VariableDeclaration(node: t.VariableDeclaration): WhitespaceFlag {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n\n let enabled = isHelper(declar.id) && !isType(declar.init);\n if (!enabled && declar.init) {\n const state = crawl(declar.init);\n enabled = (isHelper(declar.init) && state.hasCall) || state.hasFunction;\n }\n\n if (enabled) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n }\n },\n\n /**\n * Test if IfStatement needs whitespace.\n */\n\n IfStatement(node: t.IfStatement): WhitespaceFlag {\n if (isBlockStatement(node.consequent)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n },\n};\n\n/**\n * Test if Property needs whitespace.\n */\n\nnodes.ObjectProperty =\n nodes.ObjectTypeProperty =\n nodes.ObjectMethod =\n function (\n node: t.ObjectProperty | t.ObjectTypeProperty | t.ObjectMethod,\n parent: t.ObjectExpression,\n ): WhitespaceFlag {\n if (parent.properties[0] === node) {\n return WhitespaceFlag.before;\n }\n };\n\nnodes.ObjectTypeCallProperty = function (\n node: t.ObjectTypeCallProperty,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (parent.callProperties[0] === node && !parent.properties?.length) {\n return WhitespaceFlag.before;\n }\n};\n\nnodes.ObjectTypeIndexer = function (\n node: t.ObjectTypeIndexer,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (\n parent.indexers[0] === node &&\n !parent.properties?.length &&\n !parent.callProperties?.length\n ) {\n return WhitespaceFlag.before;\n }\n};\n\nnodes.ObjectTypeInternalSlot = function (\n node: t.ObjectTypeInternalSlot,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (\n parent.internalSlots[0] === node &&\n !parent.properties?.length &&\n !parent.callProperties?.length &&\n !parent.indexers?.length\n ) {\n return WhitespaceFlag.before;\n }\n};\n\n/**\n * Add whitespace tests for nodes and their aliases.\n */\n\n(\n [\n [\"Function\", true],\n [\"Class\", true],\n [\"Loop\", true],\n [\"LabeledStatement\", true],\n [\"SwitchStatement\", true],\n [\"TryStatement\", true],\n ] as const\n).forEach(function ([type, amounts]) {\n [type as string]\n .concat(FLIPPED_ALIAS_KEYS[type] || [])\n .forEach(function (type) {\n const ret = amounts ? WhitespaceFlag.before | WhitespaceFlag.after : 0;\n nodes[type] = () => ret;\n });\n});\n","import {\n isArrayTypeAnnotation,\n isArrowFunctionExpression,\n isAssignmentExpression,\n isAwaitExpression,\n isBinary,\n isBinaryExpression,\n isUpdateExpression,\n isCallExpression,\n isClass,\n isClassExpression,\n isConditional,\n isConditionalExpression,\n isExportDeclaration,\n isExportDefaultDeclaration,\n isExpressionStatement,\n isFor,\n isForInStatement,\n isForOfStatement,\n isForStatement,\n isFunctionExpression,\n isIfStatement,\n isIndexedAccessType,\n isIntersectionTypeAnnotation,\n isLogicalExpression,\n isMemberExpression,\n isNewExpression,\n isNullableTypeAnnotation,\n isObjectPattern,\n isOptionalCallExpression,\n isOptionalMemberExpression,\n isReturnStatement,\n isSequenceExpression,\n isSwitchStatement,\n isTSArrayType,\n isTSAsExpression,\n isTSInstantiationExpression,\n isTSIntersectionType,\n isTSNonNullExpression,\n isTSOptionalType,\n isTSRestType,\n isTSTypeAssertion,\n isTSUnionType,\n isTaggedTemplateExpression,\n isThrowStatement,\n isTypeAnnotation,\n isUnaryLike,\n isUnionTypeAnnotation,\n isVariableDeclarator,\n isWhileStatement,\n isYieldExpression,\n isTSSatisfiesExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nconst PRECEDENCE = {\n \"||\": 0,\n \"??\": 0,\n \"|>\": 0,\n \"&&\": 1,\n \"|\": 2,\n \"^\": 3,\n \"&\": 4,\n \"==\": 5,\n \"===\": 5,\n \"!=\": 5,\n \"!==\": 5,\n \"<\": 6,\n \">\": 6,\n \"<=\": 6,\n \">=\": 6,\n in: 6,\n instanceof: 6,\n \">>\": 7,\n \"<<\": 7,\n \">>>\": 7,\n \"+\": 8,\n \"-\": 8,\n \"*\": 9,\n \"/\": 9,\n \"%\": 9,\n \"**\": 10,\n};\n\nconst enum CheckParam {\n expressionStatement = 1 << 0,\n arrowBody = 1 << 1,\n exportDefault = 1 << 2,\n forHead = 1 << 3,\n forInHead = 1 << 4,\n forOfHead = 1 << 5,\n}\n\nfunction isTSTypeExpression(node: t.Node) {\n return (\n isTSAsExpression(node) ||\n isTSSatisfiesExpression(node) ||\n isTSTypeAssertion(node)\n );\n}\n\nconst isClassExtendsClause = (\n node: t.Node,\n parent: t.Node,\n): parent is t.Class => isClass(parent, { superClass: node });\n\nconst hasPostfixPart = (node: t.Node, parent: t.Node) =>\n ((isMemberExpression(parent) || isOptionalMemberExpression(parent)) &&\n parent.object === node) ||\n ((isCallExpression(parent) ||\n isOptionalCallExpression(parent) ||\n isNewExpression(parent)) &&\n parent.callee === node) ||\n (isTaggedTemplateExpression(parent) && parent.tag === node) ||\n isTSNonNullExpression(parent);\n\nexport function NullableTypeAnnotation(\n node: t.NullableTypeAnnotation,\n parent: t.Node,\n): boolean {\n return isArrayTypeAnnotation(parent);\n}\n\nexport function FunctionTypeAnnotation(\n node: t.FunctionTypeAnnotation,\n parent: t.Node,\n printStack: Array,\n): boolean {\n if (printStack.length < 3) return;\n\n return (\n // (() => A) | (() => B)\n isUnionTypeAnnotation(parent) ||\n // (() => A) & (() => B)\n isIntersectionTypeAnnotation(parent) ||\n // (() => A)[]\n isArrayTypeAnnotation(parent) ||\n // (A: T): (T => T[]) => B => [A, B]\n (isTypeAnnotation(parent) &&\n // Check grandparent\n isArrowFunctionExpression(printStack[printStack.length - 3]))\n );\n}\n\nexport function UpdateExpression(\n node: t.UpdateExpression,\n parent: t.Node,\n): boolean {\n return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);\n}\n\nexport function ObjectExpression(\n node: t.ObjectExpression,\n parent: t.Node,\n printStack: Array,\n): boolean {\n return isFirstInContext(\n printStack,\n CheckParam.expressionStatement | CheckParam.arrowBody,\n );\n}\n\nexport function DoExpression(\n node: t.DoExpression,\n parent: t.Node,\n printStack: Array,\n): boolean {\n // `async do` can start an expression statement\n return (\n !node.async && isFirstInContext(printStack, CheckParam.expressionStatement)\n );\n}\n\nexport function Binary(node: t.BinaryExpression, parent: t.Node): boolean {\n if (\n node.operator === \"**\" &&\n isBinaryExpression(parent, { operator: \"**\" })\n ) {\n return parent.left === node;\n }\n\n if (isClassExtendsClause(node, parent)) {\n return true;\n }\n\n if (\n hasPostfixPart(node, parent) ||\n isUnaryLike(parent) ||\n isAwaitExpression(parent)\n ) {\n return true;\n }\n\n if (isBinary(parent)) {\n const parentOp = parent.operator;\n const parentPos = PRECEDENCE[parentOp];\n\n const nodeOp = node.operator;\n const nodePos = PRECEDENCE[nodeOp];\n\n if (\n // Logical expressions with the same precedence don't need parens.\n (parentPos === nodePos &&\n parent.right === node &&\n !isLogicalExpression(parent)) ||\n parentPos > nodePos\n ) {\n return true;\n }\n }\n}\n\nexport function UnionTypeAnnotation(\n node: t.UnionTypeAnnotation,\n parent: t.Node,\n): boolean {\n return (\n isArrayTypeAnnotation(parent) ||\n isNullableTypeAnnotation(parent) ||\n isIntersectionTypeAnnotation(parent) ||\n isUnionTypeAnnotation(parent)\n );\n}\n\nexport { UnionTypeAnnotation as IntersectionTypeAnnotation };\n\nexport function OptionalIndexedAccessType(\n node: t.OptionalIndexedAccessType,\n parent: t.Node,\n): boolean {\n return isIndexedAccessType(parent, { objectType: node });\n}\n\nexport function TSAsExpression() {\n return true;\n}\n\nexport {\n TSAsExpression as TSSatisfiesExpression,\n TSAsExpression as TSTypeAssertion,\n};\n\nexport function TSUnionType(node: t.TSUnionType, parent: t.Node): boolean {\n return (\n isTSArrayType(parent) ||\n isTSOptionalType(parent) ||\n isTSIntersectionType(parent) ||\n isTSUnionType(parent) ||\n isTSRestType(parent)\n );\n}\n\nexport { TSUnionType as TSIntersectionType };\n\nexport function TSInferType(node: t.TSInferType, parent: t.Node): boolean {\n return isTSArrayType(parent) || isTSOptionalType(parent);\n}\n\nexport function TSInstantiationExpression(\n node: t.TSInstantiationExpression,\n parent: t.Node,\n) {\n return (\n (isCallExpression(parent) ||\n isOptionalCallExpression(parent) ||\n isNewExpression(parent) ||\n isTSInstantiationExpression(parent)) &&\n !!parent.typeParameters\n );\n}\n\nexport function BinaryExpression(\n node: t.BinaryExpression,\n parent: t.Node,\n): boolean {\n // let i = (1 in []);\n // for ((1 in []);;);\n return (\n node.operator === \"in\" && (isVariableDeclarator(parent) || isFor(parent))\n );\n}\n\nexport function SequenceExpression(\n node: t.SequenceExpression,\n parent: t.Node,\n): boolean {\n if (\n // Although parentheses wouldn't hurt around sequence\n // expressions in the head of for loops, traditional style\n // dictates that e.g. i++, j++ should not be wrapped with\n // parentheses.\n isForStatement(parent) ||\n isThrowStatement(parent) ||\n isReturnStatement(parent) ||\n (isIfStatement(parent) && parent.test === node) ||\n (isWhileStatement(parent) && parent.test === node) ||\n (isForInStatement(parent) && parent.right === node) ||\n (isSwitchStatement(parent) && parent.discriminant === node) ||\n (isExpressionStatement(parent) && parent.expression === node)\n ) {\n return false;\n }\n\n // Otherwise err on the side of overparenthesization, adding\n // explicit exceptions above if this proves overzealous.\n return true;\n}\n\nexport function YieldExpression(\n node: t.YieldExpression,\n parent: t.Node,\n): boolean {\n return (\n isBinary(parent) ||\n isUnaryLike(parent) ||\n hasPostfixPart(node, parent) ||\n (isAwaitExpression(parent) && isYieldExpression(node)) ||\n (isConditionalExpression(parent) && node === parent.test) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport { YieldExpression as AwaitExpression };\n\nexport function ClassExpression(\n node: t.ClassExpression,\n parent: t.Node,\n printStack: Array,\n): boolean {\n return isFirstInContext(\n printStack,\n CheckParam.expressionStatement | CheckParam.exportDefault,\n );\n}\n\nexport function UnaryLike(\n node:\n | t.UnaryLike\n | t.ArrowFunctionExpression\n | t.ConditionalExpression\n | t.AssignmentExpression,\n parent: t.Node,\n): boolean {\n return (\n hasPostfixPart(node, parent) ||\n isBinaryExpression(parent, { operator: \"**\", left: node }) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function FunctionExpression(\n node: t.FunctionExpression,\n parent: t.Node,\n printStack: Array,\n): boolean {\n return isFirstInContext(\n printStack,\n CheckParam.expressionStatement | CheckParam.exportDefault,\n );\n}\n\nexport function ArrowFunctionExpression(\n node: t.ArrowFunctionExpression,\n parent: t.Node,\n): boolean {\n return isExportDeclaration(parent) || ConditionalExpression(node, parent);\n}\n\nexport function ConditionalExpression(\n node:\n | t.ConditionalExpression\n | t.ArrowFunctionExpression\n | t.AssignmentExpression,\n parent?: t.Node,\n): boolean {\n if (\n isUnaryLike(parent) ||\n isBinary(parent) ||\n isConditionalExpression(parent, { test: node }) ||\n isAwaitExpression(parent) ||\n isTSTypeExpression(parent)\n ) {\n return true;\n }\n\n return UnaryLike(node, parent);\n}\n\nexport function OptionalMemberExpression(\n node: t.OptionalMemberExpression,\n parent: t.Node,\n): boolean {\n return (\n isCallExpression(parent, { callee: node }) ||\n isMemberExpression(parent, { object: node })\n );\n}\n\nexport { OptionalMemberExpression as OptionalCallExpression };\n\nexport function AssignmentExpression(\n node: t.AssignmentExpression,\n parent: t.Node,\n): boolean {\n if (isObjectPattern(node.left)) {\n return true;\n } else {\n return ConditionalExpression(node, parent);\n }\n}\n\nexport function LogicalExpression(\n node: t.LogicalExpression,\n parent: t.Node,\n): boolean {\n if (isTSTypeExpression(parent)) return true;\n switch (node.operator) {\n case \"||\":\n if (!isLogicalExpression(parent)) return false;\n return parent.operator === \"??\" || parent.operator === \"&&\";\n case \"&&\":\n return isLogicalExpression(parent, { operator: \"??\" });\n case \"??\":\n return isLogicalExpression(parent) && parent.operator !== \"??\";\n }\n}\n\nexport function Identifier(\n node: t.Identifier,\n parent: t.Node,\n printStack: Array,\n): boolean {\n // 13.15.2 AssignmentExpression RS: Evaluation\n // (fn) = function () {};\n if (\n node.extra?.parenthesized &&\n isAssignmentExpression(parent, { left: node }) &&\n (isFunctionExpression(parent.right) || isClassExpression(parent.right)) &&\n parent.right.id == null\n ) {\n return true;\n }\n // Non-strict code allows the identifier `let`, but it cannot occur as-is in\n // certain contexts to avoid ambiguity with contextual keyword `let`.\n if (node.name === \"let\") {\n // Some contexts only forbid `let [`, so check if the next token would\n // be the left bracket of a computed member expression.\n const isFollowedByBracket =\n isMemberExpression(parent, {\n object: node,\n computed: true,\n }) ||\n isOptionalMemberExpression(parent, {\n object: node,\n computed: true,\n optional: false,\n });\n return isFirstInContext(\n printStack,\n isFollowedByBracket\n ? CheckParam.expressionStatement |\n CheckParam.forHead |\n CheckParam.forInHead |\n CheckParam.forOfHead\n : CheckParam.forOfHead,\n );\n }\n\n // ECMAScript specifically forbids a for-of loop from starting with the\n // token sequence `for (async of`, because it would be ambiguous with\n // `for (async of => {};;)`, so we need to add extra parentheses.\n //\n // If the parent is a for-await-of loop (i.e. parent.await === true), the\n // parentheses aren't strictly needed, but we add them anyway because\n // some tools (including earlier Babel versions) can't parse\n // `for await (async of [])` without them.\n return (\n node.name === \"async\" && isForOfStatement(parent) && node === parent.left\n );\n}\n\n// Walk up the print stack to determine if our node can come first\n// in a particular context.\nfunction isFirstInContext(\n printStack: Array,\n checkParam: CheckParam,\n): boolean {\n const expressionStatement = checkParam & CheckParam.expressionStatement;\n const arrowBody = checkParam & CheckParam.arrowBody;\n const exportDefault = checkParam & CheckParam.exportDefault;\n const forHead = checkParam & CheckParam.forHead;\n const forInHead = checkParam & CheckParam.forInHead;\n const forOfHead = checkParam & CheckParam.forOfHead;\n\n let i = printStack.length - 1;\n if (i <= 0) return;\n let node = printStack[i];\n i--;\n let parent = printStack[i];\n while (i >= 0) {\n if (\n (expressionStatement &&\n isExpressionStatement(parent, { expression: node })) ||\n (exportDefault &&\n isExportDefaultDeclaration(parent, { declaration: node })) ||\n (arrowBody && isArrowFunctionExpression(parent, { body: node })) ||\n (forHead && isForStatement(parent, { init: node })) ||\n (forInHead && isForInStatement(parent, { left: node })) ||\n (forOfHead && isForOfStatement(parent, { left: node }))\n ) {\n return true;\n }\n\n if (\n i > 0 &&\n ((hasPostfixPart(node, parent) && !isNewExpression(parent)) ||\n (isSequenceExpression(parent) && parent.expressions[0] === node) ||\n (isUpdateExpression(parent) && !parent.prefix) ||\n isConditional(parent, { test: node }) ||\n isBinary(parent, { left: node }) ||\n isAssignmentExpression(parent, { left: node }))\n ) {\n node = parent;\n i--;\n parent = printStack[i];\n } else {\n return false;\n }\n }\n\n return false;\n}\n","import * as whitespace from \"./whitespace\";\nimport * as parens from \"./parentheses\";\nimport {\n FLIPPED_ALIAS_KEYS,\n isCallExpression,\n isExpressionStatement,\n isMemberExpression,\n isNewExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport type { WhitespaceFlag } from \"./whitespace\";\n\nexport type NodeHandlers = {\n [K in string]?: (\n node: K extends t.Node[\"type\"] ? Extract : t.Node,\n // todo:\n // node: K extends keyof typeof t\n // ? Extract\n // : t.Node,\n parent: t.Node,\n stack: t.Node[],\n ) => R;\n};\n\nfunction expandAliases(obj: NodeHandlers) {\n const newObj: NodeHandlers = {};\n\n function add(\n type: string,\n func: (node: t.Node, parent: t.Node, stack: t.Node[]) => R,\n ) {\n const fn = newObj[type];\n newObj[type] = fn\n ? function (node, parent, stack) {\n const result = fn(node, parent, stack);\n\n return result == null ? func(node, parent, stack) : result;\n }\n : func;\n }\n\n for (const type of Object.keys(obj)) {\n const aliases = FLIPPED_ALIAS_KEYS[type];\n if (aliases) {\n for (const alias of aliases) {\n add(alias, obj[type]);\n }\n } else {\n add(type, obj[type]);\n }\n }\n\n return newObj;\n}\n\n// Rather than using `t.is` on each object property, we pre-expand any type aliases\n// into concrete types so that the 'find' call below can be as fast as possible.\nconst expandedParens = expandAliases(parens);\nconst expandedWhitespaceNodes = expandAliases(whitespace.nodes);\n\nfunction find(\n obj: NodeHandlers,\n node: t.Node,\n parent: t.Node,\n printStack?: t.Node[],\n): R | null {\n const fn = obj[node.type];\n return fn ? fn(node, parent, printStack) : null;\n}\n\nfunction isOrHasCallExpression(node: t.Node): boolean {\n if (isCallExpression(node)) {\n return true;\n }\n\n return isMemberExpression(node) && isOrHasCallExpression(node.object);\n}\n\nexport function needsWhitespace(\n node: t.Node,\n parent: t.Node,\n type: WhitespaceFlag,\n): boolean {\n if (!node) return false;\n\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n const flag = find(expandedWhitespaceNodes, node, parent);\n\n if (typeof flag === \"number\") {\n return (flag & type) !== 0;\n }\n\n return false;\n}\n\nexport function needsWhitespaceBefore(node: t.Node, parent: t.Node) {\n return needsWhitespace(node, parent, 1);\n}\n\nexport function needsWhitespaceAfter(node: t.Node, parent: t.Node) {\n return needsWhitespace(node, parent, 2);\n}\n\nexport function needsParens(\n node: t.Node,\n parent: t.Node,\n printStack?: t.Node[],\n) {\n if (!parent) return false;\n\n if (isNewExpression(parent) && parent.callee === node) {\n if (isOrHasCallExpression(node)) return true;\n }\n\n return find(expandedParens, node, parent, printStack);\n}\n","import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport function TaggedTemplateExpression(\n this: Printer,\n node: t.TaggedTemplateExpression,\n) {\n this.print(node.tag, node);\n this.print(node.typeParameters, node); // TS\n this.print(node.quasi, node);\n}\n\nexport function TemplateElement(\n this: Printer,\n node: t.TemplateElement,\n parent: t.TemplateLiteral,\n) {\n const isFirst = parent.quasis[0] === node;\n const isLast = parent.quasis[parent.quasis.length - 1] === node;\n\n const value = (isFirst ? \"`\" : \"}\") + node.value.raw + (isLast ? \"`\" : \"${\");\n\n this.token(value, true);\n}\n\nexport function TemplateLiteral(this: Printer, node: t.TemplateLiteral) {\n const quasis = node.quasis;\n\n for (let i = 0; i < quasis.length; i++) {\n this.print(quasis[i], node);\n\n if (i + 1 < quasis.length) {\n this.print(node.expressions[i], node);\n }\n }\n}\n","import type Printer from \"../printer\";\nimport {\n isCallExpression,\n isLiteral,\n isMemberExpression,\n isNewExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport * as n from \"../node\";\n\nexport function UnaryExpression(this: Printer, node: t.UnaryExpression) {\n const { operator } = node;\n if (\n operator === \"void\" ||\n operator === \"delete\" ||\n operator === \"typeof\" ||\n // throwExpressions\n operator === \"throw\"\n ) {\n this.word(operator);\n this.space();\n } else {\n this.token(operator);\n }\n\n this.print(node.argument, node);\n}\n\nexport function DoExpression(this: Printer, node: t.DoExpression) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n}\n\nexport function ParenthesizedExpression(\n this: Printer,\n node: t.ParenthesizedExpression,\n) {\n this.token(\"(\");\n this.print(node.expression, node);\n this.rightParens(node);\n}\n\nexport function UpdateExpression(this: Printer, node: t.UpdateExpression) {\n if (node.prefix) {\n this.token(node.operator);\n this.print(node.argument, node);\n } else {\n this.printTerminatorless(node.argument, node, true);\n this.token(node.operator);\n }\n}\n\nexport function ConditionalExpression(\n this: Printer,\n node: t.ConditionalExpression,\n) {\n this.print(node.test, node);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent, node);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate, node);\n}\n\nexport function NewExpression(\n this: Printer,\n node: t.NewExpression,\n parent: t.Node,\n) {\n this.word(\"new\");\n this.space();\n this.print(node.callee, node);\n if (\n this.format.minified &&\n node.arguments.length === 0 &&\n !node.optional &&\n !isCallExpression(parent, { callee: node }) &&\n !isMemberExpression(parent) &&\n !isNewExpression(parent)\n ) {\n return;\n }\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n\n if (node.optional) {\n // TODO: This can never happen\n this.token(\"?.\");\n }\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.rightParens(node);\n}\n\nexport function SequenceExpression(this: Printer, node: t.SequenceExpression) {\n this.printList(node.expressions, node);\n}\n\nexport function ThisExpression(this: Printer) {\n this.word(\"this\");\n}\n\nexport function Super(this: Printer) {\n this.word(\"super\");\n}\n\nfunction isDecoratorMemberExpression(\n node: t.Expression | t.Super | t.V8IntrinsicIdentifier,\n): boolean {\n switch (node.type) {\n case \"Identifier\":\n return true;\n case \"MemberExpression\":\n return (\n !node.computed &&\n node.property.type === \"Identifier\" &&\n isDecoratorMemberExpression(node.object)\n );\n default:\n return false;\n }\n}\nfunction shouldParenthesizeDecoratorExpression(\n node: t.Expression | t.Super | t.V8IntrinsicIdentifier,\n) {\n if (node.type === \"ParenthesizedExpression\") {\n // We didn't check extra?.parenthesized here because we don't track decorators in needsParen\n return false;\n }\n return !isDecoratorMemberExpression(\n node.type === \"CallExpression\" ? node.callee : node,\n );\n}\n\nexport function _shouldPrintDecoratorsBeforeExport(\n this: Printer,\n node: t.ExportDeclaration & { declaration: t.ClassDeclaration },\n) {\n if (typeof this.format.decoratorsBeforeExport === \"boolean\") {\n return this.format.decoratorsBeforeExport;\n }\n return (\n typeof node.start === \"number\" && node.start === node.declaration.start\n );\n}\n\nexport function Decorator(this: Printer, node: t.Decorator) {\n this.token(\"@\");\n const { expression } = node;\n if (shouldParenthesizeDecoratorExpression(expression)) {\n this.token(\"(\");\n this.print(expression, node);\n this.token(\")\");\n } else {\n this.print(expression, node);\n }\n this.newline();\n}\n\nexport function OptionalMemberExpression(\n this: Printer,\n node: t.OptionalMemberExpression,\n) {\n let { computed } = node;\n const { optional, property } = node;\n\n this.print(node.object, node);\n\n if (!computed && isMemberExpression(property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n // @ts-expect-error todo(flow->ts) maybe instead of typeof check specific literal types?\n if (isLiteral(property) && typeof property.value === \"number\") {\n computed = true;\n }\n if (optional) {\n this.token(\"?.\");\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(property, node);\n this.token(\"]\");\n } else {\n if (!optional) {\n this.token(\".\");\n }\n this.print(property, node);\n }\n}\n\nexport function OptionalCallExpression(\n this: Printer,\n node: t.OptionalCallExpression,\n) {\n this.print(node.callee, node);\n\n this.print(node.typeParameters, node); // TS\n\n if (node.optional) {\n this.token(\"?.\");\n }\n\n this.print(node.typeArguments, node); // Flow\n\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.rightParens(node);\n}\n\nexport function CallExpression(this: Printer, node: t.CallExpression) {\n this.print(node.callee, node);\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.rightParens(node);\n}\n\nexport function Import(this: Printer) {\n this.word(\"import\");\n}\n\nexport function AwaitExpression(this: Printer, node: t.AwaitExpression) {\n this.word(\"await\");\n\n if (node.argument) {\n this.space();\n this.printTerminatorless(node.argument, node, false);\n }\n}\n\nexport function YieldExpression(this: Printer, node: t.YieldExpression) {\n this.word(\"yield\", true);\n\n if (node.delegate) {\n this.token(\"*\");\n if (node.argument) {\n this.space();\n // line terminators are allowed after yield*\n this.print(node.argument, node);\n }\n } else {\n if (node.argument) {\n this.space();\n this.printTerminatorless(node.argument, node, false);\n }\n }\n}\n\nexport function EmptyStatement(this: Printer) {\n this.semicolon(true /* force */);\n}\n\nexport function ExpressionStatement(\n this: Printer,\n node: t.ExpressionStatement,\n) {\n this.print(node.expression, node);\n this.semicolon();\n}\n\nexport function AssignmentPattern(this: Printer, node: t.AssignmentPattern) {\n this.print(node.left, node);\n // @ts-expect-error todo(flow->ts) property present on some of the types in union but not all\n if (node.left.optional) this.token(\"?\");\n // @ts-expect-error todo(flow->ts) property present on some of the types in union but not all\n this.print(node.left.typeAnnotation, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right, node);\n}\n\nexport function AssignmentExpression(\n this: Printer,\n node: t.AssignmentExpression,\n parent: t.Node,\n) {\n // Somewhere inside a for statement `init` node but doesn't usually\n // needs a paren except for `in` expressions: `for (a in b ? a : b;;)`\n const parens =\n this.inForStatementInitCounter &&\n node.operator === \"in\" &&\n !n.needsParens(node, parent);\n\n if (parens) {\n this.token(\"(\");\n }\n\n this.print(node.left, node);\n\n this.space();\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n this.word(node.operator);\n } else {\n this.token(node.operator);\n }\n this.space();\n\n this.print(node.right, node);\n\n if (parens) {\n this.token(\")\");\n }\n}\n\nexport function BindExpression(this: Printer, node: t.BindExpression) {\n this.print(node.object, node);\n this.token(\"::\");\n this.print(node.callee, node);\n}\n\nexport {\n AssignmentExpression as BinaryExpression,\n AssignmentExpression as LogicalExpression,\n};\n\nexport function MemberExpression(this: Printer, node: t.MemberExpression) {\n this.print(node.object, node);\n\n if (!node.computed && isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n // @ts-expect-error todo(flow->ts) maybe use specific literal types\n if (isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n this.token(\".\");\n this.print(node.property, node);\n }\n}\n\nexport function MetaProperty(this: Printer, node: t.MetaProperty) {\n this.print(node.meta, node);\n this.token(\".\");\n this.print(node.property, node);\n}\n\nexport function PrivateName(this: Printer, node: t.PrivateName) {\n this.token(\"#\");\n this.print(node.id, node);\n}\n\nexport function V8IntrinsicIdentifier(\n this: Printer,\n node: t.V8IntrinsicIdentifier,\n) {\n this.token(\"%\");\n this.word(node.name);\n}\n\nexport function ModuleExpression(this: Printer, node: t.ModuleExpression) {\n this.word(\"module\", true);\n this.space();\n this.token(\"{\");\n this.indent();\n const { body } = node;\n if (body.body.length || body.directives.length) {\n this.newline();\n }\n this.print(body, node);\n this.dedent();\n this.rightBrace(node);\n}\n","import type Printer from \"../printer\";\nimport {\n isFor,\n isForStatement,\n isIfStatement,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport * as charCodes from \"charcodes\";\n\nexport function WithStatement(this: Printer, node: t.WithStatement) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function IfStatement(this: Printer, node: t.IfStatement) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.space();\n\n const needsBlock =\n node.alternate && isIfStatement(getLastStatement(node.consequent));\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent, node);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(charCodes.rightCurlyBrace)) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate, node);\n }\n}\n\n// Recursively get the last statement.\nfunction getLastStatement(statement: t.Statement): t.Statement {\n // @ts-expect-error: If statement.body is empty or not a Node, isStatement will return false\n const { body } = statement;\n if (isStatement(body) === false) {\n return statement;\n }\n\n return getLastStatement(body);\n}\n\nexport function ForStatement(this: Printer, node: t.ForStatement) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n\n this.inForStatementInitCounter++;\n this.print(node.init, node);\n this.inForStatementInitCounter--;\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test, node);\n }\n this.token(\";\");\n\n if (node.update) {\n this.space();\n this.print(node.update, node);\n }\n\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function WhileStatement(this: Printer, node: t.WhileStatement) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nfunction ForXStatement(this: Printer, node: t.ForXStatement) {\n this.word(\"for\");\n this.space();\n const isForOf = node.type === \"ForOfStatement\";\n if (isForOf && node.await) {\n this.word(\"await\");\n this.space();\n }\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n this.print(node.left, node);\n this.space();\n this.word(isForOf ? \"of\" : \"in\");\n this.space();\n this.print(node.right, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport const ForInStatement = ForXStatement;\nexport const ForOfStatement = ForXStatement;\n\nexport function DoWhileStatement(this: Printer, node: t.DoWhileStatement) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction printStatementAfterKeyword(\n printer: Printer,\n node: t.Node,\n parent: t.Node,\n isLabel: boolean,\n) {\n if (node) {\n printer.space();\n printer.printTerminatorless(node, parent, isLabel);\n }\n\n printer.semicolon();\n}\n\nexport function BreakStatement(this: Printer, node: t.ContinueStatement) {\n this.word(\"break\");\n printStatementAfterKeyword(this, node.label, node, true);\n}\n\nexport function ContinueStatement(this: Printer, node: t.ContinueStatement) {\n this.word(\"continue\");\n printStatementAfterKeyword(this, node.label, node, true);\n}\n\nexport function ReturnStatement(this: Printer, node: t.ReturnStatement) {\n this.word(\"return\");\n printStatementAfterKeyword(this, node.argument, node, false);\n}\n\nexport function ThrowStatement(this: Printer, node: t.ThrowStatement) {\n this.word(\"throw\");\n printStatementAfterKeyword(this, node.argument, node, false);\n}\n\nexport function LabeledStatement(this: Printer, node: t.LabeledStatement) {\n this.print(node.label, node);\n this.token(\":\");\n this.space();\n this.print(node.body, node);\n}\n\nexport function TryStatement(this: Printer, node: t.TryStatement) {\n this.word(\"try\");\n this.space();\n this.print(node.block, node);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n // @ts-expect-error todo(flow->ts) should ast node type be updated to support this?\n if (node.handlers) {\n // @ts-expect-error todo(flow->ts) should ast node type be updated to support this?\n this.print(node.handlers[0], node);\n } else {\n this.print(node.handler, node);\n }\n\n if (node.finalizer) {\n this.space();\n this.word(\"finally\");\n this.space();\n this.print(node.finalizer, node);\n }\n}\n\nexport function CatchClause(this: Printer, node: t.CatchClause) {\n this.word(\"catch\");\n this.space();\n if (node.param) {\n this.token(\"(\");\n this.print(node.param, node);\n this.print(node.param.typeAnnotation, node);\n this.token(\")\");\n this.space();\n }\n this.print(node.body, node);\n}\n\nexport function SwitchStatement(this: Printer, node: t.SwitchStatement) {\n this.word(\"switch\");\n this.space();\n this.token(\"(\");\n this.print(node.discriminant, node);\n this.token(\")\");\n this.space();\n this.token(\"{\");\n\n this.printSequence(node.cases, node, {\n indent: true,\n addNewlines(leading, cas) {\n if (!leading && node.cases[node.cases.length - 1] === cas) return -1;\n },\n });\n\n this.rightBrace(node);\n}\n\nexport function SwitchCase(this: Printer, node: t.SwitchCase) {\n if (node.test) {\n this.word(\"case\");\n this.space();\n this.print(node.test, node);\n this.token(\":\");\n } else {\n this.word(\"default\");\n this.token(\":\");\n }\n\n if (node.consequent.length) {\n this.newline();\n this.printSequence(node.consequent, node, { indent: true });\n }\n}\n\nexport function DebuggerStatement(this: Printer) {\n this.word(\"debugger\");\n this.semicolon();\n}\n\nexport function VariableDeclaration(\n this: Printer,\n node: t.VariableDeclaration,\n parent: t.Node,\n) {\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n const { kind } = node;\n this.word(kind, kind === \"using\" || kind === \"await using\");\n this.space();\n\n let hasInits = false;\n // don't add whitespace to loop heads\n if (!isFor(parent)) {\n for (const declar of node.declarations) {\n if (declar.init) {\n // has an init so let's split it up over multiple lines\n hasInits = true;\n }\n }\n }\n\n //\n // use a pretty separator when we aren't in compact mode, have initializers and don't have retainLines on\n // this will format declarations like:\n //\n // let foo = \"bar\", bar = \"foo\";\n //\n // into\n //\n // let foo = \"bar\",\n // bar = \"foo\";\n //\n\n this.printList(node.declarations, node, {\n separator: hasInits\n ? function (this: Printer) {\n this.token(\",\");\n this.newline();\n }\n : undefined,\n indent: node.declarations.length > 1 ? true : false,\n });\n\n if (isFor(parent)) {\n // don't give semicolons to these nodes since they'll be inserted in the parent generator\n if (isForStatement(parent)) {\n if (parent.init === node) return;\n } else {\n if (parent.left === node) return;\n }\n }\n\n this.semicolon();\n}\n\nexport function VariableDeclarator(this: Printer, node: t.VariableDeclarator) {\n this.print(node.id, node);\n if (node.definite) this.token(\"!\"); // TS\n // @ts-expect-error todo(flow-ts) Property 'typeAnnotation' does not exist on type 'MemberExpression'.\n this.print(node.id.typeAnnotation, node);\n if (node.init) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.init, node);\n }\n}\n","import type Printer from \"../printer\";\nimport {\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport * as charCodes from \"charcodes\";\n\nexport function ClassDeclaration(\n this: Printer,\n node: t.ClassDeclaration,\n parent: t.Node,\n) {\n const inExport =\n isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);\n\n if (\n !inExport ||\n !this._shouldPrintDecoratorsBeforeExport(\n parent as t.ExportDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n this.printJoin(node.decorators, node);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id, node);\n }\n\n this.print(node.typeParameters, node);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass, node);\n this.print(node.superTypeParameters, node);\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements, node);\n }\n\n this.space();\n this.print(node.body, node);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(this: Printer, node: t.ClassBody) {\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n\n this.printSequence(node.body, node, { indent: true });\n\n if (!this.endsWith(charCodes.lineFeed)) this.newline();\n\n this.rightBrace(node);\n }\n}\n\nexport function ClassProperty(this: Printer, node: t.ClassProperty) {\n this.printJoin(node.decorators, node);\n\n // catch up to property key, avoid line break\n // between member modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n\n this.tsPrintClassMemberModifiers(node);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key, node);\n this.token(\"]\");\n } else {\n this._variance(node);\n this.print(node.key, node);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassAccessorProperty(\n this: Printer,\n node: t.ClassAccessorProperty,\n) {\n this.printJoin(node.decorators, node);\n\n // catch up to property key, avoid line break\n // between member modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n\n // TS does not support class accessor property yet\n this.tsPrintClassMemberModifiers(node);\n\n this.word(\"accessor\", true);\n this.space();\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key, node);\n this.token(\"]\");\n } else {\n // Todo: Flow does not support class accessor property yet.\n this._variance(node);\n this.print(node.key, node);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassPrivateProperty(\n this: Printer,\n node: t.ClassPrivateProperty,\n) {\n this.printJoin(node.decorators, node);\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.print(node.key, node);\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassMethod(this: Printer, node: t.ClassMethod) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport function ClassPrivateMethod(this: Printer, node: t.ClassPrivateMethod) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport function _classMethodHead(\n this: Printer,\n node: t.ClassMethod | t.ClassPrivateMethod | t.TSDeclareMethod,\n) {\n this.printJoin(node.decorators, node);\n\n // catch up to method key, avoid line break\n // between member modifiers/method heads and the method key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n\n this.tsPrintClassMemberModifiers(node);\n this._methodHead(node);\n}\n\nexport function StaticBlock(this: Printer, node: t.StaticBlock) {\n this.word(\"static\");\n this.space();\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n this.printSequence(node.body, node, {\n indent: true,\n });\n this.rightBrace(node);\n }\n}\n","import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\nimport { isIdentifier } from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport function _params(\n this: Printer,\n node: t.Function | t.TSDeclareMethod | t.TSDeclareFunction,\n idNode: t.Expression | t.PrivateName,\n parentNode: NodePath<\n t.Function | t.TSDeclareMethod | t.TSDeclareFunction\n >[\"parent\"],\n) {\n this.print(node.typeParameters, node);\n\n const nameInfo = _getFuncIdName.call(this, idNode, parentNode);\n if (nameInfo) {\n this.sourceIdentifierName(nameInfo.name, nameInfo.pos);\n }\n\n this.token(\"(\");\n this._parameters(node.params, node);\n this.token(\")\");\n\n const noLineTerminator = node.type === \"ArrowFunctionExpression\";\n this.print(node.returnType, node, noLineTerminator);\n\n this._noLineTerminator = noLineTerminator;\n}\n\nexport function _parameters(\n this: Printer,\n parameters: t.Function[\"params\"],\n parent:\n | t.Function\n | t.TSIndexSignature\n | t.TSDeclareMethod\n | t.TSDeclareFunction\n | t.TSFunctionType\n | t.TSConstructorType,\n) {\n const paramLength = parameters.length;\n for (let i = 0; i < paramLength; i++) {\n this._param(parameters[i], parent);\n\n if (i < parameters.length - 1) {\n this.token(\",\");\n this.space();\n }\n }\n}\n\nexport function _param(\n this: Printer,\n parameter: t.Identifier | t.RestElement | t.Pattern | t.TSParameterProperty,\n parent?:\n | t.Function\n | t.TSIndexSignature\n | t.TSDeclareMethod\n | t.TSDeclareFunction\n | t.TSFunctionType\n | t.TSConstructorType,\n) {\n this.printJoin(parameter.decorators, parameter);\n this.print(parameter, parent);\n if (\n // @ts-expect-error optional is not in TSParameterProperty\n parameter.optional\n ) {\n this.token(\"?\"); // TS / flow\n }\n\n this.print(\n // @ts-expect-error typeAnnotation is not in TSParameterProperty\n parameter.typeAnnotation,\n parameter,\n ); // TS / flow\n}\n\nexport function _methodHead(this: Printer, node: t.Method | t.TSDeclareMethod) {\n const kind = node.kind;\n const key = node.key;\n\n if (kind === \"get\" || kind === \"set\") {\n this.word(kind);\n this.space();\n }\n\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n\n if (\n kind === \"method\" ||\n // @ts-expect-error Fixme: kind: \"init\" is not defined\n kind === \"init\"\n ) {\n if (node.generator) {\n this.token(\"*\");\n }\n }\n\n if (node.computed) {\n this.token(\"[\");\n this.print(key, node);\n this.token(\"]\");\n } else {\n this.print(key, node);\n }\n\n if (\n // @ts-expect-error optional is not in ObjectMethod\n node.optional\n ) {\n // TS\n this.token(\"?\");\n }\n\n this._params(\n node,\n node.computed && node.key.type !== \"StringLiteral\" ? undefined : node.key,\n undefined,\n );\n}\n\nexport function _predicate(\n this: Printer,\n node:\n | t.FunctionDeclaration\n | t.FunctionExpression\n | t.ArrowFunctionExpression,\n noLineTerminatorAfter?: boolean,\n) {\n if (node.predicate) {\n if (!node.returnType) {\n this.token(\":\");\n }\n this.space();\n this.print(node.predicate, node, noLineTerminatorAfter);\n }\n}\n\nexport function _functionHead(\n this: Printer,\n node: t.FunctionDeclaration | t.FunctionExpression | t.TSDeclareFunction,\n parent: NodePath<\n t.FunctionDeclaration | t.FunctionExpression | t.TSDeclareFunction\n >[\"parent\"],\n) {\n if (node.async) {\n this.word(\"async\");\n // We prevent inner comments from being printed here,\n // so that they are always consistently printed in the\n // same place regardless of the function type.\n this._endsWithInnerRaw = false;\n this.space();\n }\n this.word(\"function\");\n if (node.generator) {\n // We prevent inner comments from being printed here,\n // so that they are always consistently printed in the\n // same place regardless of the function type.\n this._endsWithInnerRaw = false;\n this.token(\"*\");\n }\n\n this.space();\n if (node.id) {\n this.print(node.id, node);\n }\n\n this._params(node, node.id, parent);\n if (node.type !== \"TSDeclareFunction\") {\n this._predicate(node);\n }\n}\n\nexport function FunctionExpression(\n this: Printer,\n node: t.FunctionExpression,\n parent: NodePath[\"parent\"],\n) {\n this._functionHead(node, parent);\n this.space();\n this.print(node.body, node);\n}\n\nexport { FunctionExpression as FunctionDeclaration };\n\nexport function ArrowFunctionExpression(\n this: Printer,\n node: t.ArrowFunctionExpression,\n parent: NodePath[\"parent\"],\n) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n\n // Try to avoid printing parens in simple cases, but only if we're pretty\n // sure that they aren't needed by type annotations or potential newlines.\n let firstParam;\n if (\n !this.format.retainLines &&\n node.params.length === 1 &&\n isIdentifier((firstParam = node.params[0])) &&\n !hasTypesOrComments(node, firstParam)\n ) {\n this.print(firstParam, node, true);\n } else {\n this._params(node, undefined, parent);\n }\n\n this._predicate(node, true);\n this.space();\n // When printing (x)/*1*/=>{}, we remove the parentheses\n // and thus there aren't two contiguous inner tokens.\n // We forcefully print inner comments here.\n this.printInnerComments();\n this.token(\"=>\");\n\n this.space();\n\n this.print(node.body, node);\n}\n\nfunction hasTypesOrComments(\n node: t.ArrowFunctionExpression,\n param: t.Identifier,\n): boolean {\n return !!(\n node.typeParameters ||\n node.returnType ||\n node.predicate ||\n param.typeAnnotation ||\n param.optional ||\n // Flow does not support `foo /*: string*/ => {};`\n param.leadingComments?.length ||\n param.trailingComments?.length\n );\n}\n\nfunction _getFuncIdName(\n this: Printer,\n idNode: t.Expression | t.PrivateName,\n parent: NodePath<\n t.Function | t.TSDeclareMethod | t.TSDeclareFunction\n >[\"parent\"],\n) {\n let id: t.Expression | t.PrivateName | t.LVal = idNode;\n\n if (!id && parent) {\n const parentType = parent.type;\n\n if (parentType === \"VariableDeclarator\") {\n id = parent.id;\n } else if (\n parentType === \"AssignmentExpression\" ||\n parentType === \"AssignmentPattern\"\n ) {\n id = parent.left;\n } else if (\n parentType === \"ObjectProperty\" ||\n parentType === \"ClassProperty\"\n ) {\n if (!parent.computed || parent.key.type === \"StringLiteral\") {\n id = parent.key;\n }\n } else if (\n parentType === \"ClassPrivateProperty\" ||\n parentType === \"ClassAccessorProperty\"\n ) {\n id = parent.key;\n }\n }\n\n if (!id) return;\n\n let nameInfo;\n\n if (id.type === \"Identifier\") {\n nameInfo = {\n pos: id.loc?.start,\n name:\n // @ts-expect-error Undocumented property identifierName\n id.loc?.identifierName || id.name,\n };\n } else if (id.type === \"PrivateName\") {\n nameInfo = {\n pos: id.loc?.start,\n name: \"#\" + id.id.name,\n };\n } else if (id.type === \"StringLiteral\") {\n nameInfo = {\n pos: id.loc?.start,\n name: id.value,\n };\n }\n\n return nameInfo;\n}\n","import type Printer from \"../printer\";\nimport {\n isClassDeclaration,\n isExportDefaultSpecifier,\n isExportNamespaceSpecifier,\n isImportDefaultSpecifier,\n isImportNamespaceSpecifier,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nexport function ImportSpecifier(this: Printer, node: t.ImportSpecifier) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported, node);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n }\n}\n\nexport function ImportDefaultSpecifier(\n this: Printer,\n node: t.ImportDefaultSpecifier,\n) {\n this.print(node.local, node);\n}\n\nexport function ExportDefaultSpecifier(\n this: Printer,\n node: t.ExportDefaultSpecifier,\n) {\n this.print(node.exported, node);\n}\n\nexport function ExportSpecifier(this: Printer, node: t.ExportSpecifier) {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n this.print(node.local, node);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n }\n}\n\nexport function ExportNamespaceSpecifier(\n this: Printer,\n node: t.ExportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n}\n\nlet warningShown = false;\n\nexport function _printAttributes(\n this: Printer,\n node: Extract,\n) {\n const { importAttributesKeyword } = this.format;\n const { attributes, assertions } = node;\n\n if (\n attributes &&\n !importAttributesKeyword &&\n // In the production build only show the warning once.\n // We want to show it per-usage locally for tests.\n (!process.env.IS_PUBLISH || !warningShown)\n ) {\n warningShown = true;\n console.warn(`\\\nYou are using import attributes, without specifying the desired output syntax.\nPlease specify the \"importAttributesKeyword\" generator option, whose value can be one of:\n - \"with\" : \\`import { a } from \"b\" with { type: \"json\" };\\`\n - \"assert\" : \\`import { a } from \"b\" assert { type: \"json\" };\\`\n - \"with-legacy\" : \\`import { a } from \"b\" with type: \"json\";\\`\n`);\n }\n\n const useAssertKeyword =\n importAttributesKeyword === \"assert\" ||\n (!importAttributesKeyword && assertions);\n\n this.word(useAssertKeyword ? \"assert\" : \"with\");\n this.space();\n\n if (!useAssertKeyword && importAttributesKeyword !== \"with\") {\n // with-legacy\n this.printList(attributes || assertions, node);\n return;\n }\n\n this.token(\"{\");\n this.space();\n this.printList(attributes || assertions, node);\n this.space();\n this.token(\"}\");\n}\n\nexport function ExportAllDeclaration(\n this: Printer,\n node: t.ExportAllDeclaration | t.DeclareExportAllDeclaration,\n) {\n this.word(\"export\");\n this.space();\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n this.token(\"*\");\n this.space();\n this.word(\"from\");\n this.space();\n // @ts-expect-error Fixme: attributes is not defined in DeclareExportAllDeclaration\n if (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, node, true);\n this.space();\n // @ts-expect-error Fixme: attributes is not defined in DeclareExportAllDeclaration\n this._printAttributes(node);\n } else {\n this.print(node.source, node);\n }\n\n this.semicolon();\n}\n\nfunction maybePrintDecoratorsBeforeExport(\n printer: Printer,\n node: t.ExportNamedDeclaration | t.ExportDefaultDeclaration,\n) {\n if (\n isClassDeclaration(node.declaration) &&\n printer._shouldPrintDecoratorsBeforeExport(\n node as t.ExportNamedDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n printer.printJoin(node.declaration.decorators, node);\n }\n}\n\nexport function ExportNamedDeclaration(\n this: Printer,\n node: t.ExportNamedDeclaration,\n) {\n maybePrintDecoratorsBeforeExport(this, node);\n\n this.word(\"export\");\n this.space();\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar, node);\n if (!isStatement(declar)) this.semicolon();\n } else {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n\n // print \"special\" specifiers first\n let hasSpecial = false;\n for (;;) {\n const first = specifiers[0];\n if (\n isExportDefaultSpecifier(first) ||\n isExportNamespaceSpecifier(first)\n ) {\n hasSpecial = true;\n this.print(specifiers.shift(), node);\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length || (!specifiers.length && !hasSpecial)) {\n this.token(\"{\");\n if (specifiers.length) {\n this.space();\n this.printList(specifiers, node);\n this.space();\n }\n this.token(\"}\");\n }\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n if (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, node, true);\n this.space();\n this._printAttributes(node);\n } else {\n this.print(node.source, node);\n }\n }\n\n this.semicolon();\n }\n}\n\nexport function ExportDefaultDeclaration(\n this: Printer,\n node: t.ExportDefaultDeclaration,\n) {\n maybePrintDecoratorsBeforeExport(this, node);\n\n this.word(\"export\");\n this.noIndentInnerCommentsHere();\n this.space();\n this.word(\"default\");\n this.space();\n const declar = node.declaration;\n this.print(declar, node);\n if (!isStatement(declar)) this.semicolon();\n}\n\nexport function ImportDeclaration(this: Printer, node: t.ImportDeclaration) {\n this.word(\"import\");\n this.space();\n\n const isTypeKind = node.importKind === \"type\" || node.importKind === \"typeof\";\n if (isTypeKind) {\n this.noIndentInnerCommentsHere();\n this.word(node.importKind);\n this.space();\n } else if (node.module) {\n this.noIndentInnerCommentsHere();\n this.word(\"module\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n const hasSpecifiers = !!specifiers.length;\n // print \"special\" specifiers first. The loop condition is constant,\n // but there is a \"break\" in the body.\n while (hasSpecifiers) {\n const first = specifiers[0];\n if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {\n this.print(specifiers.shift(), node);\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length) {\n this.token(\"{\");\n this.space();\n this.printList(specifiers, node);\n this.space();\n this.token(\"}\");\n } else if (isTypeKind && !hasSpecifiers) {\n this.token(\"{\");\n this.token(\"}\");\n }\n\n if (hasSpecifiers || isTypeKind) {\n this.space();\n this.word(\"from\");\n this.space();\n }\n\n if (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, node, true);\n this.space();\n this._printAttributes(node);\n } else {\n this.print(node.source, node);\n }\n\n this.semicolon();\n}\n\nexport function ImportAttribute(this: Printer, node: t.ImportAttribute) {\n this.print(node.key);\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ImportNamespaceSpecifier(\n this: Printer,\n node: t.ImportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n}\n","'use strict';\n\nconst object = {};\nconst hasOwnProperty = object.hasOwnProperty;\nconst forOwn = (object, callback) => {\n\tfor (const key in object) {\n\t\tif (hasOwnProperty.call(object, key)) {\n\t\t\tcallback(key, object[key]);\n\t\t}\n\t}\n};\n\nconst extend = (destination, source) => {\n\tif (!source) {\n\t\treturn destination;\n\t}\n\tforOwn(source, (key, value) => {\n\t\tdestination[key] = value;\n\t});\n\treturn destination;\n};\n\nconst forEach = (array, callback) => {\n\tconst length = array.length;\n\tlet index = -1;\n\twhile (++index < length) {\n\t\tcallback(array[index]);\n\t}\n};\n\nconst toString = object.toString;\nconst isArray = Array.isArray;\nconst isBuffer = Buffer.isBuffer;\nconst isObject = (value) => {\n\t// This is a very simple check, but it’s good enough for what we need.\n\treturn toString.call(value) == '[object Object]';\n};\nconst isString = (value) => {\n\treturn typeof value == 'string' ||\n\t\ttoString.call(value) == '[object String]';\n};\nconst isNumber = (value) => {\n\treturn typeof value == 'number' ||\n\t\ttoString.call(value) == '[object Number]';\n};\nconst isFunction = (value) => {\n\treturn typeof value == 'function';\n};\nconst isMap = (value) => {\n\treturn toString.call(value) == '[object Map]';\n};\nconst isSet = (value) => {\n\treturn toString.call(value) == '[object Set]';\n};\n\n/*--------------------------------------------------------------------------*/\n\n// https://mathiasbynens.be/notes/javascript-escapes#single\nconst singleEscapes = {\n\t'\"': '\\\\\"',\n\t'\\'': '\\\\\\'',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t'\n\t// `\\v` is omitted intentionally, because in IE < 9, '\\v' == 'v'.\n\t// '\\v': '\\\\x0B'\n};\nconst regexSingleEscape = /[\"'\\\\\\b\\f\\n\\r\\t]/;\n\nconst regexDigit = /[0-9]/;\nconst regexWhitelist = /[ !#-&\\(-\\[\\]-_a-~]/;\n\nconst jsesc = (argument, options) => {\n\tconst increaseIndentation = () => {\n\t\toldIndent = indent;\n\t\t++options.indentLevel;\n\t\tindent = options.indent.repeat(options.indentLevel)\n\t};\n\t// Handle options\n\tconst defaults = {\n\t\t'escapeEverything': false,\n\t\t'minimal': false,\n\t\t'isScriptContext': false,\n\t\t'quotes': 'single',\n\t\t'wrap': false,\n\t\t'es6': false,\n\t\t'json': false,\n\t\t'compact': true,\n\t\t'lowercaseHex': false,\n\t\t'numbers': 'decimal',\n\t\t'indent': '\\t',\n\t\t'indentLevel': 0,\n\t\t'__inline1__': false,\n\t\t'__inline2__': false\n\t};\n\tconst json = options && options.json;\n\tif (json) {\n\t\tdefaults.quotes = 'double';\n\t\tdefaults.wrap = true;\n\t}\n\toptions = extend(defaults, options);\n\tif (\n\t\toptions.quotes != 'single' &&\n\t\toptions.quotes != 'double' &&\n\t\toptions.quotes != 'backtick'\n\t) {\n\t\toptions.quotes = 'single';\n\t}\n\tconst quote = options.quotes == 'double' ?\n\t\t'\"' :\n\t\t(options.quotes == 'backtick' ?\n\t\t\t'`' :\n\t\t\t'\\''\n\t\t);\n\tconst compact = options.compact;\n\tconst lowercaseHex = options.lowercaseHex;\n\tlet indent = options.indent.repeat(options.indentLevel);\n\tlet oldIndent = '';\n\tconst inline1 = options.__inline1__;\n\tconst inline2 = options.__inline2__;\n\tconst newLine = compact ? '' : '\\n';\n\tlet result;\n\tlet isEmpty = true;\n\tconst useBinNumbers = options.numbers == 'binary';\n\tconst useOctNumbers = options.numbers == 'octal';\n\tconst useDecNumbers = options.numbers == 'decimal';\n\tconst useHexNumbers = options.numbers == 'hexadecimal';\n\n\tif (json && argument && isFunction(argument.toJSON)) {\n\t\targument = argument.toJSON();\n\t}\n\n\tif (!isString(argument)) {\n\t\tif (isMap(argument)) {\n\t\t\tif (argument.size == 0) {\n\t\t\t\treturn 'new Map()';\n\t\t\t}\n\t\t\tif (!compact) {\n\t\t\t\toptions.__inline1__ = true;\n\t\t\t\toptions.__inline2__ = false;\n\t\t\t}\n\t\t\treturn 'new Map(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isSet(argument)) {\n\t\t\tif (argument.size == 0) {\n\t\t\t\treturn 'new Set()';\n\t\t\t}\n\t\t\treturn 'new Set(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isBuffer(argument)) {\n\t\t\tif (argument.length == 0) {\n\t\t\t\treturn 'Buffer.from([])';\n\t\t\t}\n\t\t\treturn 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isArray(argument)) {\n\t\t\tresult = [];\n\t\t\toptions.wrap = true;\n\t\t\tif (inline1) {\n\t\t\t\toptions.__inline1__ = false;\n\t\t\t\toptions.__inline2__ = true;\n\t\t\t}\n\t\t\tif (!inline2) {\n\t\t\t\tincreaseIndentation();\n\t\t\t}\n\t\t\tforEach(argument, (value) => {\n\t\t\t\tisEmpty = false;\n\t\t\t\tif (inline2) {\n\t\t\t\t\toptions.__inline2__ = false;\n\t\t\t\t}\n\t\t\t\tresult.push(\n\t\t\t\t\t(compact || inline2 ? '' : indent) +\n\t\t\t\t\tjsesc(value, options)\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (isEmpty) {\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t\tif (inline2) {\n\t\t\t\treturn '[' + result.join(', ') + ']';\n\t\t\t}\n\t\t\treturn '[' + newLine + result.join(',' + newLine) + newLine +\n\t\t\t\t(compact ? '' : oldIndent) + ']';\n\t\t} else if (isNumber(argument)) {\n\t\t\tif (json) {\n\t\t\t\t// Some number values (e.g. `Infinity`) cannot be represented in JSON.\n\t\t\t\treturn JSON.stringify(argument);\n\t\t\t}\n\t\t\tif (useDecNumbers) {\n\t\t\t\treturn String(argument);\n\t\t\t}\n\t\t\tif (useHexNumbers) {\n\t\t\t\tlet hexadecimal = argument.toString(16);\n\t\t\t\tif (!lowercaseHex) {\n\t\t\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t\t\t}\n\t\t\t\treturn '0x' + hexadecimal;\n\t\t\t}\n\t\t\tif (useBinNumbers) {\n\t\t\t\treturn '0b' + argument.toString(2);\n\t\t\t}\n\t\t\tif (useOctNumbers) {\n\t\t\t\treturn '0o' + argument.toString(8);\n\t\t\t}\n\t\t} else if (!isObject(argument)) {\n\t\t\tif (json) {\n\t\t\t\t// For some values (e.g. `undefined`, `function` objects),\n\t\t\t\t// `JSON.stringify(value)` returns `undefined` (which isn’t valid\n\t\t\t\t// JSON) instead of `'null'`.\n\t\t\t\treturn JSON.stringify(argument) || 'null';\n\t\t\t}\n\t\t\treturn String(argument);\n\t\t} else { // it’s an object\n\t\t\tresult = [];\n\t\t\toptions.wrap = true;\n\t\t\tincreaseIndentation();\n\t\t\tforOwn(argument, (key, value) => {\n\t\t\t\tisEmpty = false;\n\t\t\t\tresult.push(\n\t\t\t\t\t(compact ? '' : indent) +\n\t\t\t\t\tjsesc(key, options) + ':' +\n\t\t\t\t\t(compact ? '' : ' ') +\n\t\t\t\t\tjsesc(value, options)\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (isEmpty) {\n\t\t\t\treturn '{}';\n\t\t\t}\n\t\t\treturn '{' + newLine + result.join(',' + newLine) + newLine +\n\t\t\t\t(compact ? '' : oldIndent) + '}';\n\t\t}\n\t}\n\n\tconst string = argument;\n\t// Loop over each code unit in the string and escape it\n\tlet index = -1;\n\tconst length = string.length;\n\tresult = '';\n\twhile (++index < length) {\n\t\tconst character = string.charAt(index);\n\t\tif (options.es6) {\n\t\t\tconst first = string.charCodeAt(index);\n\t\t\tif ( // check if it’s the start of a surrogate pair\n\t\t\t\tfirst >= 0xD800 && first <= 0xDBFF && // high surrogate\n\t\t\t\tlength > index + 1 // there is a next code unit\n\t\t\t) {\n\t\t\t\tconst second = string.charCodeAt(index + 1);\n\t\t\t\tif (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\tconst codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n\t\t\t\t\tlet hexadecimal = codePoint.toString(16);\n\t\t\t\t\tif (!lowercaseHex) {\n\t\t\t\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t\t\t\t}\n\t\t\t\t\tresult += '\\\\u{' + hexadecimal + '}';\n\t\t\t\t\t++index;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!options.escapeEverything) {\n\t\t\tif (regexWhitelist.test(character)) {\n\t\t\t\t// It’s a printable ASCII character that is not `\"`, `'` or `\\`,\n\t\t\t\t// so don’t escape it.\n\t\t\t\tresult += character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '\"') {\n\t\t\t\tresult += quote == character ? '\\\\\"' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '`') {\n\t\t\t\tresult += quote == character ? '\\\\`' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '\\'') {\n\t\t\t\tresult += quote == character ? '\\\\\\'' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tcharacter == '\\0' &&\n\t\t\t!json &&\n\t\t\t!regexDigit.test(string.charAt(index + 1))\n\t\t) {\n\t\t\tresult += '\\\\0';\n\t\t\tcontinue;\n\t\t}\n\t\tif (regexSingleEscape.test(character)) {\n\t\t\t// no need for a `hasOwnProperty` check here\n\t\t\tresult += singleEscapes[character];\n\t\t\tcontinue;\n\t\t}\n\t\tconst charCode = character.charCodeAt(0);\n\t\tif (options.minimal && charCode != 0x2028 && charCode != 0x2029) {\n\t\t\tresult += character;\n\t\t\tcontinue;\n\t\t}\n\t\tlet hexadecimal = charCode.toString(16);\n\t\tif (!lowercaseHex) {\n\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t}\n\t\tconst longhand = hexadecimal.length > 2 || json;\n\t\tconst escaped = '\\\\' + (longhand ? 'u' : 'x') +\n\t\t\t('0000' + hexadecimal).slice(longhand ? -4 : -2);\n\t\tresult += escaped;\n\t\tcontinue;\n\t}\n\tif (options.wrap) {\n\t\tresult = quote + result + quote;\n\t}\n\tif (quote == '`') {\n\t\tresult = result.replace(/\\$\\{/g, '\\\\\\$\\{');\n\t}\n\tif (options.isScriptContext) {\n\t\t// https://mathiasbynens.be/notes/etago\n\t\treturn result\n\t\t\t.replace(/<\\/(script|style)/gi, '<\\\\/$1')\n\t\t\t.replace(/` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ``;\n case 5:\n return escapeHtml(toDisplayString(evaluateConstant(node.content)));\n case 8:\n return escapeHtml(evaluateConstant(node));\n case 12:\n return stringifyNode(node.content, context);\n default:\n return \"\";\n }\n}\nfunction stringifyElement(node, context) {\n let res = `<${node.tag}`;\n let innerHTML = \"\";\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 6) {\n res += ` ${p.name}`;\n if (p.value) {\n res += `=\"${escapeHtml(p.value.content)}\"`;\n }\n } else if (p.type === 7) {\n if (p.name === \"bind\") {\n const exp = p.exp;\n if (exp.content[0] === \"_\") {\n res += ` ${p.arg.content}=\"__VUE_EXP_START__${exp.content}__VUE_EXP_END__\"`;\n continue;\n }\n if (isBooleanAttr(p.arg.content) && exp.content === \"false\") {\n continue;\n }\n let evaluated = evaluateConstant(exp);\n if (evaluated != null) {\n const arg = p.arg && p.arg.content;\n if (arg === \"class\") {\n evaluated = normalizeClass(evaluated);\n } else if (arg === \"style\") {\n evaluated = stringifyStyle(normalizeStyle(evaluated));\n }\n res += ` ${p.arg.content}=\"${escapeHtml(\n evaluated\n )}\"`;\n }\n } else if (p.name === \"html\") {\n innerHTML = evaluateConstant(p.exp);\n } else if (p.name === \"text\") {\n innerHTML = escapeHtml(\n toDisplayString(evaluateConstant(p.exp))\n );\n }\n }\n }\n if (context.scopeId) {\n res += ` ${context.scopeId}`;\n }\n res += `>`;\n if (innerHTML) {\n res += innerHTML;\n } else {\n for (let i = 0; i < node.children.length; i++) {\n res += stringifyNode(node.children[i], context);\n }\n }\n if (!isVoidTag(node.tag)) {\n res += ``;\n }\n return res;\n}\nfunction evaluateConstant(exp) {\n if (exp.type === 4) {\n return new Function(`return (${exp.content})`)();\n } else {\n let res = ``;\n exp.children.forEach((c) => {\n if (isString$2(c) || isSymbol$1(c)) {\n return;\n }\n if (c.type === 2) {\n res += c.content;\n } else if (c.type === 5) {\n res += toDisplayString(evaluateConstant(c.content));\n } else {\n res += evaluateConstant(c);\n }\n });\n return res;\n }\n}\n\nconst ignoreSideEffectTags = (node, context) => {\n if (node.type === 1 && node.tagType === 0 && (node.tag === \"script\" || node.tag === \"style\")) {\n context.onError(\n createDOMCompilerError(\n 63,\n node.loc\n )\n );\n context.removeNode();\n }\n};\n\nconst DOMNodeTransforms = [\n transformStyle,\n ...[transformTransition] \n];\nconst DOMDirectiveTransforms = {\n cloak: noopDirectiveTransform,\n html: transformVHtml,\n text: transformVText,\n model: transformModel,\n // override compiler-core\n on: transformOn,\n // override compiler-core\n show: transformShow\n};\nfunction compile$1(template, options = {}) {\n return baseCompile(\n template,\n extend({}, parserOptions, options, {\n nodeTransforms: [\n // ignore