import { computed } from 'vue';
import '../Masonry';
import { responsiveArray } from '../../_util/responsiveObserve';
const useGutter = (gutter, screens) => {
  // const results = ref<[Gap, Gap]>([undefined, undefined]);
  const normalizedGutter = computed(() => Array.isArray(gutter.value) ? gutter.value : [gutter.value, undefined]);
  const mergedScreens = computed(() => screens.value || {
    xs: true,
    sm: true,
    md: true,
    lg: true,
    xl: true,
    xxl: true
  });
  return computed(() => {
    const results = [undefined, undefined];
    normalizedGutter.value.forEach((g, index) => {
      if (typeof g === 'object' && g !== null) {
        for (let i = 0; i < responsiveArray.length; i++) {
          const breakpoint = responsiveArray[i];
          if (mergedScreens.value[breakpoint] && g[breakpoint] !== undefined) {
            results[index] = g[breakpoint];
            break;
          }
        }
      } else {
        results[index] = g;
      }
    });
    return results;
  });
};
export default useGutter;