"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MDXDependencyDetector = void 0;
function _mdxCompilers() {
  const data = require("@teambit/mdx.compilers.mdx-transpiler");
  _mdxCompilers = function () {
    return data;
  };
  return data;
}
class MDXDependencyDetector {
  constructor(supportedExtensions) {
    this.supportedExtensions = supportedExtensions;
  }
  isSupported(context) {
    return this.supportedExtensions.includes(context.ext);
  }
  detect(source) {
    const output = (0, _mdxCompilers().compileSync)(source);
    const imports = output.getImportSpecifiers();
    if (!imports) return [];
    const files = imports.map(importSpec => {
      return importSpec.fromModule;
    });
    return files;
  }
}
exports.MDXDependencyDetector = MDXDependencyDetector;

//# sourceMappingURL=mdx.detector.js.map