import "../styles/reset.css";
import "./tag.less";
import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, TagThemeType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_TagThemeType__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
import { computed as __WEBPACK_EXTERNAL_MODULE_vue_computed__, createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__ } from "vue";
import { toType as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__ } from "vue-types";
import { usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
import { Error as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Error__ } from "../icon";

;// external "../shared"

;// external "vue"

;// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(o) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
    return typeof o;
  } : function (o) {
    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  }, _typeof(o);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js

function toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js


function toPropertyKey(t) {
  var i = toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}

;// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js

function _defineProperty(e, r, t) {
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}

;// external "vue-types"

;// external "../config-provider"

;// external "../icon"

;// ../../packages/tag/src/tag.tsx


/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */





var TagStrokeType;
(function (TagStrokeType) {
  TagStrokeType["FILLED"] = "filled";
  TagStrokeType["STROKE"] = "stroke";
  TagStrokeType["UNKNOWN"] = "";
})(TagStrokeType || (TagStrokeType = {}));
/* harmony default export */ const tag = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Tag',
  props: {
    theme: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_TagThemeType__().def(''),
    closable: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
    type: __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__('tagStorkeType', {}).def(TagStrokeType.UNKNOWN),
    checkable: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
    checked: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
    radius: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def('2px'),
    size: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.size(),
    stopPropagation: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(true)
  },
  emits: ['change', 'close'],
  slots: Object,
  setup: function setup(props, _ref) {
    var emit = _ref.emit;
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var wrapperStyle = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return {
        borderRadius: props.radius
      };
    });
    var handleClose = function handleClose(e) {
      e.preventDefault();
      if (props.stopPropagation) {
        e.stopPropagation();
      }
      emit('close', e);
    };
    var handleClick = function handleClick(e) {
      e.preventDefault();
      if (props.stopPropagation) {
        e.stopPropagation();
      }
      if (props.checkable) {
        emit('change', !props.checked);
      }
    };
    return {
      wrapperStyle: wrapperStyle,
      handleClose: handleClose,
      handleClick: handleClick,
      resolveClassName: resolveClassName
    };
  },
  render: function render() {
    var _this$$slots$default, _this$$slots;
    var classes = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, this.resolveClassName('tag'), true), this.resolveClassName('tag-closable'), this.closable), this.resolveClassName('tag-checkable'), this.checkable), this.resolveClassName('tag-check'), this.checked), this.resolveClassName("tag-".concat(this.type)), this.type), this.resolveClassName("tag-".concat(this.theme)), this.theme), this.resolveClassName("tag--".concat(this.size)), true);
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "style": this.wrapperStyle,
      "class": classes,
      "onClick": this.handleClick
    }, [this.$slots.icon ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
      "class": "".concat(this.resolveClassName('tag-icon'))
    }, [this.$slots.icon()]) : '', __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
      "class": "".concat(this.resolveClassName('tag-text'))
    }, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]), this.closable && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Error__, {
      "class": "".concat(this.resolveClassName('tag-close')),
      "onClick": this.handleClose
    }, null)]);
  }
}));
;// ../../packages/tag/src/index.tsx
/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */


var BkTag = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__(tag);
/* harmony default export */ const src = (BkTag);
export { src as default };
