"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const index_esm = require("../../../@vant/use/dist/index.esm.js");
const Vue = require("vue");
const onPopupReopen = require("./on-popup-reopen.js");
const dom = require("../utils/dom.js");
const useHeight = (element, withSafeArea) => {
  const height = Vue.ref();
  const setHeight = () => {
    height.value = index_esm.useRect(element).height;
  };
  Vue.onMounted(() => {
    Vue.nextTick(setHeight);
    if (withSafeArea) {
      for (let i = 1; i <= 3; i++) {
        setTimeout(setHeight, 100 * i);
      }
    }
  });
  onPopupReopen.onPopupReopen(() => Vue.nextTick(setHeight));
  Vue.watch([dom.windowWidth, dom.windowHeight], setHeight);
  return height;
};
exports.useHeight = useHeight;
