import{resetComponent as e}from"../../style/index.mjs";import t from"../../theme/util/genComponentStyleHook.mjs";import{merge as n}from"../../theme/util/statistic.mjs";import r from"../../style/motion/collapse.mjs";import{zoomIn as i}from"../../style/motion/zoom.mjs";import a from"./explain.mjs";var o=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},label:{fontSize:e.fontSize},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n  input[type='radio']:focus,\n  input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),s=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},c=t=>{let{componentCls:n}=t;return{[t.componentCls]:{...e(t),...o(t),[`${n}-text`]:{display:`inline-block`,paddingInlineEnd:t.paddingSM},"&-small":{...s(t,t.controlHeightSM)},"&-large":{...s(t,t.controlHeightLG)}}}},l=t=>{let{formItemCls:n,iconCls:r,componentCls:a,rootPrefixCls:o}=t;return{[n]:{...e(t),marginBottom:t.marginLG,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden,
        &-hidden.${o}-row`]:{display:`none`},"&-has-warning":{[`${n}-split`]:{color:t.colorError}},"&-has-error":{[`${n}-split`]:{color:t.colorWarning}},[`${n}-label`]:{display:`inline-block`,flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:`${t.lineHeight} - 0.25em`,whiteSpace:`unset`},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:t.controlHeight,color:t.colorTextHeading,fontSize:t.fontSize,[`> ${r}`]:{fontSize:t.fontSize,verticalAlign:`top`},[`&${n}-required:not(${n}-required-mark-optional)::before`]:{display:`inline-block`,marginInlineEnd:t.marginXXS,color:t.colorError,fontSize:t.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`,[`${a}-hide-required-mark &`]:{display:`none`}},[`${n}-optional`]:{display:`inline-block`,marginInlineStart:t.marginXXS,color:t.colorTextDescription,[`${a}-hide-required-mark &`]:{display:`none`}},[`${n}-tooltip`]:{color:t.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:t.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:t.marginXXS/2,marginInlineEnd:t.marginXS},[`&${n}-no-colon::after`]:{content:`" "`}}},[`${n}-control`]:{display:`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:t.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`}}},[n]:{"&-explain, &-extra":{clear:`both`,color:t.colorTextDescription,fontSize:t.fontSize,lineHeight:t.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:t.controlHeightSM,transition:`color ${t.motionDurationMid} ${t.motionEaseOut}`},"&-explain":{"&-error":{color:t.colorError},"&-warning":{color:t.colorWarning}}},[`&-with-help ${n}-explain`]:{height:`auto`,opacity:1},[`${n}-feedback-icon`]:{fontSize:t.fontSize,textAlign:`center`,visibility:`visible`,animationName:i,animationDuration:t.motionDurationMid,animationTimingFunction:t.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:t.colorSuccess},"&-error":{color:t.colorError},"&-warning":{color:t.colorWarning},"&-validating":{color:t.colorPrimary}}}}},u=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label.${r}-col-24 + ${n}-control`]:{minWidth:`unset`}}}},d=e=>{let{componentCls:t,formItemCls:n}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[n]:{flex:`none`,flexWrap:`nowrap`,marginInlineEnd:e.margin,marginBottom:0,"&-with-help":{marginBottom:e.marginLG},[`> ${n}-label,
        > ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},f=e=>({margin:0,padding:`0 0 ${e.paddingXS}px`,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{display:`none`}}}),p=e=>{let{componentCls:t,formItemCls:n}=e;return{[`${n} ${n}-label`]:f(e),[t]:{[n]:{flexWrap:`wrap`,[`${n}-label,
          ${n}-control`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}},m=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-vertical`]:{[n]:{"&-row":{flexDirection:`column`},"&-label > label":{height:`auto`},[`${t}-item-control`]:{width:`100%`}}},[`${t}-vertical ${n}-label,
      .${r}-col-24${n}-label,
      .${r}-col-xl-24${n}-label`]:f(e),[`@media (max-width: ${e.screenXSMax}px)`]:[p(e),{[t]:{[`.${r}-col-xs-24${n}-label`]:f(e)}}],[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{[`.${r}-col-sm-24${n}-label`]:f(e)}},[`@media (max-width: ${e.screenMDMax}px)`]:{[t]:{[`.${r}-col-md-24${n}-label`]:f(e)}},[`@media (max-width: ${e.screenLGMax}px)`]:{[t]:{[`.${r}-col-lg-24${n}-label`]:f(e)}}}},h=t(`Form`,(e,{rootPrefixCls:t})=>{let o=n(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t});return[c(o),l(o),a(o),u(o),d(o),m(o),r(o),i]});export{h as default};