import "../styles/reset.css";
import "./menu.less";
import { withInstallProps as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__ } from "../shared";
import { Transition as __WEBPACK_EXTERNAL_MODULE_vue_Transition__, computed as __WEBPACK_EXTERNAL_MODULE_vue_computed__, 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__, onBeforeUnmount as __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__, provide as __WEBPACK_EXTERNAL_MODULE_vue_provide__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__, vShow as __WEBPACK_EXTERNAL_MODULE_vue_vShow__, watch as __WEBPACK_EXTERNAL_MODULE_vue_watch__, watchEffect as __WEBPACK_EXTERNAL_MODULE_vue_watchEffect__, withDirectives as __WEBPACK_EXTERNAL_MODULE_vue_withDirectives__ } from "vue";
import { usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
import { AngleDown as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53_AngleDown__, TreeApplicationShape as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53_TreeApplicationShape__ } 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;
}

;// ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  return n;
}

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

function _arrayWithoutHoles(r) {
  if (Array.isArray(r)) return _arrayLikeToArray(r);
}

;// ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}

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

function _unsupportedIterableToArray(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray(r, a);
    var t = {}.toString.call(r).slice(8, -1);
    return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  }
}

;// ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

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




function _toConsumableArray(r) {
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}

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

;// ../../packages/menu/src/utils.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 MENU_PROVIDER_KEY = Symbol('MENU_PROVIDER_KEY');
var MENU_PROVIDER_KEY_PATH = Symbol('MENU_PROVIDER_KEY_PATH');
var useMenuProvider = function useMenuProvider(data) {
  __WEBPACK_EXTERNAL_MODULE_vue_provide__(MENU_PROVIDER_KEY, data);
};
var useMenuPathProvider = function useMenuPathProvider(key) {
  var _useMenuPathInject = useMenuPathInject(),
    parentKeys = _useMenuPathInject.parentKeys,
    parentInfo = _useMenuPathInject.parentInfo;
  var keys = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    return [].concat(_toConsumableArray(parentKeys.value), [key]);
  });
  __WEBPACK_EXTERNAL_MODULE_vue_provide__(MENU_PROVIDER_KEY_PATH, {
    parentInfo: {
      key: key,
      parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
    },
    parentKeys: keys
  });
};
var useMenuInject = function useMenuInject() {
  return __WEBPACK_EXTERNAL_MODULE_vue_inject__(MENU_PROVIDER_KEY);
};
var useMenuPathInject = function useMenuPathInject() {
  var _instance$vnode$appCo;
  var instance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__();
  var provides = !instance.parent ? (_instance$vnode$appCo = instance.vnode.appContext) === null || _instance$vnode$appCo === void 0 ? void 0 : _instance$vnode$appCo.provides : instance.parent.provides;
  if (provides && MENU_PROVIDER_KEY_PATH in provides) {
    return __WEBPACK_EXTERNAL_MODULE_vue_inject__(MENU_PROVIDER_KEY_PATH);
  }
  return {
    parentInfo: undefined,
    parentKeys: __WEBPACK_EXTERNAL_MODULE_vue_ref__([])
  };
};
var trimArr = function trimArr(s) {
  return (s || '').split(' ').filter(function (item) {
    return !!item.trim();
  });
};
function removeClass(el, cls) {
  if (!el || !cls) return;
  var classes = trimArr(cls);
  var curClass = el.getAttribute('class') || '';
  if (el.classList) {
    var _el$classList;
    (_el$classList = el.classList).remove.apply(_el$classList, _toConsumableArray(classes));
    return;
  }
  classes.forEach(function (item) {
    curClass = curClass.replace(" ".concat(item, " "), ' ');
  });
  var className = trimArr(curClass).join(' ');
  el.setAttribute('class', className);
}
/* istanbul ignore next */
function addClass(el, cls) {
  if (!el) return;
  var className = el.getAttribute('class') || '';
  var curClass = trimArr(className);
  var classes = (cls || '').split(' ').filter(function (item) {
    return !curClass.includes(item) && !!item.trim();
  });
  if (el.classList) {
    var _el$classList2;
    (_el$classList2 = el.classList).add.apply(_el$classList2, _toConsumableArray(classes));
  } else {
    className += " ".concat(classes.join(' '));
    el.setAttribute('class', className);
  }
}
var collapseMotion = function collapseMotion() {
  return {
    css: true,
    onBeforeEnter: function onBeforeEnter(el) {
      addClass(el, 'collapse-transition');
      if (!el.dataset) el.dataset = {};
      el.style.height = '0px';
      el.style.maxHeight = '0px';
    },
    onEnter: function onEnter(el) {
      el.dataset.oldOverflow = el.style.overflow;
      if (el.scrollHeight !== 0) {
        el.style.height = "".concat(el.scrollHeight, "px");
        el.style.maxHeight = "".concat(el.scrollHeight, "px");
      } else {
        el.style.height = '0px';
        el.style.maxHeight = '0px';
      }
      el.style.overflow = 'hidden';
    },
    onAfterEnter: function onAfterEnter(el) {
      el.style.height = '';
      el.style.maxHeight = '';
      el.style.overflow = el.dataset.oldOverflow;
      removeClass(el, 'collapse-transition');
    },
    onBeforeLeave: function onBeforeLeave(el) {
      if (!el.dataset) el.dataset = {};
      el.dataset.oldOverflow = el.style.overflow;
      el.style.height = "".concat(el.scrollHeight, "px");
      el.style.maxHeight = "".concat(el.scrollHeight, "px");
      el.style.overflow = 'hidden';
    },
    onLeave: function onLeave(el) {
      if (el.scrollHeight !== 0) {
        addClass(el, 'collapse-transition');
        el.style.transitionProperty = 'height';
        el.style.height = '0px';
        el.style.maxHeight = '0px';
      }
    },
    onAfterLeave: function onAfterLeave(el) {
      removeClass(el, 'collapse-transition');
      el.style.height = '';
      el.style.maxHeight = '';
      el.style.overflow = el.dataset.oldOverflow;
    }
  };
};
;// ../../packages/menu/src/menu.tsx



