import{roundedArrow as e}from"../../style/roundedArrow.mjs";import{genFocusStyle as t,resetComponent as n}from"../../style/index.mjs";import r from"../../theme/util/genComponentStyleHook.mjs";import{merge as i}from"../../theme/util/statistic.mjs";import{initMoveMotion as a}from"../../style/motion/move.mjs";import{initSlideMotion as o,slideDownIn as s,slideDownOut as c,slideUpIn as l,slideUpOut as u}from"../../style/motion/slide.mjs";import{initZoomMotion as d}from"../../style/motion/zoom.mjs";import{getArrowOffset as f}from"../../style/placementArrow.mjs";import p from"./button.mjs";import m from"./status.mjs";var h=r=>{let{componentCls:i,menuCls:f,zIndexPopup:p,dropdownArrowDistance:m,dropdownArrowOffset:h,sizePopupArrow:g,antCls:_,iconCls:v,motionDurationMid:y,dropdownPaddingVertical:b,fontSize:x,dropdownEdgeChildPadding:S,colorTextDisabled:C,fontSizeIcon:w,controlPaddingHorizontal:T,colorBgElevated:E,boxShadowPopoverArrow:D}=r;return[{[i]:{...n(r),position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:p,display:`block`,"&::before":{position:`absolute`,insetBlock:-m+g/2,zIndex:-9999,opacity:1e-4,content:`""`},[`${i}-wrap`]:{position:`relative`,[`${_}-btn > ${v}-down`]:{fontSize:w},[`${v}-down::before`]:{transition:`transform ${y}`}},[`${i}-wrap-open`]:{[`${v}-down::before`]:{transform:`rotate(180deg)`}},"\n        &-hidden,\n        &-menu-hidden,\n        &-menu-submenu-hidden\n      ":{display:`none`},[`
        &-show-arrow${i}-placement-topLeft,
        &-show-arrow${i}-placement-top,
        &-show-arrow${i}-placement-topRight
      `]:{paddingBottom:m},[`
        &-show-arrow${i}-placement-bottomLeft,
        &-show-arrow${i}-placement-bottom,
        &-show-arrow${i}-placement-bottomRight
      `]:{paddingTop:m},[`${i}-arrow`]:{position:`absolute`,zIndex:1,display:`block`,...e(g,r.borderRadiusXS,r.borderRadiusOuter,E,D)},[`
        &-placement-top > ${i}-arrow,
        &-placement-topLeft > ${i}-arrow,
        &-placement-topRight > ${i}-arrow
      `]:{bottom:m,transform:`translateY(100%) rotate(180deg)`},[`&-placement-top > ${i}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateX(-50%) translateY(100%) rotate(180deg)`},[`&-placement-topLeft > ${i}-arrow`]:{left:{_skip_check_:!0,value:h}},[`&-placement-topRight > ${i}-arrow`]:{right:{_skip_check_:!0,value:h}},[`
          &-placement-bottom > ${i}-arrow,
          &-placement-bottomLeft > ${i}-arrow,
          &-placement-bottomRight > ${i}-arrow
        `]:{top:m,transform:`translateY(-100%)`},[`&-placement-bottom > ${i}-arrow`]:{left:{_skip_check_:!0,value:`50%`},transform:`translateY(-100%) translateX(-50%)`},[`&-placement-bottomLeft > ${i}-arrow`]:{left:{_skip_check_:!0,value:h}},[`&-placement-bottomRight > ${i}-arrow`]:{right:{_skip_check_:!0,value:h}},[`&${_}-slide-down-enter${_}-slide-down-enter-active${i}-placement-bottomLeft,
          &${_}-slide-down-appear${_}-slide-down-appear-active${i}-placement-bottomLeft,
          &${_}-slide-down-enter${_}-slide-down-enter-active${i}-placement-bottom,
          &${_}-slide-down-appear${_}-slide-down-appear-active${i}-placement-bottom,
          &${_}-slide-down-enter${_}-slide-down-enter-active${i}-placement-bottomRight,
          &${_}-slide-down-appear${_}-slide-down-appear-active${i}-placement-bottomRight`]:{animationName:l},[`&${_}-slide-up-enter${_}-slide-up-enter-active${i}-placement-topLeft,
          &${_}-slide-up-appear${_}-slide-up-appear-active${i}-placement-topLeft,
          &${_}-slide-up-enter${_}-slide-up-enter-active${i}-placement-top,
          &${_}-slide-up-appear${_}-slide-up-appear-active${i}-placement-top,
          &${_}-slide-up-enter${_}-slide-up-enter-active${i}-placement-topRight,
          &${_}-slide-up-appear${_}-slide-up-appear-active${i}-placement-topRight`]:{animationName:s},[`&${_}-slide-down-leave${_}-slide-down-leave-active${i}-placement-bottomLeft,
          &${_}-slide-down-leave${_}-slide-down-leave-active${i}-placement-bottom,
          &${_}-slide-down-leave${_}-slide-down-leave-active${i}-placement-bottomRight`]:{animationName:u},[`&${_}-slide-up-leave${_}-slide-up-leave-active${i}-placement-topLeft,
          &${_}-slide-up-leave${_}-slide-up-leave-active${i}-placement-top,
          &${_}-slide-up-leave${_}-slide-up-leave-active${i}-placement-topRight`]:{animationName:c}}},{[`${i} ${f}`]:{position:`relative`,margin:0},[`${f}-submenu-popup`]:{position:`absolute`,zIndex:p,background:`transparent`,boxShadow:`none`,transformOrigin:`0 0`,"ul,li":{listStyle:`none`},ul:{marginInline:`0.3em`}},[`${i}, ${i}-menu-submenu`]:{[f]:{padding:S,listStyleType:`none`,backgroundColor:E,backgroundClip:`padding-box`,borderRadius:r.borderRadiusLG,outline:`none`,boxShadow:r.boxShadowSecondary,...t(r),[`${f}-item-group-title`]:{padding:`${b}px ${T}px`,color:r.colorTextDescription,transition:`all ${y}`},[`${f}-item`]:{position:`relative`,display:`flex`,alignItems:`center`,borderRadius:r.borderRadiusSM},[`${f}-item-icon`]:{minWidth:x,marginInlineEnd:r.marginXS,fontSize:r.fontSizeSM},[`${f}-title-content`]:{flex:`auto`,"> a":{color:`inherit`,transition:`all ${y}`,"&:hover":{color:`inherit`},"&::after":{position:`absolute`,inset:0,content:`""`}}},[`${f}-item, ${f}-submenu-title`]:{clear:`both`,margin:0,padding:`${b}px ${T}px`,color:r.colorText,fontWeight:`normal`,fontSize:x,lineHeight:r.lineHeight,cursor:`pointer`,transition:`all ${y}`,"&:hover, &-active":{backgroundColor:r.controlItemBgHover},...t(r),"&-selected":{color:r.colorPrimary,backgroundColor:r.controlItemBgActive,"&:hover, &-active":{backgroundColor:r.controlItemBgActiveHover}},"&-disabled":{color:C,cursor:`not-allowed`,"&:hover":{color:C,backgroundColor:E,cursor:`not-allowed`},a:{pointerEvents:`none`}},"&-divider":{height:1,margin:`${r.marginXXS}px 0`,overflow:`hidden`,lineHeight:0,backgroundColor:r.colorSplit},[`${i}-menu-submenu-expand-icon`]:{position:`absolute`,insetInlineEnd:r.paddingXS,[`${i}-menu-submenu-arrow-icon`]:{marginInlineEnd:`0 !important`,color:r.colorTextDescription,fontSize:w,fontStyle:`normal`}}},[`${f}-item-group-list`]:{margin:`0 ${r.marginXS}px`,padding:0,listStyle:`none`},[`${f}-submenu-title`]:{paddingInlineEnd:T+r.fontSizeSM},[`${f}-submenu-vertical`]:{position:`relative`},[`${f}-submenu${f}-submenu-disabled ${i}-menu-submenu-title`]:{[`&, ${i}-menu-submenu-arrow-icon`]:{color:C,backgroundColor:E,cursor:`not-allowed`}},[`${f}-submenu-selected ${i}-menu-submenu-title`]:{color:r.colorPrimary}}}},[o(r,`slide-up`),o(r,`slide-down`),a(r,`move-up`),a(r,`move-down`),d(r,`zoom-big`)]]},g=r(`Dropdown`,(e,{rootPrefixCls:t})=>{let{marginXXS:n,sizePopupArrow:r,controlHeight:a,fontSize:o,lineHeight:s,paddingXXS:c,componentCls:l,borderRadiusOuter:u,borderRadiusLG:d}=e,g=(a-o*s)/2,{dropdownArrowOffset:_}=f({sizePopupArrow:r,contentRadius:d,borderRadiusOuter:u}),v=i(e,{menuCls:`${l}-menu`,rootPrefixCls:t,dropdownArrowDistance:r/2+n,dropdownArrowOffset:_,dropdownPaddingVertical:g,dropdownEdgeChildPadding:c});return[h(v),p(v),m(v)]},e=>({zIndexPopup:e.zIndexPopupBase+50}));export{g as default};