import { iconMap } from '@/common/icon-map';
const __sfc__ = defineComponent({
    props: {
        name: String,
        src: String,
        size: Number,
        active: Boolean
    },
    computed: {
        resolvedSrc(): string {
            if (this.src != null)
                return this.src!;
            if (this.name != null) {
                const key = (this.active == true ? `${this.name!}-active` : this.name!) as string;
                const iconFromKey = iconMap[key] as string | null;
                if (iconFromKey != null)
                    return iconFromKey;
                const iconFromName = iconMap[this.name!] as string | null;
                if (iconFromName != null)
                    return iconFromName;
                return '';
            }
            return '';
        }
    },
    methods: {
        handleClick() {
            this.$emit('click');
        }
    }
});
export default __sfc__;
function GenComponentsUIconUIconRender(this: InstanceType<typeof __sfc__>): any | null {
    const _ctx = this;
    const _cache = this.$.renderCache;
    return _cE("image", _uM({
        class: "u-icon-img",
        src: _ctx.resolvedSrc,
        style: _nS(_uM({ width: (_ctx.size ?? 0) + 'px', height: (_ctx.size ?? 0) + 'px' })),
        mode: "aspectFit",
        onClick: _ctx.handleClick
    }), null, 12 /* STYLE, PROPS */, ["src", "onClick"]);
}
export type UIconComponentPublicInstance = InstanceType<typeof __sfc__>;
const GenComponentsUIconUIconStyles = [];
//# sourceMappingURL=u-icon.vue.map