import{a0 as B,aM as D,a2 as b,af as N,a4 as $,r as I,G as k,o as a,g as l,w as p,i as V,a as h,n as o,f as e,ab as f,al as A,l as n,c as i,j as C,t as u,F as M,h as F,v as P,aC as j,ai as z}from"./index-25eb6331.js";import{T as E,E as g,_ as G,D as O}from"./index-3bef6acb.js";const _=["light","dark"],q=B({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:D(E),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:_,default:"light"}}),H={close:r=>r instanceof MouseEvent},J=b({name:"ElAlert"}),K=b({...J,props:q,emits:H,setup(r,{emit:S}){const d=r,{Close:w}=O,T=N(),t=$("alert"),m=I(!0),y=k(()=>E[d.type]),c=k(()=>!!(d.description||T.default)),v=s=>{m.value=!1,S("close",s)};return(s,Q)=>(a(),l(j,{name:e(t).b("fade"),persisted:""},{default:p(()=>[V(h("div",{class:o([e(t).b(),e(t).m(s.type),e(t).is("center",s.center),e(t).is(s.effect)]),role:"alert"},[s.showIcon&&(s.$slots.icon||e(y))?(a(),l(e(g),{key:0,class:o([e(t).e("icon"),{[e(t).is("big")]:e(c)}])},{default:p(()=>[f(s.$slots,"icon",{},()=>[(a(),l(A(e(y))))])]),_:3},8,["class"])):n("v-if",!0),h("div",{class:o(e(t).e("content"))},[s.title||s.$slots.title?(a(),i("span",{key:0,class:o([e(t).e("title"),{"with-description":e(c)}])},[f(s.$slots,"title",{},()=>[C(u(s.title),1)])],2)):n("v-if",!0),e(c)?(a(),i("p",{key:1,class:o(e(t).e("description"))},[f(s.$slots,"default",{},()=>[C(u(s.description),1)])],2)):n("v-if",!0),s.closable?(a(),i(M,{key:2},[s.closeText?(a(),i("div",{key:0,class:o([e(t).e("close-btn"),e(t).is("customed")]),onClick:v},u(s.closeText),3)):(a(),l(e(g),{key:1,class:o(e(t).e("close-btn")),onClick:v},{default:p(()=>[F(e(w))]),_:1},8,["class"]))],64)):n("v-if",!0)],2)],2),[[P,m.value]])]),_:3},8,["name"]))}});var L=G(K,[["__file","alert.vue"]]);const W=z(L);export{W as E};
