"use strict";const e=require("vue"),a=require("./constants.js"),n=require("./Icon.js"),d=require("./useSlotContents.js"),p=require("./CdxTooltip.cjs"),f=require("./_plugin-vue_export-helper.js"),m={notice:n.e6,error:n.F4,warning:n.C3,success:n.n8},C=e.defineComponent({name:"CdxInfoChip",components:{CdxIcon:n.CdxIcon},directives:{tooltip:p},props:{status:{type:String,default:"notice",validator:a.statusTypeValidator},icon:{type:[String,Object],default:null}},setup(t,{slots:c}){const r=e.computed(()=>({["cdx-info-chip--".concat(t.status)]:!0})),u=e.computed(()=>t.status==="notice"?t.icon:m[t.status]),o=e.ref(),i=e.ref(!1),s=e.computed(()=>i.value&&o.value&&o.value.scrollWidth>o.value.clientWidth?d.useSlotContents(c==null?void 0:c.default)[0]:null);return e.onMounted(()=>{i.value=!0}),{rootClasses:r,computedIcon:u,tooltipContent:s,textElement:o}}}),v={ref:"textElement",class:"cdx-info-chip__text"};function _(t,c,r,u,o,i){const s=e.resolveComponent("cdx-icon"),l=e.resolveDirective("tooltip");return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cdx-info-chip",t.rootClasses])},[t.computedIcon?(e.openBlock(),e.createBlock(s,{key:0,class:"cdx-info-chip__icon--vue",icon:t.computedIcon},null,8,["icon"])):e.createCommentVNode("v-if",!0),e.createElementVNode("span",v,[e.renderSlot(t.$slots,"default")],512)],2)),[[l,t.tooltipContent]])}const x=f._export_sfc(C,[["render",_]]);module.exports=x;
