"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),x=require("../_util/classNames.js"),q=require("../config-provider/hooks/useConfigInject.js");require("../vc-notification/Notification.js");const A=require("../vc-notification/useNotification.js"),N=require("./PurePanel.js"),R=require("./style/index.js"),y=require("./util.js"),h=24,S=4.5,T=s.defineComponent({name:"Holder",inheritAttrs:!1,props:["prefixCls","class","type","icon","content","onAllRemoved"],setup(e,{expose:n}){const{getPrefixCls:a,getPopupContainer:l}=q.default("notification",e),o=s.computed(()=>e.prefixCls||a("notification")),c=u=>y.getPlacementStyle(u,e.top??h,e.bottom??h),[,r]=R.default(o),t=()=>x.default(r.value,{[`${o.value}-rtl`]:e.rtl}),i=()=>y.getMotion(o.value),[f,d]=A.default({prefixCls:o.value,getStyles:c,getClassName:t,motion:i,closable:!0,closeIcon:N.getCloseIcon(o.value),duration:S,getContainer:()=>e.getPopupContainer?.()||l.value?.()||document.body,maxCount:e.maxCount,hashId:r.value,onAllRemoved:e.onAllRemoved});return n({...f,prefixCls:o.value,hashId:r}),d}});function I(e){const n=s.shallowRef(null),a=Symbol("notificationHolderKey"),l=t=>{if(!n.value)return;const{open:i,prefixCls:f,hashId:d}=n.value,u=`${f}-notice`,{message:m,description:C,icon:g,type:p,btn:v,class:P,...b}=t;return i({placement:"topRight",...b,content:()=>s.createVNode(N.PureContent,{prefixCls:u,icon:typeof g=="function"?g():g,type:p,message:typeof m=="function"?m():m,description:typeof C=="function"?C():C,btn:typeof v=="function"?v():v},null),class:x.default(p&&`${u}-${p}`,d,P)})},c={open:l,destroy:t=>{t!==void 0?n.value?.close(t):n.value?.destroy()}};return["success","info","warning","error"].forEach(t=>{c[t]=i=>l({...i,type:t})}),[c,()=>s.createVNode(T,{key:a,...e,ref:n},null)]}function $(e){return I(e)}exports.default=$;exports.useInternalNotification=I;
