1import{o as e}from"./DlwYmI-E.js";import{B as t,Ht as n,L as r,Tn as i,ft as a,g as o,k as s,tt as c,vn as l}from"./DBq4UlV4.js";import{c as u}from"./DlTq1xPB.js";import{a as d,n as f}from"./90xg2Rc1.js";function p(e,t){let n=l(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function m(e,t){let r=l({}),i=l(`none`),s=l(e),d=e.value?`mounted`:`unmounted`,m,g=t.value?.ownerDocument.defaultView??f,{state:_,dispatch:v}=p(d,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),y=e=>{if(u){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};n(e,async(e,n)=>{let a=n!==e;if(await c(),a){let a=i.value,o=h(t.value);e?(v(`MOUNT`),y(`enter`),o===`none`&&y(`after-enter`)):o===`none`||o===`undefined`||r.value?.display===`none`?(v(`UNMOUNT`),y(`leave`),y(`after-leave`)):n&&a!==o?(v(`ANIMATION_OUT`),y(`leave`)):(v(`UNMOUNT`),y(`after-leave`))}},{immediate:!0});let b=e=>{if(e.target!==t.value)return;let n=h(t.value),r=n.includes(CSS.escape(e.animationName)),i=_.value===`mounted`?`enter`:`leave`;if(r&&(y(`after-${i}`),v(`ANIMATION_END`),!s.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,m=g?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&v(`ANIMATION_END`)},x=e=>{e.target===t.value&&(i.value=h(t.value))},S=n(t,(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=n(_,()=>{let e=h(t.value);i.value=_.value===`mounted`?e:`none`});return a(()=>{S(),C(),t.value&&(t.value.removeEventListener(`animationstart`,x),t.value.removeEventListener(`animationcancel`,b),t.value.removeEventListener(`animationend`,b)),m!==void 0&&g?.clearTimeout(m)}),{isPresent:o(()=>[`mounted`,`unmountSuspended`].includes(_.value))}}function h(e){return e&&getComputedStyle(e).animationName||`none`}var g=s({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(n,{slots:a,expose:o}){let{present:s,forceMount:c}=i(n),u=l(),{isPresent:f}=m(s,u);o({present:f});let p=a.default({present:f.value});p=e(p||[]);let h=r();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()=>c.value||s.value||f.value?t(a.default({present:f.value})[0],{ref:e=>{let t=d(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?u.value=t.firstElementChild:u.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.