1import{B as e,Ht as t,L as n,Tn as r,ft as i,g as a,k as o,tt as s,vn as c}from"./runtime-core.esm-bundler-DPmoNEl9.js";import{f as l,i as u,n as d}from"./useForwardExpose-RlTU6fXY.js";import{r as f}from"./Primitive-OUQ7g2gS.js";function p(e,t){let n=c(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function m(e,n){let r=c({}),o=c(`none`),u=c(e),f=e.value?`mounted`:`unmounted`,m,g=n.value?.ownerDocument.defaultView??d,{state:_,dispatch:v}=p(f,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),y=e=>{if(l){let t=new CustomEvent(e,{bubbles:!1,cancelable:!1});n.value?.dispatchEvent(t)}};t(e,async(e,t)=>{let i=t!==e;if(await s(),i){let i=o.value,a=h(n.value);e?(v(`MOUNT`),y(`enter`),a===`none`&&y(`after-enter`)):a===`none`||a===`undefined`||r.value?.display===`none`?(v(`UNMOUNT`),y(`leave`),y(`after-leave`)):t&&i!==a?(v(`ANIMATION_OUT`),y(`leave`)):(v(`UNMOUNT`),y(`after-leave`))}},{immediate:!0});let b=e=>{if(e.target!==n.value)return;let t=h(n.value),r=t.includes(CSS.escape(e.animationName)),i=_.value===`mounted`?`enter`:`leave`;if(r&&(y(`after-${i}`),v(`ANIMATION_END`),!u.value)){let e=n.value.style.animationFillMode;n.value.style.animationFillMode=`forwards`,m=g?.setTimeout(()=>{n.value?.style.animationFillMode===`forwards`&&(n.value.style.animationFillMode=e)})}t===`none`&&v(`ANIMATION_END`)},x=e=>{e.target===n.value&&(o.value=h(n.value))},S=t(n,(e,t)=>{e?(r.value=getComputedStyle(e),e.addEventListener(`animationstart`,x),e.addEventListener(`animationcancel`,b),e.addEventListener(`animationend`,b)):(v(`ANIMATION_END`),m!==void 0&&g?.clearTimeout(m),t?.removeEventListener(`animationstart`,x),t?.removeEventListener(`animationcancel`,b),t?.removeEventListener(`animationend`,b))},{immediate:!0}),C=t(_,()=>{let e=h(n.value);o.value=_.value===`mounted`?e:`none`});return i(()=>{S(),C(),n.value&&(n.value.removeEventListener(`animationstart`,x),n.value.removeEventListener(`animationcancel`,b),n.value.removeEventListener(`animationend`,b)),m!==void 0&&g?.clearTimeout(m)}),{isPresent:a(()=>[`mounted`,`unmountSuspended`].includes(_.value))}}function h(e){return e&&getComputedStyle(e).animationName||`none`}var g=o({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:i,expose:a}){let{present:o,forceMount:s}=r(t),l=c(),{isPresent:d}=m(o,l);a({present:d});let p=i.default({present:d.value});p=f(p||[]);let h=n();if(p&&p?.length>1){let e=h?.parent?.type.name?`<${h.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(` 2`)].join(` 3`))}return()=>s.value||o.value||d.value?e(i.default({present:d.value})[0],{ref:e=>{let t=u(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?l.value=t.firstElementChild:l.value=t),t}}):null}});export{g as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.