import{__rest as e,__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useMemo as i}from"react";import{makeStyles as l,FormControl as a,InputLabel as n,Select as u,FormHelperText as d}from"@material-ui/core";import p from"uuid/v4";import c from"classnames";var s=l((function(e){return{formControlRoot:{"& .MuiSelect-icon":{top:"calc(50% - 8px)",right:4},"& .MuiSelect-icon.MuiSelect-iconOutlined":{right:8},"& .MuiSelect-icon.MuiSelect-iconFilled":{right:8},"&:hover":{"& .MuiFormLabel-root, & .MuiInputAdornment-root,  & .MuiSelect-icon > svg > path":{color:e.palette.primary.contrastText},"& .MuiSelect-icon > svg > path":{stroke:e.palette.primary.contrastText,fill:e.palette.primary.contrastText},"& .MuiInput-underline:not(.Mui-disabled), & .MuiFilledInput-underline:not(.Mui-disabled)":{"&::before":{borderBottom:"2px solid ".concat(e.palette.primary.contrastText)}}},"& .MuiInputBase-root.Mui-focused":{"& .MuiSelect-icon > svg > path":{stroke:e.palette.primary.main,fill:e.palette.primary.main}},"& .MuiInput-underline, & .MuiFilledInput-underline":{"&::before":{borderBottom:"1px solid ".concat(e.palette.primary.text6)},"&.Mui-disabled":{"&::before":{opacity:"0.4",borderBottom:"1px solid ".concat(e.palette.primary.text6)},"&::after":{opacity:"0.4"}}},"& .MuiSelect-root":{"&.Mui-disabled":{color:e.palette.primary.contrastText,opacity:"0.4"}},"& .MuiFormLabel-root":{color:e.palette.primary.text6,"&.Mui-focused":{color:e.palette.primary.main},"&.Mui-disabled.MuiInputLabel-root":{color:e.palette.primary.text6,opacity:"0.4"}},"& .MuiSelect-icon.Mui-disabled":{color:e.palette.primary.contrastText,opacity:"0.4"},"& .MuiFormHelperText-root":{color:e.palette.primary.text6,"&.Mui-disabled":{opacity:"0.4"}},"& .MuiFilledInput-root":{backgroundColor:e.palette.background.b6,"&:hover":{backgroundColor:e.palette.background.b7},"&.Mui-disabled":{backgroundColor:e.palette.background.b6,opacity:"0.4"}},"& .MuiInputLabel-filled":{left:2},"& .MuiSelect-filled":{paddingLeft:14},"& .MuiSvgIcon-root.MuiSelect-icon":{color:e.palette.primary.text6},"& .MuiInputBase-root":{"& .MuiInputAdornment-root":{color:e.palette.primary.text6,"& svg":{height:16,width:16}},"&.Mui-error":{"& .MuiInputAdornment-root":{color:e.palette.error.main}},"&.Mui-disabled":{"& .MuiInputAdornment-root":{opacity:"0.4"}},"&.Mui-focused":{"& .MuiInputAdornment-root":{color:e.palette.primary.main}}}},menuList:{backgroundColor:e.palette.background.b9,"& .MuiMenuItem-root":{"&.Mui-selected":{backgroundColor:e.palette.primary.text9}}},error:{"&:hover":{"& .MuiInput-underline, & .MuiFilledInput-underline":{"&::after":{borderBottom:"2px solid ".concat(e.palette.error.main)}},"& .MuiInput-underline.Mui-disabled, & .MuiFilledInput-underline.Mui-disabled":{"&::before":{borderBottom:"1px solid ".concat(e.palette.error.main)},"&::after":{display:"none"}},"& .MuiOutlinedInput-root.Mui-error:not(.Mui-disabled) .MuiOutlinedInput-notchedOutline":{borderWidth:2}},"& .MuiFormLabel-root.MuiInputLabel-root":{color:e.palette.error.main,"&.Mui-focused":{color:e.palette.error.main},"&.Mui-disabled":{color:e.palette.error.main}},"& .MuiFormHelperText-root":{color:e.palette.error.main},"& .MuiInput-underline, & .MuiFilledInput-underline":{"&::after":{borderBottom:"1px solid ".concat(e.palette.error.main)},"&.Mui-disabled::after":{display:"none"},"&.Mui-disabled::before":{borderBottom:"1px solid ".concat(e.palette.error.main)}},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:e.palette.error.main,opacity:"0.4"}},paper:{marginTop:8}}})),m=function(l){var m,M,b,f,v,I,y,x=l.FormControlProps,h=void 0===x?{}:x,g=l.InputLabelProps,F=void 0===g?{}:g,S=l.label,k=void 0===S?null:S,C=l.formHelperText,L=void 0===C?null:C,T=l.error,B=void 0!==T&&T,O=l.fullWidth,P=void 0!==O&&O,A=e(l,["FormControlProps","InputLabelProps","label","formHelperText","error","fullWidth"]),W=i(p,[]),H=s();return t(a,o({},h,{classes:o(o({},h.classes),{root:c(null===(M=h.classes)||void 0===M?void 0:M.root,H.formControlRoot,(m={},m[H.error]=B,m))}),disabled:h.disabled||A.disabled,fullWidth:P,error:B},{children:[k&&r(n,o({id:W},F,{children:k})),r(u,o({},A,{labelId:W,label:k,MenuProps:o(o({getContentAnchorEl:null,anchorOrigin:{horizontal:"left",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"left"}},null==A?void 0:A.MenuProps),{classes:o(o({},null===(b=null==A?void 0:A.MenuProps)||void 0===b?void 0:b.classes),{paper:c(H.paper,null===(v=null===(f=null==A?void 0:A.MenuProps)||void 0===f?void 0:f.classes)||void 0===v?void 0:v.paper),list:c(null===(y=null===(I=null==A?void 0:A.MenuProps)||void 0===I?void 0:I.classes)||void 0===y?void 0:y.list,H.menuList)})}),fullWidth:P})),L&&r(d,{children:L})]}))};export{m as default};
