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kB,EAAM,GAAS,eAAe,OAC/D,OAAO,eAAe,QAAQ,UAAK,EAAQ,EAAM,EACnD,CAWA,SAAS,kBAAkB,EAAM,GAC/B,MAAM,EAAe,EAAQ,WAAW,SAAS,OAC3C,EAAsB,EAAQ,WAAW,SAAS,cAClD,EAAgB,EAAQ,WAAW,SAAS,QAC5C,GAAsD,IAAhC,EAAQ,oBAC9B,EAAO,QAAQ,MAAM,UAAK,EAAQ,EAAM,EAAc,EAAqB,GAC3E,EAAS,EAAK,OACd,EAAS,EAAK,OAEd,EAAc,IAAI,EAAI,cAAc,SAAS,EAAM,GACnD,EAAgB,IAAI,EAAI,eAAe,eAAe,GACtD,EAAiB,IAAI,EAAI,iBAAiB,SAC9C,EACA,EACA,EACA,EACA,GAEI,EAAsC,QAAQ,EAAQ,qCAE5D,IAAI,EAAkB,KAoBtB,OAnBI,EAAQ,WAAW,SAAS,YAC9B,EAAkB,IAAI,EAAI,qBAAqB,SAC7C,EACA,EACA,EACA,EACA,EAAQ,WAAW,SAAS,cAC5B,GAEF,EAAgB,mBAGhB,0BAA0B,QAAQ,UAAK,EAAQ,EAAgB,EAAQ,EAAgB,kBACnF,EAAQ,WAAW,SAAS,eAC9B,EAAgB,wBAET,EAAQ,WAAW,SAAS,eACrC,0BAA0B,QAAQ,UAAK,EAAQ,EAAgB,EAAQ,qBAAqB,QAAQ,UAAK,EAAQ,IAE5G,CAAC,iBAAgB,SAAQ,cAAa,kBAAiB,gBAChE,CA3FE,QAAQ,WAAa,WA8BrB,QAAQ,UAAY,UASpB,QAAQ,mBAAqB","file":"/npm/sucrase@3.31.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/sucrase@3.31.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _CJSImportProcessor = require('./CJSImportProcessor'); var _CJSImportProcessor2 = _interopRequireDefault(_CJSImportProcessor);\nvar _computeSourceMap = require('./computeSourceMap'); var _computeSourceMap2 = _interopRequireDefault(_computeSourceMap);\nvar _HelperManager = require('./HelperManager');\nvar _identifyShadowedGlobals = require('./identifyShadowedGlobals'); var _identifyShadowedGlobals2 = _interopRequireDefault(_identifyShadowedGlobals);\nvar _NameManager = require('./NameManager'); var _NameManager2 = _interopRequireDefault(_NameManager);\nvar _Options = require('./Options');\nvar _parser = require('./parser');\n\nvar _TokenProcessor = require('./TokenProcessor'); var _TokenProcessor2 = _interopRequireDefault(_TokenProcessor);\nvar _RootTransformer = require('./transformers/RootTransformer'); var _RootTransformer2 = _interopRequireDefault(_RootTransformer);\nvar _formatTokens = require('./util/formatTokens'); var _formatTokens2 = _interopRequireDefault(_formatTokens);\nvar _getTSImportedNames = require('./util/getTSImportedNames'); var _getTSImportedNames2 = _interopRequireDefault(_getTSImportedNames);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n function getVersion() {\n  /* istanbul ignore next */\n  return \"3.31.0\";\n} exports.getVersion = getVersion;\n\n function transform(code, options) {\n  _Options.validateOptions.call(void 0, options);\n  try {\n    const sucraseContext = getSucraseContext(code, options);\n    const transformer = new (0, _RootTransformer2.default)(\n      sucraseContext,\n      options.transforms,\n      Boolean(options.enableLegacyBabel5ModuleInterop),\n      options,\n    );\n    let result = {code: transformer.transform()};\n    if (options.sourceMapOptions) {\n      if (!options.filePath) {\n        throw new Error(\"filePath must be specified when generating a source map.\");\n      }\n      result = {\n        ...result,\n        sourceMap: _computeSourceMap2.default.call(void 0, result.code, options.filePath, options.sourceMapOptions),\n      };\n    }\n    return result;\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  } catch (e) {\n    if (options.filePath) {\n      e.message = `Error transforming ${options.filePath}: ${e.message}`;\n    }\n    throw e;\n  }\n} exports.transform = transform;\n\n/**\n * Return a string representation of the sucrase tokens, mostly useful for\n * diagnostic purposes.\n */\n function getFormattedTokens(code, options) {\n  const tokens = getSucraseContext(code, options).tokenProcessor.tokens;\n  return _formatTokens2.default.call(void 0, code, tokens);\n} exports.getFormattedTokens = getFormattedTokens;\n\n/**\n * Call into the parser/tokenizer and do some further preprocessing:\n * - Come up with a set of used names so that we can assign new names.\n * - Preprocess all import/export statements so we know which globals we are interested in.\n * - Compute situations where any of those globals are shadowed.\n *\n * In the future, some of these preprocessing steps can be skipped based on what actual work is\n * being done.\n */\nfunction getSucraseContext(code, options) {\n  const isJSXEnabled = options.transforms.includes(\"jsx\");\n  const isTypeScriptEnabled = options.transforms.includes(\"typescript\");\n  const isFlowEnabled = options.transforms.includes(\"flow\");\n  const disableESTransforms = options.disableESTransforms === true;\n  const file = _parser.parse.call(void 0, code, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled);\n  const tokens = file.tokens;\n  const scopes = file.scopes;\n\n  const nameManager = new (0, _NameManager2.default)(code, tokens);\n  const helperManager = new (0, _HelperManager.HelperManager)(nameManager);\n  const tokenProcessor = new (0, _TokenProcessor2.default)(\n    code,\n    tokens,\n    isFlowEnabled,\n    disableESTransforms,\n    helperManager,\n  );\n  const enableLegacyTypeScriptModuleInterop = Boolean(options.enableLegacyTypeScriptModuleInterop);\n\n  let importProcessor = null;\n  if (options.transforms.includes(\"imports\")) {\n    importProcessor = new (0, _CJSImportProcessor2.default)(\n      nameManager,\n      tokenProcessor,\n      enableLegacyTypeScriptModuleInterop,\n      options,\n      options.transforms.includes(\"typescript\"),\n      helperManager,\n    );\n    importProcessor.preprocessTokens();\n    // We need to mark shadowed globals after processing imports so we know that the globals are,\n    // but before type-only import pruning, since that relies on shadowing information.\n    _identifyShadowedGlobals2.default.call(void 0, tokenProcessor, scopes, importProcessor.getGlobalNames());\n    if (options.transforms.includes(\"typescript\")) {\n      importProcessor.pruneTypeOnlyImports();\n    }\n  } else if (options.transforms.includes(\"typescript\")) {\n    _identifyShadowedGlobals2.default.call(void 0, tokenProcessor, scopes, _getTSImportedNames2.default.call(void 0, tokenProcessor));\n  }\n  return {tokenProcessor, scopes, nameManager, importProcessor, helperManager};\n}\n"]}