"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../../config-provider/index.js");const S=require("./style/index.js"),y=require("../../config-provider/hooks/use-namespace.js"),$=["title"],b=t.defineComponent({name:"ApTag",__name:"ap-tag",props:{type:{default:"purely"},text:{},color:{default:"#34B77C"},size:{default:"middle"},disabled:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1}},setup(r){const a=r,{b:n,bm:s}=y.useNamespace("tag"),l=S.default("tag");function c(e,i){e.length===4&&(e=`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);const d=parseInt(e.slice(1,3),16),g=parseInt(e.slice(3,5),16),m=parseInt(e.slice(5,7),16),f=Math.round(i*255).toString(16).padStart(2,"0");return`#${d.toString(16).padStart(2,"0")}${g.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}${f}`}const p=t.computed(()=>({"--tag-main-color":a.color,"--tag-main-color-opacity":c(a.color,.06),"--tag-main-color-background":c(a.color,.15)})),o=t.computed(()=>[n(),n("wrapper"),n(`wrapper-${a.type}`),s("wrapper",a.size),l.value].filter(Boolean)),u=t.computed(()=>{const e=[n("inner-wrapper"),s("inner-wrapper",a.size)];return a.disabled&&e.push(s("inner-wrapper","disabled")),e});return(e,i)=>(t.openBlock(),t.createElementBlock("span",{style:t.normalizeStyle(p.value),title:r.text,class:t.normalizeClass(o.value)},[t.createElementVNode("span",{class:t.normalizeClass(u.value)},t.toDisplayString(r.text),3)],14,$))}});exports.default=b;
