import { defineComponent as u, mergeModels as p, useModel as f, onBeforeMount as c, watch as y, createBlock as b, createCommentVNode as v, openBlock as T, unref as t } from "vue";
import { useI18n as g } from "vue-i18n";
import { storeToRefs as A } from "pinia";
import { a_ as M } from "./start-CE9SawgU.js";
import "./header-Bn1EKnBE.js";
import { u as V } from "./dictionary-B08TTkmv.js";
import { b as r } from "./rma-address-field-extension.json_vue_type_i18n_index_0_src_true_lang-B0T8WrmL.js";
const _ = /* @__PURE__ */ u({
  __name: "RMAEmailAddressExtension",
  props: /* @__PURE__ */ p({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(i) {
    const e = f(i, "modelValue"), { t: l } = g(), o = V(), { addressTypes: d, isAddressTypesLoading: m } = A(o);
    return c(() => {
      o.ensureAddressTypes();
    }), y(
      d,
      (s) => {
        e.value?.addressTypes?.length || (e.value = {
          ...e.value,
          addressTypes: s ?? []
        });
      },
      { immediate: !0 }
    ), (s, a) => e.value ? (T(), b(t(M), {
      key: 0,
      modelValue: e.value.type,
      "onUpdate:modelValue": a[0] || (a[0] = (n) => e.value.type = n),
      items: e.value.addressTypes ?? [],
      label: t(l)("rma-plugin.rma-address-field-extension.addressTypes"),
      loading: t(m),
      "item-title": "typeName",
      "item-value": "typeKey"
    }, null, 8, ["modelValue", "items", "label", "loading"])) : v("", !0);
  }
});
typeof r == "function" && r(_);
export {
  _ as default
};
