"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),r=require("prop-types"),l=require("lodash"),n=require("@material-ui/core"),a=require("../../constants.js"),s=require("./SubjectWellSearch.js"),t=require("./RadiusInput.js"),u=require("./SidetrackSwitch.js"),d=require("./NonEngineeredWellsSwitch.js"),o=require("./ToggleFiltersButton.js"),c=require("./ToggleMapButton.js"),f=require("./SingleSelect.js"),p=require("./MultiSelect.js"),g=require("./ClearFiltersButton.js"),q=require("../../../../utils/mobileDetect.js"),j=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(e),b=h(r),x=n.makeStyles({container:{display:"flex"},filters:{display:"flex",flexWrap:"wrap"},fileterSection:{display:"flex",width:"100%",alignItems:"center",flexWrap:"wrap"},subjectWellWrapper:{display:"flex",alignItems:"center",flexWrap:"wrap"}}),C=q.isNativeDetected||q.isMobileDetected;function R(e){var r=e.companyId,n=e.companies,q=e.canViewCompanies,h=e.wells,b=e.subjectWell,R=e.radius,S=e.excludeSideTrack,W=e.includeNonEngineeredWells,y=e.filters,v=e.filtersOptions,w=e.mapHidden,E=e.isRadiusEditable,N=e.isExistNonEngineeredWells,T=e.onChangeCompany,k=e.onSetSubjectWell,F=e.onChangeFilters,I=e.onChangeRadius,M=e.onChangeSidetrack,V=e.onChangeNonEngineeredWells,D=e.onClearFilters,H=e.onToggleMap,O=i.useState(C),B=m.default(O,2),z=B[0],L=B[1],_=x({isMobile:C});return j.jsxs("div",{children:[C&&j.jsx(o,{filtersHidden:z,onToggleFilters:function(){L((function(e){return!e}))}}),!z&&j.jsxs("div",{className:_.container,children:[j.jsx(c,{mapHidden:w,onToggleMap:H}),j.jsx("div",{className:_.filters,children:j.jsxs("div",{className:_.fileterSection,children:[q&&j.jsx(f,{"data-testid":"".concat("Filter","_companyDropdown"),label:"Company",items:n,currentValue:r,onChange:function(e){return T(e.target.value)}},"company"),a.FILTERS_LIST.map((function(e){var i=e.key,r=e.title,n=e.size,a=e.renderValue;return j.jsx(p,{title:r,size:n,options:l.get(v,i,[]),currentValues:l.get(y,i,[]),renderValue:a,onChange:function(e){return F(i,e)}},i)})),j.jsxs("div",{className:_.subjectWellWrapper,children:[j.jsx(s,{wells:h,subjectWell:b,onChange:k}),j.jsx(t,{radius:R,editable:E,onChange:I}),j.jsx(u,{initialChecked:S,onChange:M}),N&&j.jsx(d,{value:W,onChange:V}),j.jsx(g,{onClick:D})]})]})})]})]})}R.propTypes={canViewCompanies:b.default.bool.isRequired,isExistNonEngineeredWells:b.default.bool.isRequired,companies:b.default.arrayOf(b.default.shape({})).isRequired,wells:b.default.arrayOf(b.default.shape({})).isRequired,subjectWell:b.default.shape({}),companyId:b.default.number.isRequired,radius:b.default.number.isRequired,isRadiusEditable:b.default.bool.isRequired,excludeSideTrack:b.default.bool.isRequired,includeNonEngineeredWells:b.default.bool.isRequired,filters:b.default.shape({}).isRequired,filtersOptions:b.default.shape({}).isRequired,mapHidden:b.default.bool.isRequired,onChangeCompany:b.default.func.isRequired,onSetSubjectWell:b.default.func.isRequired,onChangeFilters:b.default.func.isRequired,onChangeRadius:b.default.func.isRequired,onChangeSidetrack:b.default.func.isRequired,onChangeNonEngineeredWells:b.default.func.isRequired,onClearFilters:b.default.func.isRequired,onToggleMap:b.default.func.isRequired},R.defaultProps={subjectWell:null};var S=i.memo(R);module.exports=S;
//# sourceMappingURL=index.js.map
