"use strict";const e=require("../common/src/instantiationDecorator.js"),i=require("../common/config.js"),s=require("./props.js"),t=require("../common/utils.js"),o=require("../common/utils.wxs.js"),n=require("../../../../common/vendor.js"),a=`${i.prefix}-icon`,r=e.uniComponent({name:a,options:{styleIsolation:"shared"},externalClasses:[`${i.prefix}-class`],props:{...s.props},data:()=>({componentPrefix:i.prefix,classPrefix:a,isImage:!1,iconStyle:void 0,tools:o.tools}),watch:{name:{handler(){this.setIconStyle()},immediate:!0},color:{handler(){this.setIconStyle()},immediate:!0},size:{handler(){this.setIconStyle()},immediate:!0},style:{handler(){this.setIconStyle()},immediate:!0}},methods:{onTap(e){this.$emit("click",e)},setIconStyle(){const{name:e,color:i,size:s,classPrefix:o}=this,n=-1!==e.indexOf("/"),a=t.addUnit(s),r={...i?{color:i}:{},...s?{"font-size":a}:{}};if(this.isImage=n,n){let e=a;e||t.getRect(this,`.${o}`).then((i=>{e=t.addUnit(null==i?void 0:i.height)})).catch((()=>{})),r.width=e,r.height=e}this.iconStyle=`${t.styles(r)}`}}});const c=n._export_sfc(r,[["render",function(e,i,s,t,o,a){return n.e({a:e.isImage},e.isImage?{b:e.name,c:n.n(e.classPrefix+"__image"),d:n.n(e.classPrefix+"--image")}:{},{e:e.tools.isValidIconName(e.name)&&!e.isImage},e.tools.isValidIconName(e.name)&&!e.isImage?{f:n.n((e.prefix?e.prefix:e.classPrefix)+"-"+e.name+" "+e.classPrefix+"-base")}:{},{g:n.n(e.tClass),h:n.n(e.prefix||"t-icon"),i:n.s(e.tools._style([e.iconStyle,e.customStyle])),j:e.ariaHidden,k:e.ariaLabel,l:e.ariaRole,m:n.o(((...i)=>e.onTap&&e.onTap(...i)))})}],["__scopeId","data-v-a4f8549c"]]);wx.createComponent(c);
