const e=require("../_util/util.js"),t=require("../_util/classNames.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../vc-trigger/utils/motionUtil.js"),i=require("../vc-notification/useNotification.js"),a=require("./style/index.js"),o=require("./PurePanel.js");let s=require("vue"),c=require("@antsoo-lib/icons");var l=8,u=3,d=(0,s.defineComponent)({name:`Holder`,inheritAttrs:!1,props:[`top`,`prefixCls`,`getContainer`,`maxCount`,`duration`,`rtl`,`transitionName`,`onAllRemoved`,`animation`,`staticGetContainer`],setup(e,{expose:o}){let{getPrefixCls:d,getPopupContainer:f}=n.default(`message`,e),p=(0,s.computed)(()=>d(`message`,e.prefixCls)),[,m]=a.default(p),h=()=>{let t=e.top??l;return{left:`50%`,transform:`translateX(-50%)`,top:typeof t==`number`?`${t}px`:t}},g=()=>t.default(m.value,e.rtl?`${p.value}-rtl`:``),_=()=>r.getMotion({prefixCls:p.value,animation:e.animation??`move-up`,transitionName:e.transitionName}),v=(0,s.createVNode)(`span`,{class:`${p.value}-close-x`},[(0,s.createVNode)(c.CloseOutlined,{class:`${p.value}-close-icon`},null)]),[y,b]=i.default({getStyles:h,prefixCls:p.value,getClassName:g,motion:_,closable:!1,closeIcon:v,duration:e.duration??u,getContainer:e.staticGetContainer??f.value,maxCount:e.maxCount,onAllRemoved:e.onAllRemoved});return o({...y,prefixCls:p,hashId:m}),b}}),f=0;function p(n){let r=(0,s.shallowRef)(null),i=Symbol(`messageHolderKey`),a=e=>{r.value?.close(e)},c=n=>{if(!r.value){let e=()=>{};return e.then=()=>{},e}let{open:i,prefixCls:c,hashId:l}=r.value,u=`${c}-notice`,{content:d,icon:p,type:m,key:h,class:g,onClose:_,...v}=n,y=h;return y??(f+=1,y=`antd-message-${f}`),e.wrapPromiseFn(e=>(i({...v,key:y,content:()=>(0,s.createVNode)(o.PureContent,{prefixCls:c,type:m,icon:typeof p==`function`?p():p},{default:()=>[typeof d==`function`?d():d]}),placement:`top`,class:t.default(m&&`${u}-${m}`,l,g),onClose:()=>{_?.(),e()}}),()=>{a(y)}))},l={open:c,destroy:e=>{e===void 0?r.value?.destroy():a(e)}};return[`info`,`success`,`warning`,`error`,`loading`].forEach(e=>{l[e]=(t,n,r)=>{let i;i=t&&typeof t==`object`&&`content`in t?t:{content:t};let a,o;typeof n==`function`?o=n:(a=n,o=r);let s={onClose:o,duration:a,...i,type:e};return c(s)}}),[l,()=>(0,s.createVNode)(d,{key:i,...n,ref:r},null)]}function m(e){return p(e)}exports.default=m,exports.useInternalMessage=p;