import{b as N,bI as $,bs as S,d as D,bF as V,a as x,o as l,e as n,w as d,K as M,q as h,n as o,f as e,E as k,h as m,r as A,g as i,c,x as g,aa as v,M as F,s as P,bo as j,L as q,Z as z,y as K,j as E,l as L}from"./index-CGB0A5x_.js";import{f as O,b as Z}from"./vnode-DFpZw5lG.js";const G=["light","dark"],H=N({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:$(S),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:G,default:"light"}}),J={close:t=>t instanceof MouseEvent};var Q=D({name:"ElAlert",__name:"alert",props:H,emits:J,setup(t,{emit:w}){const{Close:B}=j,p=t,T=w,r=V(),s=x("alert"),y=K(!0),b=E(()=>S[p.type]),u=E(()=>{var f;if(p.description)return!0;const a=(f=r.default)==null?void 0:f.call(r);return a?O(a).some(I=>!Z(I)):!1}),C=a=>{y.value=!1,T("close",a)};return(a,f)=>(l(),n(z,{name:e(s).b("fade"),persisted:""},{default:d(()=>[M(h("div",{class:o([e(s).b(),e(s).m(t.type),e(s).is("center",t.center),e(s).is(t.effect)]),role:"alert"},[t.showIcon&&(a.$slots.icon||b.value)?(l(),n(e(k),{key:0,class:o([e(s).e("icon"),e(s).is("big",u.value)])},{default:d(()=>[m(a.$slots,"icon",{},()=>[(l(),n(A(b.value)))])]),_:3},8,["class"])):i("v-if",!0),h("div",{class:o(e(s).e("content"))},[t.title||a.$slots.title?(l(),c("span",{key:0,class:o([e(s).e("title"),{"with-description":u.value}])},[m(a.$slots,"title",{},()=>[g(v(t.title),1)])],2)):i("v-if",!0),u.value?(l(),c("p",{key:1,class:o(e(s).e("description"))},[m(a.$slots,"default",{},()=>[g(v(t.description),1)])],2)):i("v-if",!0),t.closable?(l(),c(F,{key:2},[t.closeText?(l(),c("div",{key:0,class:o([e(s).e("close-btn"),e(s).is("customed")]),onClick:C},v(t.closeText),3)):(l(),n(e(k),{key:1,class:o(e(s).e("close-btn")),onClick:C},{default:d(()=>[P(e(B))]),_:1},8,["class"]))],64)):i("v-if",!0)],2)],2),[[q,y.value]])]),_:3},8,["name"]))}}),R=Q;const X=L(R);export{X as E};
