"use client";
import{b as C}from"./chunk-XTULWCS7.js";import{a as u}from"./chunk-SUBVXXYD.js";import{e as d,i as P}from"./chunk-CLTGASR6.js";import{a as f}from"./chunk-3CHPBNY2.js";import{s as i}from"./chunk-KEPQUAOX.js";import{cloneElement as v,forwardRef as D,isValidElement as H,useState as y}from"react";import s from"clsx";var R=f("EulPopover",["root","anchor","content","open"]),h=e=>d("EulPopover",{anchor:["anchor"],content:["content"],root:["root",e.open&&"open"]}),S=R;import{jsx as n}from"react/jsx-runtime";var p=D((e,E)=>{let{children:t,content:o,id:x,isPanel:T,open:l,placement:k}=e,[a,N]=y(null),w=P(t.props.ref,N,E),[c,m]=y(!1),B=()=>{m(!0),e.onOpen?.()},A=()=>{m(!1),e.onClose?.()},r=h({open:c}),L=t&&v(t,{...t.props,className:s(t.props.className,r.anchor),key:"popover-child",onClick:B,ref:w}),O=o&&H(o)?v(o,{...o.props,className:s(o.props.className,r.content),key:"popover-content"}):o;return n(u,{onClickAway:A,children:n(i,{className:s(r.root),children:n(C,{anchorEl:a,content:O,id:x,isPanel:T,open:(typeof l<"u"?l:c)&&Boolean(a),placement:k,children:L})})})});p.displayName="Popover";p.defaultProps={placement:"bottom",touchDelay:700,touchEndDelay:1500};var M=p;export{S as a,M as b};
