import { ref as n, watch as i } from "vue";
import { u as o } from "./Units-B45W1CXa.js";
const r = {}, g = (c) => {
  const e = n([]), s = n(!1);
  async function u(t) {
    if (t) {
      if (r[t]) {
        const { data: a } = await r[t];
        return e.value = a, e.value;
      }
      try {
        s.value = !0, r[t] = o.getByDimension(t);
        const { data: a } = await r[t];
        return e.value = a, a;
      } catch (a) {
        console.log(a.message);
      } finally {
        s.value = !1;
      }
    }
  }
  return i(c, u, { immediate: !0 }), {
    units: e,
    isUnitsLoading: s,
    fetchUnits: u
  };
};
export {
  g as u
};
