const e=require("../_util/classNames.js"),t=require("../_util/transition.js"),n=require("../_util/Portal.js"),r=require("./Notice.js");let i=require("vue");var a=0,o=Date.now();function s(){let e=a;return a+=1,`rcNotification_${o}_${e}`}var c=(0,i.defineComponent)({name:`HookNotification`,inheritAttrs:!1,props:[`prefixCls`,`transitionName`,`animation`,`maxCount`,`closeIcon`,`hashId`,`remove`,`notices`,`getStyles`,`getClassName`,`onAllRemoved`,`getContainer`],setup(a,{attrs:o,slots:s}){let c=new Map,l=(0,i.computed)(()=>a.notices),u=(0,i.computed)(()=>{let e=a.transitionName;if(!e&&a.animation)switch(typeof a.animation){case`string`:e=a.animation;break;case`function`:e=a.animation().name;break;case`object`:e=a.animation.name;break;default:e=`${a.prefixCls}-fade`;break}return t.getTransitionGroupProps(e)}),d=e=>a.remove(e),f=(0,i.ref)({});(0,i.watch)(l,()=>{let e={};Object.keys(f.value).forEach(t=>{e[t]=[]}),a.notices.forEach(t=>{let{placement:n=`topRight`}=t.notice;n&&(e[n]=e[n]||[],e[n].push(t))}),f.value=e});let p=(0,i.computed)(()=>Object.keys(f.value));return()=>{let{prefixCls:t,closeIcon:m=s.closeIcon?.({prefixCls:t})}=a,h=p.value.map(n=>{let s=f.value[n],p=a.getClassName?.(n),h=a.getStyles?.(n),g=s.map(({notice:n,holderCallback:o},s)=>{let u=s===l.value.length-1?n.updateMark:void 0,{key:f,userPassKey:p}=n,{content:h}=n,g={prefixCls:t,closeIcon:typeof m==`function`?m({prefixCls:t}):m,...n,...n.props,key:f,noticeKey:p||f,updateMark:u,onClose:e=>{d(e),n.onClose?.()},onClick:n.onClick};return o?(0,i.createVNode)(`div`,{key:f,class:`${t}-hook-holder`,ref:e=>{f!==void 0&&(e?(c.set(f,e),o(e,g)):c.delete(f))}},null):(0,i.createVNode)(r.default,{...g,class:e.default(g.class,a.hashId)},{default:()=>[typeof h==`function`?h({prefixCls:t}):h]})}),_={[t]:1,[`${t}-${n}`]:1,[o.class]:!!o.class,[a.hashId]:!0,[p]:!!p};function v(){s.length>0||(Reflect.deleteProperty(f.value,n),a.onAllRemoved?.())}return(0,i.createVNode)(`div`,{key:n,class:_,style:o.style||h||{top:`65px`,left:`50%`}},[(0,i.createVNode)(i.TransitionGroup,{tag:`div`,...u.value,onAfterLeave:v},{default:()=>[g]})])});return(0,i.createVNode)(n.default,{getContainer:a.getContainer},{default:()=>[h]})}}});exports.default=c,exports.getUuid=s;