import{a2 as J,a3 as F,a as S,U as $,f as h,S as j,J as g,j as l,cN as V,cO as q,aa as N,r as D,F as G,cP as H,aF as K}from"./index.bde7963b.js";function aa(r){var a=J();return F(function(){a.value=r()},{flush:"sync"}),a}var L=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function}},M=S({name:"ACheckableTag",props:L(),setup:function(a,f){var n=f.slots,d=f.emit,v=$("tag",a),i=v.prefixCls,c=function(b){var s=a.checked;d("update:checked",!s),d("change",!s),d("click",b)},k=h(function(){var e;return j(i.value,(e={},g(e,"".concat(i.value,"-checkable"),!0),g(e,"".concat(i.value,"-checkable-checked"),a.checked),e))});return function(){var e;return l("span",{class:k.value,onClick:c},[(e=n.default)===null||e===void 0?void 0:e.call(n)])}}}),C=M,Q=new RegExp("^(".concat(V.join("|"),")(-inverse)?$")),X=new RegExp("^(".concat(q.join("|"),")$")),Y=function(){return{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:N.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},"onUpdate:visible":Function,icon:N.any}},u=S({name:"ATag",props:Y(),slots:["closeIcon","icon"],setup:function(a,f){var n=f.slots,d=f.emit,v=f.attrs,i=$("tag",a),c=i.prefixCls,k=i.direction,e=D(!0);F(function(){a.visible!==void 0&&(e.value=a.visible)});var b=function(t){t.stopPropagation(),d("update:visible",!1),d("close",t),!t.defaultPrevented&&a.visible===void 0&&(e.value=!1)},s=h(function(){var o=a.color;return o?Q.test(o)||X.test(o):!1}),R=h(function(){var o;return j(c.value,(o={},g(o,"".concat(c.value,"-").concat(a.color),s.value),g(o,"".concat(c.value,"-has-color"),a.color&&!s.value),g(o,"".concat(c.value,"-hidden"),!e.value),g(o,"".concat(c.value,"-rtl"),k.value==="rtl"),o))});return function(){var o,t,p,m=a.icon,z=m===void 0?(o=n.icon)===null||o===void 0?void 0:o.call(n):m,x=a.color,y=a.closeIcon,P=y===void 0?(t=n.closeIcon)===null||t===void 0?void 0:t.call(n):y,T=a.closable,B=T===void 0?!1:T,E=function(){return B?P?l("div",{class:"".concat(c.value,"-close-icon"),onClick:b},[P]):l(K,{class:"".concat(c.value,"-close-icon"),onClick:b},null):null},U={backgroundColor:x&&!s.value?x:void 0},I=z||null,_=(p=n.default)===null||p===void 0?void 0:p.call(n),A=I?l(G,null,[I,l("span",null,[_])]):_,O="onClick"in v,w=l("span",{class:R.value,style:U},[A,E()]);return O?l(H,null,{default:function(){return[w]}}):w}}});u.CheckableTag=C;u.install=function(r){return r.component(u.name,u),r.component(C.name,C),r};var oa=u;export{oa as T,aa as e};
