import { defineComponent as D, mergeModels as F, useModel as A, computed as s, watch as M, createElementBlock as S, openBlock as r, Fragment as k, createElementVNode as T, createVNode as m, createBlock as f, createCommentVNode as c, unref as t, mergeProps as w, withCtx as U } from "vue";
import { useI18n as y } from "vue-i18n";
import { d as u, j as E, o as C } from "./start-CE9SawgU.js";
import "pinia";
import "./header-Bn1EKnBE.js";
import { D as B } from "./constants-DiSFhhBB.js";
const N = { class: "extension-config" }, p = "Actindo\\Modules\\Actindo\\DataHub\\DataTypes\\StringValue", v = /* @__PURE__ */ D({
  __name: "XToDateExtension",
  props: /* @__PURE__ */ F({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {
      default: () => ({ modifiers: [] })
    },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(l) {
    const a = l, e = A(l, "modelValue"), { t: d } = y(), _ = s(
      () => a.sourceAttributes?.[0]?.dataType === p
    ), V = s(
      () => a.destinationAttribute?.dataType === p
    );
    function h() {
      e.value.modifiers.push("");
    }
    function x({ rowIndex: i }) {
      e.value.modifiers.length > 1 ? e.value.modifiers.splice(i, 1) : e.value.modifiers = [];
    }
    return M(
      e,
      (i) => {
        i ? i.modifiers || (e.value.modifiers = []) : e.value = { modifiers: [] };
      },
      { immediate: !0 }
    ), (i, n) => (r(), S(k, null, [
      T("div", N, [
        _.value ? (r(), f(t(u), {
          key: 0,
          modelValue: e.value.sourceFormat,
          "onUpdate:modelValue": n[0] || (n[0] = (o) => e.value.sourceFormat = o),
          label: t(d)("datahub-plugin.etl.x-to-date.SourceFormat"),
          "max-width": "567"
        }, null, 8, ["modelValue", "label"])) : c("", !0),
        V.value ? (r(), f(t(u), {
          key: 1,
          modelValue: e.value.destinationFormat,
          "onUpdate:modelValue": n[1] || (n[1] = (o) => e.value.destinationFormat = o),
          label: t(d)("datahub-plugin.etl.x-to-date.DestinationFormat"),
          "max-width": "567"
        }, null, 8, ["modelValue", "label"])) : c("", !0)
      ]),
      m(t(E), w({
        data: e.value.modifiers,
        "table-name": t(d)("datahub-plugin.etl.x-to-date.modifiers")
      }, t(B), {
        onCreate: h,
        onRemove: x
      }), {
        "cell-text": U(({ rowIndex: o }) => [
          m(t(u), {
            modelValue: e.value.modifiers[o],
            "onUpdate:modelValue": (g) => e.value.modifiers[o] = g,
            placeholder: t(d)("datahub-plugin.etl.x-to-date.modifier", [o + 1]),
            "max-width": "567"
          }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
        ]),
        _: 1
      }, 16, ["data", "table-name"])
    ], 64));
  }
});
function b(l) {
  const a = l;
  a.__i18n = a.__i18n || [], a.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "datahub-plugin": {
          etl: {
            "x-to-date": {
              modifiers: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Modifiers" } },
              modifier: { t: 0, b: { t: 2, i: [{ t: 3, v: "Modifier " }, { t: 5, i: 0 }] } },
              SourceFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Source format" } },
              DestinationFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Destination format" } }
            }
          }
        }
      },
      "de-DE": {
        "datahub-plugin": {
          etl: {
            "x-to-date": {
              modifiers: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Modifikatoren" } },
              modifier: { t: 0, b: { t: 2, i: [{ t: 3, v: "Modifikator " }, { t: 5, i: 0 }] } },
              SourceFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Quellformat" } },
              DestinationFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Zielformat" } }
            }
          }
        }
      }
    }
  });
}
typeof b == "function" && b(v);
const G = /* @__PURE__ */ C(v, [["__scopeId", "data-v-56b0510c"]]);
export {
  G as default
};
