const e=require("../_util/type.js"),t=require("../_util/warning.js"),n=require("../_util/classNames.js"),r=require("../_util/omit.js"),i=require("../_util/props-util/initDefaultProps.js"),a=require("../locale/en_US.js"),o=require("../locale/LocaleReceiver.js"),s=require("../config-provider/hooks/useConfigInject.js"),c=require("../_util/transition.js"),l=require("../_util/KeyCode.js"),u=require("../_util/vnode.js"),d=require("../_util/hooks/useMergedState.js"),f=require("../tooltip/abstractTooltipProps.js"),p=require("../tooltip/Tooltip.js"),m=require("../popover/index.js"),h=require("../button/buttonTypes.js"),g=require("../button/index.js"),_=require("../_util/ActionButton.js"),v=require("./style/index.js");let y=require("vue"),b=require("@antsoo-lib/icons");var x=()=>({...f.default(),prefixCls:String,content:e.anyType(),title:e.anyType(),description:e.anyType(),okType:e.stringType(`primary`),disabled:{type:Boolean,default:!1},okText:e.anyType(),cancelText:e.anyType(),icon:e.anyType(),okButtonProps:e.objectType(),cancelButtonProps:e.objectType(),showCancel:{type:Boolean,default:!0},onConfirm:Function,onCancel:Function}),S=(0,y.defineComponent)({compatConfig:{MODE:3},name:`APopconfirm`,inheritAttrs:!1,props:i.default(x(),{...p.tooltipDefaultProps(),trigger:`click`,placement:`top`,mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0,okType:`primary`,disabled:!1}),slots:Object,setup(e,{slots:i,emit:f,expose:p,attrs:x}){let S=(0,y.ref)();t.default(e.visible===void 0,`Popconfirm`,"`visible` will be removed in next major version, please use `open` instead."),p({getPopupDomNode:()=>S.value?.getPopupDomNode?.()});let[C,w]=d.default(!1,{value:(0,y.toRef)(e,`open`)}),T=(t,n)=>{e.open===void 0&&w(t),f(`update:open`,t),f(`openChange`,t,n)},E=e=>{T(!1,e)},D=t=>e.onConfirm?.(t),O=t=>{T(!1,t),e.onCancel?.(t)},k=e=>{e.keyCode===l.default.ESC&&C&&T(!1,e)},A=t=>{let{disabled:n}=e;n||T(t)},{prefixCls:j,getPrefixCls:M}=s.default(`popconfirm`,e),N=(0,y.computed)(()=>M()),P=(0,y.computed)(()=>M(`btn`)),[F]=v.default(j),[I]=o.useLocaleReceiver(`Popconfirm`,a.default.Popconfirm),L=()=>{let{okButtonProps:t,cancelButtonProps:n,title:r=i.title?.(),description:a=i.description?.(),cancelText:o=i.cancel?.(),okText:s=i.okText?.(),okType:c,icon:l=i.icon?.()||(0,y.createVNode)(b.ExclamationCircleFilled,null,null),showCancel:u=!0}=e,{cancelButton:d,okButton:f}=i,p={onClick:O,size:`small`,...n},m={onClick:D,...h.convertLegacyProps(c),size:`small`,...t};return(0,y.createVNode)(`div`,{class:`${j.value}-inner-content`},[(0,y.createVNode)(`div`,{class:`${j.value}-message`},[l&&(0,y.createVNode)(`span`,{class:`${j.value}-message-icon`},[l]),(0,y.createVNode)(`div`,{class:[`${j.value}-message-title`,{[`${j.value}-message-title-only`]:!!a}]},[r])]),a&&(0,y.createVNode)(`div`,{class:`${j.value}-description`},[a]),(0,y.createVNode)(`div`,{class:`${j.value}-buttons`},[u?d?d(p):(0,y.createVNode)(g.default,p,{default:()=>[o||I.value.cancelText]}):null,f?f(m):(0,y.createVNode)(_.default,{buttonProps:{size:`small`,...h.convertLegacyProps(c),...t},actionFn:D,close:E,prefixCls:P.value,quitOnNullishReturnValue:!0,emitEvent:!0},{default:()=>[s||I.value.okText]})])])};return()=>{let{placement:t,overlayClassName:a,trigger:o=`click`,...s}=e,l=r.default(s,[`title`,`content`,`cancelText`,`okText`,`onUpdate:open`,`onConfirm`,`onCancel`,`prefixCls`]),d=n.default(j.value,a);return F((0,y.createVNode)(m.default,{...l,...x,trigger:o,placement:t,onOpenChange:A,open:C.value,overlayClassName:d,transitionName:c.getTransitionName(N.value,`zoom-big`,e.transitionName),ref:S,"data-popover-inject":!0},{default:()=>[u.cloneVNodes(i.default?.()||[],{onKeydown:e=>{k(e)}},!1)],content:L}))}}}),C=e.withInstall(S);exports.default=C,exports.popconfirmProps=x;