import{resetComponent as e,resetIcon as t,textEllipsis as n}from"../../style/index.mjs";import r from"../../theme/util/genComponentStyleHook.mjs";import{merge as i}from"../../theme/util/statistic.mjs";import{genCompactItemStyle as a}from"../../style/compact-item.mjs";import o from"./dropdown.mjs";import s from"./multiple.mjs";import c from"./single.mjs";var l=e=>{let{componentCls:t}=e;return{position:`relative`,backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:`pointer`},[`${t}-show-search&`]:{cursor:`text`,input:{cursor:`auto`,color:`inherit`}},[`${t}-disabled&`]:{color:e.colorTextDisabled,background:e.colorBgContainerDisabled,cursor:`not-allowed`,[`${t}-multiple&`]:{background:e.colorBgContainerDisabled},input:{cursor:`not-allowed`}}}},u=(e,t,n=!1)=>{let{componentCls:r,borderHoverColor:i,outlineColor:a,antCls:o}=t,s=n?{[`${r}-selector`]:{borderColor:i}}:{};return{[e]:{[`&:not(${r}-disabled):not(${r}-customize-input):not(${o}-pagination-size-changer)`]:{...s,[`${r}-focused& ${r}-selector`]:{borderColor:i,boxShadow:`0 0 0 ${t.controlOutlineWidth}px ${a}`,borderInlineEndWidth:`${t.controlLineWidth}px !important`,outline:0},[`&:hover ${r}-selector`]:{borderColor:i,borderInlineEndWidth:`${t.controlLineWidth}px !important`}}}}},d=e=>{let{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:`transparent`,border:`none`,outline:`none`,appearance:`none`,"&::-webkit-search-cancel-button":{display:`none`,"-webkit-appearance":`none`}}}},f=r=>{let{componentCls:i,inputPaddingHorizontalBase:a,iconCls:o}=r;return{[i]:{...e(r),position:`relative`,display:`inline-block`,cursor:`pointer`,[`&:not(${i}-customize-input) ${i}-selector`]:{...l(r),...d(r)},[`${i}-selection-item`]:{flex:1,fontWeight:`normal`,...n},[`${i}-selection-placeholder`]:{...n,flex:1,color:r.colorTextPlaceholder,pointerEvents:`none`},[`${i}-arrow`]:{...t(),position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:a,height:r.fontSizeIcon,marginTop:-r.fontSizeIcon/2,color:r.colorTextQuaternary,fontSize:r.fontSizeIcon,lineHeight:1,textAlign:`center`,pointerEvents:`none`,display:`flex`,alignItems:`center`,[o]:{verticalAlign:`top`,transition:`transform ${r.motionDurationSlow}`,"> svg":{verticalAlign:`top`},[`&:not(${i}-suffix)`]:{pointerEvents:`auto`}},[`${i}-disabled &`]:{cursor:`not-allowed`},"> *:not(:last-child)":{marginInlineEnd:8}},[`${i}-clear`]:{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:a,zIndex:1,display:`inline-block`,width:r.fontSizeIcon,height:r.fontSizeIcon,marginTop:-r.fontSizeIcon/2,color:r.colorTextQuaternary,fontSize:r.fontSizeIcon,fontStyle:`normal`,lineHeight:1,textAlign:`center`,textTransform:`none`,background:r.colorBgContainer,cursor:`pointer`,opacity:0,transition:`color ${r.motionDurationMid} ease, opacity ${r.motionDurationSlow} ease`,textRendering:`auto`,"&:before":{display:`block`},"&:hover":{color:r.colorTextTertiary}},"&:hover":{[`${i}-clear`]:{opacity:1}}},[`${i}-has-feedback`]:{[`${i}-clear`]:{insetInlineEnd:a+r.fontSize+r.paddingXXS}}}},p=e=>{let{componentCls:t}=e;return[{[t]:{[`&-borderless ${t}-selector`]:{backgroundColor:`transparent !important`,borderColor:`transparent !important`,boxShadow:`none !important`},[`&${t}-in-form-item`]:{width:`100%`}}},f(e),c(e),s(e),o(e),{[`${t}-rtl`]:{direction:`rtl`}},u(t,i(e,{borderHoverColor:e.colorPrimaryHover,outlineColor:e.controlOutline})),u(`${t}-status-error`,i(e,{borderHoverColor:e.colorErrorHover,outlineColor:e.colorErrorOutline}),!0),u(`${t}-status-warning`,i(e,{borderHoverColor:e.colorWarningHover,outlineColor:e.colorWarningOutline}),!0),a(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]},m=r(`Select`,(e,{rootPrefixCls:t})=>[p(i(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.paddingSM-1}))],e=>({zIndexPopup:e.zIndexPopupBase+50}));export{m as default};