import{V as f,bj as t,X as a,bk as R,bl as i,a9 as u,as as K,av as V,f as U,Z as j,q as p,h as D,o as g,w as y,ae as m,u as h,c as $,n as H,N as b,t as w,d as z,aK as F,i as I,H as L,bi as q,aj as X,bm as Z}from"./index-Dyf_FKwG.js";const v=f({trigger:{...i.trigger,type:a([String,Array])},triggerKeys:{type:a(Array),default:()=>[u.enter,u.numpadEnter,u.space,u.down]},virtualTriggering:i.virtualTriggering,virtualRef:i.virtualRef,effect:{...t.effect,default:"light"},type:{type:a(String)},placement:{type:a(String),default:"bottom"},popperOptions:{type:a(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:a([Number,String]),default:0},maxHeight:{type:a([Number,String]),default:""},popperClass:t.popperClass,popperStyle:t.popperStyle,disabled:Boolean,role:{type:String,values:R,default:"menu"},buttonProps:{type:a(Object)},teleported:t.teleported,appendTo:t.appendTo,persistent:{type:Boolean,default:!0}});f({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:K}});f({onKeydown:{type:a(Function)}});const G=f({trigger:i.trigger,triggerKeys:i.triggerKeys,placement:v.placement,disabled:i.disabled,visible:t.visible,transition:t.transition,popperOptions:v.popperOptions,tabindex:v.tabindex,content:t.content,popperStyle:t.popperStyle,popperClass:t.popperClass,enterable:{...t.enterable,default:!0},effect:{...t.effect,default:"light"},teleported:t.teleported,appendTo:t.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),J={"update:visible":e=>V(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},M="onUpdate:visible";var Q=U({name:"ElPopover",__name:"popover",props:G,emits:J,setup(e,{expose:n,emit:s}){const r=e,l=s,T=p(()=>r[M]),d=j("popover"),c=I(),B=p(()=>{var o;return(o=b(c))==null?void 0:o.popperRef}),C=p(()=>[{width:q(r.width)},r.popperStyle]),E=p(()=>[d.b(),r.popperClass,{[d.m("plain")]:!!r.content}]),N=p(()=>r.transition===`${d.namespace.value}-fade-in-linear`),P=()=>{var o;(o=c.value)==null||o.hide()},k=()=>{l("before-enter")},A=()=>{l("before-leave")},x=()=>{l("after-enter")},O=()=>{l("update:visible",!1),l("after-leave")};return n({popperRef:B,hide:P}),(o,ee)=>(g(),D(b(L),F({ref_key:"tooltipRef",ref:c},o.$attrs,{trigger:e.trigger,"trigger-keys":e.triggerKeys,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":E.value,"popper-style":C.value,teleported:e.teleported,"append-to":e.appendTo,persistent:e.persistent,"gpu-acceleration":N.value,"onUpdate:visible":T.value,onBeforeShow:k,onBeforeHide:A,onShow:x,onHide:O}),{content:y(()=>[e.title?(g(),$("div",{key:0,class:H(b(d).e("title")),role:"title"},w(e.title),3)):h("v-if",!0),m(o.$slots,"default",{},()=>[z(w(e.content),1)])]),default:y(()=>[o.$slots.reference?m(o.$slots,"reference",{key:0}):h("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});const S=(e,n)=>{const s=n.arg||n.value,r=s?.popperRef;r&&(r.triggerRef=e)};var W={mounted(e,n){S(e,n)},updated(e,n){S(e,n)}};const Y="popover",_=Z(W,Y),oe=X(Q,{directive:_});export{oe as E};
