"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _vue = require("vue");
var _SizeContext = require("../SizeContext");
const useSize = customSize => {
  const size = (0, _SizeContext.useInjectSize)();
  return (0, _vue.computed)(() => {
    var _a;
    const rawSize = size.value;
    if (!customSize) {
      return rawSize;
    }
    if (typeof customSize === 'function') {
      return customSize(rawSize);
    }
    if ((0, _vue.isRef)(customSize)) {
      return (_a = customSize.value) !== null && _a !== void 0 ? _a : rawSize;
    }
    return rawSize;
  });
};
var _default = exports.default = useSize;