import { defineComponent as y, mergeModels as h, useModel as k, computed as A, onBeforeMount as x, createElementBlock as b, openBlock as i, createBlock as f, createCommentVNode as E, createVNode as d, Fragment as F, unref as l } from "vue";
import { useI18n as L } from "vue-i18n";
import { storeToRefs as M } from "pinia";
import { a as u, d as w, o as S } from "./start-CE9SawgU.js";
import "./header-Bn1EKnBE.js";
import { u as U } from "./dataTypes-DocW2t0g.js";
import { a as n } from "./constants-CwfsvyFM.js";
import { b as g } from "./number-to-tree.json_vue_type_i18n_index_0_src_true_lang-BH4ZonZZ.js";
const _ = { class: "extension-config d-flex flex-wrap" }, v = /* @__PURE__ */ y({
  __name: "TreeExtension",
  props: /* @__PURE__ */ h({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(V) {
    const a = k(V, "modelValue"), { t: o } = L(), m = U(), { languages: c, isLanguagesLoading: T } = M(m);
    function p(r, e, t) {
      return r === n && e === n ? t === "tree-to-tree" : r === n ? t === "tree-to-string" : e === n ? t === "string-to-tree" : !1;
    }
    const s = A(() => [
      {
        value: "key",
        title: o("datahub-plugin.etl.number-to-tree.Key"),
        mode: 1
      },
      {
        value: "title",
        title: o("datahub-plugin.etl.number-to-tree.Title"),
        mode: 0
      }
    ]);
    return x(m.ensureLanguages), (r, e) => (i(), b("div", _, [
      p(
        r.sourceAttributes?.[0]?.dataType,
        r.destinationAttribute?.dataType,
        "tree-to-tree"
      ) ? (i(), b(F, { key: 0 }, [
        d(l(u), {
          modelValue: a.value.sourceField,
          "onUpdate:modelValue": e[0] || (e[0] = (t) => a.value.sourceField = t),
          items: s.value,
          label: l(o)("datahub-plugin.etl.number-to-tree.SourceTreeLanguage"),
          "max-width": "567",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "label"]),
        d(l(u), {
          modelValue: a.value.destinationField,
          "onUpdate:modelValue": e[1] || (e[1] = (t) => a.value.destinationField = t),
          items: s.value,
          label: l(o)("datahub-plugin.etl.number-to-tree.DestinationField"),
          "max-width": "567",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "label"])
      ], 64)) : (i(), f(l(w), {
        key: 1,
        modelValue: a.value.separator,
        "onUpdate:modelValue": e[2] || (e[2] = (t) => a.value.separator = t),
        label: l(o)("datahub-plugin.etl.number-to-tree.Separator"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"])),
      p(
        r.sourceAttributes?.[0]?.dataType,
        r.destinationAttribute?.dataType,
        "string-to-tree"
      ) ? (i(), f(l(u), {
        key: 2,
        modelValue: a.value.mode,
        "onUpdate:modelValue": e[3] || (e[3] = (t) => a.value.mode = t),
        items: s.value,
        "item-value": "mode",
        label: l(o)("datahub-plugin.etl.number-to-tree.DestinationField"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"])) : E("", !0),
      d(l(u), {
        modelValue: a.value.relevantLocale,
        "onUpdate:modelValue": e[4] || (e[4] = (t) => a.value.relevantLocale = t),
        items: l(c),
        loading: l(T),
        label: l(o)("datahub-plugin.etl.number-to-tree.RelevantLocale"),
        "item-title": "description",
        "item-value": "key",
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])
    ]));
  }
});
typeof g == "function" && g(v);
const O = /* @__PURE__ */ S(v, [["__scopeId", "data-v-daa4e99a"]]);
export {
  O as default
};
