import { watch as o } from "vue";
import { cloneDeep as c, isEqual as f } from "lodash";
const m = (e, a, u, i) => {
  const n = (t) => {
    if (e.option.isDefaultSelect) {
      if (!t && i.value.length > 0) {
        u.value = i.value[0].value;
        return;
      }
      u.value = t;
    } else
      u.value = "";
  };
  o(() => e.sources, () => {
    e.sources && e.sources.length > 0 && a(e.option);
  }, {
    deep: !0
  }), o(() => c(e.option.value), (t, l) => {
    f(t, l) || n(t);
  }, {
    deep: !0
  }), o(() => c(e.option.isDefaultSelect), (t, l) => {
    f(t, l) || n(e.option.value);
  }, {
    deep: !0
  });
};
export {
  m as useTabsWatch
};
