import { o as d } from "./rolldown-runtime.js";
import { i as p } from "./vendor/react.js";
import { o as h } from "./useRenderElement.js";
import { r as g } from "./useButton.js";
import { n as l } from "./useCompositeListItem.js";
var n = /* @__PURE__ */ d(p());
function M(m = {}) {
  const { highlightItemOnHover: s, highlightedIndex: a, onHighlightedIndexChange: i } = g(), { ref: u, index: e } = l(m), t = a === e, r = n.useRef(null), c = h(u, r);
  return {
    compositeProps: n.useMemo(() => ({
      tabIndex: t ? 0 : -1,
      onFocus() {
        i(e);
      },
      onMouseMove() {
        const o = r.current;
        if (!s || !o) return;
        const f = o.hasAttribute("disabled") || o.ariaDisabled === "true";
        !t && !f && o.focus();
      }
    }), [
      t,
      i,
      e,
      s
    ]),
    compositeRef: c,
    index: e
  };
}
export {
  M as t
};

//# sourceMappingURL=useCompositeItem.js.map