import "../styles/reset.css";
import "./breadcrumb.less";
import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, classes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__, withInstallProps as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__ } from "../shared";
import { createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, getCurrentInstance as __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__, inject as __WEBPACK_EXTERNAL_MODULE_vue_inject__, onMounted as __WEBPACK_EXTERNAL_MODULE_vue_onMounted__, provide as __WEBPACK_EXTERNAL_MODULE_vue_provide__ } from "vue";
import { usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
import { ArrowsLeft as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_ArrowsLeft__ } 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 "../config-provider"

;// external "../icon"

;// ../../packages/breadcrumb/src/breadcrumb.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 breadcrumbType = {
  extCls: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
  separator: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def('/'),
  separatorClass: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
  replace: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool,
  backRouter: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOfType([__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string, __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.object]).def('')
};
/* harmony default export */ const breadcrumb = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Breadcrumb',
  props: breadcrumbType,
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var _getCurrentInstance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__(),
      proxy = _getCurrentInstance.proxy,
      appContext = _getCurrentInstance.appContext;
    __WEBPACK_EXTERNAL_MODULE_vue_provide__('breadcrumb', props);
    __WEBPACK_EXTERNAL_MODULE_vue_onMounted__(function () {
      var items = proxy.$el.querySelectorAll(resolveClassName('breadcrumb-item'));
      if (items.length) {
        items[items.length - 1].setAttribute('aria-current', 'page');
      }
    });
    var classCtx = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__(_defineProperty({}, resolveClassName('breadcrumb'), true), "".concat(props.extCls || ''));
    var goBack = function goBack() {
      var backRouter = props.backRouter,
        replace = props.replace;
      var $router = appContext.config.globalProperties.$router;
      if (!$router) return;
      replace ? $router.replace(backRouter) : $router.push(backRouter);
    };
    return function () {
      var _slots$default;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": classCtx,
        "aria-label": "Breadcrumb",
        "role": "navigation"
      }, [!slots.prefix && props.backRouter ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": resolveClassName('breadcrumb-goback')
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_ArrowsLeft__, {
        "onClick": goBack
      }, null)]) : '', slots.prefix ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": resolveClassName('breadcrumb-goback')
      }, [slots.prefix()]) : '', (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]);
    };
  }
}));
;// ../../packages/breadcrumb/src/breadcrumb-item.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 breadcrumbItemType = {
  extCls: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
  to: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOfType([__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string, __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.object]).def(''),
  replace: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool
};
var EVENTS;
(function (EVENTS) {
  EVENTS["CLICK"] = "click";
})(EVENTS || (EVENTS = {}));
function CompositionEventFunction(evt) {
  return evt;
}
var breadcrumbItemEmitEventsType = _defineProperty({}, EVENTS.CLICK, CompositionEventFunction);
/* harmony default export */ const breadcrumb_item = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'BreadcrumbItem',
  props: breadcrumbItemType,
  emits: breadcrumbItemEmitEventsType,
  setup: function setup(props, _ref) {
    var emit = _ref.emit,
      slots = _ref.slots;
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var _getCurrentInstance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__(),
      appContext = _getCurrentInstance.appContext;
    var parent = __WEBPACK_EXTERNAL_MODULE_vue_inject__('breadcrumb');
    var router = appContext.config.globalProperties.$router;
    var handleClick = function handleClick(e) {
      emit(EVENTS.CLICK, e);
      var to = props.to,
        replace = props.replace;
      if (!to || !router) return;
      replace ? router.replace(to) : router.push(to);
    };
    var classCtx = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__(_defineProperty({}, resolveClassName('breadcrumb-item'), true), "".concat(props.extCls || ''));
    var renderSeparator = function renderSeparator() {
      if (slots.separator) {
        return slots.separator();
      }
      if (parent.separatorClass) {
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("i", {
          "class": "".concat(resolveClassName('breadcrumb-separator'), " ").concat(parent.separatorClass)
        }, null);
      }
      if (parent.separator) {
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
          "class": resolveClassName('breadcrumb-separator'),
          "role": "presentation"
        }, [parent === null || parent === void 0 ? void 0 : parent.separator]);
      }
      return null;
    };
    return function () {
      var _slots$default;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": classCtx
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "ref": "link",
        "class": "".concat(resolveClassName('breadcrumb-item-inner'), " ").concat(props.to ? 'is-link' : ''),
        "role": "link",
        "onClick": handleClick
      }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]), renderSeparator()]);
    };
  }
}));
;// ../../packages/breadcrumb/src/index.ts
/*
 * 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 BkBreadcrumb = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__(breadcrumb, {
  Item: breadcrumb_item
});

/* harmony default export */ const src = (BkBreadcrumb);
export { BkBreadcrumb, breadcrumb_item as BkBreadcrumbItem, src as default };
