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