import { defineComponent, useAttrs, resolveComponent, createBlock, openBlock, mergeProps, unref, createSlots, withCtx, renderSlot, createTextVNode, toDisplayString, renderList, createCommentVNode, normalizeProps, guardReactiveProps } from 'vue';
import '../../../utils/index.mjs';
import { tagProps } from './tag.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlTag", inheritAttrs: false },
  __name: "tag",
  props: tagProps,
  setup(__props) {
    const props = __props;
    const bem = createNamespace("tag");
    const attrs = useAttrs();
    return (_ctx, _cache) => {
      const _component_ll_icon = resolveComponent("ll-icon");
      const _component_a_tag = resolveComponent("a-tag");
      return openBlock(), createBlock(_component_a_tag, mergeProps(unref(attrs), {
        class: [unref(bem).b(), unref(bem).is(props.shape)]
      }), createSlots({
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default", {}, () => [
            createTextVNode(
              toDisplayString(props.label),
              1
              /* TEXT */
            )
          ])
        ]),
        _: 2
        /* DYNAMIC */
      }, [
        _ctx.$slots["icon"] || _ctx.icon.iconName ? {
          name: "icon",
          fn: withCtx(() => [
            _ctx.$slots["icon"] ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : _ctx.icon.iconName ? (openBlock(), createBlock(_component_ll_icon, mergeProps({ key: 1 }, _ctx.icon, {
              style: { order: _ctx.iconDirection === "left" ? 0 : 1 }
            }), null, 16, ["style"])) : createCommentVNode("v-if", true)
          ]),
          key: "0"
        } : void 0,
        renderList(Object.keys(_ctx.$slots).filter(
          (k) => k !== "default" && k !== "icon"
        ), (item) => {
          return {
            name: item,
            fn: withCtx((data) => [
              renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
            ])
          };
        })
      ]), 1040, ["class"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=tag.vue2.mjs.map
