"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),M=require("@ant-design/icons-vue/CheckCircleFilled"),j=require("@ant-design/icons-vue/CloseCircleFilled"),w=require("@ant-design/icons-vue/ExclamationCircleFilled"),O=require("@ant-design/icons-vue/InfoCircleFilled"),F=require("@ant-design/icons-vue/LoadingOutlined"),S=require("../_util/classNames.js"),$=require("../vc-notification/Notification.js");require("../_util/Portal.js");const g=require("./style/index.js"),K=require("./useMessage.js");let d=3,C,t,L=1,y="",m="move-up",p=!1,v=()=>document.body,x,N=!1;function q(){return L++}function V(e){e.top!==void 0&&(C=e.top,t=null),e.duration!==void 0&&(d=e.duration),e.prefixCls!==void 0&&(y=e.prefixCls),e.getContainer!==void 0&&(v=e.getContainer,t=null),e.transitionName!==void 0&&(m=e.transitionName,t=null,p=!0),e.maxCount!==void 0&&(x=e.maxCount,t=null),e.rtl!==void 0&&(N=e.rtl)}function E(e,n){if(t){n(t);return}$.default.newInstance({appContext:e.appContext,prefixCls:e.prefixCls||y,rootPrefixCls:e.rootPrefixCls,transitionName:m,hasTransitionName:p,style:{top:C},getContainer:v||e.getPopupContainer,maxCount:x,name:"message",useStyle:g.default},o=>{if(t){n(t);return}t=o,n(o)})}const h={info:O,success:M,error:j,warning:w,loading:F},I=Object.keys(h);function _(e){const n=e.duration!==void 0?e.duration:d,o=e.key||q(),i=new Promise(r=>{const u=()=>(typeof e.onClose=="function"&&e.onClose(),r(!0));E(e,T=>{T.notice({key:o,duration:n,style:e.style||{},class:e.class,content:({prefixCls:s})=>{const a=h[e.type],b=a?f.createVNode(a,null,null):"",k=S.default(`${s}-custom-content`,{[`${s}-${e.type}`]:e.type,[`${s}-rtl`]:N===!0});return f.createVNode("div",{class:k},[typeof e.icon=="function"?e.icon():e.icon||b,f.createVNode("span",null,[typeof e.content=="function"?e.content():e.content])])},onClose:u,onClick:e.onClick})})}),c=()=>{t&&t.removeNotice(o)};return c.then=(r,u)=>i.then(r,u),c.promise=i,c}function A(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}const l={open:_,config:V,destroy(e){if(t)if(e){const{removeNotice:n}=t;n(e)}else{const{destroy:n}=t;n(),t=null}}};function P(e,n){e[n]=(o,i,c)=>A(o)?e.open({...o,type:n}):(typeof i=="function"&&(c=i,i=void 0),e.open({content:o,duration:i,type:n,onClose:c}))}I.forEach(e=>P(l,e));l.warn=l.warning;l.useMessage=K.default;exports.attachTypeApi=P;exports.default=l;exports.getKeyThenIncreaseKey=q;exports.typeList=I;
