"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),I=require("../_util/transition.js"),T=require("./IDialogPropTypes.js"),q=require("./util.js"),A={width:0,height:0,overflow:"hidden",outline:"none"},D={outline:"none"},k=t.defineComponent({compatConfig:{MODE:3},name:"DialogContent",inheritAttrs:!1,props:{...T.default(),motionName:String,ariaId:String,onVisibleChanged:Function,onMousedown:Function,onMouseup:Function},setup(i,{expose:p,slots:l,attrs:s}){const r=t.ref(),a=t.ref(),c=t.ref();p({focus:()=>{r.value?.focus({preventScroll:!0})},changeActive:e=>{const{activeElement:o}=document;e&&o===a.value?r.value.focus({preventScroll:!0}):!e&&o===r.value&&a.value.focus({preventScroll:!0})}});const u=t.ref(),b=t.computed(()=>{const{width:e,height:o}=i,n={};return e!==void 0&&(n.width=typeof e=="number"?`${e}px`:e),o!==void 0&&(n.height=typeof o=="number"?`${o}px`:o),u.value&&(n.transformOrigin=u.value),n}),N=()=>{t.nextTick(()=>{if(c.value){const e=q.offset(c.value);u.value=i.mousePosition?`${i.mousePosition.x-e.left}px ${i.mousePosition.y-e.top}px`:""}})},d=e=>{i.onVisibleChanged(e)};return()=>{const{prefixCls:e,footer:o=l.footer?.(),title:n=l.title?.(),ariaId:V,closable:S,closeIcon:C=l.closeIcon?.(),onClose:$,bodyStyle:w,bodyProps:x,onMousedown:M,onMouseup:P,visible:f,modalRender:v=l.modalRender,destroyOnClose:O,motionName:R}=i;let m;o&&(m=t.createVNode("div",{class:`${e}-footer`},[o]));let y;n&&(y=t.createVNode("div",{class:`${e}-header`},[t.createVNode("div",{class:`${e}-title`,id:V},[n])]));let g;S&&(g=t.createVNode("button",{type:"button",onClick:$,"aria-label":"Close",class:`${e}-close`},[C||t.createVNode("span",{class:`${e}-close-x`},null)]));const h=t.createVNode("div",{class:`${e}-content`},[g,y,t.createVNode("div",{class:`${e}-body`,style:w,...x},[l.default?.()]),m]),E=I.getTransitionProps(R);return t.createVNode(t.Transition,{...E,onBeforeEnter:N,onAfterEnter:()=>d(!0),onAfterLeave:()=>d(!1)},{default:()=>[f||!O?t.withDirectives(t.createVNode("div",{...s,ref:c,key:"dialog-element",role:"document",style:[b.value,s.style],class:[e,s.class],onMousedown:M,onMouseup:P},[t.createVNode("div",{tabindex:0,ref:r,style:D},[v?v({originVNode:h}):h]),t.createVNode("div",{tabindex:0,ref:a,style:A},null)]),[[t.vShow,f]]):null]})}}});exports.default=k;
