import{initInputToken as n,genInputSmallStyle as e,genBasicInputStyle as a}from"../../input/style/index.mjs";import{resetComponent as t,genFocusOutline as o,genFocusStyle as l}from"../../style/index.mjs";import"../../theme/internal.mjs";import g from"../../theme/util/genComponentStyleHook.mjs";import{merge as c}from"../../theme/util/statistic.mjs";const p=i=>{const{componentCls:r}=i;return{[`${r}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${r}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${r}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}}},[`&${r}-disabled`]:{cursor:"not-allowed",[`&${r}-mini`]:{[`
          &:hover ${r}-item:not(${r}-item-active),
          &:active ${r}-item:not(${r}-item-active),
          &:hover ${r}-item-link,
          &:active ${r}-item-link
        `]:{backgroundColor:"transparent"}},[`${r}-item`]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:i.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:i.colorBorder,backgroundColor:i.paginationItemDisabledBgActive,"&:hover, &:active":{backgroundColor:i.paginationItemDisabledBgActive},a:{color:i.paginationItemDisabledColorActive}}},[`${r}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${r}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${r}-simple-pager`]:{color:i.colorTextDisabled},[`${r}-jump-prev, ${r}-jump-next`]:{[`${r}-item-link-icon`]:{opacity:0},[`${r}-item-ellipsis`]:{opacity:1}}},[`&${r}-simple`]:{[`${r}-prev, ${r}-next`]:{[`&${r}-disabled ${r}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},m=i=>{const{componentCls:r}=i;return{[`&${r}-mini ${r}-total-text, &${r}-mini ${r}-simple-pager`]:{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`},[`&${r}-mini ${r}-item`]:{minWidth:i.paginationItemSizeSM,height:i.paginationItemSizeSM,margin:0,lineHeight:`${i.paginationItemSizeSM-2}px`},[`&${r}-mini ${r}-item:not(${r}-item-active)`]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive}},[`&${r}-mini ${r}-prev, &${r}-mini ${r}-next`]:{minWidth:i.paginationItemSizeSM,height:i.paginationItemSizeSM,margin:0,lineHeight:`${i.paginationItemSizeSM}px`,[`&:hover ${r}-item-link`]:{backgroundColor:i.colorBgTextHover},[`&:active ${r}-item-link`]:{backgroundColor:i.colorBgTextActive},[`&${r}-disabled:hover ${r}-item-link`]:{backgroundColor:"transparent"}},[`
    &${r}-mini ${r}-prev ${r}-item-link,
    &${r}-mini ${r}-next ${r}-item-link
    `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`}},[`&${r}-mini ${r}-jump-prev, &${r}-mini ${r}-jump-next`]:{height:i.paginationItemSizeSM,marginInlineEnd:0,lineHeight:`${i.paginationItemSizeSM}px`},[`&${r}-mini ${r}-options`]:{marginInlineStart:i.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:i.paginationMiniOptionsSizeChangerTop},"&-quick-jumper":{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`,input:{...e(i),width:i.paginationMiniQuickJumperInputWidth,height:i.controlHeightSM}}}}},d=i=>{const{componentCls:r}=i;return{[`
    &${r}-simple ${r}-prev,
    &${r}-simple ${r}-next
    `]:{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`,verticalAlign:"top",[`${r}-item-link`]:{height:i.paginationItemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive},"&::after":{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`}}},[`&${r}-simple ${r}-simple-pager`]:{display:"inline-block",height:i.paginationItemSizeSM,marginInlineEnd:i.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:i.marginXS,padding:`0 ${i.paginationItemPaddingInline}px`,textAlign:"center",backgroundColor:i.paginationItemInputBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,outline:"none",transition:`border-color ${i.motionDurationMid}`,color:"inherit","&:hover":{borderColor:i.colorPrimary},"&:focus":{borderColor:i.colorPrimaryHover,boxShadow:`${i.inputOutlineOffset}px 0 ${i.controlOutlineWidth}px ${i.controlOutline}`},"&[disabled]":{color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,cursor:"not-allowed"}}}}},s=i=>{const{componentCls:r}=i;return{[`${r}-jump-prev, ${r}-jump-next`]:{outline:0,[`${r}-item-container`]:{position:"relative",[`${r}-item-link-icon`]:{color:i.colorPrimary,fontSize:i.fontSizeSM,opacity:0,transition:`all ${i.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${r}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:i.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:i.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:i.paginationEllipsisTextIndent,opacity:1,transition:`all ${i.motionDurationMid}`}},"&:hover":{[`${r}-item-link-icon`]:{opacity:1},[`${r}-item-ellipsis`]:{opacity:0}},"&:focus-visible":{[`${r}-item-link-icon`]:{opacity:1},[`${r}-item-ellipsis`]:{opacity:0},...o(i)}},[`
    ${r}-prev,
    ${r}-jump-prev,
    ${r}-jump-next
    `]:{marginInlineEnd:i.marginXS},[`
    ${r}-prev,
    ${r}-next,
    ${r}-jump-prev,
    ${r}-jump-next
    `]:{display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,color:i.colorText,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:i.borderRadius,cursor:"pointer",transition:`all ${i.motionDurationMid}`},[`${r}-prev, ${r}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:i.colorText,cursor:"pointer",userSelect:"none"},[`${r}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:i.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:"none",transition:`all ${i.motionDurationMid}`},[`&:focus-visible ${r}-item-link`]:{...o(i)},[`&:hover ${r}-item-link`]:{backgroundColor:i.colorBgTextHover},[`&:active ${r}-item-link`]:{backgroundColor:i.colorBgTextActive},[`&${r}-disabled:hover`]:{[`${r}-item-link`]:{backgroundColor:"transparent"}}},[`${r}-slash`]:{marginInlineEnd:i.paginationSlashMarginInlineEnd,marginInlineStart:i.paginationSlashMarginInlineStart},[`${r}-options`]:{display:"inline-block",marginInlineStart:i.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:i.controlHeight,marginInlineStart:i.marginXS,lineHeight:`${i.controlHeight}px`,verticalAlign:"top",input:{...a(i),width:i.controlHeightLG*1.25,height:i.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:i.marginXS,marginInlineEnd:i.marginXS}}}}},$=i=>{const{componentCls:r}=i;return{[`${r}-item`]:{display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,marginInlineEnd:i.marginXS,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${i.paginationItemPaddingInline}px`,color:i.colorText,transition:"none","&:hover":{textDecoration:"none"}},[`&:not(${r}-item-active)`]:{"&:hover":{transition:`all ${i.motionDurationMid}`,backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive}},...l(i),"&-active":{fontWeight:i.paginationFontWeightActive,backgroundColor:i.paginationItemBgActive,borderColor:i.colorPrimary,a:{color:i.colorPrimary},"&:hover":{borderColor:i.colorPrimaryHover},"&:hover a":{color:i.colorPrimaryHover}}}}},b=i=>{const{componentCls:r}=i;return{[r]:{...t(i),"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${r}-total-text`]:{display:"inline-block",height:i.paginationItemSize,marginInlineEnd:i.marginXS,lineHeight:`${i.paginationItemSize-2}px`,verticalAlign:"middle"},...$(i),...s(i),...d(i),...m(i),...p(i),[`@media only screen and (max-width: ${i.screenLG}px)`]:{[`${r}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${i.screenSM}px)`]:{[`${r}-options`]:{display:"none"}}},[`&${i.componentCls}-rtl`]:{direction:"rtl"}}},u=i=>{const{componentCls:r}=i;return{[`${r}${r}-disabled`]:{"&, &:hover":{[`${r}-item-link`]:{borderColor:i.colorBorder}},"&:focus-visible":{[`${r}-item-link`]:{borderColor:i.colorBorder}},[`${r}-item, ${r}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,[`&:hover:not(${r}-item-active)`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,a:{color:i.colorTextDisabled}},[`&${r}-item-active`]:{backgroundColor:i.paginationItemDisabledBgActive}},[`${r}-prev, ${r}-next`]:{"&:hover button":{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,color:i.colorTextDisabled},[`${r}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder}}},[r]:{[`${r}-prev, ${r}-next`]:{"&:hover button":{borderColor:i.colorPrimaryHover,backgroundColor:i.paginationItemBg},[`${r}-item-link`]:{backgroundColor:i.paginationItemLinkBg,borderColor:i.colorBorder},[`&:hover ${r}-item-link`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,color:i.colorPrimary},[`&${r}-disabled`]:{[`${r}-item-link`]:{borderColor:i.colorBorder,color:i.colorTextDisabled}}},[`${r}-item`]:{backgroundColor:i.paginationItemBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,[`&:hover:not(${r}-item-active)`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,a:{color:i.colorPrimary}},"&-active":{borderColor:i.colorPrimary}}}}},x=g("Pagination",i=>{const r=c(i,{paginationItemSize:i.controlHeight,paginationFontFamily:i.fontFamily,paginationItemBg:i.colorBgContainer,paginationItemBgActive:i.colorBgContainer,paginationFontWeightActive:i.fontWeightStrong,paginationItemSizeSM:i.controlHeightSM,paginationItemInputBg:i.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:i.controlItemBgActiveDisabled,paginationItemDisabledColorActive:i.colorTextDisabled,paginationItemLinkBg:i.colorBgContainer,inputOutlineOffset:"0 0",paginationMiniOptionsMarginInlineStart:i.marginXXS/2,paginationMiniQuickJumperInputWidth:i.controlHeightLG*1.1,paginationItemPaddingInline:i.marginXXS*1.5,paginationEllipsisLetterSpacing:i.marginXXS/2,paginationSlashMarginInlineStart:i.marginXXS,paginationSlashMarginInlineEnd:i.marginSM,paginationEllipsisTextIndent:"0.13em"},n(i));return[b(r),i.wireframe&&u(r)]});export{x as default};