function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/*
 * 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 menuProps = {
  activeKey: String,
  collapse: Boolean,
  openedKeys: {
    type: Array
  },
  mode: {
    type: String,
    "default": 'vertical'
  },
  uniqueOpen: {
    type: Boolean,
    "default": true
  }
};
/* harmony default export */ const menu = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Menu',
  props: menuProps,
  emits: ['update:activeKey', 'update:openKeys', 'click', 'openChange'],
  setup: function setup(props, _ref) {
    var slots = _ref.slots,
      emit = _ref.emit,
      expose = _ref.expose;
    var activeKey = __WEBPACK_EXTERNAL_MODULE_vue_ref__('');
    var openedKeys = __WEBPACK_EXTERNAL_MODULE_vue_ref__([]);
    var menuStore = __WEBPACK_EXTERNAL_MODULE_vue_ref__({});
    var mode = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return props.mode;
    });
    var collapse = __WEBPACK_EXTERNAL_MODULE_vue_ref__(props.collapse);
    var oldOpenKeys = __WEBPACK_EXTERNAL_MODULE_vue_ref__([]);
    __WEBPACK_EXTERNAL_MODULE_vue_watchEffect__(function () {
      if (props.activeKey !== undefined) {
        activeKey.value = props.activeKey;
      }
    });
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
      return props.collapse;
    }, function () {
      collapse.value = props.collapse;
      var oldKeys = _toConsumableArray(oldOpenKeys.value);
      var openKeys = _toConsumableArray(openedKeys.value);
      openedKeys.value = collapse.value ? [] : oldKeys;
      oldOpenKeys.value = collapse.value ? openKeys : [];
    }, {
      immediate: true
    });
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
      return props.openedKeys;
    }, function () {
      var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : openedKeys.value;
      openedKeys.value = keys;
    }, {
      immediate: true
    });
    var registerMenuInfo = function registerMenuInfo(key, info) {
      menuStore.value = _objectSpread(_objectSpread({}, menuStore.value), {}, _defineProperty({}, key, info));
    };
    var unregisterMenuInfo = function unregisterMenuInfo(key) {
      delete menuStore.value[key];
      menuStore.value = _objectSpread({}, menuStore.value);
    };
    var handleOpenChange = function handleOpenChange(key, opened) {
      if (opened) {
        if (props.uniqueOpen) {
          openedKeys.value = [key];
        } else openedKeys.value.push(key);
      } else {
        openedKeys.value = openedKeys.value.filter(function (v) {
          return v !== key;
        });
      }
      emit('openChange', opened, menuStore.value[key]);
      emit('update:openKeys', _toConsumableArray(openedKeys.value));
    };
    var handleActiveChange = function handleActiveChange(key) {
      activeKey.value = key;
      emit('click', menuStore.value[key]);
      emit('update:activeKey', key, menuStore.value[key]);
    };
    useMenuProvider({
      activeKey: activeKey,
      menuStore: menuStore,
      registerMenuInfo: registerMenuInfo,
      unregisterMenuInfo: unregisterMenuInfo,
      mode: mode.value,
      openedKeys: openedKeys,
      collapse: collapse,
      handleOpenChange: handleOpenChange,
      handleActiveChange: handleActiveChange
    });
    expose({
      activeKey: activeKey,
      openedKeys: openedKeys,
      menuStore: menuStore
    });
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    return function () {
      var _slots$default;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('menu')), true), 'is-collapse', collapse.value)
      }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]);
    };
  }
}));
;// ../../packages/menu/src/menu-group.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.
 */



