import { defineComponent as v, mergeModels as x, useModel as U, computed as s, createElementBlock as h, openBlock as m, createVNode as o, createBlock as S, createCommentVNode as M, unref as t } from "vue";
import { useI18n as I } from "vue-i18n";
import { a as u, d as n, o as _ } from "./start-CE9SawgU.js";
import "pinia";
import "./header-Bn1EKnBE.js";
import { u as w } from "./units-B2_QriGO.js";
import { b as r } from "./unit-to-string.json_vue_type_i18n_index_0_src_true_lang-D7RUwSL9.js";
const k = { class: "extension-config d-flex flex-wrap" }, p = /* @__PURE__ */ v({
  __name: "UnitValueToStringExtension",
  props: /* @__PURE__ */ x({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(d) {
    const f = d, e = U(d, "modelValue"), { t: a } = I(), { units: g, isUnitsLoading: b } = w(
      () => f.sourceAttributes?.[0]?.configuration?.dimensionId
    ), c = s(() => [
      {
        value: "keep_unit",
        title: a("datahub-plugin.etl.unit-to-string.KeepUnit")
      },
      {
        value: "configured_unit",
        title: a("datahub-plugin.etl.unit-to-string.ConfiguredUnit")
      }
    ]), V = s(() => [
      {
        value: "suffix_symbol",
        title: a("datahub-plugin.etl.unit-to-string.SuffixSymbol")
      },
      {
        value: "suffix_name",
        title: a("datahub-plugin.etl.unit-to-string.SuffixName")
      },
      {
        value: "suffix_empty",
        title: a("datahub-plugin.etl.unit-to-string.SuffixEmpty")
      }
    ]);
    return (y, l) => (m(), h("div", k, [
      o(t(u), {
        modelValue: e.value.mode,
        "onUpdate:modelValue": l[0] || (l[0] = (i) => e.value.mode = i),
        items: c.value,
        label: t(a)("datahub-plugin.etl.unit-to-string.Mode"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      e.value.mode && e.value.mode === "configured_unit" ? (m(), S(t(u), {
        key: 0,
        modelValue: e.value.configuredUnitId,
        "onUpdate:modelValue": l[1] || (l[1] = (i) => e.value.configuredUnitId = i),
        items: t(g),
        loading: t(b),
        label: t(a)("datahub-plugin.etl.unit-to-string.Unit"),
        "item-title": "name",
        "item-value": "id",
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])) : M("", !0),
      o(t(u), {
        modelValue: e.value.suffixMode,
        "onUpdate:modelValue": l[2] || (l[2] = (i) => e.value.suffixMode = i),
        items: V.value,
        label: t(a)("datahub-plugin.etl.unit-to-string.SuffixMode"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      o(t(n), {
        modelValue: e.value.separator,
        "onUpdate:modelValue": l[3] || (l[3] = (i) => e.value.separator = i),
        label: t(a)("datahub-plugin.etl.unit-to-string.Separator"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"]),
      o(t(n), {
        modelValue: e.value.decimalSeparator,
        "onUpdate:modelValue": l[4] || (l[4] = (i) => e.value.decimalSeparator = i),
        label: t(a)("datahub-plugin.etl.unit-to-string.DecimalSeparator"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"]),
      o(t(n), {
        modelValue: e.value.decimalPlaces,
        "onUpdate:modelValue": l[5] || (l[5] = (i) => e.value.decimalPlaces = i),
        label: t(a)("datahub-plugin.etl.unit-to-string.DecimalPlaces"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"])
    ]));
  }
});
typeof r == "function" && r(p);
const T = /* @__PURE__ */ _(p, [["__scopeId", "data-v-b62c4c97"]]);
export {
  T as default
};
