import{_ as k,u as z}from"./DCp3GJQW.js";import{z as C,b as c,N as l,i as y,W as o,g as b,D as f,h as s,a0 as S,A as N,l as j,e as n,a1 as O,a4 as _,a3 as g}from"./D7LY3N47.js";import{u as $}from"./DqW9UKXb.js";import{_ as B}from"./DlAUqK2U.js";const A={base:"inline-flex items-center",rounded:"rounded-md",font:"font-medium",size:{xs:"text-xs px-1.5 py-0.5",sm:"text-xs px-2 py-1",md:"text-sm px-2 py-1",lg:"text-sm px-2.5 py-1.5"},gap:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5"},color:{white:{solid:"ring-1 ring-inset ring-gray-300 dark:ring-gray-700 text-gray-900 dark:text-white bg-white dark:bg-gray-900"},gray:{solid:"ring-1 ring-inset ring-gray-300 dark:ring-gray-700 text-gray-700 dark:text-gray-200 bg-gray-50 dark:bg-gray-800"},black:{solid:"text-white dark:text-gray-900 bg-gray-900 dark:bg-white"}},variant:{solid:"bg-{color}-500 dark:bg-{color}-400 text-white dark:text-gray-900",outline:"text-{color}-500 dark:text-{color}-400 ring-1 ring-inset ring-{color}-500 dark:ring-{color}-400",soft:"bg-{color}-50 dark:bg-{color}-400 dark:bg-opacity-10 text-{color}-500 dark:text-{color}-400",subtle:"bg-{color}-50 dark:bg-{color}-400 dark:bg-opacity-10 text-{color}-500 dark:text-{color}-400 ring-1 ring-inset ring-{color}-500 dark:ring-{color}-400 ring-opacity-25 dark:ring-opacity-25"},icon:{base:"flex-shrink-0",size:{xs:"h-4 w-4",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-5 w-5"}},default:{size:"sm",variant:"solid",color:"primary"}},t=C(c.ui.strategy,c.ui.badge,A),U=j({components:{UIcon:k},inheritAttrs:!1,props:{size:{type:String,default:()=>t.default.size,validator(a){return Object.keys(t.size).includes(a)}},color:{type:String,default:()=>t.default.color,validator(a){return[...c.ui.colors,...Object.keys(t.color)].includes(a)}},variant:{type:String,default:()=>t.default.variant,validator(a){return[...Object.keys(t.variant),...Object.values(t.color).flatMap(e=>Object.keys(e))].includes(a)}},label:{type:[String,Number],default:null},icon:{type:String,default:null},leadingIcon:{type:String,default:null},trailingIcon:{type:String,default:null},trailing:{type:Boolean,default:!1},leading:{type:Boolean,default:!1},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},setup(a){const{ui:e,attrs:d}=$("badge",O(a,"ui"),t),{size:r,rounded:u}=z({ui:e,props:a}),m=n(()=>a.icon&&a.leading||a.icon&&!a.trailing||!a.trailing||a.leadingIcon),i=n(()=>a.icon&&a.trailing||a.trailing||a.trailingIcon),v=n(()=>{const w=e.value.color?.[a.color]?.[a.variant]||e.value.variant[a.variant];return _(g(e.value.base,e.value.font,u.value,e.value.size[r.value],e.value.gap[r.value],w?.replaceAll("{color}",a.color)),a.class)}),I=n(()=>a.leadingIcon||a.icon),p=n(()=>a.trailingIcon||a.icon),x=n(()=>g(e.value.icon.base,e.value.icon.size[r.value])),h=n(()=>g(e.value.icon.base,e.value.icon.size[r.value]));return{attrs:d,isLeading:m,isTrailing:i,badgeClass:v,leadingIconName:I,trailingIconName:p,leadingIconClass:x,trailingIconClass:h}}}),D={key:0};function L(a,e,d,r,u,m){const i=k;return l(),y("span",N({class:a.badgeClass},a.attrs),[o(a.$slots,"leading",{},()=>[a.isLeading&&a.leadingIconName?(l(),b(i,{key:0,name:a.leadingIconName,class:f(a.leadingIconClass),"aria-hidden":"true"},null,8,["name","class"])):s("",!0)]),o(a.$slots,"default",{},()=>[a.label!==void 0&&a.label!==null?(l(),y("span",D,S(a.label),1)):s("",!0)]),o(a.$slots,"trailing",{},()=>[a.isTrailing&&a.trailingIconName?(l(),b(i,{key:0,name:a.trailingIconName,class:f(a.trailingIconClass),"aria-hidden":"true"},null,8,["name","class"])):s("",!0)])],16)}const J=B(U,[["render",L]]);export{J as _};
