var o = Object.defineProperty;
var t = (e, r) => o(e, "name", { value: r, configurable: !0 });
import n from "../../../../../../typescript@5.5.4/node_modules/typescript/lib/typescript.js";
function a(e) {
  if (e.code === 7027)
    return "warning";
  switch (e.category) {
    case n.DiagnosticCategory.Error:
      return "error";
    case n.DiagnosticCategory.Message:
      return "info";
    case n.DiagnosticCategory.Warning:
      return "warning";
    case n.DiagnosticCategory.Suggestion:
      return "info";
  }
}
t(a, "tsCategoryToSeverity");
function u(e) {
  return !!(e.file && typeof e.start == "number" && typeof e.length == "number");
}
t(u, "isDiagnosticWithLocation");
function i(e) {
  return typeof e.messageText == "string" ? e.messageText : e.messageText.messageText;
}
t(i, "tsDiagnosticMessage");
function f(e) {
  const r = e.start, s = i(e);
  return {
    from: r,
    to: r + e.length,
    message: s,
    severity: a(e)
  };
}
t(f, "convertTSDiagnosticToCM");
export {
  f as convertTSDiagnosticToCM,
  u as isDiagnosticWithLocation,
  a as tsCategoryToSeverity,
  i as tsDiagnosticMessage
};