/* harmony default export */ const menu_group = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'MenuGroup',
  props: {
    name: {
      type: String,
      "default": ''
    },
    foldName: {
      type: String,
      "default": undefined
    }
  },
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    var _useMenuInject = useMenuInject(),
      collapse = _useMenuInject.collapse;
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var renderGroupName = function renderGroupName() {
      if (slots.name) {
        return slots.name();
      }
      if (collapse.value) {
        // 收起
        return props.foldName !== undefined ? props.foldName : props.name;
      }
      return props.name;
    };
    return function () {
      var _slots$default;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "".concat(resolveClassName('menu-group'))
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "group-name"
      }, [renderGroupName()]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("ul", {
        "class": "group-wrap"
      }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)])]);
    };
  }
}));
;// ../../packages/menu/src/menu-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.
 */



/* harmony default export */ const menu_item = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'MenuItem',
  props: {
    needIcon: {
      type: Boolean,
      "default": true
    },
    disabled: {
      type: Boolean,
      "default": false
    }
  },
  emits: ['click'],
  // slots: ['icon'],
  slots: Object,
  setup: function setup(props, _ref) {
    var _instance$vnode$key, _instance$vnode$key$t;
    var slots = _ref.slots,
      emit = _ref.emit;
    var _useMenuInject = useMenuInject(),
      registerMenuInfo = _useMenuInject.registerMenuInfo,
      unregisterMenuInfo = _useMenuInject.unregisterMenuInfo,
      activeKey = _useMenuInject.activeKey,
      handleActiveChange = _useMenuInject.handleActiveChange;
    var instance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__();
    var _useMenuPathInject = useMenuPathInject(),
      parentInfo = _useMenuPathInject.parentInfo;
    var key = ((_instance$vnode$key = instance.vnode.key) === null || _instance$vnode$key === void 0 || (_instance$vnode$key$t = _instance$vnode$key.toString) === null || _instance$vnode$key$t === void 0 ? void 0 : _instance$vnode$key$t.call(_instance$vnode$key)) || String(instance.uid);
    var isActive = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return activeKey.value === key;
    });
    var needIcon = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return props.needIcon;
    });
    registerMenuInfo(key, {
      key: key,
      parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
    });
    var handleClick = function handleClick(e) {
      if (props.disabled) {
        return;
      }
      handleActiveChange(key);
      emit('click', e);
    };
    __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__(function () {
      return unregisterMenuInfo(key);
    });
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    return function () {
      var _slots$icon, _slots$default;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("li", {
        "class": _defineProperty(_defineProperty(_defineProperty({}, "".concat(resolveClassName('menu-item')), true), 'is-active', isActive.value), 'is-disabled', props.disabled),
        "onClick": handleClick
      }, [needIcon.value && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "item-icon"
      }, [(slots === null || slots === void 0 || (_slots$icon = slots.icon) === null || _slots$icon === void 0 ? void 0 : _slots$icon.call(slots)) || __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("i", {
        "class": "default-icon"
      }, null)]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "item-content"
      }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)])]);
    };
  }
}));
;// external "../icon/"

