import{cJ as L,y as b,N,x as R,a0 as w,a1 as d,O as E,bV as F,X as M,z as O,Y as G,c9 as H,bU as X,Z as Y,aH as Z,ab as j,b as l,D as v,E as m,bX as J,R as U,G as p,a6 as q,bY as K,bZ as Q,a7 as W,H as ee,a8 as ae,I as te,cc as le,b$ as se,a as s,g as ne,aA as y,aG as f}from"./index-LFx1jIjH.js";import{a as oe}from"./VBtn-BYKkZzw0.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:N(()=>{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(),...Q(),...K(),...q(),...p(),...U(),...J({variant:"flat"})},"VAlert"),ye=R()({name:"VAlert",props:de(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,n){let{emit:c,slots:a}=n;const t=w(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}=E(e),{colorClasses:P,colorStyles:V,variantClasses:z}=F(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:g}=M(e),{dimensionStyles:C}=O(e),{elevationClasses:x}=G(e),{locationStyles:_}=H(e),{positionClasses:I}=X(e),{roundedClasses:A}=Y(e),{textColorClasses:B,textColorStyles:h}=Z(()=>e.borderColor),{t:T}=j(),r=d(()=>({"aria-label":T(e.closeLabel),onClick(i){t.value=!1,c("click:close",i)}}));return()=>{const i=!!(a.prepend||o.value),D=!!(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,g.value,x.value,I.value,A.value,z.value,e.class]),style:v([V.value,C.value,_.value,e.style]),role:"alert"},{default:()=>[se(!1,"v-alert"),e.border&&s("div",{key:"border",class:m(["v-alert__border",B.value]),style:v(h.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"},[D&&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};
