/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { computed, ref, onMounted, watch } from 'vue';
import isFunction from 'lodash/isFunction';
import { getSSRAttach, getAttach } from '../utils/dom.js';
import '../_chunks/dep-c9c789a8.js';
import 'lodash/isString';
import 'lodash/isArray';
import '../utils/easing.js';

var useTeleport = function useTeleport(attach, triggerNode) {
  var to = isFunction(attach) ? computed(attach) : ref(attach);
  var innerTriggerNode = isFunction(triggerNode) ? computed(triggerNode) : ref(triggerNode);
  var element = ref();
  var getElement = function getElement() {
    element.value = getSSRAttach() || getAttach(to.value, innerTriggerNode.value);
  };
  onMounted(function () {
    return getElement();
  });
  watch([to, innerTriggerNode], function () {
    return getElement();
  });
  return element;
};

export { useTeleport as default };
//# sourceMappingURL=useTeleport.js.map
