import { defineComponent as E, mergeModels as p, useModel as B, ref as D, watch as f, createBlock as I, openBlock as M, unref as k } from "vue";
import { useI18n as T } from "vue-i18n";
import { u as h, b as N } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { V as O } from "./constants-CwfsvyFM.mjs";
import { u as A, b as c } from "./Numbers.json_vue_type_i18n_index_0_src_true_lang-BOEd2Oac.mjs";
const w = /* @__PURE__ */ E({
  __name: "DatahubDataTypeIntegerValueEditor",
  props: /* @__PURE__ */ p({
    modelValue: {},
    readOnly: { type: Boolean },
    attribute: {},
    massEditing: { type: Boolean },
    label: {},
    fieldName: {},
    dataTypeInstance: {},
    loading: { type: Boolean }
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: /* @__PURE__ */ p(["validated", "update:model-value"], ["update:modelValue"]),
  setup(i, { emit: b }) {
    const t = i, g = b, s = B(i, "modelValue"), { t: V } = T(), { root: y, dispatchEvent: v } = h(O), n = D("");
    return f(
      () => t.modelValue,
      (e) => {
        var a, l, m, u, d;
        const r = parseInt(e), o = A(r, (a = t.attribute) == null ? void 0 : a.configuration);
        n.value = o ? V(o, {
          min: (m = (l = t.attribute) == null ? void 0 : l.configuration) == null ? void 0 : m.min,
          max: (d = (u = t.attribute) == null ? void 0 : u.configuration) == null ? void 0 : d.max
        }) : "";
      }
    ), f(
      () => !n.value,
      (e) => {
        v({ data: e }), g("validated", e);
      }
    ), (e, r) => {
      var o, a;
      return M(), I(k(N), {
        ref_key: "root",
        ref: y,
        modelValue: s.value,
        "onUpdate:modelValue": r[0] || (r[0] = (l) => s.value = l),
        modelModifiers: { number: !0 },
        readonly: ((a = (o = e.attribute) == null ? void 0 : o.configuration) == null ? void 0 : a.readOnly) || e.readOnly,
        loading: e.loading,
        label: e.massEditing ? void 0 : e.label,
        "error-messages": n.value,
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "readonly", "loading", "label", "error-messages"]);
    };
  }
});
typeof c == "function" && c(w);
export {
  w as default
};
