import { defineComponent as v, mergeModels as _, useModel as h, computed as m, createElementBlock as M, openBlock as b, createVNode as p, createBlock as V, createCommentVNode as D, unref as t } from "vue";
import { useI18n as C } from "vue-i18n";
import { h as s, l as I } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { u as T } from "./units-DogXJCIC.mjs";
const x = { class: "extension-config d-flex flex-wrap" }, f = /* @__PURE__ */ v({
  __name: "NumberToUnitExtension",
  props: /* @__PURE__ */ _({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(l) {
    const o = l, i = h(l, "modelValue"), { t: n } = C(), { units: r, isUnitsLoading: d } = T(
      () => {
        var a, e;
        return (e = (a = o.destinationAttribute) == null ? void 0 : a.configuration) == null ? void 0 : e.dimensionId;
      }
    ), g = m(() => [
      {
        value: "configured_unit",
        title: n("datahub-plugin.etl.number-to-unit.ConfigureManually")
      },
      {
        value: "keep_unit",
        title: n("datahub-plugin.etl.number-to-unit.KeepUnit")
      },
      {
        value: "destination_unit",
        title: n("datahub-plugin.etl.number-to-unit.DefaultUnitDestination")
      }
    ]), U = m(
      () => i.value.mode === "configured_unit"
    );
    return (a, e) => (b(), M("div", x, [
      p(t(s), {
        modelValue: i.value.sourceUnitId,
        "onUpdate:modelValue": e[0] || (e[0] = (u) => i.value.sourceUnitId = u),
        items: t(r),
        loading: t(d),
        label: t(n)("datahub-plugin.etl.number-to-unit.SourceTreeLanguage"),
        "item-title": "symbol",
        "item-value": "id",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"]),
      p(t(s), {
        modelValue: i.value.mode,
        "onUpdate:modelValue": e[1] || (e[1] = (u) => i.value.mode = u),
        items: g.value,
        label: t(n)("datahub-plugin.etl.number-to-unit.ModeDestinationUnit"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      U.value ? (b(), V(t(s), {
        key: 0,
        modelValue: i.value.configuredUnitId,
        "onUpdate:modelValue": e[2] || (e[2] = (u) => i.value.configuredUnitId = u),
        items: t(r),
        loading: t(d),
        label: t(n)("datahub-plugin.etl.number-to-unit.unitToConvertTo"),
        "item-title": "symbol",
        "item-value": "id",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])) : D("", !0)
    ]));
  }
});
function c(l) {
  const o = l;
  o.__i18n = o.__i18n || [], o.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "datahub-plugin": {
          etl: {
            "number-to-unit": {
              SourceUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Source unit" } },
              ModeDestinationUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Mode destination unit" } },
              ConfigureManually: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Configure manually" } },
              KeepUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Keep unit" } },
              DefaultUnitDestination: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Default unit of destination attribute" } },
              unitToConvertTo: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Unit to convert to" } }
            }
          }
        }
      },
      "de-DE": {
        "datahub-plugin": {
          etl: {
            "number-to-unit": {
              SourceUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit des Ursprungswertes" } },
              ModeDestinationUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Modus zum Finden der Ziel-Einheit" } },
              ConfigureManually: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Manuell Konfigurieren" } },
              KeepUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit behalten" } },
              DefaultUnitDestination: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Standardeinheit des Zielattributes" } },
              unitToConvertTo: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Wert umrechen auf" } }
            }
          }
        }
      }
    }
  });
}
typeof c == "function" && c(f);
const B = /* @__PURE__ */ I(f, [["__scopeId", "data-v-d1ec913c"]]);
export {
  B as default
};
