import{textEllipsis as c,resetComponent as d}from"../../style/index.mjs";import"../../theme/internal.mjs";import p from"../../theme/util/genComponentStyleHook.mjs";import{merge as s}from"../../theme/util/statistic.mjs";const h=n=>{const{componentCls:o,holderOffsetBlock:t,motionDurationSlow:l,lineWidthBold:i,colorPrimary:r,lineType:e,colorSplit:a}=n;return{[`${o}-wrapper`]:{marginBlockStart:-t,paddingBlockStart:t,backgroundColor:"transparent",[o]:{...d(n),position:"relative",paddingInlineStart:i,[`${o}-link`]:{paddingBlock:n.anchorPaddingBlock,paddingInline:`${n.anchorPaddingInline}px 0`,"&-title":{...c,position:"relative",display:"block",marginBlockEnd:n.anchorTitleBlock,color:n.colorText,transition:`all ${n.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}},[`&-active > ${o}-link-title`]:{color:n.colorPrimary},[`${o}-link`]:{paddingBlock:n.anchorPaddingBlockSecondary}}},[`&:not(${o}-wrapper-horizontal)`]:{[o]:{"&::before":{position:"absolute",left:{_skip_check_:!0,value:0},top:0,height:"100%",borderInlineStart:`${i}px ${e} ${a}`,content:'" "'},[`${o}-ink`]:{position:"absolute",left:{_skip_check_:!0,value:0},display:"none",transform:"translateY(-50%)",transition:`top ${l} ease-in-out`,width:i,backgroundColor:r,[`&${o}-ink-visible`]:{display:"inline-block"}}}},[`${o}-fixed ${o}-ink ${o}-ink`]:{display:"none"}}}},k=n=>{const{componentCls:o,motionDurationSlow:t,lineWidthBold:l,colorPrimary:i}=n;return{[`${o}-wrapper-horizontal`]:{position:"relative","&::before":{position:"absolute",left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`1px ${n.lineType} ${n.colorSplit}`,content:'" "'},[o]:{overflowX:"scroll",position:"relative",display:"flex",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},[`${o}-link:first-of-type`]:{paddingInline:0},[`${o}-ink`]:{position:"absolute",bottom:0,transition:`left ${t} ease-in-out, width ${t} ease-in-out`,height:l,backgroundColor:i}}}}},f=p("Anchor",n=>{const{fontSize:o,fontSizeLG:t,padding:l,paddingXXS:i}=n,r=s(n,{holderOffsetBlock:i,anchorPaddingBlock:i,anchorPaddingBlockSecondary:i/2,anchorPaddingInline:l,anchorTitleBlock:o/14*3,anchorBallSize:t/2});return[h(r),k(r)]});export{f as default};
