const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-dom-BT-HHJs9.js","assets/codemirror-core-DIzFijqu.js","assets/react-dom-Cfkhaq8h.css"])))=>i.map(i=>d[i]);
import{q as H,_ as S,T as h,z as U,b as w}from"./index-tO5nu8Yv.js";import{h as s,j as e}from"./codemirror-core-DIzFijqu.js";import{z,B as b,L as j,m as C,i as _,ba as L,v as F,A as V,J as q}from"./react-dom-BT-HHJs9.js";import{a as J}from"./chunk-WQVQ7P2I-bQ701xkJ.js";import{c as G}from"./chunk-KVDW62ZT-DlWCkB-8.js";var[K,$]=H({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),y=()=>S(()=>import("./react-dom-BT-HHJs9.js").then(t=>t.ck),__vite__mapDeps([0,1,2])).then(t=>t.default),A=t=>{const{as:a,children:i,className:p,...o}=t,{Component:l,placement:r,backdrop:n,motionProps:m,disableAnimation:c,getPopoverProps:f,getDialogProps:d,getBackdropProps:v,getContentProps:u,isNonModal:I,onClose:x}=$(),P=s.useRef(null),{dialogProps:N,titleProps:M}=z({},P),O=d({ref:P,...N,...o}),D=a||l||"div",g=e.jsxs(e.Fragment,{children:[!I&&e.jsx(b,{onDismiss:x}),e.jsx(D,{...O,children:e.jsx("div",{...u({className:p}),children:typeof i=="function"?i(M):i})}),e.jsx(b,{onDismiss:x})]}),k=s.useMemo(()=>n==="transparent"?null:c?e.jsx("div",{...v()}):e.jsx(j,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"exit",variants:h.fade,...v()})}),[n,c,v]),E=r?J(r==="center"?"top":r):void 0,B=e.jsx(e.Fragment,{children:c?g:e.jsx(j,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"initial",style:E,variants:h.scaleSpringOpacity,...m,children:g})})});return e.jsxs("div",{...f(),children:[k,B]})};A.displayName="HeroUI.PopoverContent";var ee=A,R=t=>{var a;const{triggerRef:i,getTriggerProps:p}=$(),{children:o,...l}=t,r=s.useMemo(()=>typeof o=="string"?e.jsx("p",{children:o}):s.Children.only(o),[o]),n=(a=r.props.ref)!=null?a:r.ref,{onPress:m,isDisabled:c,...f}=s.useMemo(()=>p(_(l,r.props),n),[p,r.props,l,n]),[,d]=L(o,w),{buttonProps:v}=U({onPress:m,isDisabled:c},i),u=s.useMemo(()=>(d==null?void 0:d[0])!==void 0,[d]);return s.cloneElement(r,_(f,u?{onPress:m,isDisabled:c}:v))};R.displayName="HeroUI.PopoverTrigger";var oe=R,T=F((t,a)=>{const{children:i,...p}=t,o=G({...p,ref:a}),[l,r]=s.Children.toArray(i),n=e.jsx(q,{portalContainer:o.portalContainer,children:r});return e.jsxs(K,{value:o,children:[l,o.disableAnimation&&o.isOpen?n:e.jsx(V,{children:o.isOpen?n:null})]})});T.displayName="HeroUI.Popover";var re=T;export{oe as a,ee as b,re as p};
