import{cO as L,C as b,O,B as w,a1 as F,a2 as d,Q as M,bY as N,Y as R,D as j,Z as E,cf as J,bX as K,a0 as Y,aK as H,ac as Q,b as l,H as v,n as m,b_ as X,S as Z,I as p,a7 as q,b$ as G,c0 as U,a8 as W,J as ee,a9 as ae,K as te,ce as le,c2 as se,a as s,j as ne,aD as y,aJ as f}from"./index-CoB_2BUd.js";import{V as oe}from"./VBtn-hyLqVrgl.js";const ie=L("v-alert-title"),ce=b({iconSize:[Number,String],iconSizes:{type:Array,default:()=>[["x-small",10],["small",16],["default",24],["large",28],["x-large",32]]}},"iconSize");function re(e,n){return{iconSize:O(()=>{const a=new Map(e.iconSizes),t=e.iconSize??n()??"default";return a.has(t)?a.get(t):t})}}const ue=["success","info","warning","error"],de=b({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:le,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:e=>ue.includes(e)},...te(),...ae(),...ee(),...W(),...ce(),...U(),...G(),...q(),...p(),...Z(),...X({variant:"flat"})},"VAlert"),ye=w()({name:"VAlert",props:de(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,n){let{emit:c,slots:a}=n;const t=F(e,"modelValue"),o=d(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),{iconSize:S}=re(e,()=>e.prominent?44:void 0),{themeClasses:k}=M(e),{colorClasses:P,colorStyles:V,variantClasses:C}=N(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:z}=R(e),{dimensionStyles:g}=j(e),{elevationClasses:x}=E(e),{locationStyles:_}=J(e),{positionClasses:B}=K(e),{roundedClasses:I}=Y(e),{textColorClasses:h,textColorStyles:A}=H(()=>e.borderColor),{t:D}=Q(),r=d(()=>({"aria-label":D(e.closeLabel),onClick(i){t.value=!1,c("click:close",i)}}));return()=>{const i=!!(a.prepend||o.value),T=!!(a.title||e.title),$=!!(a.close||e.closable),u={density:e.density,icon:o.value,size:e.iconSize||e.prominent?S.value:void 0};return t.value&&l(e.tag,{class:m(["v-alert",e.border&&{"v-alert--border":!!e.border,[`v-alert--border-${e.border===!0?"start":e.border}`]:!0},{"v-alert--prominent":e.prominent},k.value,P.value,z.value,x.value,B.value,I.value,C.value,e.class]),style:v([V.value,g.value,_.value,e.style]),role:"alert"},{default:()=>[se(!1,"v-alert"),e.border&&s("div",{key:"border",class:m(["v-alert__border",h.value]),style:v(A.value)},null),i&&s("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?l(f,{key:"prepend-defaults",disabled:!o.value,defaults:{VIcon:{...u}}},a.prepend):l(ne,y({key:"prepend-icon"},u),null)]),s("div",{class:"v-alert__content"},[T&&l(ie,{key:"title"},{default:()=>[a.title?.()??e.title]}),a.text?.()??e.text,a.default?.()]),a.append&&s("div",{key:"append",class:"v-alert__append"},[a.append()]),$&&s("div",{key:"close",class:"v-alert__close"},[a.close?l(f,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>[a.close?.({props:r.value})]}):l(oe,y({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},r.value),null)])]})}}});export{ye as V};
