import { useEnvironment as C, useModuleSkeleton as v } from "@m4l/core";
import { ASSETS_URL as S, ASSETS as n } from "../../constants.js";
import { getDynamicSortDictionary as w, DICCTIONARY as i } from "../../dictionary.js";
import { useDynamicSortStore as o } from "../../store/useDynamicSortStore.js";
function T() {
  const { host_static_assets: r, environment_assets: e } = C(), l = o((t) => t.automatic), m = v(), s = o((t) => t.ownerState?.isValid), c = o((t) => t.ownerState?.isDirty), d = o((t) => t.appliedSorts), p = o((t) => t.ownerState?.inEdition), { hidePopoverSort: f, clearSorts: u, fireOnChangeSorts: a } = o(
    (t) => t.actions
  );
  function _() {
    f(!1), u(), a();
  }
  const $ = `${r}/${e}/${S}/${l ? n.refresh : n.sort}`, y = `${r}/${e}/${S}/${n.clean}`, D = d.findIndex((t) => !t.fixed) > -1, h = w(
    s ? c ? i.sort_tooltip_dirty : i.sort_tooltip_refresh : i.sort_tooltip_invalid
  );
  return {
    isSkeleton: m,
    sortIconUrl: $,
    clearIconUrl: y,
    canShowRemoveAction: D,
    onClickClearSorts: _,
    onClickSort: a,
    sortButtonDictionaryTooltip: h,
    ownerState: { isValid: s, isDirty: c, inEdition: p }
  };
}
export {
  T as default
};
