"use strict";
var import_LogViewerEntry = require("../../LogViewerEntry.css");
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const jsxRuntime = require("react/jsx-runtime");
const kit_Icon = require("../Icon.cjs");
const kit_internal_functions = require("../internal/functions.cjs");
const kit_internal_types = require("../internal/types.cjs");
const kit_Theme_UI = require("../Theme/UI.cjs");
require("../Theme/themeUtils.cjs");
require("../Theme/themes.cjs");
const kit_Tooltip = require("../Tooltip.cjs");
const base = "LogViewerEntry_base_04229";
const level = "LogViewerEntry_level_04229";
const levelLabel = "LogViewerEntry_levelLabel_04229";
const time = "LogViewerEntry_time_04229";
const message = "LogViewerEntry_message_04229";
const critical = "LogViewerEntry_critical_04229";
const debug = "LogViewerEntry_debug_04229";
const error = "LogViewerEntry_error_04229";
const trace = "LogViewerEntry_trace_04229";
const warning = "LogViewerEntry_warning_04229";
const noWrap = "LogViewerEntry_noWrap_04229";
const css = {
  base,
  level,
  levelLabel,
  time,
  message,
  critical,
  debug,
  error,
  trace,
  warning,
  noWrap
};
const ICON_WIDTH = 26;
const DATETIME_PREFIX = "[";
const DATETIME_SUFFIX = "]";
const DATETIME_FORMAT = `[${DATETIME_PREFIX}]YYYY-MM-DD HH:mm:ss${DATETIME_SUFFIX}`;
const MAX_DATETIME_LENGTH = 22;
const LogViewerEntry = ({
  level: level2 = kit_internal_types.LogLevel.None,
  message: message2,
  noWrap: noWrap2 = false,
  formattedTime,
  style
}) => {
  const {
    themeSettings: { className: themeClass }
  } = kit_Theme_UI.useTheme();
  const classes = [css.base, themeClass];
  const levelClasses = [css.level, css[level2]];
  const messageClasses = [css.message, css[level2]];
  if (noWrap2)
    classes.push(css.noWrap);
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.join(" "), style, tabIndex: 0, children: [
    /* @__PURE__ */ jsxRuntime.jsx(kit_Tooltip, { content: `Level: ${kit_internal_functions.capitalize(level2)}`, placement: "top", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: levelClasses.join(" "), children: [
      /* @__PURE__ */ jsxRuntime.jsxs("div", { className: css.levelLabel, children: [
        "<[",
        level2,
        "]>"
      ] }),
      level2 !== kit_internal_types.LogLevel.None && /* @__PURE__ */ jsxRuntime.jsx(kit_Icon.default, { name: level2, size: "small", title: level2 })
    ] }) }),
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: css.time, children: formattedTime }),
    /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        className: messageClasses.join(" "),
        dangerouslySetInnerHTML: { __html: kit_internal_functions.ansiToHtml(message2) }
      }
    )
  ] });
};
exports.DATETIME_FORMAT = DATETIME_FORMAT;
exports.ICON_WIDTH = ICON_WIDTH;
exports.MAX_DATETIME_LENGTH = MAX_DATETIME_LENGTH;
exports.default = LogViewerEntry;
