import BadgeStyle from 'primevue/badge/style';
import BaseComponent from 'primevue/basecomponent';
import { resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, normalizeClass, createVNode, createCommentVNode, createElementVNode, toDisplayString } from 'vue';

var script$1 = {
  name: 'BaseBadge',
  "extends": BaseComponent,
  props: {
    label: {
      type: [String, Number],
      "default": null
    },
    icon: {
      type: String,
      "default": null
    },
    iconPos: {
      type: String,
      "default": 'left'
    },
    iconClass: {
      type: String,
      "default": null
    },
    variant: {
      type: String,
      "default": null
    },
    size: {
      type: String,
      "default": null
    }
  },
  style: BadgeStyle,
  provide: function provide() {
    return {
      $parentInstance: this
    };
  }
};

var script = {
  name: 'Badge',
  "extends": script$1,
  inheritAttrs: false,
  methods: {
    getPTOptions: function getPTOptions(key) {
      return this.ptm(key, {
        context: {
          disabled: this.disabled
        }
      });
    }
  },
  computed: {
    disabled: function disabled() {
      return this.$attrs.disabled || this.$attrs.disabled === '';
    },
    hasIcon: function hasIcon() {
      return this.icon || this.$slots.icon;
    }
  }
};

var _hoisted_1 = ["disabled", "data-pc-variant"];
function render(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_WecgIcon = resolveComponent("WecgIcon");
  return openBlock(), createElementBlock("span", mergeProps({
    "class": _ctx.cx('root'),
    disabled: $options.disabled
  }, $options.getPTOptions('root'), {
    "data-pc-variant": _ctx.variant
  }), [_ctx.icon ? renderSlot(_ctx.$slots, "icon", {
    key: 0,
    "class": normalizeClass([_ctx.cx('icon')])
  }, function () {
    return [createVNode(_component_WecgIcon, mergeProps({
      icon: _ctx.icon,
      "class": _ctx.cx('iconClass')
    }, _ctx.ptm('icon'), {
      label: _ctx.icon,
      size: _ctx.size,
      variant: _ctx.variant,
      disabled: $options.disabled
    }), null, 16, ["icon", "class", "label", "size", "variant", "disabled"])];
  }) : createCommentVNode("", true), createElementVNode("span", mergeProps({
    "class": _ctx.cx('label')
  }, _ctx.ptm('label')), toDisplayString(_ctx.label || ' '), 17)], 16, _hoisted_1);
}

script.render = render;

export { script as default };
