import e from"../_util/classNames.mjs";import{useLocaleReceiver as t}from"../locale/LocaleReceiver.mjs";import{getTransitionName as n}from"../_util/transition.mjs";import r from"./Modal.mjs";import i from"../_util/ActionButton.mjs";import{createVNode as a,defineComponent as o}from"vue";import{CheckCircleFilled as s,CloseCircleFilled as c,ExclamationCircleFilled as l,InfoCircleFilled as u}from"@antsoo-lib/icons";function d(e){return typeof e==`function`?e():e}var f=o({name:`ConfirmDialog`,inheritAttrs:!1,props:`icon.onCancel.onOk.close.closable.zIndex.afterClose.visible.open.keyboard.centered.getContainer.maskStyle.okButtonProps.cancelButtonProps.okType.prefixCls.okCancel.width.mask.maskClosable.okText.cancelText.autoFocusButton.transitionName.maskTransitionName.type.title.content.direction.rootPrefixCls.bodyStyle.closeIcon.modalRender.focusTriggerAfterClose.wrapClassName.confirmPrefixCls.footer`.split(`.`),setup(o,{attrs:f}){let[p]=t(`Modal`);return()=>{let{icon:t,onCancel:m,onOk:h,close:g,okText:_,closable:v=!1,zIndex:y,afterClose:b,keyboard:x,centered:S,getContainer:C,maskStyle:w,okButtonProps:T,cancelButtonProps:E,okCancel:D,width:O=416,mask:k=!0,maskClosable:A=!1,type:j,open:M,title:N,content:P,direction:F,closeIcon:I,modalRender:L,focusTriggerAfterClose:R,rootPrefixCls:z,bodyStyle:B,wrapClassName:V,footer:H}=o,U=t;if(!t&&t!==null)switch(j){case`info`:U=a(u,null,null);break;case`success`:U=a(s,null,null);break;case`error`:U=a(c,null,null);break;default:U=a(l,null,null)}let W=o.okType||`primary`,G=o.prefixCls||`ant-modal`,K=`${G}-confirm`,q=f.style||{},J=D??j===`confirm`,Y=o.autoFocusButton===null?!1:o.autoFocusButton||`ok`,X=`${G}-confirm`,Z=e(X,`${X}-${o.type}`,{[`${X}-rtl`]:F===`rtl`},f.class),Q=p.value,$=J&&a(i,{actionFn:m,close:g,autofocus:Y===`cancel`,buttonProps:E,prefixCls:`${z}-btn`},{default:()=>[d(o.cancelText)||Q.cancelText]});return a(r,{prefixCls:G,class:Z,wrapClassName:e({[`${X}-centered`]:!!S},V),onCancel:e=>g?.({triggerCancel:!0},e),open:M,title:``,footer:``,transitionName:n(z,`zoom`,o.transitionName),maskTransitionName:n(z,`fade`,o.maskTransitionName),mask:k,maskClosable:A,maskStyle:w,style:q,bodyStyle:B,width:O,zIndex:y,afterClose:b,keyboard:x,centered:S,getContainer:C,closable:v,closeIcon:I,modalRender:L,focusTriggerAfterClose:R},{default:()=>[a(`div`,{class:`${K}-body-wrapper`},[a(`div`,{class:`${K}-body`},[d(U),N===void 0?null:a(`span`,{class:`${K}-title`},[d(N)]),a(`div`,{class:`${K}-content`},[d(P)])]),H===void 0?a(`div`,{class:`${K}-btns`},[$,a(i,{type:W,actionFn:h,close:g,autofocus:Y===`ok`,buttonProps:T,prefixCls:`${z}-btn`},{default:()=>[d(_)||(J?Q.okText:Q.justOkText)]})]):d(H)])]})}}});export{f as default};