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

import { computed, ref, onMounted, watch } from 'vue';
import { i as isFunction_1 } from '../_chunks/dep-5717e263.mjs';
import { getSSRAttach, getAttach } from '../utils/dom.mjs';
import '../_chunks/dep-eba0ea6e.mjs';
import '../_chunks/dep-469b4ae0.mjs';
import '../_chunks/dep-255303ba.mjs';
import '../_chunks/dep-a8bcacea.mjs';
import '../_chunks/dep-876fb3ec.mjs';
import '../_chunks/dep-b57180d0.mjs';
import '../_chunks/dep-c8d7b6b4.mjs';
import '../_chunks/dep-3da99438.mjs';
import '../utils/easing.mjs';

var useTeleport = function useTeleport(attach, triggerNode) {
  var to = isFunction_1(attach) ? computed(attach) : ref(attach);
  var innerTriggerNode = isFunction_1(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.mjs.map
