import { defineComponent as N, computed as C, watch as _, createBlock as i, unref as e, openBlock as R, createSlots as h, withCtx as p, createVNode as c } from "vue";
import { useI18n as E } from "vue-i18n";
import { storeToRefs as T } from "pinia";
import { R as f, E as I } from "./start-BYfL32Oe.mjs";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import "./IsActiveStatusCell-DlvB6_E-.mjs";
import "@vuelidate/validators";
import "./MultiLangScopeEditorsList.vue_vue_type_script_setup_true_lang-CWQeDnSm.mjs";
import "./DatahubDataTypeCompletenessRenderer.vue_vue_type_script_setup_true_lang-Btvu_WeF.mjs";
import { u as L } from "./topBarRoutes-0VuQ_i6D.mjs";
import "./VariantToVariantExtension-WcLvPNqG.mjs";
import F from "./DatahubDataTypeVariantValueEditor-f1gR3QCx.mjs";
import { b as G } from "./link-value.json_vue_type_i18n_index_0_src_true_lang-BN-qknjZ.mjs";
var u = /* @__PURE__ */ ((t) => (t.OFFERS = "Channels.OFFERS", t.OFFERS_LIST = "Channels.OFFERS_LIST", t.OFFERS_RECYCLE_BIN = "Channels.OFFERS_RECYCLE_BIN", t.SEMI_AUTOMATIC = "Channels.SEMI_AUTOMATIC", t.OFFER_EXPORT = "Channels.OFFER_EXPORT", t.OFFER_IMPORT = "Channels.OFFER_IMPORT", t.ORDERS = "Channels.ORDERS", t.ORDERS_LIST = "Channels.ORDERS_LIST", t.ORDERS_RETURNS = "Channels.ORDERS_RETURNS", t.ORDERS_EXPORTS = "Channels.ORDERS_EXPORTS", t.LOGGING = "Channels.LOGGING", t.LOGGING_LOGS = "Channels.LOGS", t.LOGGING_OFFER_EXPORT_ERRORS = "Channels.LOGGING_OFFER_EXPORT_ERRORS", t.LOGGING_ORDER_ERRORS = "Channels.LOGGING_ORDER_ERRORS", t.LOGGING_SHIPMENT_ERRORS = "Channels.LOGGING_SHIPMENT_ERRORS", t.LOGGING_CANCELLATION_ERRORS = "Channels.LOGGING_CANCELLATION_ERRORS", t.SETTINGS = "Channels.SETTINGS", t.SETTINGS_CONNECTIONS = "Channels.SETTINGS_CONNECTIONS", t.SETTINGS_VARIANT_SETS = "Channels.SETTINGS_VARIANT_SETS", t.SETTINGS_LOGGING = "Channels.SETTINGS_LOGGING", t))(u || {});
const y = /* @__PURE__ */ N({
  __name: "ChannelsDataTypeVariantValueEditor",
  props: {
    modelValue: {},
    readOnly: { type: Boolean },
    attribute: {},
    massEditing: { type: Boolean },
    label: {},
    fieldName: {},
    dataTypeInstance: {},
    loading: { type: Boolean }
  },
  setup(t) {
    const { t: S } = E(), l = L(), {
      entity: a,
      variantKey: r,
      masterEntityId: O
    } = T(l), d = [
      {
        id: "sku",
        header: "datahub-ui.dh-shared.sku"
      }
    ], s = C(
      () => {
        var n, o;
        return (n = a.value) != null && n.sku ? S("channels-ui.offers.childOfferOf", { sku: (o = a.value) == null ? void 0 : o.sku }) : "";
      }
    );
    return _(
      () => null,
      async (n) => {
        n && l.fetchEntity(n);
      },
      { immediate: !0 }
    ), (n, o) => !e(a) || !e(r) ? (R(), i(e(f), {
      key: 0,
      type: "table"
    })) : (R(), i(e(F), {
      key: 1,
      modelValue: e(a)[e(r)],
      "onUpdate:modelValue": o[0] || (o[0] = (m) => e(a)[e(r)] = m),
      attribute: e(a),
      "attribute-set-id": e(a).attributeSetId,
      "variant-set-controller": "Actindo.Modules.Actindo.Channels.VariantSets.",
      "variant-controller": "Actindo.Modules.Actindo.Channels.Variants.",
      "additional-columns": d
    }, h({ _: 2 }, [
      s.value ? {
        name: "child-redirect",
        fn: p(() => [
          c(e(I), {
            to: {
              name: e(u).OFFERS_LIST,
              params: { offerId: e(O) }
            },
            text: s.value,
            variant: "text",
            color: "primary"
          }, null, 8, ["to", "text"])
        ]),
        key: "0"
      } : void 0
    ]), 1032, ["modelValue", "attribute", "attribute-set-id"]));
  }
});
typeof G == "function" && G(y);
export {
  y as default
};