;// ../../packages/menu/src/submenu.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 subMenuProps = {
  title: {
    type: String,
    "default": 'title'
  }
};
/* harmony default export */ const submenu = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Submenu',
  props: subMenuProps,
  emits: ['collapse'],
  // slots: ['icon'],
  slots: Object,
  setup: function setup(props, _ref) {
    var _instance$vnode$key, _instance$vnode$key$t;
    var slots = _ref.slots,
      emit = _ref.emit;
    var _useMenuInject = useMenuInject(),
      registerMenuInfo = _useMenuInject.registerMenuInfo,
      unregisterMenuInfo = _useMenuInject.unregisterMenuInfo,
      openedKeys = _useMenuInject.openedKeys,
      handleOpenChange = _useMenuInject.handleOpenChange,
      collapse = _useMenuInject.collapse,
      activeKey = _useMenuInject.activeKey,
      menuStore = _useMenuInject.menuStore;
    var _useMenuPathInject = useMenuPathInject(),
      parentInfo = _useMenuPathInject.parentInfo;
    var instance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__();
    var key = ((_instance$vnode$key = instance.vnode.key) === null || _instance$vnode$key === void 0 || (_instance$vnode$key$t = _instance$vnode$key.toString) === null || _instance$vnode$key$t === void 0 ? void 0 : _instance$vnode$key$t.call(_instance$vnode$key)) || String(instance.uid);
    var transition = __WEBPACK_EXTERNAL_MODULE_vue_ref__(collapseMotion());
    var isShow = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return openedKeys.value.includes(key);
    });
    var specialCollapse = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      var _menuStore$value;
      var activeParentKey = (_menuStore$value = menuStore.value) === null || _menuStore$value === void 0 || (_menuStore$value = _menuStore$value[activeKey.value]) === null || _menuStore$value === void 0 ? void 0 : _menuStore$value.parentKey;
      return collapse.value && activeParentKey === key && isShow;
    });
    useMenuPathProvider(key);
    registerMenuInfo(key, {
      key: key,
      parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
    });
    __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__(function () {
      return unregisterMenuInfo(key);
    });
    var handleCollapse = function handleCollapse() {
      handleOpenChange(key, !isShow.value);
      emit('collapse', !isShow.value, instance);
    };
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    return function () {
      var _slots$icon, _slots$title, _slots$default;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("li", {
        "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('menu-submenu')), true), 'is-opened', isShow.value)
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": {
          'submenu-header': true,
          'is-collapse': specialCollapse.value
        },
        "onClick": handleCollapse
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "submenu-header-icon"
      }, [((_slots$icon = slots.icon) === null || _slots$icon === void 0 ? void 0 : _slots$icon.call(slots)) || __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53_TreeApplicationShape__, {
        "class": "menu-icon"
      }, null)]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "submenu-header-content"
      }, [((_slots$title = slots.title) === null || _slots$title === void 0 ? void 0 : _slots$title.call(slots)) || props.title]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53_AngleDown__, {
        "class": {
          'submenu-header-collapse': true,
          'is-collapse': openedKeys.value.includes(key)
        }
      }, null)]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_vue_Transition__, transition.value, {
        "default": function _default() {
          return [__WEBPACK_EXTERNAL_MODULE_vue_withDirectives__(__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("ul", {
            "class": "submenu-list"
          }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]), [[__WEBPACK_EXTERNAL_MODULE_vue_vShow__, isShow.value]])];
        }
      })]);
    };
  }
}));
;// ../../packages/menu/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 BkMenu = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__(menu, {
  Item: menu_item,
  Submenu: submenu,
  Group: menu_group
});
/* harmony default export */ const src = (BkMenu);

export { BkMenu, menu_group as BkMenuGroup, menu_item as BkMenuItem, submenu as BkSubmenu, src as default };
