match-curriculum / node_modules / @babel / plugin-transform-react-jsx / lib / create-plugin.js.map
create-plugin.js.map
Raw
{"version":3,"names":["DEFAULT","importSource","runtime","pragma","pragmaFrag","JSX_SOURCE_ANNOTATION_REGEX","JSX_RUNTIME_ANNOTATION_REGEX","JSX_ANNOTATION_REGEX","JSX_FRAG_ANNOTATION_REGEX","get","pass","name","set","v","hasProto","node","properties","some","value","t","isObjectProperty","computed","shorthand","isIdentifier","key","isStringLiteral","createPlugin","development","declare","_","options","pure","PURE_ANNOTATION","throwIfNamespace","filter","RUNTIME_DEFAULT","IMPORT_SOURCE_DEFAULT","PRAGMA_DEFAULT","PRAGMA_FRAG_DEFAULT","useSpread","useBuiltIns","Error","injectMetaPropertiesVisitor","JSXOpeningElement","path","state","attributes","isThisAllowed","scope","push","jsxAttribute","jsxIdentifier","jsxExpressionContainer","thisExpression","makeSource","pushContainer","inherits","jsx","visitor","JSXNamespacedName","buildCodeFrameError","JSXSpreadChild","Program","enter","file","source","sourceSet","pragmaSet","pragmaFragSet","ast","comments","comment","sourceMatches","exec","runtimeMatches","jsxMatches","jsxFragMatches","createElement","toMemberExpression","fragment","cloneNode","define","id","createImportLazily","traverse","JSXFragment","exit","callExpr","buildCreateElementFragmentCall","buildJSXFragmentCall","replaceWith","JSXElement","shouldUseCreateElement","buildCreateElementCall","buildJSXElementCall","JSXAttribute","isJSXElement","isDerivedClass","classPath","superClass","isFunctionParent","isArrowFunctionExpression","isMethod","kind","parentPath","isTSModuleBlock","parent","call","args","callExpression","annotateAsPure","openingPath","seenPropsSpread","i","length","attr","isJSXAttribute","isJSXSpreadAttribute","convertJSXIdentifier","isJSXIdentifier","isReferenced","isValidIdentifier","type","stringLiteral","isJSXMemberExpression","memberExpression","object","property","isJSXNamespacedName","namespace","convertAttributeValue","isJSXExpressionContainer","expression","accumulateAttribute","array","attribute","arg","argument","isObjectExpression","spreadElement","booleanLiteral","replace","extra","raw","objectProperty","buildChildrenProperty","children","childrenNode","arrayExpression","undefined","identifier","getTag","attribsArray","extracted","Object","create","sourceSelfError","keyValue","react","buildChildren","attribs","buildJSXOpeningElementAttributes","objectExpression","buildUndefinedNode","__source","__self","props","reduce","nullLiteral","buildCreateElementOpeningElementAttributes","tagExpr","tagName","isCompatTag","objs","start","forEach","prop","isSpreadElement","slice","unshift","helper","addHelper","found","getSource","importName","actualSource","isModule","reference","addNamed","importedInterop","importPosition","addNamespace","split","map","location","loc","fileNameIdentifier","filename","generateUidIdentifier","getProgramParent","init","makeTrace","line","column","lineNumber","column0Based","fileLineLiteral","numericLiteral","fileColumnLiteral","template","pluginName"],"sources":["../src/create-plugin.ts"],"sourcesContent":["import jsx from \"@babel/plugin-syntax-jsx\";\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\nimport type { PluginPass } from \"@babel/core\";\nimport type { NodePath, Scope, Visitor } from \"@babel/traverse\";\nimport { addNamed, addNamespace, isModule } from \"@babel/helper-module-imports\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport type {\n  CallExpression,\n  Class,\n  Expression,\n  Identifier,\n  JSXAttribute,\n  JSXElement,\n  JSXFragment,\n  JSXOpeningElement,\n  JSXSpreadAttribute,\n  MemberExpression,\n  ObjectExpression,\n  Program,\n} from \"@babel/types\";\n\nconst DEFAULT = {\n  importSource: \"react\",\n  runtime: \"automatic\",\n  pragma: \"React.createElement\",\n  pragmaFrag: \"React.Fragment\",\n};\n\nconst JSX_SOURCE_ANNOTATION_REGEX =\n  /^\\s*\\*?\\s*@jsxImportSource\\s+([^\\s]+)\\s*$/m;\nconst JSX_RUNTIME_ANNOTATION_REGEX = /^\\s*\\*?\\s*@jsxRuntime\\s+([^\\s]+)\\s*$/m;\n\nconst JSX_ANNOTATION_REGEX = /^\\s*\\*?\\s*@jsx\\s+([^\\s]+)\\s*$/m;\nconst JSX_FRAG_ANNOTATION_REGEX = /^\\s*\\*?\\s*@jsxFrag\\s+([^\\s]+)\\s*$/m;\n\nconst get = (pass: PluginPass, name: string) =>\n  pass.get(`@babel/plugin-react-jsx/${name}`);\nconst set = (pass: PluginPass, name: string, v: any) =>\n  pass.set(`@babel/plugin-react-jsx/${name}`, v);\n\nfunction hasProto(node: t.ObjectExpression) {\n  return node.properties.some(\n    value =>\n      t.isObjectProperty(value, { computed: false, shorthand: false }) &&\n      (t.isIdentifier(value.key, { name: \"__proto__\" }) ||\n        t.isStringLiteral(value.key, { value: \"__proto__\" })),\n  );\n}\n\nexport interface Options {\n  filter?: (node: t.Node, pass: PluginPass) => boolean;\n  importSource?: string;\n  pragma?: string;\n  pragmaFrag?: string;\n  pure?: string;\n  runtime?: \"automatic\" | \"classic\";\n  throwIfNamespace?: boolean;\n  useBuiltIns: boolean;\n  useSpread?: boolean;\n}\nexport default function createPlugin({\n  name,\n  development,\n}: {\n  name: string;\n  development: boolean;\n}) {\n  return declare((_, options: Options) => {\n    const {\n      pure: PURE_ANNOTATION,\n\n      throwIfNamespace = true,\n\n      // TODO (Babel 8): It should throw if this option is used with the automatic runtime\n      filter,\n\n      runtime: RUNTIME_DEFAULT = process.env.BABEL_8_BREAKING\n        ? \"automatic\"\n        : development\n        ? \"automatic\"\n        : \"classic\",\n\n      importSource: IMPORT_SOURCE_DEFAULT = DEFAULT.importSource,\n      pragma: PRAGMA_DEFAULT = DEFAULT.pragma,\n      pragmaFrag: PRAGMA_FRAG_DEFAULT = DEFAULT.pragmaFrag,\n    } = options;\n\n    if (process.env.BABEL_8_BREAKING) {\n      if (\"useSpread\" in options) {\n        throw new Error(\n          '@babel/plugin-transform-react-jsx: Since Babel 8, an inline object with spread elements is always used, and the \"useSpread\" option is no longer available. Please remove it from your config.',\n        );\n      }\n\n      if (\"useBuiltIns\" in options) {\n        const useBuiltInsFormatted = JSON.stringify(options.useBuiltIns);\n        throw new Error(\n          `@babel/plugin-transform-react-jsx: Since \"useBuiltIns\" is removed in Babel 8, you can remove it from the config.\n- Babel 8 now transforms JSX spread to object spread. If you need to transpile object spread with\n\\`useBuiltIns: ${useBuiltInsFormatted}\\`, you can use the following config\n{\n  \"plugins\": [\n    \"@babel/plugin-transform-react-jsx\"\n    [\"@babel/plugin-proposal-object-rest-spread\", { \"loose\": true, \"useBuiltIns\": ${useBuiltInsFormatted} }]\n  ]\n}`,\n        );\n      }\n    } else {\n      // eslint-disable-next-line no-var\n      var { useSpread = false, useBuiltIns = false } = options;\n\n      if (RUNTIME_DEFAULT === \"classic\") {\n        if (typeof useSpread !== \"boolean\") {\n          throw new Error(\n            \"transform-react-jsx currently only accepts a boolean option for \" +\n              \"useSpread (defaults to false)\",\n          );\n        }\n\n        if (typeof useBuiltIns !== \"boolean\") {\n          throw new Error(\n            \"transform-react-jsx currently only accepts a boolean option for \" +\n              \"useBuiltIns (defaults to false)\",\n          );\n        }\n\n        if (useSpread && useBuiltIns) {\n          throw new Error(\n            \"transform-react-jsx currently only accepts useBuiltIns or useSpread \" +\n              \"but not both\",\n          );\n        }\n      }\n    }\n\n    const injectMetaPropertiesVisitor: Visitor<PluginPass> = {\n      JSXOpeningElement(path, state) {\n        const attributes = [];\n        if (isThisAllowed(path.scope)) {\n          attributes.push(\n            t.jsxAttribute(\n              t.jsxIdentifier(\"__self\"),\n              t.jsxExpressionContainer(t.thisExpression()),\n            ),\n          );\n        }\n        attributes.push(\n          t.jsxAttribute(\n            t.jsxIdentifier(\"__source\"),\n            t.jsxExpressionContainer(makeSource(path, state)),\n          ),\n        );\n        path.pushContainer(\"attributes\", attributes);\n      },\n    };\n\n    return {\n      name,\n      inherits: jsx,\n      visitor: {\n        JSXNamespacedName(path) {\n          if (throwIfNamespace) {\n            throw path.buildCodeFrameError(\n              `Namespace tags are not supported by default. React's JSX doesn't support namespace tags. \\\nYou can set \\`throwIfNamespace: false\\` to bypass this warning.`,\n            );\n          }\n        },\n\n        JSXSpreadChild(path) {\n          throw path.buildCodeFrameError(\n            \"Spread children are not supported in React.\",\n          );\n        },\n\n        Program: {\n          enter(path, state) {\n            const { file } = state;\n            let runtime: string = RUNTIME_DEFAULT;\n\n            let source: string = IMPORT_SOURCE_DEFAULT;\n            let pragma: string = PRAGMA_DEFAULT;\n            let pragmaFrag: string = PRAGMA_FRAG_DEFAULT;\n\n            let sourceSet = !!options.importSource;\n            let pragmaSet = !!options.pragma;\n            let pragmaFragSet = !!options.pragmaFrag;\n\n            if (file.ast.comments) {\n              for (const comment of file.ast.comments) {\n                const sourceMatches = JSX_SOURCE_ANNOTATION_REGEX.exec(\n                  comment.value,\n                );\n                if (sourceMatches) {\n                  source = sourceMatches[1];\n                  sourceSet = true;\n                }\n\n                const runtimeMatches = JSX_RUNTIME_ANNOTATION_REGEX.exec(\n                  comment.value,\n                );\n                if (runtimeMatches) {\n                  runtime = runtimeMatches[1];\n                }\n\n                const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);\n                if (jsxMatches) {\n                  pragma = jsxMatches[1];\n                  pragmaSet = true;\n                }\n                const jsxFragMatches = JSX_FRAG_ANNOTATION_REGEX.exec(\n                  comment.value,\n                );\n                if (jsxFragMatches) {\n                  pragmaFrag = jsxFragMatches[1];\n                  pragmaFragSet = true;\n                }\n              }\n            }\n\n            set(state, \"runtime\", runtime);\n            if (runtime === \"classic\") {\n              if (sourceSet) {\n                throw path.buildCodeFrameError(\n                  `importSource cannot be set when runtime is classic.`,\n                );\n              }\n\n              const createElement = toMemberExpression(pragma);\n              const fragment = toMemberExpression(pragmaFrag);\n\n              set(state, \"id/createElement\", () => t.cloneNode(createElement));\n              set(state, \"id/fragment\", () => t.cloneNode(fragment));\n\n              set(state, \"defaultPure\", pragma === DEFAULT.pragma);\n            } else if (runtime === \"automatic\") {\n              if (pragmaSet || pragmaFragSet) {\n                throw path.buildCodeFrameError(\n                  `pragma and pragmaFrag cannot be set when runtime is automatic.`,\n                );\n              }\n\n              const define = (name: string, id: string) =>\n                set(state, name, createImportLazily(state, path, id, source));\n\n              define(\"id/jsx\", development ? \"jsxDEV\" : \"jsx\");\n              define(\"id/jsxs\", development ? \"jsxDEV\" : \"jsxs\");\n              define(\"id/createElement\", \"createElement\");\n              define(\"id/fragment\", \"Fragment\");\n\n              set(state, \"defaultPure\", source === DEFAULT.importSource);\n            } else {\n              throw path.buildCodeFrameError(\n                `Runtime must be either \"classic\" or \"automatic\".`,\n              );\n            }\n\n            if (development) {\n              path.traverse(injectMetaPropertiesVisitor, state);\n            }\n          },\n\n          // TODO (Babel 8): Decide if this should be removed or brought back.\n          // see: https://github.com/babel/babel/pull/12253#discussion_r513086528\n          //\n          // exit(path, state) {\n          //   if (\n          //     get(state, \"runtime\") === \"classic\" &&\n          //     get(state, \"pragmaSet\") &&\n          //     get(state, \"usedFragment\") &&\n          //     !get(state, \"pragmaFragSet\")\n          //   ) {\n          //     throw new Error(\n          //       \"transform-react-jsx: pragma has been set but \" +\n          //         \"pragmaFrag has not been set\",\n          //     );\n          //   }\n          // },\n        },\n\n        JSXFragment: {\n          exit(path, file) {\n            let callExpr;\n            if (get(file, \"runtime\") === \"classic\") {\n              callExpr = buildCreateElementFragmentCall(path, file);\n            } else {\n              callExpr = buildJSXFragmentCall(path, file);\n            }\n\n            path.replaceWith(t.inherits(callExpr, path.node));\n          },\n        },\n\n        JSXElement: {\n          exit(path, file) {\n            let callExpr;\n            if (\n              get(file, \"runtime\") === \"classic\" ||\n              shouldUseCreateElement(path)\n            ) {\n              callExpr = buildCreateElementCall(path, file);\n            } else {\n              callExpr = buildJSXElementCall(path, file);\n            }\n\n            path.replaceWith(t.inherits(callExpr, path.node));\n          },\n        },\n\n        JSXAttribute(path) {\n          if (t.isJSXElement(path.node.value)) {\n            path.node.value = t.jsxExpressionContainer(path.node.value);\n          }\n        },\n      },\n    };\n\n    // Returns whether the class has specified a superclass.\n    function isDerivedClass(classPath: NodePath<Class>) {\n      return classPath.node.superClass !== null;\n    }\n\n    // Returns whether `this` is allowed at given scope.\n    function isThisAllowed(scope: Scope) {\n      // This specifically skips arrow functions as they do not rewrite `this`.\n      do {\n        const { path } = scope;\n        if (path.isFunctionParent() && !path.isArrowFunctionExpression()) {\n          if (!path.isMethod()) {\n            // If the closest parent is a regular function, `this` will be rebound, therefore it is fine to use `this`.\n            return true;\n          }\n          // Current node is within a method, so we need to check if the method is a constructor.\n          if (path.node.kind !== \"constructor\") {\n            // We are not in a constructor, therefore it is always fine to use `this`.\n            return true;\n          }\n          // Now we are in a constructor. If it is a derived class, we do not reference `this`.\n          return !isDerivedClass(path.parentPath.parentPath as NodePath<Class>);\n        }\n        if (path.isTSModuleBlock()) {\n          // If the closest parent is a TS Module block, `this` will not be allowed.\n          return false;\n        }\n      } while ((scope = scope.parent));\n      // We are not in a method or function. It is fine to use `this`.\n      return true;\n    }\n\n    function call(\n      pass: PluginPass,\n      name: string,\n      args: CallExpression[\"arguments\"],\n    ) {\n      const node = t.callExpression(get(pass, `id/${name}`)(), args);\n      if (PURE_ANNOTATION ?? get(pass, \"defaultPure\")) annotateAsPure(node);\n      return node;\n    }\n\n    // We want to use React.createElement, even in the case of\n    // jsx, for <div {...props} key={key} /> to distinguish it\n    // from <div key={key} {...props} />. This is an intermediary\n    // step while we deprecate key spread from props. Afterwards,\n    // we will stop using createElement in the transform.\n    function shouldUseCreateElement(path: NodePath<JSXElement>) {\n      const openingPath = path.get(\"openingElement\");\n      const attributes = openingPath.node.attributes;\n\n      let seenPropsSpread = false;\n      for (let i = 0; i < attributes.length; i++) {\n        const attr = attributes[i];\n        if (\n          seenPropsSpread &&\n          t.isJSXAttribute(attr) &&\n          attr.name.name === \"key\"\n        ) {\n          return true;\n        } else if (t.isJSXSpreadAttribute(attr)) {\n          seenPropsSpread = true;\n        }\n      }\n      return false;\n    }\n\n    function convertJSXIdentifier(\n      node: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,\n      parent: t.JSXOpeningElement | t.JSXMemberExpression,\n    ): t.ThisExpression | t.StringLiteral | t.MemberExpression | t.Identifier {\n      if (t.isJSXIdentifier(node)) {\n        if (node.name === \"this\" && t.isReferenced(node, parent)) {\n          return t.thisExpression();\n        } else if (t.isValidIdentifier(node.name, false)) {\n          // @ts-expect-error cast AST type to Identifier\n          node.type = \"Identifier\";\n          return node as unknown as t.Identifier;\n        } else {\n          return t.stringLiteral(node.name);\n        }\n      } else if (t.isJSXMemberExpression(node)) {\n        return t.memberExpression(\n          convertJSXIdentifier(node.object, node),\n          convertJSXIdentifier(node.property, node),\n        );\n      } else if (t.isJSXNamespacedName(node)) {\n        /**\n         * If the flag \"throwIfNamespace\" is false\n         * print XMLNamespace like string literal\n         */\n        return t.stringLiteral(`${node.namespace.name}:${node.name.name}`);\n      }\n\n      // todo: this branch should be unreachable\n      return node;\n    }\n\n    function convertAttributeValue(\n      node: t.JSXAttribute[\"value\"] | t.BooleanLiteral,\n    ) {\n      if (t.isJSXExpressionContainer(node)) {\n        return node.expression;\n      } else {\n        return node;\n      }\n    }\n\n    function accumulateAttribute(\n      array: ObjectExpression[\"properties\"],\n      attribute: NodePath<JSXAttribute | JSXSpreadAttribute>,\n    ) {\n      if (t.isJSXSpreadAttribute(attribute.node)) {\n        const arg = attribute.node.argument;\n        // Collect properties into props array if spreading object expression\n        if (t.isObjectExpression(arg) && !hasProto(arg)) {\n          array.push(...arg.properties);\n        } else {\n          array.push(t.spreadElement(arg));\n        }\n        return array;\n      }\n\n      const value = convertAttributeValue(\n        attribute.node.name.name !== \"key\"\n          ? attribute.node.value || t.booleanLiteral(true)\n          : attribute.node.value,\n      );\n\n      if (attribute.node.name.name === \"key\" && value === null) {\n        throw attribute.buildCodeFrameError(\n          'Please provide an explicit key value. Using \"key\" as a shorthand for \"key={true}\" is not allowed.',\n        );\n      }\n\n      if (\n        t.isStringLiteral(value) &&\n        !t.isJSXExpressionContainer(attribute.node.value)\n      ) {\n        value.value = value.value.replace(/\\n\\s+/g, \" \");\n\n        // \"raw\" JSXText should not be used from a StringLiteral because it needs to be escaped.\n        delete value.extra?.raw;\n      }\n\n      if (t.isJSXNamespacedName(attribute.node.name)) {\n        // @ts-expect-error mutating AST\n        attribute.node.name = t.stringLiteral(\n          attribute.node.name.namespace.name +\n            \":\" +\n            attribute.node.name.name.name,\n        );\n      } else if (t.isValidIdentifier(attribute.node.name.name, false)) {\n        // @ts-expect-error mutating AST\n        attribute.node.name.type = \"Identifier\";\n      } else {\n        // @ts-expect-error mutating AST\n        attribute.node.name = t.stringLiteral(attribute.node.name.name);\n      }\n\n      array.push(\n        t.inherits(\n          t.objectProperty(\n            // @ts-expect-error The attribute.node.name is an Identifier now\n            attribute.node.name,\n            value,\n          ),\n          attribute.node,\n        ),\n      );\n      return array;\n    }\n\n    function buildChildrenProperty(children: Expression[]) {\n      let childrenNode;\n      if (children.length === 1) {\n        childrenNode = children[0];\n      } else if (children.length > 1) {\n        childrenNode = t.arrayExpression(children);\n      } else {\n        return undefined;\n      }\n\n      return t.objectProperty(t.identifier(\"children\"), childrenNode);\n    }\n\n    // Builds JSX into:\n    // Production: React.jsx(type, arguments, key)\n    // Development: React.jsxDEV(type, arguments, key, isStaticChildren, source, self)\n    function buildJSXElementCall(path: NodePath<JSXElement>, file: PluginPass) {\n      const openingPath = path.get(\"openingElement\");\n      const args: t.Expression[] = [getTag(openingPath)];\n\n      const attribsArray = [];\n      const extracted = Object.create(null);\n\n      // for React.jsx, key, __source (dev), and __self (dev) is passed in as\n      // a separate argument rather than in the args object. We go through the\n      // props and filter out these three keywords so we can pass them in\n      // as separate arguments later\n      for (const attr of openingPath.get(\"attributes\")) {\n        if (attr.isJSXAttribute() && t.isJSXIdentifier(attr.node.name)) {\n          const { name } = attr.node.name;\n          switch (name) {\n            case \"__source\":\n            case \"__self\":\n              if (extracted[name]) throw sourceSelfError(path, name);\n            /* falls through */\n            case \"key\": {\n              const keyValue = convertAttributeValue(attr.node.value);\n              if (keyValue === null) {\n                throw attr.buildCodeFrameError(\n                  'Please provide an explicit key value. Using \"key\" as a shorthand for \"key={true}\" is not allowed.',\n                );\n              }\n\n              extracted[name] = keyValue;\n              break;\n            }\n            default:\n              attribsArray.push(attr);\n          }\n        } else {\n          attribsArray.push(attr);\n        }\n      }\n\n      const children = t.react.buildChildren(path.node);\n\n      let attribs: t.ObjectExpression;\n\n      if (attribsArray.length || children.length) {\n        attribs = buildJSXOpeningElementAttributes(\n          attribsArray,\n          //@ts-expect-error The children here contains JSXSpreadChild,\n          // which will be thrown later\n          children,\n        );\n      } else {\n        // attributes should never be null\n        attribs = t.objectExpression([]);\n      }\n\n      args.push(attribs);\n\n      if (development) {\n        // isStaticChildren, __source, and __self are only used in development\n        // automatically include __source and __self in this plugin\n        // so we can eliminate the need for separate Babel plugins in Babel 8\n        args.push(\n          extracted.key ?? path.scope.buildUndefinedNode(),\n          t.booleanLiteral(children.length > 1),\n        );\n        if (extracted.__source) {\n          args.push(extracted.__source);\n          if (extracted.__self) args.push(extracted.__self);\n        } else if (extracted.__self) {\n          args.push(path.scope.buildUndefinedNode(), extracted.__self);\n        }\n      } else if (extracted.key !== undefined) {\n        args.push(extracted.key);\n      }\n\n      return call(file, children.length > 1 ? \"jsxs\" : \"jsx\", args);\n    }\n\n    // Builds props for React.jsx. This function adds children into the props\n    // and ensures that props is always an object\n    function buildJSXOpeningElementAttributes(\n      attribs: NodePath<JSXAttribute | JSXSpreadAttribute>[],\n      children: Expression[],\n    ) {\n      const props = attribs.reduce(accumulateAttribute, []);\n\n      // In React.jsx, children is no longer a separate argument, but passed in\n      // through the argument object\n      if (children?.length > 0) {\n        props.push(buildChildrenProperty(children));\n      }\n\n      return t.objectExpression(props);\n    }\n\n    // Builds JSX Fragment <></> into\n    // Production: React.jsx(type, arguments)\n    // Development: React.jsxDEV(type, { children })\n    function buildJSXFragmentCall(\n      path: NodePath<JSXFragment>,\n      file: PluginPass,\n    ) {\n      const args = [get(file, \"id/fragment\")()];\n\n      const children = t.react.buildChildren(path.node);\n\n      args.push(\n        t.objectExpression(\n          children.length > 0\n            ? [\n                buildChildrenProperty(\n                  //@ts-expect-error The children here contains JSXSpreadChild,\n                  // which will be thrown later\n                  children,\n                ),\n              ]\n            : [],\n        ),\n      );\n\n      if (development) {\n        args.push(\n          path.scope.buildUndefinedNode(),\n          t.booleanLiteral(children.length > 1),\n        );\n      }\n\n      return call(file, children.length > 1 ? \"jsxs\" : \"jsx\", args);\n    }\n\n    // Builds JSX Fragment <></> into\n    // React.createElement(React.Fragment, null, ...children)\n    function buildCreateElementFragmentCall(\n      path: NodePath<JSXFragment>,\n      file: PluginPass,\n    ) {\n      if (filter && !filter(path.node, file)) return;\n\n      return call(file, \"createElement\", [\n        get(file, \"id/fragment\")(),\n        t.nullLiteral(),\n        ...t.react.buildChildren(path.node),\n      ]);\n    }\n\n    // Builds JSX into:\n    // Production: React.createElement(type, arguments, children)\n    // Development: React.createElement(type, arguments, children, source, self)\n    function buildCreateElementCall(\n      path: NodePath<JSXElement>,\n      file: PluginPass,\n    ) {\n      const openingPath = path.get(\"openingElement\");\n\n      return call(file, \"createElement\", [\n        getTag(openingPath),\n        buildCreateElementOpeningElementAttributes(\n          file,\n          path,\n          openingPath.get(\"attributes\"),\n        ),\n        // @ts-expect-error JSXSpreadChild has been transformed in convertAttributeValue\n        ...t.react.buildChildren(path.node),\n      ]);\n    }\n\n    function getTag(openingPath: NodePath<JSXOpeningElement>) {\n      const tagExpr = convertJSXIdentifier(\n        openingPath.node.name,\n        openingPath.node,\n      );\n\n      let tagName: string;\n      if (t.isIdentifier(tagExpr)) {\n        tagName = tagExpr.name;\n      } else if (t.isStringLiteral(tagExpr)) {\n        tagName = tagExpr.value;\n      }\n\n      if (t.react.isCompatTag(tagName)) {\n        return t.stringLiteral(tagName);\n      } else {\n        return tagExpr;\n      }\n    }\n\n    /**\n     * The logic for this is quite terse. It's because we need to\n     * support spread elements. We loop over all attributes,\n     * breaking on spreads, we then push a new object containing\n     * all prior attributes to an array for later processing.\n     */\n    function buildCreateElementOpeningElementAttributes(\n      file: PluginPass,\n      path: NodePath<JSXElement>,\n      attribs: NodePath<JSXAttribute | JSXSpreadAttribute>[],\n    ) {\n      const runtime = get(file, \"runtime\");\n      if (!process.env.BABEL_8_BREAKING) {\n        if (runtime !== \"automatic\") {\n          const objs = [];\n          const props = attribs.reduce(accumulateAttribute, []);\n\n          if (!useSpread) {\n            // Convert syntax to use multiple objects instead of spread\n            let start = 0;\n            props.forEach((prop, i) => {\n              if (t.isSpreadElement(prop)) {\n                if (i > start) {\n                  objs.push(t.objectExpression(props.slice(start, i)));\n                }\n                objs.push(prop.argument);\n                start = i + 1;\n              }\n            });\n            if (props.length > start) {\n              objs.push(t.objectExpression(props.slice(start)));\n            }\n          } else if (props.length) {\n            objs.push(t.objectExpression(props));\n          }\n\n          if (!objs.length) {\n            return t.nullLiteral();\n          }\n\n          if (objs.length === 1) {\n            if (\n              !(\n                t.isSpreadElement(props[0]) &&\n                // If an object expression is spread element's argument\n                // it is very likely to contain __proto__ and we should stop\n                // optimizing spread element\n                t.isObjectExpression(props[0].argument)\n              )\n            ) {\n              return objs[0];\n            }\n          }\n\n          // looks like we have multiple objects\n          if (!t.isObjectExpression(objs[0])) {\n            objs.unshift(t.objectExpression([]));\n          }\n\n          const helper = useBuiltIns\n            ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n            : file.addHelper(\"extends\");\n\n          // spread it\n          return t.callExpression(helper, objs);\n        }\n      }\n\n      const props: ObjectExpression[\"properties\"] = [];\n      const found = Object.create(null);\n\n      for (const attr of attribs) {\n        const name =\n          t.isJSXAttribute(attr) &&\n          t.isJSXIdentifier(attr.name) &&\n          attr.name.name;\n\n        if (\n          runtime === \"automatic\" &&\n          (name === \"__source\" || name === \"__self\")\n        ) {\n          if (found[name]) throw sourceSelfError(path, name);\n          found[name] = true;\n        }\n\n        accumulateAttribute(props, attr);\n      }\n\n      return props.length === 1 &&\n        t.isSpreadElement(props[0]) &&\n        // If an object expression is spread element's argument\n        // it is very likely to contain __proto__ and we should stop\n        // optimizing spread element\n        !t.isObjectExpression(props[0].argument)\n        ? props[0].argument\n        : props.length > 0\n        ? t.objectExpression(props)\n        : t.nullLiteral();\n    }\n  });\n\n  function getSource(source: string, importName: string) {\n    switch (importName) {\n      case \"Fragment\":\n        return `${source}/${development ? \"jsx-dev-runtime\" : \"jsx-runtime\"}`;\n      case \"jsxDEV\":\n        return `${source}/jsx-dev-runtime`;\n      case \"jsx\":\n      case \"jsxs\":\n        return `${source}/jsx-runtime`;\n      case \"createElement\":\n        return source;\n    }\n  }\n\n  function createImportLazily(\n    pass: PluginPass,\n    path: NodePath<Program>,\n    importName: string,\n    source: string,\n  ): () => Identifier | MemberExpression {\n    return () => {\n      const actualSource = getSource(source, importName);\n      if (isModule(path)) {\n        let reference = get(pass, `imports/${importName}`);\n        if (reference) return t.cloneNode(reference);\n\n        reference = addNamed(path, importName, actualSource, {\n          importedInterop: \"uncompiled\",\n          importPosition: \"after\",\n        });\n        set(pass, `imports/${importName}`, reference);\n\n        return reference;\n      } else {\n        let reference = get(pass, `requires/${actualSource}`);\n        if (reference) {\n          reference = t.cloneNode(reference);\n        } else {\n          reference = addNamespace(path, actualSource, {\n            importedInterop: \"uncompiled\",\n          });\n          set(pass, `requires/${actualSource}`, reference);\n        }\n\n        return t.memberExpression(reference, t.identifier(importName));\n      }\n    };\n  }\n}\n\nfunction toMemberExpression(id: string): Identifier | MemberExpression {\n  return (\n    id\n      .split(\".\")\n      .map(name => t.identifier(name))\n      // @ts-expect-error - The Array#reduce does not have a signature\n      // where the type of initial value differs from callback return type\n      .reduce((object, property) => t.memberExpression(object, property))\n  );\n}\n\nfunction makeSource(path: NodePath, state: PluginPass) {\n  const location = path.node.loc;\n  if (!location) {\n    // the element was generated and doesn't have location information\n    return path.scope.buildUndefinedNode();\n  }\n\n  // @ts-expect-error todo: avoid mutating PluginPass\n  if (!state.fileNameIdentifier) {\n    const { filename = \"\" } = state;\n\n    const fileNameIdentifier = path.scope.generateUidIdentifier(\"_jsxFileName\");\n    path.scope.getProgramParent().push({\n      id: fileNameIdentifier,\n      init: t.stringLiteral(filename),\n    });\n    // @ts-expect-error todo: avoid mutating PluginPass\n    state.fileNameIdentifier = fileNameIdentifier;\n  }\n\n  return makeTrace(\n    t.cloneNode(\n      // @ts-expect-error todo: avoid mutating PluginPass\n      state.fileNameIdentifier,\n    ),\n    location.start.line,\n    location.start.column,\n  );\n}\n\nfunction makeTrace(\n  fileNameIdentifier: Identifier,\n  lineNumber?: number,\n  column0Based?: number,\n) {\n  const fileLineLiteral =\n    lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral();\n\n  const fileColumnLiteral =\n    column0Based != null ? t.numericLiteral(column0Based + 1) : t.nullLiteral();\n\n  return template.expression.ast`{\n    fileName: ${fileNameIdentifier},\n    lineNumber: ${fileLineLiteral},\n    columnNumber: ${fileColumnLiteral},\n  }`;\n}\n\nfunction sourceSelfError(path: NodePath, name: string) {\n  const pluginName = `transform-react-jsx-${name.slice(2)}`;\n\n  return path.buildCodeFrameError(\n    `Duplicate ${name} prop found. You are most likely using the deprecated ${pluginName} Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.`,\n  );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAGA;AACA;AAgBA,MAAMA,OAAO,GAAG;EACdC,YAAY,EAAE,OAAO;EACrBC,OAAO,EAAE,WAAW;EACpBC,MAAM,EAAE,qBAAqB;EAC7BC,UAAU,EAAE;AACd,CAAC;AAED,MAAMC,2BAA2B,GAC/B,4CAA4C;AAC9C,MAAMC,4BAA4B,GAAG,uCAAuC;AAE5E,MAAMC,oBAAoB,GAAG,gCAAgC;AAC7D,MAAMC,yBAAyB,GAAG,oCAAoC;AAEtE,MAAMC,GAAG,GAAG,CAACC,IAAgB,EAAEC,IAAY,KACzCD,IAAI,CAACD,GAAG,CAAE,2BAA0BE,IAAK,EAAC,CAAC;AAC7C,MAAMC,GAAG,GAAG,CAACF,IAAgB,EAAEC,IAAY,EAAEE,CAAM,KACjDH,IAAI,CAACE,GAAG,CAAE,2BAA0BD,IAAK,EAAC,EAAEE,CAAC,CAAC;AAEhD,SAASC,QAAQ,C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