import e from"./vue-types/index.mjs";import{useInjectPortal as t}from"../vc-trigger/context.mjs";import{Teleport as n,createVNode as r,defineComponent as i,nextTick as a,onBeforeMount as o,onMounted as s,onUpdated as c,watch as l}from"vue";var u=i({compatConfig:{MODE:3},name:`Portal`,inheritAttrs:!1,props:{getContainer:e.func.isRequired,didUpdate:Function},setup(e,{slots:i}){let u=!0,d,{shouldRender:f}=t();function p(){f.value&&(d=e.getContainer())}o(()=>{u=!1,p()}),s(()=>{d||p()});let m=l(f,()=>{f.value&&!d&&(d=e.getContainer()),d&&m()});return c(()=>{a(()=>{f.value&&e.didUpdate?.(e)})}),()=>f.value?u?i.default?.():d?r(n,{to:d},i):null:null}});export{u as default};