import { useModuleDictionary as a } from "@m4l/core";
import { shallow as d } from "zustand/shallow";
import { useDynamicSortStore as o } from "../../store/useDynamicSortStore.js";
function P() {
  const { getLabel: n } = a(), t = o((e) => e.isOpenPopoverMenuFields), r = o((e) => e.actions.getElementRef(), d), { showPopoverSortForAdd: s, closePopoverMenuFields: i } = o(
    (e) => e.actions
  );
  function l(e, u) {
    s(u);
  }
  function c() {
    i(!1);
  }
  function p(e) {
    return e.label ?? n(e.dictionaryId);
  }
  return {
    elementRef: r,
    isOpenPopoverMenuFields: t,
    getItemLabel: p,
    handleClosePopover: c,
    handleOpenPopUpClickItem: l
  };
}
export {
  P as default
};
