import { defineComponent as g, mergeModels as c, useModel as s, computed as r, watch as f, createBlock as v, openBlock as x, unref as y, mergeProps as _ } from "vue";
import { useI18n as h } from "vue-i18n";
import { d as B } from "./start-CE9SawgU.js";
import "pinia";
import "./header-Bn1EKnBE.js";
const V = /* @__PURE__ */ g({
  __name: "SettingInput",
  props: /* @__PURE__ */ c({
    modelValue: {},
    data: {},
    options: {},
    settings: {},
    loading: { type: Boolean },
    readonly: { type: Boolean },
    isDefault: { type: Boolean }
  }, {
    modelValue: {},
    modelModifiers: {},
    valid: { type: Boolean, default: !0 },
    validModifiers: {}
  }),
  emits: ["update:modelValue", "update:valid"],
  setup(t) {
    const e = t, o = s(t, "modelValue"), i = s(t, "valid"), { t: u } = h(), n = r(() => !e.isDefault && e.options?.regex && !new RegExp(e.options.regex).test(o.value || "") ? u("setting-plugin.setting-input.regex", { pattern: e.options.regex }) : void 0), d = r(() => ({
      label: e.options?.label,
      hint: e.options?.helperText,
      persistentHint: !!e.options?.helperText,
      style: e.options?.width ? { width: e.options.width } : "",
      type: e.options?.encryption ? "password" : "text",
      error: !e.isDefault && (!i.value || !!n.value),
      readonly: e.readonly,
      loading: e.loading,
      errorMessages: n.value
    }));
    return f(
      n,
      (l) => {
        i.value = !l;
      },
      { immediate: !0 }
    ), (l, a) => (x(), v(y(B), _({
      modelValue: o.value,
      "onUpdate:modelValue": a[0] || (a[0] = (m) => o.value = m)
    }, d.value), null, 16, ["modelValue"]));
  }
});
function p(t) {
  const e = t;
  e.__i18n = e.__i18n || [], e.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "setting-plugin": {
          "setting-input": {
            regex: { t: 0, b: { t: 2, i: [{ t: 3, v: "Has to match " }, { t: 4, k: "pattern" }] } }
          }
        }
      },
      "de-DE": {
        "setting-plugin": {
          "setting-input": {
            regex: { t: 0, b: { t: 2, i: [{ t: 3, v: "Muss mit " }, { t: 4, k: "pattern" }, { t: 3, v: " übereinstimmen" }] } }
          }
        }
      }
    }
  });
}
typeof p == "function" && p(V);
export {
  V as default
};
