import{TinyColor as e}from"../../node_modules/.pnpm/@ctrl_tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/index.mjs";import{clearFix as t,resetComponent as n,resetIcon as r}from"../../style/index.mjs";import i from"../../theme/util/genComponentStyleHook.mjs";import{merge as a}from"../../theme/util/statistic.mjs";import o from"../../style/motion/collapse.mjs";import{initSlideMotion as s}from"../../style/motion/slide.mjs";import{initZoomMotion as c}from"../../style/motion/zoom.mjs";import l from"./horizontal.mjs";import u from"./rtl.mjs";import d from"./theme.mjs";import f from"./vertical.mjs";var p=e=>{let{componentCls:t,fontSize:n,motionDurationSlow:i,motionDurationMid:a,motionEaseInOut:o,motionEaseOut:s,iconCls:c,controlHeightSM:l}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:`relative`,display:`block`,margin:0,whiteSpace:`nowrap`,cursor:`pointer`,transition:[`border-color ${i}`,`background ${i}`,`padding ${i} ${o}`].join(`,`),[`${t}-item-icon, ${c}`]:{minWidth:n,fontSize:n,transition:[`font-size ${a} ${s}`,`margin ${i} ${o}`,`color ${i}`].join(`,`),"+ span":{marginInlineStart:l-n,opacity:1,transition:[`opacity ${i} ${o}`,`margin ${i}`,`color ${i}`].join(`,`)}},[`${t}-item-icon`]:{...r()},[`&${t}-item-only-child`]:{[`> ${c}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:`none !important`,cursor:`not-allowed`,"&::after":{borderColor:`transparent !important`},a:{color:`inherit !important`},[`> ${t}-submenu-title`]:{color:`inherit !important`,cursor:`not-allowed`}}}},m=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:r,borderRadius:i,menuArrowSize:a,menuArrowOffset:o}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:`absolute`,top:`50%`,insetInlineEnd:e.margin,width:a,color:`currentcolor`,transform:`translateY(-50%)`,transition:`transform ${n} ${r}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:`absolute`,width:a*.6,height:a*.15,backgroundColor:`currentcolor`,borderRadius:i,transition:[`background ${n} ${r}`,`transform ${n} ${r}`,`top ${n} ${r}`,`color ${n} ${r}`].join(`,`),content:`""`},"&::before":{transform:`rotate(45deg) translateY(-${o})`},"&::after":{transform:`rotate(-45deg) translateY(${o})`}}}}},h=e=>{let{antCls:r,componentCls:i,fontSize:a,motionDurationSlow:o,motionDurationMid:s,motionEaseInOut:c,lineHeight:l,paddingXS:u,padding:d,colorSplit:f,lineWidth:h,zIndexPopup:g,borderRadiusLG:_,radiusSubMenuItem:v,menuArrowSize:y,menuArrowOffset:b,lineType:x,menuPanelMaskInset:S}=e;return[{"":{[`${i}`]:{...t(),"&-hidden":{display:`none`}}},[`${i}-submenu-hidden`]:{display:`none`}},{[i]:{...n(e),...t(),marginBottom:0,paddingInlineStart:0,fontSize:a,lineHeight:0,listStyle:`none`,outline:`none`,transition:`width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:`none`},"&-overflow":{display:`flex`,[`${i}-item`]:{flex:`none`}},[`${i}-item, ${i}-submenu, ${i}-submenu-title`]:{borderRadius:e.radiusItem},[`${i}-item-group-title`]:{padding:`${u}px ${d}px`,fontSize:a,lineHeight:l,transition:`all ${o}`},[`&-horizontal ${i}-submenu`]:{transition:[`border-color ${o} ${c}`,`background ${o} ${c}`].join(`,`)},[`${i}-submenu, ${i}-submenu-inline`]:{transition:[`border-color ${o} ${c}`,`background ${o} ${c}`,`padding ${s} ${c}`].join(`,`)},[`${i}-submenu ${i}-sub`]:{cursor:`initial`,transition:[`background ${o} ${c}`,`padding ${o} ${c}`].join(`,`)},[`${i}-title-content`]:{transition:`color ${o}`},[`${i}-item a`]:{"&::before":{position:`absolute`,inset:0,backgroundColor:`transparent`,content:`""`}},[`${i}-item-divider`]:{overflow:`hidden`,lineHeight:0,borderColor:f,borderStyle:x,borderWidth:0,borderTopWidth:h,marginBlock:h,padding:0,"&-dashed":{borderStyle:`dashed`}},...p(e),[`${i}-item-group`]:{[`${i}-item-group-list`]:{margin:0,padding:0,[`${i}-item, ${i}-submenu-title`]:{paddingInline:`${a*2}px ${d}px`}}},"&-submenu":{"&-popup":{position:`absolute`,zIndex:g,background:`transparent`,borderRadius:_,boxShadow:`none`,transformOrigin:`0 0`,"&::before":{position:`absolute`,inset:`${S}px 0 0`,zIndex:-1,width:`100%`,height:`100%`,opacity:0,content:`""`}},"&-placement-rightTop::before":{top:0,insetInlineStart:S},[`> ${i}`]:{borderRadius:_,...p(e),...m(e),[`${i}-item, ${i}-submenu > ${i}-submenu-title`]:{borderRadius:v},[`${i}-submenu-title::after`]:{transition:`transform ${o} ${c}`}}},...m(e),[`&-inline-collapsed ${i}-submenu-arrow,
        &-inline ${i}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${b})`},"&::after":{transform:`rotate(45deg) translateX(-${b})`}},[`${i}-submenu-open${i}-submenu-inline > ${i}-submenu-title > ${i}-submenu-arrow`]:{transform:`translateY(-${y*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${b})`},"&::before":{transform:`rotate(45deg) translateX(${b})`}}}},{[`${r}-layout-header`]:{[i]:{lineHeight:`inherit`}}}]},g=(t,n)=>i(`Menu`,(t,{overrideComponentToken:r})=>{if(n?.value===!1)return[];let{colorBgElevated:i,colorPrimary:p,colorBgSub:m,colorError:g,colorErrorHover:_,colorTextLightSolid:v}=t,{controlHeightLG:y,fontSize:b}=t,x=b/7*5,S=a(t,{menuItemHeight:y,menuItemPaddingInline:t.margin,menuArrowSize:x,menuHorizontalHeight:y*1.15,menuArrowOffset:`${x*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:i}),C=new e(v).setAlpha(.65).toRgbString(),w=a(S,{colorItemText:C,colorItemTextHover:v,colorGroupTitle:C,colorItemTextSelected:v,colorItemBg:`#001529`,colorSubItemBg:`#000c17`,colorItemBgActive:`transparent`,colorItemBgSelected:m,colorActiveBarWidth:0,colorActiveBarHeight:0,colorActiveBarBorderSize:0,colorItemTextDisabled:new e(v).setAlpha(.25).toRgbString(),colorDangerItemText:g,colorDangerItemTextHover:_,colorDangerItemTextSelected:v,colorDangerItemBgActive:g,colorDangerItemBgSelected:g,menuSubMenuBg:`#001529`,colorItemTextSelectedHorizontal:v,colorItemBgSelectedHorizontal:m},{...r});return[h(S),l(S),f(S),d(S,`light`),d(w,`dark`),u(S),o(S),s(S,`slide-up`),s(S,`slide-down`),c(S,`zoom-big`)]},e=>{let{colorPrimary:t,colorError:n,colorTextDisabled:r,colorErrorBg:i,colorText:a,colorTextDescription:o,colorBgContainer:s,colorFillAlter:c,colorFillContent:l,lineWidth:u,lineWidthBold:d,controlItemBgActive:f,colorBgTextHover:p}=e;return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,colorItemText:a,colorItemTextHover:a,colorItemTextHoverHorizontal:t,colorGroupTitle:o,colorItemTextSelected:t,colorItemTextSelectedHorizontal:t,colorItemBg:s,colorItemBgHover:p,colorItemBgActive:l,colorSubItemBg:c,colorItemBgSelected:f,colorItemBgSelectedHorizontal:`transparent`,colorActiveBarWidth:0,colorActiveBarHeight:d,colorActiveBarBorderSize:u,colorItemTextDisabled:r,colorDangerItemText:n,colorDangerItemTextHover:n,colorDangerItemTextSelected:n,colorDangerItemBgActive:i,colorDangerItemBgSelected:i,itemMarginInline:e.marginXXS}})(t);export{g as default};