"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var languages_exports = {};
__export(languages_exports, {
  EXTENSION_MAP: () => EXTENSION_MAP,
  GRAMMAR_MAP: () => GRAMMAR_MAP,
  detectLanguage: () => detectLanguage,
  isSupportedLanguage: () => isSupportedLanguage
});
module.exports = __toCommonJS(languages_exports);
const EXTENSION_MAP = {
  ".ts": "typescript",
  ".tsx": "tsx",
  ".js": "javascript",
  ".jsx": "jsx",
  ".mjs": "javascript",
  ".cjs": "javascript",
  ".py": "python",
  ".pyw": "python",
  ".go": "go",
  ".rs": "rust",
  ".java": "java",
  ".c": "c",
  ".h": "c",
  ".cpp": "cpp",
  ".cc": "cpp",
  ".cxx": "cpp",
  ".hxx": "cpp",
  ".hpp": "cpp",
  ".cs": "csharp",
  ".php": "php",
  ".rb": "ruby",
  ".rake": "ruby",
  ".swift": "swift",
  ".kt": "kotlin",
  ".kts": "kotlin",
  ".dart": "dart",
  ".svelte": "svelte",
  ".pas": "pascal",
  ".dpr": "pascal",
  ".dpk": "pascal",
  ".lpr": "pascal",
  ".dfm": "pascal",
  ".fmx": "pascal",
  ".liquid": "liquid",
  ".ex": "elixir",
  ".exs": "elixir",
  ".scala": "scala",
  ".sc": "scala",
  ".sbt": "scala",
  ".lua": "lua",
  ".zig": "zig",
  ".zon": "zig",
  ".sh": "bash",
  ".bash": "bash",
  ".zsh": "bash",
  ".ml": "ocaml",
  ".mli": "ocaml",
  ".elm": "elm",
  ".sol": "solidity",
  ".vue": "vue",
  ".m": "objc",
  ".yaml": "yaml",
  ".yml": "yaml",
  ".tf": "hcl",
  ".tfvars": "hcl",
  ".css": "css",
  ".scss": "scss",
  ".sass": "scss",
  ".html": "html",
  ".htm": "html"
};
const GRAMMAR_MAP = {
  typescript: "tree-sitter-typescript",
  tsx: "tree-sitter-tsx",
  javascript: "tree-sitter-javascript",
  jsx: "tree-sitter-javascript",
  python: "tree-sitter-python",
  go: "tree-sitter-go",
  rust: "tree-sitter-rust",
  java: "tree-sitter-java",
  c: "tree-sitter-c",
  cpp: "tree-sitter-cpp",
  csharp: "tree-sitter-c-sharp",
  php: "tree-sitter-php",
  ruby: "tree-sitter-ruby",
  swift: "tree-sitter-swift",
  kotlin: "tree-sitter-kotlin",
  dart: "tree-sitter-dart",
  svelte: "tree-sitter-svelte",
  elixir: "tree-sitter-elixir",
  scala: "tree-sitter-scala",
  lua: "tree-sitter-lua",
  zig: "tree-sitter-zig",
  bash: "tree-sitter-bash",
  ocaml: "tree-sitter-ocaml",
  elm: "tree-sitter-elm",
  solidity: "tree-sitter-solidity",
  vue: "tree-sitter-vue",
  objc: "tree-sitter-objc",
  yaml: "tree-sitter-yaml",
  hcl: "tree-sitter-hcl",
  css: "tree-sitter-css",
  scss: "tree-sitter-scss",
  html: "tree-sitter-html",
  // Pascal and Liquid require custom WASM not bundled in tree-sitter-wasms
  pascal: "",
  liquid: "",
  unknown: ""
};
function detectLanguage(filePath) {
  const ext = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
  return EXTENSION_MAP[ext] ?? "unknown";
}
function isSupportedLanguage(lang) {
  return lang !== "unknown";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  EXTENSION_MAP,
  GRAMMAR_MAP,
  detectLanguage,
  isSupportedLanguage
});
//# sourceMappingURL=languages.js.map
