import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,Et as n,Ln as r,Ot as i,Tt as a,Vn as o,Wt as s,bt as c,nt as l,xt as u,yt as d,zn as f}from"./jsx-runtime-ADHq9IcL.js";import{w as p}from"./tooltip-CRuv8UNz.js";import{t as m}from"./CheckCircleFilled-D9xa2k05.js";import{t as h}from"./CloseCircleFilled-BARdd-Ff.js";import{r as g}from"./PlusOutlined-W6xCIIXs.js";import{t as _}from"./ExclamationCircleFilled-BF18pnJ8.js";import{_ as v,d as y,f as b,g as x,i as S,l as C,m as w,n as T,p as E,t as D,u as O}from"./context-o-GHk4GQ.js";import{n as k,t as A}from"./useClosable-CCgKioKg.js";import{t as j}from"./useModal-DQaWKI1g.js";var M=e(t()),N={info:M.createElement(v,null),success:M.createElement(m,null),error:M.createElement(h,null),warning:M.createElement(_,null),loading:M.createElement(l,null)};function P(e,t){return t===null||t===!1?null:t||M.createElement(g,{className:`${e}-close-icon`})}var F=4.5,I=`topRight`,L={offset:8},R=({children:e,prefixCls:t})=>{let n=d(t),[r,i]=C(t,n);return M.createElement(x,{classNames:{list:o(r,i,n)}},e)},z=(e,{prefixCls:t,key:n})=>M.createElement(R,{prefixCls:t,key:n},e),B=M.forwardRef((e,t)=>{let{top:n,bottom:i,prefixCls:s,getContainer:c,maxCount:l,rtl:d,onAllRemoved:p,stack:m,duration:h=F,pauseOnHover:g=!0,showProgress:_}=e,{getPrefixCls:v,getPopupContainer:x,direction:S}=f(`notification`),{notification:C}=(0,M.useContext)(r),T=s||v(`notification`),D=(0,M.useMemo)(()=>a(h)&&h>0?h:!1,[h]),[O,k]=u([C?.classNames,e?.classNames],[C?.styles,e?.styles],{props:e}),A=()=>b(n,i),j=()=>o({[`${T}-rtl`]:d??S===`rtl`}),N=()=>y(T),I=E(m,L),[R,B]=w({prefixCls:T,style:A,className:j,motion:N,closable:{closeIcon:P(T)},duration:D,getContainer:()=>c?.()||x?.()||document.body,maxCount:l,pauseOnHover:g,showProgress:_,classNames:O,styles:k,onAllRemoved:p,renderNotifications:z,stack:I});return M.useImperativeHandle(t,()=>({...R,prefixCls:T,notification:C})),B});function V(e){let t=M.useRef(null);p(`Notification`);let{notification:a}=M.useContext(r);return[M.useMemo(()=>{let r=r=>{if(!t.current)return;let{open:s,prefixCls:l,notification:u}=t.current,d=u?.className||{},f=u?.style||{},p=`${l}-notice`,{title:m,message:h,description:g,icon:_,type:v,btn:y,actions:b,className:x,style:S,role:C=`alert`,closeIcon:w,closable:T,classNames:E={},styles:D={},...j}=r,M=m??h,F=i(M),L=b??y,R=P(p,O(w,e,u)),[z,B,,V]=A(k({...e||{},...r}),k(a),{closable:!0,closeIcon:R}),H=z?{onClose:n(T)?T.onClose:void 0,closeIcon:B,...V}:!1,U=c(E,{props:r}),W=c(D,{props:r}),G=_||(v?N[v]:null),K=!_&&v?`${p}-icon-${v}`:void 0;return s({placement:e?.placement??I,...j,title:F?M:null,description:g,icon:G,actions:L,role:C,classNames:{...U,icon:o(K,U.icon)},styles:{...W,root:{...f,...W.root}},className:o({[`${p}-${v}`]:v},x,d),style:S,closable:H})},s={open:r,destroy:e=>{e===void 0?t.current?.destroy():t.current?.close(e)}};return[`success`,`info`,`warning`,`error`].forEach(e=>{s[e]=t=>r({...t,type:e})}),s},[e,a]),M.createElement(B,{key:`notification-holder`,...e,ref:t})]}function H(e){return V(e)}var U=s(`App`,e=>{let{componentCls:t,colorText:n,fontSize:r,lineHeight:i,fontFamily:a}=e;return{[t]:{color:n,fontSize:r,lineHeight:i,fontFamily:a,[`&${t}-rtl`]:{direction:`rtl`}}}},()=>({})),W=M.forwardRef((e,t)=>{let{prefixCls:n,children:r,className:i,rootClassName:a,message:s,notification:c,style:l,component:u=`div`}=e,{direction:d,getPrefixCls:m,className:h,style:g}=f(`app`),_=m(`app`,n),[v,y]=U(_),b=o(v,_,i,a,y,{[`${_}-rtl`]:d===`rtl`}),x=(0,M.useContext)(D),C=M.useMemo(()=>({message:{...x.message,...s},notification:{...x.notification,...c}}),[s,c,x.message,x.notification]),[w,E]=S(C.message),[O,k]=H(C.notification),[A,N]=j(),P=M.useMemo(()=>({message:w,notification:O,modal:A}),[w,O,A]);p(`App`)(!(y&&u===!1),`usage`,"When using cssVar, ensure `component` is assigned a valid React component string."),p(`App`)(!t||u!==!1,`usage`,"`ref` is not supported when `component` is `false`. Please provide a valid `component` instead.");let F=u===!1?M.Fragment:u,I={className:o(h,b),style:{...g,...l}};return M.createElement(T.Provider,{value:P},M.createElement(D.Provider,{value:C},M.createElement(F,{...u===!1?void 0:{...I,ref:t}},N,E,k,r)))}),G=()=>M.useContext(T),K=W;K.useApp=G;export{K as t};