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