const e=require("../../style/index.js"),t=require("../../theme/util/genComponentStyleHook.js"),n=require("../../style/compact-item.js"),r=require("../../input/style/index.js");var i=t=>{let{componentCls:n,lineWidth:i,lineType:a,colorBorder:o,borderRadius:s,fontSizeLG:c,controlHeightLG:l,controlHeightSM:u,colorError:d,inputPaddingHorizontalSM:f,colorTextDescription:p,motionDurationMid:m,colorPrimary:h,controlHeight:g,inputPaddingHorizontal:_,colorBgContainer:v,colorTextDisabled:y,borderRadiusSM:b,borderRadiusLG:x,controlWidth:S,handleVisible:C}=t;return[{[n]:{...e.resetComponent(t),...r.genBasicInputStyle(t),...r.genStatusStyle(t,n),display:`inline-block`,width:S,margin:0,padding:0,border:`${i}px ${a} ${o}`,borderRadius:s,"&-rtl":{direction:`rtl`,[`${n}-input`]:{direction:`rtl`}},"&-lg":{padding:0,fontSize:c,borderRadius:x,[`input${n}-input`]:{height:l-2*i}},"&-sm":{padding:0,borderRadius:b,[`input${n}-input`]:{height:u-2*i,padding:`0 ${f}px`}},"&:hover":{...r.genHoverStyle(t)},"&-focused":{...r.genActiveStyle(t)},"&-disabled":{...r.genDisabledStyle(t),[`${n}-input`]:{cursor:`not-allowed`}},"&-out-of-range":{input:{color:d}},"&-group":{...e.resetComponent(t),...r.genInputGroupStyle(t),"&-wrapper":{display:`inline-block`,textAlign:`start`,verticalAlign:`top`,[`${n}-affix-wrapper`]:{width:`100%`},"&-lg":{[`${n}-group-addon`]:{borderRadius:x}},"&-sm":{[`${n}-group-addon`]:{borderRadius:b}}}},[n]:{"&-input":{width:`100%`,height:g-2*i,padding:`0 ${_}px`,textAlign:`start`,backgroundColor:`transparent`,border:0,borderRadius:s,outline:0,transition:`all ${m} linear`,appearance:`textfield`,color:t.colorText,fontSize:`inherit`,verticalAlign:`top`,...r.genPlaceholderStyle(t.colorTextPlaceholder),'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:`none`,appearance:`none`}}}}},{[n]:{[`&:hover ${n}-handler-wrap, &-focused ${n}-handler-wrap`]:{opacity:1},[`${n}-handler-wrap`]:{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,width:t.handleWidth,height:`100%`,background:v,borderStartStartRadius:0,borderStartEndRadius:s,borderEndEndRadius:s,borderEndStartRadius:0,opacity:+(C===!0),display:`flex`,flexDirection:`column`,alignItems:`stretch`,transition:`opacity ${m} linear ${m}`,[`${n}-handler`]:{display:`flex`,alignItems:`center`,justifyContent:`center`,flex:`auto`,height:`40%`,[`
              ${n}-handler-up-inner,
              ${n}-handler-down-inner
            `]:{marginInlineEnd:0,fontSize:t.handleFontSize}}},[`${n}-handler`]:{height:`50%`,overflow:`hidden`,color:p,fontWeight:`bold`,lineHeight:0,textAlign:`center`,cursor:`pointer`,borderInlineStart:`${i}px ${a} ${o}`,transition:`all ${m} linear`,"&:active":{background:t.colorFillAlter},"&:hover":{height:`60%`,[`
              ${n}-handler-up-inner,
              ${n}-handler-down-inner
            `]:{color:h}},"&-up-inner, &-down-inner":{...e.resetIcon(),color:p,transition:`all ${m} linear`,userSelect:`none`}},[`${n}-handler-up`]:{borderStartEndRadius:s},[`${n}-handler-down`]:{borderBlockStart:`${i}px ${a} ${o}`,borderEndEndRadius:s},"&-disabled, &-readonly":{[`${n}-handler-wrap`]:{display:`none`},[`${n}-input`]:{color:`inherit`}},[`
          ${n}-handler-up-disabled,
          ${n}-handler-down-disabled
        `]:{cursor:`not-allowed`},[`
          ${n}-handler-up-disabled:hover &-handler-up-inner,
          ${n}-handler-down-disabled:hover &-handler-down-inner
        `]:{color:y}}},{[`${n}-borderless`]:{borderColor:`transparent`,boxShadow:`none`,[`${n}-handler-down`]:{borderBlockStartWidth:0}}}]},a=e=>{let{componentCls:t,inputPaddingHorizontal:n,inputAffixPadding:i,controlWidth:a,borderRadiusLG:o,borderRadiusSM:s}=e;return{[`${t}-affix-wrapper`]:{...r.genBasicInputStyle(e),...r.genStatusStyle(e,`${t}-affix-wrapper`),position:`relative`,display:`inline-flex`,width:a,padding:0,paddingInlineStart:n,"&-lg":{borderRadius:o},"&-sm":{borderRadius:s},[`&:not(${t}-affix-wrapper-disabled):hover`]:{...r.genHoverStyle(e),zIndex:1},"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${t}[disabled]`]:{background:`transparent`}},[`> div${t}`]:{width:`100%`,border:`none`,outline:`none`,[`&${t}-focused`]:{boxShadow:`none !important`}},[`input${t}-input`]:{padding:0},"&::before":{width:0,visibility:`hidden`,content:`"\\a0"`},[`${t}-handler-wrap`]:{zIndex:2},[t]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,pointerEvents:`none`},"&-prefix":{marginInlineEnd:i},"&-suffix":{position:`absolute`,insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:`100%`,marginInlineEnd:n,marginInlineStart:i}}}}},o=t.default(`InputNumber`,e=>{let t=r.initInputToken(e);return[i(t),a(t),n.genCompactItemStyle(t)]},e=>({controlWidth:90,handleWidth:e.controlHeightSM-e.lineWidth*2,handleFontSize:e.fontSize/2,handleVisible:`auto`}));exports.default=o;