"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const $=require("./roundedArrow.js");function d(r,a=""){return r.map(t=>`${a}${t}`).join(",")}const f=8;function _(r){const a=f,{sizePopupArrow:t,contentRadius:o,borderRadiusOuter:u,limitVerticalRadius:w}=r,n=t/2-Math.ceil(u*(Math.sqrt(2)-1)),l=(o>12?o+2:12)-n,p=w?a-n:l;return{dropdownArrowOffset:l,dropdownArrowOffsetVertical:p}}function k(r,a){const{componentCls:t,sizePopupArrow:o,marginXXS:u,borderRadiusXS:w,borderRadiusOuter:n,boxShadowPopoverArrow:l}=r,{colorBg:p,showArrowCls:c,contentRadius:h=r.borderRadiusLG,limitVerticalRadius:g}=a,{dropdownArrowOffsetVertical:i,dropdownArrowOffset:m}=_({sizePopupArrow:o,contentRadius:h,borderRadiusOuter:n,limitVerticalRadius:g}),s=o/2+u;return{[t]:{[`${t}-arrow`]:[{position:"absolute",zIndex:1,display:"block",...$.roundedArrow(o,w,n,p,l),"&:before":{background:p}}],[[`&-placement-top ${t}-arrow`,`&-placement-topLeft ${t}-arrow`,`&-placement-topRight ${t}-arrow`].join(",")]:{bottom:0,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:m}},[`&-placement-topRight ${t}-arrow`]:{right:{_skip_check_:!0,value:m}},[[`&-placement-bottom ${t}-arrow`,`&-placement-bottomLeft ${t}-arrow`,`&-placement-bottomRight ${t}-arrow`].join(",")]:{top:0,transform:"translateY(-100%)"},[`&-placement-bottom ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:m}},[`&-placement-bottomRight ${t}-arrow`]:{right:{_skip_check_:!0,value:m}},[[`&-placement-left ${t}-arrow`,`&-placement-leftTop ${t}-arrow`,`&-placement-leftBottom ${t}-arrow`].join(",")]:{right:{_skip_check_:!0,value:0},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${t}-arrow`]:{top:i},[`&-placement-leftBottom ${t}-arrow`]:{bottom:i},[[`&-placement-right ${t}-arrow`,`&-placement-rightTop ${t}-arrow`,`&-placement-rightBottom ${t}-arrow`].join(",")]:{left:{_skip_check_:!0,value:0},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${t}-arrow`]:{top:i},[`&-placement-rightBottom ${t}-arrow`]:{bottom:i},[d(["&-placement-topLeft","&-placement-top","&-placement-topRight"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingBottom:s},[d(["&-placement-bottomLeft","&-placement-bottom","&-placement-bottomRight"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingTop:s},[d(["&-placement-leftTop","&-placement-left","&-placement-leftBottom"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingRight:{_skip_check_:!0,value:s}},[d(["&-placement-rightTop","&-placement-right","&-placement-rightBottom"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingLeft:{_skip_check_:!0,value:s}}}}}exports.MAX_VERTICAL_CONTENT_RADIUS=f;exports.default=k;exports.getArrowOffset=_;
