import { a as r, E as compilerRuntimeExports, r as reactExports, j as jsxRuntimeExports } from "./vendor-react-DYNCg6N5.js";
import { T as Text, k as Tooltip } from "./vendor-mantine-h0WlM2Mj.js";
const OverflowTip = (t0) => {
  const $ = compilerRuntimeExports.c(22);
  let children;
  let index;
  let props;
  let t1;
  let t2;
  if ($[0] !== t0) {
    ({
      children,
      maxWidth: t1,
      component: t2,
      index,
      ...props
    } = t0);
    $[0] = t0;
    $[1] = children;
    $[2] = index;
    $[3] = props;
    $[4] = t1;
    $[5] = t2;
  } else {
    children = $[1];
    index = $[2];
    props = $[3];
    t1 = $[4];
    t2 = $[5];
  }
  const maxWidth = t1 === void 0 ? "200px" : t1;
  const component = t2 === void 0 ? "span" : t2;
  const [opened, setOpened] = reactExports.useState(false);
  const textElementRef = reactExports.useRef(null);
  let t3;
  if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = () => {
      const element = textElementRef.current;
      if (element) {
        const elementWidth = element.offsetWidth;
        const scrollWidth = element == null ? void 0 : element.scrollWidth;
        setOpened(scrollWidth > elementWidth);
      }
    };
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  const handleHover = t3;
  let t4;
  let t5;
  if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
    t4 = {
      wordBreak: "break-word"
    };
    t5 = {
      transition: "pop",
      duration: 300
    };
    $[7] = t4;
    $[8] = t5;
  } else {
    t4 = $[7];
    t5 = $[8];
  }
  let t6;
  if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
    t6 = () => setOpened(false);
    $[9] = t6;
  } else {
    t6 = $[9];
  }
  const t7 = component;
  const t8 = children || "";
  let t9;
  if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
    t9 = {
      fontSize: "14px"
    };
    $[10] = t9;
  } else {
    t9 = $[10];
  }
  let t10;
  if ($[11] !== children || $[12] !== props || $[13] !== t7 || $[14] !== t8) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { onMouseEnter: handleHover, onMouseLeave: t6, component: t7, ...props, "data-text": t8, ref: textElementRef, truncate: true, w: "100%", style: t9, children });
    $[11] = children;
    $[12] = props;
    $[13] = t7;
    $[14] = t8;
    $[15] = t10;
  } else {
    t10 = $[15];
  }
  let t11;
  if ($[16] !== children || $[17] !== index || $[18] !== maxWidth || $[19] !== opened || $[20] !== t10) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { withArrow: true, label: children, multiline: true, maw: maxWidth, sx: t4, transitionProps: t5, arrowSize: 6, offset: 0, opened, zIndex: index, children: t10 });
    $[16] = children;
    $[17] = index;
    $[18] = maxWidth;
    $[19] = opened;
    $[20] = t10;
    $[21] = t11;
  } else {
    t11 = $[21];
  }
  return t11;
};
const OverflowTip$1 = r.memo(OverflowTip);
export {
  OverflowTip$1 as O
};
//# sourceMappingURL=index-C-CFogWu.js.map
