import{__rest as e}from"../../../../_virtual/_tslib.js";import o,{forwardRef as t,useRef as i,useMemo as s}from"react";import l from"../../Tooltip/Tooltip.js";import n from"../../../hooks/useIsOverflowing/useIsOverflowing.js";import{withStaticProps as r}from"../../../types/withStaticProps.js";import"../../../utils/colors-vars-map.js";import a from"../../Label/Label.js";import c from"./MenuItem.module.scss.js";import p from"./components/BaseMenuItem/BaseMenuItem.js";import m from"./components/MenuItemIcon/MenuItemIcon.js";import{TooltipPositions as d}from"../../Tooltip/TooltipConstants.js";import u from"../../../../components/icon/dist/Icon/Icon.js";var f=t((function(t,r){var d=t.className,u=t.iconWrapperClassName,f=t.title,b=void 0===f?"":f,v=t.label,j=void 0===v?"":v,y=t.icon,I=void 0===y?"":y,g=t.iconType,C=t.iconBackgroundColor,h=t.disabled,k=void 0!==h&&h,w=t.disableReason,M=t.selected,N=void 0!==M&&M,T=t.key,E=t.children,P=t.tooltipContent,O=t.tooltipPosition,B=void 0===O?"right":O,S=t.tooltipShowDelay,D=void 0===S?300:S,x=t.tooltipProps,L=t["aria-label"],R=e(t,["className","iconWrapperClassName","title","label","icon","iconType","iconBackgroundColor","disabled","disableReason","selected","key","children","tooltipContent","tooltipPosition","tooltipShowDelay","tooltipProps","aria-label"]),W=i(),_=null!=L?L:b,V=n({ref:W})||k||P,q=s((function(){return k?w:P||b}),[w,k,b,P]),z=s((function(){if(j)return"string"==typeof j?o.createElement(a,{kind:"line",text:j}):o.isValidElement(j)&&j.type===a?j:void 0}),[j]);return o.createElement(l,Object.assign({content:V?q:null,position:B,showDelay:D},x),o.createElement(p,Object.assign({key:T,ref:r,subMenu:E,className:d,disabled:k,selected:N},R),!!I&&o.createElement(m,{icon:I,type:g,label:_,disabled:k,selected:N,backgroundColor:C,wrapperClassName:u}),o.createElement("div",{ref:W,className:c.title},b),z))}));Object.assign(f,{isSelectable:!0,isMenuChild:!0});var b=r(f,{iconType:u.type,tooltipPositions:d});export{b as default};
//# sourceMappingURL=MenuItem.js.map
