const e=require("../_util/classNames.js");let t=require("vue");var n=(0,t.defineComponent)({name:`Notice`,inheritAttrs:!1,props:[`prefixCls`,`duration`,`updateMark`,`noticeKey`,`closeIcon`,`closable`,`props`,`onClick`,`onClose`,`holder`,`visible`],setup(n,{attrs:r,slots:i}){let a,o=!1,s=(0,t.computed)(()=>n.duration===void 0?4.5:n.duration),c=()=>{s.value&&!o&&(a=setTimeout(()=>{u()},s.value*1e3))},l=()=>{a&&(clearTimeout(a),a=null)},u=e=>{e&&e.stopPropagation(),l();let{onClose:t,noticeKey:r}=n;t&&t(r)},d=()=>{l(),c()};return(0,t.onMounted)(()=>{c()}),(0,t.onUnmounted)(()=>{o=!0,l()}),(0,t.watch)([s,()=>n.updateMark,()=>n.visible],([e,t,n],[r,i,a])=>{(e!==r||t!==i||n!==a&&a)&&d()},{flush:`post`}),()=>{let{prefixCls:a,closable:o,closeIcon:s=i.closeIcon?.(),onClick:d,holder:f}=n,{class:p,style:m}=r,h=`${a}-notice`,g=Object.keys(r).reduce((e,t)=>((t.startsWith(`data-`)||t.startsWith(`aria-`)||t===`role`)&&(e[t]=r[t]),e),{}),_=(0,t.createVNode)(`div`,{class:e.default(h,p,{[`${h}-closable`]:o}),style:m,onMouseenter:l,onMouseleave:c,onClick:d,...g},[(0,t.createVNode)(`div`,{class:`${h}-content`},[i.default?.()]),o?(0,t.createVNode)(`a`,{tabindex:0,onClick:u,class:`${h}-close`},[s||(0,t.createVNode)(`span`,{class:`${h}-close-x`},null)]):null]);return f?(0,t.createVNode)(t.Teleport,{to:f},{default:()=>_}):_}}});exports.default=n;