"use strict";var e=require("react"),i=require("prop-types"),t=require("lodash"),l=require("@material-ui/core"),r=require("@material-ui/icons"),a=require("../../constants.js"),s=require("./RadiusInput.js"),n=require("./SidetrackSwitch.js"),o=require("./MultiSelect.js"),d=require("./ClearFiltersButton.js"),u=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=c(i),f=l.makeStyles((function(e){return{container:{display:"flex",marginBottom:"24px"},filters:{display:"flex",flexWrap:"wrap"},fileterSection:{display:"flex",width:"100%",alignItems:"center",flexWrap:"wrap"},filterRow:{display:"flex",width:"100%",flexFlow:"row wrap",alignContent:"flex-start",gap:"24px"},paper:{background:e.palette.background.b4,overflow:"hidden"},dialogTitle:{padding:"14px 0",height:"60px",borderBottom:"1px solid ".concat(e.palette.background.b7)},titleWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"18px"},title:{fontSize:"20px"},dialogContent:{display:"flex",width:"100%",flexFlow:"row wrap",alignContent:"flex-start",height:"100%",paddingRight:"16px",justifyContent:"space-between"}}}));function x(e){var i=e.radius,c=e.excludeSideTrack,p=e.filters,x=e.filtersOptions,g=e.isRadiusEditable,h=e.filtersHidden,b=e.onChangeFilters,j=e.onChangeRadius,C=e.onChangeSidetrack,m=e.onClearFilters,q=e.isTablet,R=e.isMobile,w=e.onToggleFilters,k=f({isMobile:R}),y=q?200:150,S=function(){w(!1)};return h&&R&&!q?u.jsxs(l.Dialog,{onBackdropClick:S,onEscapeKeyDown:S,fullScreen:!0,maxWidth:"xs",fullWidth:!0,open:!0,classes:{paper:k.paper},children:[u.jsx(l.DialogTitle,{className:k.dialogTitle,children:u.jsxs("div",{className:k.titleWrapper,children:[u.jsx(l.Typography,{className:k.title,children:"Filter"}),u.jsx(r.Close,{className:k.closeIcon,onClick:S})]})}),u.jsxs(l.DialogContent,{className:k.dialogContent,children:[a.FILTERS_LIST.map((function(e){var i=e.key,l=e.title,r=e.renderValue;return u.jsx(o,{title:l,size:y,options:t.get(x,i,[]),currentValues:t.get(p,i,[]),renderValue:r,onChange:function(e){return b(i,e)}},i)})),u.jsx(s,{radius:i,editable:g,onChange:j,isMobile:R}),u.jsx(n,{checked:c,onChange:C,isMobile:R})]})]}):h||R&&!q?null:u.jsx("div",{className:k.container,children:u.jsx("div",{className:k.filters,children:u.jsx("div",{className:k.fileterSection,children:u.jsxs("div",{className:k.filterRow,children:[a.FILTERS_LIST.map((function(e){var i=e.key,l=e.title,r=e.renderValue;return u.jsx(o,{title:l,size:y,options:t.get(x,i,[]),currentValues:t.get(p,i,[]),renderValue:r,onChange:function(e){return b(i,e)}},i)})),u.jsx(s,{radius:i,editable:g,onChange:j,isTablet:q}),u.jsx(n,{checked:c,onChange:C,isMobile:R}),u.jsx(d,{onClick:m})]})})})})}x.propTypes={subjectWell:p.default.shape({}),radius:p.default.number.isRequired,isRadiusEditable:p.default.bool.isRequired,excludeSideTrack:p.default.bool.isRequired,filters:p.default.shape({}).isRequired,filtersOptions:p.default.shape({}).isRequired,filtersHidden:p.default.bool.isRequired,onChangeFilters:p.default.func.isRequired,onChangeRadius:p.default.func.isRequired,onChangeSidetrack:p.default.func.isRequired,onClearFilters:p.default.func.isRequired,isTablet:p.default.bool.isRequired,isMobile:p.default.bool.isRequired,onToggleFilters:p.default.func.isRequired},x.defaultProps={subjectWell:null};var g=e.memo(x);module.exports=g;
