"use strict";const e=require("../common/src/instantiationDecorator.js"),t=require("../common/config.js"),o=require("./props.js"),s=require("../common/utils.js"),n=require("../common/utils.wxs.js"),a=require("./computed.js"),r=require("../../../../common/vendor.js"),i=`${t.prefix}-badge`,c=s.uniqueFactory("badge"),l=e.uniComponent({name:i,options:{styleIsolation:"shared"},externalClasses:[`${t.prefix}-class`,`${t.prefix}-class-count`,`${t.prefix}-class-content`],props:{...o.props},data:()=>({prefix:t.prefix,classPrefix:i,value:"",labelID:"",descriptionID:"",tools:n.tools,useOuterClass:!1}),computed:{hasChild(){var e;return!!(null==(e=this.$slots)?void 0:e.default)}},mounted(){const e=c();this.labelID=`${e}_label`,this.descriptionID=`${e}_description`,this.checkForActualContent()},methods:{getBadgeValue:a.getBadgeValue,getBadgeStyles:a.getBadgeStyles,getBadgeInnerClass:a.getBadgeInnerClass,isShowBadge:a.isShowBadge,checkForActualContent(){if(!this.content&&["ribbon","ribbon-right","ribbon-left","triangle-right","triangle-left"].includes(this.shape))return s.getRect(this,`.${i}__content`).then((e=>{const t=e.width>0||e.height>0;this.useOuterClass=!t}));this.useOuterClass=!1}}});const u=r._export_sfc(l,[["render",function(e,t,o,s,n,a){return r.e({a:!e.content},e.content?{b:r.t(e.content),c:r.n(e.classPrefix+"__content-text")}:{},{d:e.labelID,e:r.n(e.tools.cls(e.classPrefix+"__content",[["empty",!e.content&&!e.hasChild]])+" "+e.tClassContent),f:e.isShowBadge({dot:e.dot,count:e.count,showZero:e.showZero})||null===e.count},e.isShowBadge({dot:e.dot,count:e.count,showZero:e.showZero})||null===e.count?r.e({g:e.isShowBadge({dot:e.dot,count:e.count,showZero:e.showZero})},e.isShowBadge({dot:e.dot,count:e.count,showZero:e.showZero})?{h:r.t(e.getBadgeValue({dot:e.dot,count:e.count,maxCount:e.maxCount}))}:{},{i:r.n(e.classPrefix+"__count"),j:e.descriptionID,k:e.ariaLabel||e.tools.getBadgeAriaLabel({dot:e.dot,count:e.count,maxCount:e.maxCount}),l:r.n(e.getBadgeInnerClass({classPrefix:e.classPrefix,dot:e.dot,size:e.size,shape:e.shape,count:e.count})+" "+e.prefix+"-has-count "),m:r.n(e.tClassCount),n:r.s(e.tools._style([e.getBadgeStyles({color:e.color,offset:e.offset})]))}):{},{o:r.s(e.tools._style([e.customStyle])),p:r.n(e.classPrefix+" "+(e.useOuterClass?e.classPrefix+"__"+e.shape+"-outer":"")+e.tClass),q:e.labelID,r:e.descriptionID,s:e.ariaRole||"option"})}],["__scopeId","data-v-58865647"]]);wx.createComponent(u);
