import { defineComponent as f, mergeModels as y, useModel as i, onBeforeMount as v, watch as V, createBlock as d, createCommentVNode as g, openBlock as a, unref as o, withCtx as B, createElementVNode as k, createElementBlock as D, Fragment as M, renderList as T } from "vue";
import { storeToRefs as S } from "pinia";
import { T as _, e as C } from "./start-CE9SawgU.js";
import "vue-i18n";
import "./header-Bn1EKnBE.js";
import { u as L } from "./dictionary-B08TTkmv.js";
const F = /* @__PURE__ */ f({
  __name: "RMADocumentTypeFiltersSettings",
  props: /* @__PURE__ */ y({
    modelValue: {},
    data: {},
    options: {},
    settings: {},
    loading: { type: Boolean },
    readonly: { type: Boolean },
    isDefault: { type: Boolean }
  }, {
    modelValue: { default: () => [] },
    modelModifiers: {},
    valid: { type: Boolean, default: !0 },
    validModifiers: {}
  }),
  emits: ["update:modelValue", "update:valid"],
  setup(l) {
    const e = i(l, "modelValue");
    i(l, "valid");
    const n = L(), { documentTypes: m, isDocumentTypesLoading: s } = S(n);
    return v(() => {
      n.ensureDocumentTypes();
    }), V(
      e,
      (t) => {
        t || (e.value = []);
      },
      { immediate: !0 }
    ), (t, r) => e.value ? (a(), d(o(_), {
      key: 0,
      loading: o(s),
      type: "list-item-avatar@3"
    }, {
      default: B(() => [
        k("div", null, [
          (a(!0), D(M, null, T(o(m), ({ id: u, title: p }) => (a(), d(o(C), {
            key: u,
            modelValue: e.value,
            "onUpdate:modelValue": r[0] || (r[0] = (c) => e.value = c),
            label: p,
            value: String(u),
            readonly: t.readonly
          }, null, 8, ["modelValue", "label", "value", "readonly"]))), 128))
        ])
      ]),
      _: 1
    }, 8, ["loading"])) : g("", !0);
  }
});
export {
  F as default
};
