import { jsxs as s, Fragment as u, jsx as a } from "@emotion/react/jsx-runtime";
import { useModuleDictionary as f } from "@m4l/core";
import { useMemo as i } from "react";
import { BOOLEAN_OPERATORS as b } from "../../../constants.js";
import { DYNAMIC_FILTER_DICTIONARY_ID as d, DICCTIONARY as t } from "../../../dictionary.js";
import { useDynamicFilterStore as O } from "../../../store/useDynamicFilterStore.js";
import { RHFAutocomplete as p } from "../../../../hook-form/RHFAutocomplete/RHFAutocomplete.js";
function R() {
  const { getLabel: o } = f(), r = O((e) => e.popoverFilterData?.field)?.restritcOperatorsTo, n = i(
    () => b.map((e) => ({
      id: e,
      label: o(`${d}.operator_${e}`)
    })).filter((e) => r ? r.includes(e.id) : !0),
    [o, r]
  ), m = i(
    () => [
      {
        value: !0,
        label: o(t.operand_true)
      },
      {
        value: !1,
        label: o(t.operand_false)
      }
    ],
    [o]
  );
  return /* @__PURE__ */ s(u, { children: [
    /* @__PURE__ */ a(
      p,
      {
        type: "text",
        name: "formValueOperator",
        autoComplete: "off",
        options: n,
        getOptionLabel: (e) => e.label,
        isOptionEqualToValue: (e, l) => e.id === l.id,
        label: o(t.label_boolean_operator)
      }
    ),
    /* @__PURE__ */ a(
      p,
      {
        type: "text",
        name: "formValueOperand1",
        autoComplete: "off",
        options: m,
        getOptionLabel: (e) => e.label,
        isOptionEqualToValue: (e, l) => e.value === l.value,
        label: o(t.label_boolean_operand1)
      }
    )
  ] });
}
export {
  R as BooleanFilter
};
