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