"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("../../_util/props-util/initDefaultProps.js"),x=require("../../config-provider/context.js"),m=require("../../locale/LocaleReceiver.js"),p=require("../../locale/en_US.js"),g=require("../ConfirmDialog.js"),k=()=>({config:Object,afterClose:Function,destroyAction:Function,open:Boolean}),T=t.defineComponent({name:"HookModal",inheritAttrs:!1,props:C.default(k(),{config:{width:520,okType:"primary"}}),setup(o,{expose:r}){const a=t.computed(()=>o.open),e=t.computed(()=>o.config),{direction:i,getPrefixCls:c}=x.useConfigContextInject(),s=c("modal"),u=c(),f=()=>{o?.afterClose(),e.value.afterClose?.()},l=(...v)=>{o.destroyAction(...v)};r({destroy:l});const d=e.value.okCancel??e.value.type==="confirm",[n]=m.useLocaleReceiver("Modal",p.default.Modal);return()=>t.createVNode(g.default,{prefixCls:s,rootPrefixCls:u,...e.value,close:l,open:a.value,afterClose:f,okText:e.value.okText||(d?n?.value.okText:n?.value.justOkText),direction:e.value.direction||i.value,cancelText:e.value.cancelText||n?.value.cancelText},null)}});exports.default=T;
