import { ref as f, watch as l } from "vue";
function i(o, t) {
  const e = f(!o.value);
  function n() {
    e.value || (e.value = !0, t?.("opened"));
  }
  function u() {
    e.value && (e.value = !1, t?.("closed"));
  }
  function r() {
    e.value ? u() : n();
  }
  return l(o, (a) => {
    a ? u() : n();
  }), {
    opened: e,
    open: n,
    close: u,
    toggle: r
  };
}
export {
  i as u
};
