const e=require("../_util/classNames.js"),t=require("../_util/props-util/index.js"),n=require("../_util/vue-types/index.js"),r=require("../_util/vnode.js"),i=require("../vc-trigger/index.js"),a=require("./placements.js");let o=require("vue");var s=(0,o.defineComponent)({compatConfig:{MODE:3},props:{minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},arrow:{type:Boolean,default:!1},prefixCls:n.default.string.def(`rc-dropdown`),transitionName:String,overlayClassName:n.default.string.def(``),openClassName:String,animation:n.default.any,align:n.default.object,overlayStyle:{type:Object,default:void 0},placement:n.default.string.def(`bottomLeft`),overlay:n.default.any,trigger:n.default.oneOfType([n.default.string,n.default.arrayOf(n.default.string)]).def(`hover`),alignPoint:{type:Boolean,default:void 0},showAction:n.default.array,hideAction:n.default.array,getPopupContainer:Function,visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},mouseEnterDelay:n.default.number.def(.15),mouseLeaveDelay:n.default.number.def(.1)},emits:[`visibleChange`,`overlayClick`],setup(n,{slots:s,emit:c,expose:l}){let u=(0,o.ref)(!!n.visible);(0,o.watch)(()=>n.visible,e=>{e!==void 0&&(u.value=e)});let d=(0,o.ref)();l({triggerRef:d});let f=e=>{n.visible===void 0&&(u.value=!1),c(`overlayClick`,e)},p=e=>{n.visible===void 0&&(u.value=e),c(`visibleChange`,e)},m=()=>{let e=s.overlay?.(),i={prefixCls:`${n.prefixCls}-menu`,onClick:f};return(0,o.createVNode)(o.Fragment,{key:t.skipFlattenKey},[n.arrow&&(0,o.createVNode)(`div`,{class:`${n.prefixCls}-arrow`},null),r.cloneElement(e,i,!1)])},h=(0,o.computed)(()=>{let{minOverlayWidthMatchTrigger:e=!n.alignPoint}=n;return e}),g=()=>{let e=s.default?.();return u.value&&e?r.cloneElement(e[0],{class:n.openClassName||`${n.prefixCls}-open`},!1):e},_=(0,o.computed)(()=>!n.hideAction&&n.trigger.includes(`contextmenu`)?[`click`]:n.hideAction);return()=>{let{prefixCls:t,arrow:r,showAction:s,overlayStyle:c,trigger:l,placement:f,align:v,getPopupContainer:y,transitionName:b,animation:x,overlayClassName:S,...C}=n;return(0,o.createVNode)(i.default,{...C,prefixCls:t,ref:d,popupClassName:e.default(S,{[`${t}-show-arrow`]:r}),popupStyle:c,builtinPlacements:a.default,action:l,showAction:s,hideAction:_.value||[],popupPlacement:f,popupAlign:v,popupTransitionName:b,popupAnimation:x,popupVisible:u.value,stretch:h.value?`minWidth`:``,onPopupVisibleChange:p,getPopupContainer:y},{popup:m,default:g})}}});exports.default=s;