{"version":3,"sources":["services/api.ts","components/SummaryCard/index.tsx","shared/toast.ts","shared/roles.ts","hooks/useAlert.ts","hooks/useDebouncedState.ts","components/SummaryDataChartCard/index.tsx","contexts/AlertContext.tsx","contexts/ModalContext.tsx","assets/img/symbol.svg","components/FallbackSpinner/index.tsx","contexts/SidebarContext.tsx","styles/theme/config.ts","shared/env.ts","hooks/usePersistedState.ts","hooks/useCookies.ts","hooks/useAuth.ts","components/OwnSelect/components/DropdownIndicator.tsx","components/OwnSelect/components/LoadingIndicator.tsx","components/OwnSelect/index.tsx","components/AppTable/index.tsx","components/Pagination/index.tsx","hooks/useThrottledState.ts","components/Loader/styles.ts","components/Loader/index.tsx","services/axios.ts","contexts/AuthContext.tsx","routes/index.tsx","components/ConfettiEffect/index.tsx","components/Alert/BudgetExportSuccess/index.tsx","components/Modal/BudgetCompositionEdit/index.tsx","components/Alert/Root/alertList.ts","components/Alert/Generic/index.tsx","components/Alert/DangerDelete/index.tsx","components/Alert/Root/index.tsx","components/Modal/ABCValues/index.tsx","components/Modal/BaseAdd/index.tsx","components/Modal/BaseSelect/index.tsx","components/Modal/BudgetComponentObservation/index.tsx","components/Modal/BudgetCompositionEdit/FragmentsTableRow.tsx","components/Modal/BudgetCompositionEdit/FragmentsTable.tsx","components/Modal/BudgetCompositionFragmentSelect/SearchFilter.tsx","components/Modal/BudgetCompositionFragmentSelect/index.tsx","components/Modal/BudgetCompositionLookup/FragmentsTableRow.tsx","components/Modal/BudgetCompositionLookup/FragmentsTable.tsx","components/Modal/BudgetCompositionLookup/index.tsx","components/Modal/BudgetCompositionSelect/SearchFilter.tsx","components/Modal/BudgetCompositionSelect/index.tsx","components/Modal/BudgetCustomCompositionAdd/Form.tsx","components/Modal/BudgetCustomCompositionAdd/index.tsx","components/Modal/BudgetGlobalPriceChange/index.tsx","components/Modal/BudgetHistory/StatusBadge.tsx","components/Modal/BudgetHistory/index.tsx","components/Modal/BudgetInputFragmentSelect/SearchFilter.tsx","components/Modal/BudgetInputFragmentSelect/index.tsx","components/Modal/BudgetInputSelect/SearchFilter.tsx","components/Modal/BudgetInputSelect/index.tsx","components/Modal/BudgetOutdatedComponentSelect/CompositionRow.tsx","components/Modal/BudgetOutdatedComponentSelect/InputRow.tsx","components/Modal/BudgetOutdatedComponentSelect/OutdatedComponentsTableBody.tsx","components/Modal/BudgetOutdatedComponentSelect/OutdatedComponentsTable.tsx","components/Modal/BudgetOutdatedComponentSelect/index.tsx","components/Modal/BudgetTypeSelect/index.tsx","components/Modal/ClientLookup/index.tsx","components/Modal/ClientSelfLookup/Form.tsx","components/Modal/ClientSelfLookup/index.tsx","components/Modal/CompositionLookup/FragmentsTableRow.tsx","components/Modal/CompositionLookup/FragmentsTable.tsx","components/Modal/CompositionLookup/index.tsx","shared/locale.ts","components/Modal/CompositionPriceLookup/index.tsx","components/Modal/EnterpriseLookup/index.tsx","components/Modal/GPTModel/index.tsx","components/Modal/Import/index.tsx","components/Modal/Import/Composition/Fields.tsx","components/Modal/Import/StatusBadge.tsx","components/Modal/Import/Composition/ElementPreviewTableRow.tsx","components/Modal/Import/Composition/ElementPreviewTable.tsx","components/Modal/Import/Composition/ImportPreviewTableRow.tsx","components/Modal/Import/Composition/ImportPreviewTable.tsx","components/Modal/Import/Composition/Overview.tsx","components/Modal/Import/Input/Fields.tsx","components/Modal/Import/Input/Overview.tsx","components/Modal/InputPriceLookup/index.tsx","components/Modal/JSONViewer/index.tsx","components/Modal/LocaleAndPriceTypeSelect/index.tsx","components/Modal/ManageFlow/index.tsx","components/Modal/ManageParametricFlow/index.tsx","components/Modal/OwnCompositionSelect/SearchFilter.tsx","components/Modal/OwnCompositionSelect/index.tsx","components/Modal/OwnInputSelect/SearchFilter.tsx","components/Modal/OwnInputSelect/index.tsx","components/Modal/ParametricBudgetHistory/StatusBadge.tsx","components/Modal/ParametricBudgetHistory/index.tsx","components/Modal/ParametricBudgetLookup/BuildingDescriptionPopover.tsx","components/Modal/ParametricBudgetLookup/shared.ts","components/Modal/ParametricBudgetLookup/index.tsx","components/Modal/PositionUpdate/index.tsx","components/Modal/SiengeOrganizationLookup/index.tsx","components/Modal/StageAdd/index.tsx","components/Modal/SubscriptionHistory/getStatusBadge.tsx","components/Modal/SubscriptionHistory/index.tsx","components/Modal/SubscriptionHistory/getPaymentMethod.ts","components/Modal/Support/index.tsx","components/Modal/UnitConstructiveAdd/index.tsx","components/Modal/UnitConstructiveLookup/index.tsx","components/Modal/Root/modalList.ts","components/Modal/VersionAdd/index.tsx","components/Modal/UserInvite/index.tsx","components/Modal/UserOrganizationLookup/index.tsx","components/Modal/Root/index.tsx","styles/theme/components/Badge.ts","styles/theme/components/Box.ts","styles/theme/components/Button.ts","styles/theme/components/Form.ts","styles/theme/components/IconButton.ts","styles/theme/components/Input.ts","styles/theme/components/Select.ts","styles/theme/components/Table.ts","styles/theme/components/Tooltip.ts","styles/theme/customTheme.ts","styles/theme/colors.ts","App.tsx","index.tsx","shared/date.ts","components/StatusCircle/index.tsx","contexts/TableContext.tsx","components/Table/Table.tsx","components/Table/Tbody.tsx","components/Table/Thead.tsx","components/Table/Td.tsx","components/Table/Tr.tsx","components/Table/Th.tsx","hooks/useModal.ts","components/SummaryContainer/index.tsx"],"names":["api","createApiClient","baseURL","env","MotionBox","motion","Box","SummaryCard","props","idx","isHidden","loading","typeNumber","summaryData","data","rest","padding","bg","borderWidth","borderRadius","position","width","base","lg","initial","opacity","scale","animate","transition","duration","exit","top","direction","alignItems","justifyContent","icon","_before","content","background","colorSchemeType","colorSchemeCard","right","left","bottom","as","height","color","overflow","marginTop","fontSize","fontWeight","textTransform","whiteSpace","formattedNumber","altNumber","marginLeft","complementaryNumber","title","render","toast","createStandaloneToast","defaultOptions","variant","isClosable","roles","name","manager","default","getColorByRole","roleArray","i","length","includes","getRoleName","mergeRoles","userData","managed_organization","flat","getUserRoleName","userRoles","is","role","user","isSuperAdmin","isEcustosAdmin","isOrganizationAdmin","isSuperOrEcustosAdmin","useAlert","alert","useContext","AlertContext","Error","useDebouncedState","initialValue","delay","useState","debouncedValue","setDebouncedValue","value","setValue","useEffect","handler","setTimeout","clearTimeout","SummaryDataChartCard","hasAnyData","Boolean","chart","series","reduce","acc","curr","gap","options","type","fontFamily","labels","dataLabels","enabled","colors","tooltip","y","formatter","Intl","NumberFormat","style","currency","format","legend","show","responsive","breakpoint","createContext","AlertProvider","children","list","setList","openCustomAlert","key","oldList","Provider","alerts","openAlert","closeAlert","filter","Alert","ModalContext","ModalProvider","modals","openModal","closeModal","modal","FallbackSpinner","src","logoSymbol","marginBottom","SidebarContext","SidebarProvider","open","setOpen","isSticked","setIsSticked","useMediaQuery","isMobile","toggleSidebar","toggleStick","openSidebar","closeSidebar","sidebarWidth","headerHeight","sidebarClosedWidth","sidebarOpenWidth","cssVarPrefix","defaultColorMode","useSystemColorMode","process","persistedStateNamePrefix","usePersistedState","initialState","storageValue","localStorage","getItem","JSON","parse","state","setState","setItem","stringify","useCookie","cookieName","Cookies","get","useCallback","newValue","set","remove","cookieOptions","path","domain","expires","useAuth","history","useHistory","setLoading","authenticated","setAuthenticated","cookieTokenKey","cookieJwtKey","useCookies","token","setToken","removeToken","jwtManagement","setJwt","removeJwt","userOrganizations","setUserOrganizations","validating","setValidating","setUser","shouldRedirectToAnotherFrontend","organization","url","currentFrontend","window","location","href","targetFrontend","currentUrl","URL","targetUrl","hostname","getAuth","a","userInfo","userOrganization","defaults","headers","Authorization","common","description","status","getUserOrganizationDefault","organizationId","userId","params","organization_id","user_id","isAxiosError","response","message","handleSelectOrganization","organizationJwt","getUserOrganizations","force","page","per_page","userOrganizationsLoaded","id","jwt_management","push","revokeTokens","handleLogout","delete","handleLogin","email","password","post","encodeURIComponent","handleTwoFactorAuth","code","authUser","accessToken","handleOAuth2Login","then","variants","rotate","closed","UpCircleIconMotion","Icon","DropdownIndicator","selectProps","components","UpCircleIcon","menuIsOpen","w","h","LoadingIndicator","Loader","OwnSelect","isInvalid","sx","zIndex","paddingX","boxShadow","backgroundColor","borderColor","undefined","_hover","cursor","outline","IndicatorSeparator","classNamePrefix","createColumns","cols","col","condition","AppTable","mapping","noDataMessage","initialSort","onUpdateSort","sort","setSort","rows","setRows","mappingObject","map","d","isReactNode","field","isActionsColumn","getColumnIcon","column","allFields","split","fieldExists","some","f","find","index","findIndex","startsWith","isNumeric","SortNumericDescendingIcon","SortAlphabeticalDescendingIcon","mx","SortNumericAscendingIcon","SortAlphabeticalAscendingIcon","handleSortChange","event","row","existsField","newSortArray","indexOf","splice","newSort","join","shiftKey","concat","replace","handleOnClick","sortable","getClassNames","classNames","clickable","selected","shouldCenter","isCentered","inHeader","onClick","className","textAlign","Date","rowKeys","Object","keys","active","deleted","mapTd","columnKey","highlighted","colSpan","memo","Pagination","forcePage","lastPage","onPaginate","useAlternativeColors","my","boxSizing","listStyle","display","userSelect","margin","textDecoration","marginRight","previousLabel","AngleLeftIcon","nextLabel","AngleRightIcon","breakLabel","breakClassName","pageCount","marginPagesDisplayed","pageRangeDisplayed","onPageChange","containerClassName","activeClassName","useThrottledState","thottledValue","setThrottledValue","throttled","useRef","throttle","current","Container","styled","div","axios","create","Accept","e","getErrors","AuthContext","AuthProvider","auth","AuthRoutes","lazy","AppRoutes","withRouter","useLocation","scrollTo","document","body","scrollTop","documentElement","pathname","fallback","ConfettiEffect","containerRef","dimensions","useDimensions","setWidth","setHeight","setDisplay","useUpdateEffect","contentBox","timeout","ref","numberOfPieces","recycle","tweenDuration","loadFragmentsFn","BudgetExportSuccessAlert","buttons","handleClose","size","restProps","cancelRef","React","queryString","URLSearchParams","search","showConfetti","useMemo","easterEgg","isOpen","motionPreset","leastDestructiveRef","onClose","CheckIcon","genericAlert","descr","onConfirm","WarningIcon","InfoCircleIcon","colorScheme","ml","dangerDeleteAlert","inputValue","setInputValue","confirmText","isConfirmTextValid","localeCompare","sensitivity","mt","onChange","target","isDisabled","budgetExportSuccess","AlertRoot","Component","alertList","closeOnOverlayClick","ModalABCValues","valueA","setValueA","valueB","setValueB","valueC","setValueC","handleSubmitValues","scrollBehavior","flexDirection","marginY","templateColumns","columnGap","rowGap","customInput","Input","displayType","placeholder","fixedDecimalScale","thousandSeparator","decimalSeparator","suffix","decimalScale","onValueChange","v","floatValue","ModalBaseAdd","mode","setDescription","modelType","descriptionRef","use_social_law","useSocialLaw","setUseSocialLaw","isAllStates","setIsAllStates","stateSelected","setStateSelected","localeList","setLocaleList","stateList","setStateList","selectedPriceType","setSelectedPriceType","isFindingStates","setIsFindingStates","isFindingLocales","setIsFindingLocales","setIsFindingPriceTypes","errors","setErrors","focus","statesToSelect","label","getStates","responseStates","states","getLocales","base_id","responseLocales","locales","getPriceTypes","responsePriceTypes","localesIds","locale","abbreviation","getStatesNameById","stateId","handleConfirm","formErrors","assign","model_type","price_types","newBase","newBaseId","put","columns","md","spacing","onKeyPress","toLocaleUpperCase","isReadOnly","mr","isChecked","checked","isMulti","s","isLoading","isClearable","Number","_disabled","border","hasArrow","InfoCircleFillIcon","ModalBaseSelect","bases","setBases","selectedBase","setSelectedBase","getBases","basesLoaded","basesToSelect","String","item","ModalBudgetCompositionObservation","budgetId","component","observation","setObservation","handleSubmitComponents","quantity","composition_price_id","composition_price","mb","composition","resize","FragmentTableRow","visibleColumns","renderRowSubComponent","getType","tableRow","original","fragment_type","getRowProps","getToggleRowExpandedProps","isExpanded","cells","cell","getCellProps","stopPropagation","toggleRowExpanded","getCustomCellProps","borderBottomColor","py","borderBottom","paddingY","isComposition","nextComponentId","fragment","nextComponentPriceTypeKey","price_type","FragmentsTable","isSubRow","parentFragments","registerLoadFragments","budget_id","budget_bases","component_id","locale_id","locale_key","price_type_id","price_type_key","getSummary","reloadTable","useModal","fragments","setFragments","isEditingFragment","setIsEditingFragment","qttySummary","setQttySummary","getData","fragmentsLoaded","newQttySummary","total_compositions","summary","total","total_inputs","newQuantity","coefficient","newUnitPrice","unit_price","isInput","getIcon","InfoIcon","GroupIcon","getInputIcon","classification","BricksIcon","TrafficConeIcon","ShovelIcon","CardAccountDetails","getInputIconType","handleRemoveFragment","resource","oldFragments","newFragments","handleUpdateQuantity","handleUpdateUnitPrice","price_id","Header","Cell","DownArrowIcon","RightArrowIcon","accessor","version","maxWidth","unit_measure","values","allowNegative","oldData","newData","borderTopRightRadius","borderBottomRightRadius","px","aria-label","SaveIcon","borderTopLeftRadius","borderBottomLeftRadius","CloseIcon","coefficient_was_changed","textDecor","maximumFractionDigits","coefficient_original","price","prefix","unit_price_was_changed","unit_price_original","IconButton","CogIcon","compositionId","getRowId","useTable","autoResetExpanded","useExpanded","getTableProps","getTableBodyProps","headerGroups","prepareRow","parent","fontStyle","headerGroup","getHeaderGroupProps","getHeaderProps","modalMargin","ModalCompositionEdit","setSummary","summaryLoaded","material","material_percent","equipment","equipment_percent","labor","labor_percent","third_party","third_party_percent","other","other_percent","fn","closeOnEsc","maxHeight","SummaryContainer","DollarSignIcon","number","leftIcon","PlusIcon","RefreshIcon","SearchFilter","budgetBases","onSubmit","useForm","handleSubmit","register","control","formState","selectedBaseVersion","setSelectedBaseVersion","selectedBaseLocale","setSelectedBaseLocale","selectedBasePriceType","setSelectedBasePriceType","classifications","setClassifications","selectedClassification","setSelectedClassification","isLoadingClassifications","setIsLoadingClassifications","classificationTypes","setClassificationTypes","selectedClassificationType","setSelectedClassificationType","isLoadingTypes","setIsLoadingTypes","unitMeasures","setUnitMeasures","selectedUnitMeasure","setSelectedUnitMeasure","isLoadingUnitMeasures","setIsLoadingUnitMeasures","prepareSubmit","getClassifications","baseId","classificationsLoaded","classificationsToSelect","getClassificationTypes","classificationId","classificationTypesLoaded","classificationTypesToSelect","getUnitMeasures","unitMeasuresLoaded","unitMeasuresToSelect","unitMeasure","handleBaseChange","baseSelected","handleClassificationChange","versionDescription","localeDescription","priceTypeDescription","rules","required","version_id","_readOnly","type_id","maxMenuHeight","FilterIcon","ModalBudgetCompositionFragmentSelect","activeTab","setActiveTab","compositions","setCompositions","pagination","setPagination","searchFilter","setSearchFilter","hasRequiredFilters","last_page","servicePagination","setServicePagination","selectedCompositions","setSelectedCompositions","processFilters","validFilter","classification_id","classification_type_id","unit_measure_id","getPrice","getStatePrice","isDefaultPrice","taxed","untaxed","processSort","sortString","isDesc","slice","compositionsData","newPagination","meta","handleDeleteComposition","c","_id","_source","prices","Array","from","prepareComponents","composition_id","oldPagination","rightIcon","ArrowRightIcon","_selected","marginX","p","pt","defaultValue","actions","prepared","handleSelectComposition","disabled","selectedPage","Table","tabIndex","TrashAltIcon","ModalBudgetCompositionLookup","ModalBudgetCompositionSelect","subStageId","saving","setSaving","fakeProgress","setFakeProgress","parent_stage_id","budget_base_id","b","interval","setInterval","oldProgress","clearInterval","Math","min","hasStripe","isAnimated","initialData","isSaving","isLoadingFilters","setIsLoadingFilters","defaultValues","clearErrors","setError","setQuantity","setLabor","setMaterial","setEquipment","setThirdPartyServices","setOther","unitPrice","setUnitPrice","total_value","totalValue","setTotalValue","unitPriceTotal","templateAreas","gridTemplateColumns","readOnly","ModalBudgetCustomCompositionAdd","getCustomComposition","budget_composition_price","social_law_price","third_party_services","immobilized","prepareCustomComponent","refund","handleSubmitComponent","Form","ModalBudgetGlobalPriceChange","client","budget","setMode","change","setChange","changeLabel","changeInputsProps","changeIcon","paddingBottom","isAllowedToChangeValue","approximateValue","n","decreased","difference","total_bdi","gross_total","payloadChangeType","payloadCalculationType","onConfirmSubmit","change_type","calculation_type","identification","type_person","fantasy_name","corporate_name","bdi_percent","prev","FlowStatusBadge","StatusCircle","ModalManageFlow","budgetData","setData","getUserName","document_type","borderTop","noOfLines","textOverflow","flow_status","formatDate","created_at","total_separate_percent","responsible","ModalBudgetInputFragmentSelect","inputs","setInputs","selectedInputs","setSelectedInputs","input","inputsData","handleDeleteInput","input_id","handleSelectInput","ChakraInput","ModalBudgetInputSelect","CompositionRow","isSiengeBudget","selectedComponents","handleSelectComponent","handleDeleteComponent","flexDir","MdiGroupIcon","outdated_price","InputRow","input_price","OutdatedComponentsBody","getRow","OutdatedComponentsTable","toggleSelectAllComponents","OutdatedComponentsTableBody","ModalBudgetOutdatedComponentSelect","setComponents","setSelectedComponents","componentsData","budget_components","ModalBudgetTypeSelect","setType","aria-selected","ModalClientLookup","clientList","setClientList","keyword","setKeyword","getClientList","clients","flexWrap","gridGap","phone","cell_phone","contact","FormClientLookup","htmlFor","cep","state_name","city_name","address","complement","district","setClient","getClient","client_id","clientLoaded","zip_code","city_id","prepareClient","ModalCompositionLookup","price_","stateDescriptionByKey","AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO","sortLocales","ModalCompositionPricesLookup","mappedPrices","entries","taxed_total","untaxed_total","composition_description","ModalEnterpriseLookup","setId","idInputRef","initialLoad","setInitialLoad","getEnterpriseList","enterprises","found","enterprisesData","SearchIcon","external_id","minWidth","enterprise","ModalGPTModel","model","setModel","prompt","setPrompt","baseStyle","flex","borderStyle","focusedStyle","selectedStyle","acceptStyle","rejectStyle","ModalImport","isLoadingBases","setIsLoadingBases","baseVersions","setBaseVersions","isLoadingBaseVersions","setIsLoadingBaseVersions","progress","setProgress","file","setFile","headerLine","setHeaderLine","getBaseVersions","baseVersionsLoaded","baseVersion","baseVersionsToSelect","onDrop","acceptedFiles","accept","useDropzone","getRootProps","getInputProps","isDragActive","isFocused","isDragAccept","isDragReject","header","formData","FormData","append","onUploadProgress","progressEvent","uploadPercentage","round","loaded","importId","mappedHeaders","mapped_header","headerRow","header_row","importedFile","baseName","versionName","fileName","newErrors","extensions","dropMessage","AnimatePresence","setHeaders","actualHeaders","isUpdatingHeader","setIsUpdatingHeader","newHeaderLine","setNewHeaderLine","type_","integration_code","composition_code","composition_type","class","untaxed_price","taxed_price","fields","setFields","mappedColumns","handleUpdateHeader","mapped_columns","modalMarginHeight","ImportStatusBadge","getBadgeColor","getBadgeDescription","hasCircle","ElementPreviewTableRow","_index","compositionCode","raw_data","ElementPreviewTable","importPreview","setImportPreview","setStatus","getImportPreview","responseData","shouldShowInputIcon","getInputTitle","nextCompositionCode","ImportPreviewTableRow","ImportPreviewTable","refetchInterval","setRefetchInterval","scrollingBody","targetElement","success","error","getImport","queryImport","useQuery","refetchOnWindowFocus","onSuccess","isImporting","isStoring","offsetTop","behavior","GlobeIcon","progress_bar","elapsed_for_humans","start_time_iso","progress_percent","remaining_for_humans","estimated_for_humans","line","ModalInputPricesLookup","inputs_description","themes","ModalJSONViewer","theme","setTheme","json","displayObjectSize","displayDataTypes","enableClipboard","copy","navigator","clipboard","writeText","ModalLocaleAndPriceTypeSelect","baseLocales","setBaseLocales","isLoadingBaseLocales","setIsLoadingBaseLocales","basePriceTypes","setBasePriceTypes","isLoadingPriceTypes","setIsLoadingPriceTypes","getBaseLocales","baseLocalesLoaded","baseLocale","prevErrors","baseLocalesToSelect","getBasePriceTypes","basePriceTypesLoaded","basePriceType","basePriceTypesToSelect","l","priceType","t","spin","keyframes","formatOptionLabel","spinAnimation","flexShrink","animation","selectedAction","setSelectedAction","actionList","actionsToSelect","getClientName","integrated_sienge","object_type","object_id","flow_key","ModalManageParametricFlow","build_description","selectedBaseObj","preparedComponents","ModalOwnInputSelect","ModalParametricBudgetHistory","BuildingDetailsPopover","placement","substr","maxW","overflowY","dangerouslySetInnerHTML","__html","typeMap","single_family_residence","affordable_housing_pp","multi_family_residence_r8","multi_family_residence_r16","social_interest_project","affordable_housing_rp1q","commercial_open_floors","commercial_offices_and_stores_csl8","commercial_offices_and_stores_csl16","industrial_warehouse","patternMap","ModalParametricBudgetLookup","parametricBudgets","getPatternDescription","buildType","pattern","BuildingDescriptionPopover","build_type","build_pattern","total_cost","parametricBudget","ModalPositionUpdate","setPosition","positionRef","targetPosition","constructive_unit_position","item_id","ModalSiengeOrganizationLookup","modalData","getOrganizations","organizations","organizationsData","user_info","org","ModalStageAdd","setTitle","titleRef","stage_id","valueAsNumber","getStatusBadge","ModalSubscriptionHistory","histories","reversedHistories","reverse","transaction_id","payment_method","paymentMethod","ModalSupport","WhatsAppIcon","boxSize","rel","MailIcon","ModalUnitConstructiveAdd","ModalUnitConstructiveLookup","unitConstructiveList","setUnitConstructiveList","getUnitConstructiveList","enterprise_id","units","unit","baseAdd","baseSelect","versionAdd","reference","referenceMonth","year","month","yearNum","monthNum","clientLookup","clientSelfLookup","ModalClientSelfLookup","compositionLookup","budgetCompositionLookup","compositionPriceLookup","inputPriceLookup","userInvite","emailValidator","yup","setEmail","setRole","isValid","group_id","Button","bgColor","_active","roleDescriptionByKey","budgetCompositionSelect","budgetCompositionFragmentSelect","budgetComponentObservation","ModalBudgetComponentObservation","budgetInputSelect","budgetInputFragmentSelect","stageAdd","positionUpdate","ownCompositionSelect","ModalOwnCompositionSelect","ownInputSelect","import","inputImportFields","ModalImportInputFields","compositionImportFields","ModalImportCompositionFields","importInputOverview","ModalImportInputOverview","importCompositionOverview","ModalImportCompositionOverview","budgetCompositionEdit","ModalBudgetCompositionEdit","subscriptionHistory","userOrganizationLookup","getOrganizationName","u","canCloseModal","email_verified_at","abcValues","support","budgetTypeSelect","enterpriseLookup","unitConstructiveLookup","jsonViewer","siengeOrganizationLookup","flowChange","budgetHistory","ModalBudgetHistory","parametricFlowChange","parametricBudgetHistory","gptModel","unitConstructiveAdd","parametricBudgetLookup","budgetCustomCompositionAdd","budgetOutdatedComponentSelect","localeAndPriceTypeSelect","budgetGlobalPriceChange","ModalRoot","modalList","Badge","defaultProps","FormLabel","_invalid","FormError","text","isRound","ecustos","errorBorderColor","transitionDuration","_focus","_placeholder","Select","pointerEvents","touchAction","ariaDisabled","Td","Tooltip","customTheme","extendTheme","config","brand","50","100","200","300","400","500","600","700","800","900","siengeRed","siengeBlue","purple","pink","yellow","green","lime","blue","oceanBlue","gray","indigo","styles","global","fonts","heading","mono","transitionTimingFunction","queryClient","QueryClient","App","DndProvider","backend","HTML5Backend","ReactDOM","StrictMode","getElementById","date","toFilterFormat","utcToZonedTime","centered","weight","TableContext","classes","Tbody","Thead","isValidElement","cloneElement","TdInner","narrowHeaders","noData","innerOnClick","data-testid","Consumer","TrInner","Children","child","childPro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SACX6c,cAAe,CAAExd,KAAM,SAAUC,GAAI,OACrCyF,IAAI,KACAjG,GARN,aAUGuH,GACC4T,IAAMk/B,SAASvnC,IAAIvL,GAAU,SAAC+yC,EAAO56C,GACnC,OACEyb,IAAMy+B,eAAeU,IACrBn/B,IAAM0+B,aAAaS,EAAO,CAAE56C,MAAKE,qB","file":"static/js/main.fcc3aa06.chunk.js","sourcesContent":["import { env } from 'shared/env';\n\nimport { createApiClient } from './axios';\n\nexport const api = createApiClient({\n baseURL: env('REACT_APP_API_URL'),\n});\n","import React from 'react';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { MdiReactIconComponentType } from 'mdi-react';\n\nimport {\n Box,\n BoxProps,\n Icon,\n IconProps,\n Heading,\n Text,\n Skeleton,\n Flex,\n} from '@chakra-ui/react';\n\nconst MotionBox = motion(Box);\n\ntype SummaryData = {\n // tooltipLabel: string;\n number: number | React.Component;\n formattedNumber: number | string;\n altNumber?: number | string | React.Component;\n formattedAltNumber?: number | string;\n complementaryNumber?: number | string;\n title: string | JSX.Element;\n render?: () => JSX.Element | null;\n icon?: StyledIcon | MdiReactIconComponentType | typeof Icon;\n colorSchemeType?: 'chakra' | 'manual';\n colorSchemeCard: string;\n};\ninterface SummaryCardProps extends BoxProps {\n isHidden: boolean;\n idx: number;\n data: SummaryData;\n typeNumber: 'currency' | 'number';\n loading?: boolean;\n}\n\nexport const SummaryHelper: React.FC = ({ children }) => {\n return (\n \n {children}\n \n );\n};\n\nexport const SummaryHelperIcon: React.FC = ({ ...props }) => {\n return (\n \n );\n};\n\nconst SummaryCard = (props: SummaryCardProps): React.ReactElement => {\n const {\n // children,\n idx,\n isHidden,\n loading,\n typeNumber = 'currency',\n data: summaryData,\n ...rest\n } = props;\n\n return (\n \n {!isHidden && (\n \n {/* \n \n \n \n */}\n\n \n {summaryData.icon && (\n \n \n \n )}\n\n \n {/* \n \n {summaryData.title}{' '}\n {summaryData.formattedAltNumber && (\n <>({summaryData.formattedAltNumber})\n )}\n \n\n \n {summaryData.formattedNumber}\n \n\n \n {summaryData.tooltipLabel}\n \n \n }\n > */}\n \n {loading ? (\n \n ) : (\n <>\n {typeNumber === 'currency' ? 'R$ ' : ''}\n {summaryData.formattedNumber}\n {summaryData.altNumber && (\n \n ({summaryData.altNumber})\n \n )}\n \n )}\n \n {/* */}\n\n {summaryData.complementaryNumber && (\n \n {summaryData.complementaryNumber}\n \n )}\n\n \n {summaryData.title}\n \n\n {summaryData.render && (\n {summaryData.render()}\n )}\n \n \n \n )}\n \n );\n};\n\nexport default SummaryCard;\n","import { createStandaloneToast } from '@chakra-ui/react';\n\nexport const toast = createStandaloneToast({\n defaultOptions: {\n position: 'top-right',\n variant: 'solid',\n isClosable: true,\n duration: 5000,\n },\n});\n","import { UserOrganization } from 'types/access-control';\n\nconst roles = {\n 'super-admin': {\n name: 'Super Admin',\n color: 'orange',\n },\n 'ecustos-admin': {\n name: 'Suporte',\n color: 'orange',\n },\n 'organization-admin': {\n name: 'Administrador',\n color: 'brand',\n },\n 'organization-user': {\n name: 'Gestor',\n color: 'blue',\n },\n 'group-admin': {\n name: 'Construtora',\n color: 'green',\n },\n manager: {\n name: 'Gerenciadora',\n color: 'purple',\n },\n default: {\n name: 'Usuário',\n color: 'gray',\n },\n};\n\ntype Key = keyof typeof roles;\n\nexport const getColorByRole = (roleArray: string[]): string => {\n for (let i = 0; i < roleArray.length; i += 1) {\n if (roleArray.includes(roleArray[i])) {\n return roles[roleArray[i] as Key].color;\n }\n }\n\n return roles.default.color;\n};\n\nexport const getRoleName = (roleArray: string[]): string => {\n for (let i = 0; i < roleArray.length; i += 1) {\n if (roleArray.includes(roleArray[i])) {\n return roles[roleArray[i] as Key].name;\n }\n }\n\n return roles.default.name;\n};\n\nexport const mergeRoles = (userData: UserOrganization): string[] => {\n return [\n userData.roles ? [...userData.roles] : [],\n userData.managed_organization?.roles\n ? [...userData.managed_organization.roles]\n : [],\n ].flat();\n};\n\nexport const getUserRoleName = (userData: UserOrganization): string => {\n const userRoles = mergeRoles(userData);\n return getRoleName(userRoles);\n};\n\nexport const SUPER_ADMIN = 'super-admin';\nexport const ECUSTOS_ADMIN = 'ecustos-admin';\nexport const ORGANIZATION_ADMIN = 'organization-admin';\nexport const ORGANIZATION_USER = 'organization-user';\nexport const GROUP_ADMIN = 'group-admin';\nexport const MANAGER = 'manager';\nexport const DEFAULT = 'default';\n\nconst is =\n (role: string) =>\n (user: UserOrganization): boolean => {\n const userRoles = mergeRoles(user);\n return userRoles.includes(role);\n };\n\nexport const isSuperAdmin = is(SUPER_ADMIN);\nexport const isEcustosAdmin = is(ECUSTOS_ADMIN);\nexport const isOrganizationAdmin = is(ORGANIZATION_ADMIN);\nexport const isOrganizationUser = is(ORGANIZATION_USER);\nexport const isGroupAdmin = is(GROUP_ADMIN);\nexport const isManager = is(MANAGER);\nexport const isDefault = is(DEFAULT);\n\nexport const isBankAccount = (user: UserOrganization): boolean => {\n return isOrganizationAdmin(user) || isOrganizationUser(user);\n};\n\nexport const isSuperOrEcustosAdmin = (user: UserOrganization): boolean => {\n return isSuperAdmin(user) || isEcustosAdmin(user);\n};\n\nexport const createCanFunction =\n (user: UserOrganization) =>\n (guard: (user: UserOrganization) => boolean): boolean => {\n if (isSuperOrEcustosAdmin(user)) {\n return true;\n }\n\n return guard(user);\n };\n","import { useContext } from 'react';\n\nimport AlertContext, { IAlertContext } from 'contexts/AlertContext';\n\nfunction useAlert(): IAlertContext {\n const alert = useContext(AlertContext);\n\n if (!alert) {\n throw new Error('You have to use \"useAlert()\" inside AlertProvider');\n }\n\n return alert;\n}\n\nexport type { AlertProps, IAlertContext } from 'contexts/AlertContext';\n\nexport default useAlert;\n","import { useState, useEffect, Dispatch, SetStateAction } from 'react';\n\ntype Response = [T, Dispatch>];\n\nfunction useDebouncedState(initialValue: T, delay = 300): Response {\n const [debouncedValue, setDebouncedValue] = useState(initialValue);\n const [value, setValue] = useState(initialValue);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return [debouncedValue, setValue];\n}\n\nexport default useDebouncedState;\n","import React from 'react';\nimport ReactApexCharts from 'react-apexcharts';\n\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { MdiReactIconComponentType } from 'mdi-react';\n\nimport {\n Box,\n BoxProps,\n Icon,\n Heading,\n Text,\n Skeleton,\n Flex,\n} from '@chakra-ui/react';\n\nconst MotionBox = motion(Box);\n\ntype SummaryData = {\n // tooltipLabel: string;\n number: number | React.Component;\n formattedNumber: number | string;\n altNumber?: number | string | React.Component;\n formattedAltNumber?: number | string;\n title: string | JSX.Element;\n icon?: StyledIcon | MdiReactIconComponentType | typeof Icon;\n colorSchemeType?: 'chakra' | 'manual';\n colorSchemeCard: string;\n\n chart: {\n colors: string[];\n labels: string[];\n series: number[];\n };\n};\ninterface SummaryDataChartCardProps extends BoxProps {\n isHidden: boolean;\n idx: number;\n data: SummaryData;\n typeNumber: 'currency' | 'number';\n loading?: boolean;\n}\n\nconst SummaryDataChartCard = (\n props: SummaryDataChartCardProps,\n): React.ReactElement => {\n const {\n idx,\n isHidden,\n loading,\n typeNumber = 'currency',\n data: summaryData,\n ...rest\n } = props;\n\n const hasAnyData = Boolean(\n summaryData.chart.series.reduce((acc, curr) => acc + curr, 0),\n );\n\n return (\n \n {!isHidden && (\n \n \n \n {summaryData.icon && (\n \n \n \n )}\n\n \n \n {loading ? (\n \n ) : (\n <>\n {typeNumber === 'currency' ? 'R$ ' : ''}\n {summaryData.formattedNumber}\n {summaryData.altNumber && (\n \n ({summaryData.altNumber})\n \n )}\n \n )}\n \n\n \n {summaryData.title}\n \n \n \n\n {hasAnyData && (\n \n )}\n \n \n )}\n \n );\n};\n\nexport default SummaryDataChartCard;\n","import React, { useState, createContext } from 'react';\n\nimport { AlertKey } from 'components/Alert/Root';\n\nexport interface AlertProps {\n type: 'info' | 'warning' | 'danger';\n title?: string;\n description?: string | (() => JSX.Element);\n buttons?: [string, string];\n /* eslint-disable-next-line */\n data?: Record;\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';\n /* eslint-disable-next-line */\n onConfirm?: (...args: any[]) => void;\n}\n\nexport interface Alert {\n key: AlertKey;\n props?: AlertProps;\n}\n\nexport interface IAlertContext {\n alerts: Alert[];\n openCustomAlert: (key: AlertKey, data?: AlertProps) => void;\n openAlert: (data: AlertProps) => void;\n closeAlert: (key: AlertKey) => void;\n}\n\nconst AlertContext = createContext({} as IAlertContext);\n\nexport const AlertProvider: React.FC = ({ children }) => {\n const [list, setList] = useState([]);\n\n const openCustomAlert = (key: AlertKey, props?: AlertProps): void => {\n setList((oldList) => [...oldList, { key, props }]);\n };\n\n const openAlert = (props: AlertProps): void => {\n openCustomAlert('genericAlert', props);\n };\n\n const closeAlert = (key: string): void => {\n setList((oldList) => oldList.filter((Alert) => Alert.key !== key));\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport type { AlertKey } from 'components/Alert/Root';\nexport default AlertContext;\n","import React, { useState, createContext } from 'react';\n\nimport { ModalKey } from 'components/Modal/Root';\n\nexport interface ModalProps {\n mode: 'edit' | 'add' | 'lookup' | 'select';\n /* eslint-disable-next-line */\n data?: Record;\n /* eslint-disable-next-line */\n onConfirm?: (...args: any[]) => void;\n}\n\nexport interface Modal {\n key: ModalKey;\n props?: ModalProps;\n}\n\nexport interface IModalContext {\n modals: Modal[];\n openModal: (key: ModalKey, data?: ModalProps) => void;\n closeModal: (key: ModalKey) => void;\n}\n\nconst ModalContext = createContext({} as IModalContext);\n\nexport const ModalProvider: React.FC = ({ children }) => {\n const [list, setList] = useState([]);\n\n const openModal = (key: ModalKey, props?: ModalProps): void => {\n setList((oldList) => [...oldList, { key, props }]);\n };\n\n const closeModal = (key: string): void => {\n setList((oldList) => oldList.filter((modal) => modal.key !== key));\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport type { ModalKey } from 'components/Modal/Root';\nexport default ModalContext;\n","export default __webpack_public_path__ + \"static/media/symbol.80676784.svg\";","import React from 'react';\n\nimport { Spinner, Image, Flex } from '@chakra-ui/react';\n\nimport logoSymbol from 'assets/img/symbol.svg';\n\nconst FallbackSpinner: React.FC = () => {\n return (\n \n \n \n \n );\n};\n\nexport default FallbackSpinner;\n","import React, { createContext, useState } from 'react';\n\nimport { useMediaQuery } from '@chakra-ui/react';\n\ninterface ISidebar {\n open: boolean;\n variant: 'sidebar';\n isMobile: boolean;\n isSticked: boolean;\n toggleSidebar(): void;\n toggleStick(): void;\n openSidebar(): void;\n closeSidebar(): void;\n}\n\nconst SidebarContext = createContext({} as ISidebar);\n\nexport const SidebarProvider: React.FC = ({ children }) => {\n const [open, setOpen] = useState(false);\n const [isSticked, setIsSticked] = useState(false);\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const toggleSidebar = (): void => {\n setOpen(!open);\n };\n\n const toggleStick = (): void => {\n setIsSticked(!isSticked);\n };\n\n const closeSidebar = (): void => setOpen(false);\n const openSidebar = (): void => setOpen(true);\n\n return (\n \n {children}\n \n );\n};\n\nexport default SidebarContext;\n","export const sidebarWidth = 300;\nexport const headerHeight = 80;\n\nexport const sidebarClosedWidth = 0;\nexport const sidebarOpenWidth = 300;\n\nexport default {\n cssVarPrefix: 'ecustos',\n defaultColorMode: 'light',\n useSystemColorMode: false,\n};\n","type Env =\n | 'REACT_APP_API_URL'\n | 'REACT_APP_OAUTH2_AUTHORIZATION_URL'\n | 'REACT_APP_OAUTH2_AUTHORIZATION_TENANT_URL'\n | 'REACT_APP_OAUTH2_CLIENT_ID'\n | 'REACT_APP_OAUTH2_REDIRECT_URI'\n | 'REACT_APP_REVERB_APP_KEY'\n | 'REACT_APP_REVERB_HOST'\n | 'REACT_APP_REVERB_WSS_PORT'\n | 'REACT_APP_REVERB_PORT'\n | 'REACT_APP_REVERB_SCHEME';\n\nexport const env = (key: Env): string => {\n const value = process.env[key];\n if (!value) throw new Error(`${key} is not set.`);\n return value;\n};\n","import { useState, useEffect, Dispatch, SetStateAction } from 'react';\n\ntype Response = [T, Dispatch>];\n\nconst persistedStateNamePrefix = '@persisted:';\n\nfunction usePersistedState(key: string, initialState: T): Response {\n const [state, setState] = useState(() => {\n const storageValue = localStorage.getItem(\n `${persistedStateNamePrefix}${key}`,\n );\n\n if (storageValue) {\n return JSON.parse(storageValue);\n }\n\n return initialState;\n });\n\n useEffect(() => {\n localStorage.setItem(\n `${persistedStateNamePrefix}${key}`,\n JSON.stringify(state),\n );\n }, [key, state]);\n\n return [state, setState];\n}\n\nexport default usePersistedState;\n","import { useCallback, useState } from 'react';\n\nimport Cookies from 'js-cookie';\n\ntype Value = string | null;\ntype UpdateCookie = (\n newValue: string,\n options?: Cookies.CookieAttributes,\n) => void;\ntype DeleteCookie = () => void;\n\nconst useCookie = (cookieName: string): [Value, UpdateCookie, DeleteCookie] => {\n const [value, setValue] = useState(\n () => Cookies.get(cookieName) || null,\n );\n\n const updateCookie = useCallback(\n (newValue: string, options?: Cookies.CookieAttributes) => {\n Cookies.set(cookieName, newValue, options);\n setValue(newValue);\n },\n [cookieName],\n );\n\n const deleteCookie = useCallback(() => {\n Cookies.remove(cookieName);\n setValue(null);\n }, [cookieName]);\n\n return [value, updateCookie, deleteCookie];\n};\n\nexport default useCookie;\n","import { useState, useEffect, useCallback } from 'react';\nimport { useHistory } from 'react-router-dom';\n\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { isSuperOrEcustosAdmin } from 'shared/roles';\nimport { toast } from 'shared/toast';\n\nimport { UserOrganization } from 'types/access-control';\n\nimport useCookies from './useCookies';\n\nexport type Organization = UserOrganization['managed_organization'];\n\nexport interface Auth {\n user: UserOrganization;\n token: string | null;\n jwtManagement: string | null;\n validating: boolean;\n loading: boolean;\n authenticated: boolean;\n userOrganizations: Organization[];\n handleLogin(email: string, password: string): Promise;\n handleTwoFactorAuth(email: string, code: string): Promise;\n handleOAuth2Login(code: string, state?: string): Promise;\n handleSelectOrganization(\n organizationId: number,\n userId: number,\n organizationJwt: string,\n ): Promise;\n shouldRedirectToAnotherFrontend(organization: Organization): boolean;\n handleLogout(): void;\n revokeTokens(): void;\n getAuth(): Promise;\n}\n\nconst domain = process.env.NODE_ENV === 'development' ? '' : '.ecustos.com.br';\n\nconst cookieOptions = {\n path: '/',\n domain,\n expires: 15, // 15 days\n};\n\nconst getCookieKeys = (): [string, string] => {\n const env = process.env.REACT_APP_ECUSTOS_ENV;\n\n if (env === 'production') {\n return ['ecustos-auth-prd', 'ecustos-jwt-prd'];\n }\n\n if (env === 'staging') {\n return ['ecustos-auth-stg', 'ecustos-jwt-stg'];\n }\n\n return ['ecustos-auth-dev', 'ecustos-jwt-dev'];\n};\n\nfunction useAuth(): Auth {\n const history = useHistory();\n\n const [loading, setLoading] = useState(false);\n const [authenticated, setAuthenticated] = useState(false);\n\n const [cookieTokenKey, cookieJwtKey] = getCookieKeys();\n\n const [token, setToken, removeToken] = useCookies(cookieTokenKey);\n const [jwtManagement, setJwt, removeJwt] = useCookies(cookieJwtKey);\n\n const [userOrganizations, setUserOrganizations] = useState(\n [],\n );\n\n const [validating, setValidating] = useState(true);\n\n const [user, setUser] = useState({} as UserOrganization);\n\n const shouldRedirectToAnotherFrontend = useCallback(\n ({ organization }: Organization): boolean => {\n if (!organization.url) {\n return false;\n }\n\n if (process.env.NODE_ENV === 'development') {\n return false;\n }\n\n const currentFrontend = window.location.href;\n const targetFrontend = organization.url;\n\n const currentUrl = new URL(currentFrontend);\n const targetUrl = new URL(targetFrontend);\n\n return currentUrl.hostname !== targetUrl.hostname;\n },\n [],\n );\n\n const getAuth = useCallback(async () => {\n setValidating(true);\n\n try {\n const { data: userInfo } = await api.get('/auth');\n\n const userOrganization = userInfo.data?.managed_organization;\n\n if (\n userOrganization &&\n shouldRedirectToAnotherFrontend(userOrganization)\n ) {\n window.location.href = userOrganization.organization.url;\n }\n\n setUser(userInfo.data);\n setAuthenticated(true);\n } catch (err) {\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n\n toast({\n description: 'Sessão expirada! Faça login novamente.',\n status: 'warning',\n });\n } finally {\n setValidating(false);\n }\n }, [\n removeToken,\n removeJwt,\n setUser,\n setAuthenticated,\n shouldRedirectToAnotherFrontend,\n ]);\n\n const getUserOrganizationDefault = useCallback(\n async (organizationId = null, userId = null) => {\n setLoading(true);\n\n try {\n const { data: userInfo } = await api.get('/user/organization/default', {\n params: {\n ...(organizationId && { organization_id: organizationId }),\n ...(userId && { user_id: userId }),\n },\n });\n return userInfo.data;\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data.message ||\n 'Houve um erro ao buscar as informações do usuário.',\n status: 'error',\n });\n\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n }\n } finally {\n setLoading(false);\n }\n\n return null;\n },\n [removeToken, removeJwt, setUser, setAuthenticated],\n );\n\n const handleSelectOrganization = useCallback(\n async (organizationId, userId, organizationJwt) => {\n api.defaults.headers.common['JWT-Management'] = organizationJwt;\n await getUserOrganizationDefault(organizationId, userId);\n\n setJwt(organizationJwt, cookieOptions);\n setAuthenticated(true);\n },\n [setJwt, setAuthenticated, getUserOrganizationDefault],\n );\n\n const getUserOrganizations = useCallback(\n async (userId, force?: boolean) => {\n setLoading(true);\n\n try {\n const { data: userOrganizationsLoaded } = await api.get(\n '/organization/user',\n {\n params: {\n page: 1,\n per_page: 100,\n 'filter[user_id]': userId,\n },\n },\n );\n\n if (userOrganizationsLoaded.data.length === 1) {\n const [userOrganization] = userOrganizationsLoaded.data;\n const organizationId = userOrganization.organization.id;\n const organizationJwt = userOrganization.jwt_management;\n\n if (shouldRedirectToAnotherFrontend(userOrganization)) {\n window.location.href = userOrganization.organization.url;\n }\n\n await handleSelectOrganization(\n organizationId,\n userId,\n organizationJwt,\n );\n\n if (!force) history.push('/');\n\n return;\n }\n\n setUserOrganizations(userOrganizationsLoaded.data);\n\n history.push('/organization');\n } catch (err) {\n toast({\n description:\n err.response?.data.message ||\n 'Houve um erro ao buscar as informações do usuário.',\n status: 'error',\n });\n\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n } finally {\n setLoading(false);\n }\n },\n [\n history,\n handleSelectOrganization,\n removeToken,\n removeJwt,\n setUser,\n setAuthenticated,\n shouldRedirectToAnotherFrontend,\n ],\n );\n\n const revokeTokens = useCallback(() => {\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n }, [removeToken, removeJwt, setUser, setAuthenticated]);\n\n const handleLogout = useCallback(\n (force?: boolean): void => {\n setValidating(true);\n\n try {\n if (!force) {\n api.delete('/auth');\n }\n } finally {\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n\n history.push('/');\n }\n },\n [history, removeToken, removeJwt],\n );\n\n const handleLogin = async (\n email: string,\n password: string,\n ): Promise => {\n try {\n await api.post('/auth', {\n email,\n password,\n });\n\n history.push(`/2fa?email=${encodeURIComponent(email)}`);\n } catch (err) {\n if (isAxiosError(err)) {\n const message =\n err.response?.data.message ||\n 'Houve um erro inesperado ao realizar o login.';\n throw new Error(message);\n }\n }\n };\n\n const handleTwoFactorAuth = async (\n email: string,\n code: string,\n ): Promise => {\n try {\n const authUser = await api.post('/auth/code', {\n email,\n code,\n });\n\n const accessToken = authUser.data?.accessToken;\n const userId = authUser.data?.token.user_id;\n\n if (accessToken) {\n api.defaults.headers.Authorization = `Bearer ${accessToken}`;\n setToken(accessToken, cookieOptions);\n\n const userInfo = await getUserOrganizationDefault(null, null);\n\n if (isSuperOrEcustosAdmin(userInfo)) {\n getAuth();\n history.push('/');\n } else {\n getUserOrganizations(userId);\n }\n }\n } catch (err) {\n if (isAxiosError(err)) {\n const message =\n err.response?.data.message ||\n 'Houve um erro inesperado ao realizar o login.';\n throw new Error(message);\n }\n }\n };\n\n const handleOAuth2Login = async (\n code: string,\n state?: string,\n ): Promise => {\n try {\n const authUser = await api.get('/auth/sienge-id/callback', {\n params: {\n code,\n state,\n },\n });\n\n const accessToken = authUser.data?.['0'].accessToken;\n const userId = authUser.data?.['0'].token.user_id;\n\n if (accessToken) {\n api.defaults.headers.Authorization = `Bearer ${accessToken}`;\n setToken(accessToken, cookieOptions);\n\n const userInfo = await getUserOrganizationDefault(null, null);\n\n if (isSuperOrEcustosAdmin(userInfo)) {\n getAuth();\n history.push('/');\n } else {\n getUserOrganizations(userId, true);\n }\n }\n } catch (err) {\n if (isAxiosError(err)) {\n const message =\n err.response?.data.message ||\n 'Houve um erro inesperado ao realizar o login.';\n throw new Error(message);\n }\n }\n };\n\n useEffect(() => {\n if (token && jwtManagement) {\n api.defaults.headers.Authorization = `Bearer ${token}`;\n api.defaults.headers.common['JWT-Management'] = jwtManagement;\n\n getAuth().then(() => {\n // history.push('/');\n });\n } else {\n setValidating(false);\n setAuthenticated(false);\n setUser({} as UserOrganization);\n }\n }, [token, jwtManagement, getAuth, history]);\n\n return {\n authenticated,\n user,\n validating,\n token,\n jwtManagement,\n userOrganizations,\n loading,\n handleLogin,\n handleTwoFactorAuth,\n handleOAuth2Login,\n handleSelectOrganization,\n shouldRedirectToAnotherFrontend,\n handleLogout,\n revokeTokens,\n getAuth,\n };\n}\n\nexport type { UserOrganization };\nexport default useAuth;\n","import React from 'react';\nimport { components, DropdownIndicatorProps } from 'react-select';\n\nimport { ChevronUp as UpCircleIcon } from '@styled-icons/entypo/ChevronUp';\nimport { motion } from 'framer-motion';\n\nimport { Icon } from '@chakra-ui/react';\n\nconst variants = {\n open: { rotate: 0 },\n closed: { rotate: 180 },\n};\n\nconst UpCircleIconMotion = motion(Icon);\n\nconst DropdownIndicator: React.FC = (props) => {\n const { selectProps } = props;\n\n return (\n components.DropdownIndicator && (\n \n \n \n )\n );\n};\n\nexport default DropdownIndicator;\n","import React from 'react';\nimport { components, LoadingIndicatorProps } from 'react-select';\n\nimport Loader from 'components/Loader';\n\nconst LoadingIndicator: React.FC = (props) => {\n return (\n components.LoadingIndicator && (\n \n \n \n )\n );\n};\n\nexport default LoadingIndicator;\n","import React from 'react';\nimport ReactSelect, { Props as ReactSelectProps } from 'react-select';\n\nimport { Box } from '@chakra-ui/react';\n\nimport DropdownIndicator from './components/DropdownIndicator';\nimport LoadingIndicator from './components/LoadingIndicator';\n\nexport type SelectedValue = {\n value: string;\n label: string;\n};\n\nexport type SelectedValues = SelectedValue[];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype OwnSelectProps = ReactSelectProps & {\n isInvalid?: boolean;\n};\n\nconst OwnSelect: React.FC = (props) => {\n const { isInvalid } = props;\n\n return (\n \n \n \n );\n};\n\nexport default OwnSelect;\n","import React, { memo, useState, useEffect, useCallback } from 'react';\n\nimport classNames from 'classnames';\nimport SortAlphabeticalAscendingIcon from 'mdi-react/SortAlphabeticalAscendingIcon';\nimport SortAlphabeticalDescendingIcon from 'mdi-react/SortAlphabeticalDescendingIcon';\nimport SortNumericAscendingIcon from 'mdi-react/SortNumericAscendingIcon';\nimport SortNumericDescendingIcon from 'mdi-react/SortNumericDescendingIcon';\n\nimport { TableContainer, Icon } from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport { Table, Thead, Tbody, Tr, Th, Td } from 'components/Table';\n\ntype OnClick = React.MouseEvent;\n\ntype Row = {\n field: string;\n description: Data;\n sortable?: boolean;\n condition?: boolean;\n isNumeric?: boolean;\n isCentered?: boolean;\n};\n\ntype KeyExtractor = { id: string | number };\ntype ActionColumn = { actions: JSX.Element | null };\ntype TableRows = Array;\n\ntype Data =\n | string\n | number\n | boolean\n | Date\n | typeof Function\n | JSX.Element\n | null;\ntype TableData = { [key: string]: Data };\n\ntype MappingFunction = (item: T) => TableData & KeyExtractor & ActionColumn;\n\ninterface TableProps {\n cols: TableRows;\n mapping: MappingFunction;\n data: Array;\n noDataMessage?: string;\n initialSort?: string;\n onUpdateSort?: (sort: string) => void;\n loading?: boolean;\n}\n\nexport function createColumns(cols: Array): Array {\n return cols.filter((col) => {\n if ('condition' in col) {\n return col.condition;\n }\n\n return true;\n });\n}\n\nconst AppTable = ({\n cols,\n mapping,\n data = [],\n noDataMessage = 'Nenhum resultado encontrado. Atualize os filtros e pequise novamente',\n initialSort = '',\n onUpdateSort,\n loading = false,\n}: TableProps): React.ReactElement => {\n const [sort, setSort] = useState(initialSort);\n const [rows, setRows] = useState([]);\n\n useEffect(() => {\n const mappingObject = data.map((d) => mapping(d));\n\n setRows(mappingObject);\n }, [data, mapping]);\n\n const isReactNode = useCallback(\n ({ field }: Row) => typeof field === 'function',\n [],\n );\n\n const isActionsColumn = useCallback(\n ({ field }: Row) => typeof field === 'string' && field === 'actions',\n [],\n );\n\n const getColumnIcon = useCallback(\n (column: Row): React.ReactNode => {\n const allFields = sort.split(',');\n\n const fieldExists = allFields.some(\n (f) => f === column.field || f === `-${column.field}`,\n );\n const field = allFields.find((f) => f.includes(column.field));\n const index = allFields.findIndex((f) => f.includes(column.field));\n\n if (fieldExists && index >= 0) {\n if (!isActionsColumn(column)) {\n return field?.startsWith('-') ? (\n \n ) : (\n \n );\n }\n }\n\n return null;\n },\n [sort, isActionsColumn],\n );\n\n const handleSortChange = useCallback(\n (event: OnClick, row: Row) => {\n const allFields = sort.split(',');\n const existsField = allFields.findIndex((f) => f.includes(row.field));\n\n if (existsField === -1) {\n if (event.shiftKey) {\n const newSort = sort\n .concat(`,${row.field}`)\n .replace(/^,/, '')\n .replace(/^-/, '');\n\n setSort(newSort);\n onUpdateSort?.(newSort);\n } else {\n setSort(row.field);\n onUpdateSort?.(row.field);\n }\n\n return;\n }\n\n const field = allFields.find((f) => f.includes(row.field));\n\n const newSortArray = allFields;\n\n if (existsField >= 0 && field) {\n const index = allFields.indexOf(field);\n newSortArray[index] = `-${field}`;\n }\n\n if (existsField >= 0 && field?.startsWith('-')) {\n const index = allFields.indexOf(field);\n newSortArray.splice(index, 1);\n }\n\n const newSort = newSortArray.join(',');\n setSort(newSort);\n onUpdateSort?.(newSort);\n },\n [sort, onUpdateSort],\n );\n\n const handleOnClick = useCallback(\n (col: Row) => {\n return (event: OnClick) => {\n return (\n !isReactNode(col) &&\n !isActionsColumn(col) &&\n !('sortable' in col && col.sortable === false) &&\n typeof col.description !== 'object' &&\n handleSortChange(event, col)\n );\n };\n },\n [handleSortChange, isActionsColumn, isReactNode],\n );\n\n const getClassNames = useCallback(\n (col) => {\n return classNames({\n clickable:\n !isActionsColumn(col) &&\n !('sortable' in col && col.sortable === false) &&\n typeof col.description !== 'object',\n\n selected:\n !isActionsColumn(col) &&\n sort.split(',').some((f) => f === col.field || f === `-${col.field}`),\n });\n },\n [isActionsColumn, sort],\n );\n\n const shouldCenter = useCallback(\n (col: Row) => {\n if (isActionsColumn(col)) return true;\n return col.isCentered;\n },\n [isActionsColumn],\n );\n\n return (\n \n \n \n \n {cols.map((col) => {\n return (\n \n {typeof col.description !== 'string' &&\n typeof col.description !== 'number' &&\n typeof col.description !== 'boolean' &&\n typeof col.description !== 'object' &&\n !(col.description instanceof Date)\n ? col.description()\n : col.description}\n\n {!isReactNode(col) ? getColumnIcon(col) : null}\n \n );\n })}\n \n \n\n \n {!loading &&\n rows.map((row) => {\n const rowKeys = Object.keys(row);\n const key = row.id;\n\n if (typeof key !== 'number' && typeof key !== 'string') {\n const error = `Invalid row key. You need an alphanumeric id in the mapping object.`;\n throw new Error(error);\n }\n\n const active = rowKeys.includes('active') && row.active === true;\n const deleted =\n rowKeys.includes('deleted') && row.deleted === true;\n\n const mapTd = cols.map((col, index) => {\n const value = row[col.field];\n\n return (\n \n {value || '-'}\n \n );\n });\n\n return (\n \n {mapTd}\n \n );\n })}\n\n {loading && (\n \n \n \n )}\n\n {!loading && data.length === 0 && (\n \n \n \n )}\n \n
\n \n
\n {noDataMessage}\n
\n
\n );\n};\n\nexport default memo(AppTable) as typeof AppTable;\n","import React from 'react';\nimport ReactPaginate from 'react-paginate';\n\nimport { AngleLeft as AngleLeftIcon } from '@styled-icons/fa-solid/AngleLeft';\nimport { AngleRight as AngleRightIcon } from '@styled-icons/fa-solid/AngleRight';\n\nimport { Flex, Icon } from '@chakra-ui/react';\n\ntype PaginationProps = {\n lastPage: number;\n forcePage?: number;\n onPaginate(selectedPage: number): void;\n useAlternativeColors?: boolean;\n};\n\nconst Pagination: React.FC = ({\n forcePage,\n lastPage,\n onPaginate,\n useAlternativeColors = false,\n}) => {\n return (\n \n }\n nextLabel={}\n breakLabel=\"...\"\n breakClassName=\"break-me\"\n pageCount={lastPage}\n forcePage={forcePage}\n marginPagesDisplayed={2}\n pageRangeDisplayed={3}\n onPageChange={({ selected }) => {\n onPaginate(selected + 1);\n }}\n containerClassName={\n useAlternativeColors ? 'pagination-fragment' : 'pagination'\n }\n activeClassName=\"active\"\n />\n \n );\n};\n\nexport default Pagination;\n","import { useState, useEffect, useRef, Dispatch, SetStateAction } from 'react';\n\nimport throttle from 'lodash/throttle';\n\ntype Response = [T, Dispatch>];\n\nfunction useThrottledState(initialValue: T, delay = 300): Response {\n const [thottledValue, setThrottledValue] = useState(initialValue);\n const [value, setValue] = useState(initialValue);\n\n const throttled = useRef(\n throttle((newValue: T) => setThrottledValue(newValue), delay),\n );\n\n useEffect(() => {\n if (throttled.current) {\n throttled.current(value);\n }\n }, [throttled, value]);\n\n return [thottledValue, setValue];\n}\n\nexport default useThrottledState;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n overflow: hidden;\n`;\n","import React from 'react';\n\nimport { Spinner, SpinnerProps } from '@chakra-ui/react';\n\nimport { Container } from './styles';\n\nconst Loader: React.FC = (props) => {\n return (\n \n \n \n );\n};\n\nexport default Loader;\n","import axios, { AxiosError, AxiosInstance } from 'axios';\n\ntype ApiClientOptions = {\n baseURL: string;\n};\n\nexport const createApiClient = (options: ApiClientOptions): AxiosInstance => {\n const client = axios.create({\n baseURL: options.baseURL,\n headers: {\n Accept: 'application/json',\n },\n });\n\n return client;\n};\n\nexport const isAxiosError = (e: unknown): e is AxiosError => {\n if (typeof e !== 'object') return false;\n if (e == null) return false;\n return 'response' in e;\n};\n\nexport const getErrors = (e?: string[]): string => {\n return e ? e.join(', ') : '';\n};\n","import React, { createContext } from 'react';\n\nimport useAuth, { Auth, UserOrganization } from 'hooks/useAuth';\n\nconst AuthContext = createContext({} as Auth);\n\nexport const AuthProvider: React.FC = ({ children }) => {\n const auth = useAuth();\n\n return {children};\n};\n\nexport type { UserOrganization };\nexport default AuthContext;\n","import React, { Suspense, lazy, useContext, useEffect } from 'react';\nimport { withRouter, useLocation } from 'react-router-dom';\n\nimport FallbackSpinner from 'components/FallbackSpinner';\n\nimport AuthContext from 'contexts/AuthContext';\nimport { SidebarProvider } from 'contexts/SidebarContext';\n\nconst AuthRoutes = lazy(() => import('./AuthRoutes'));\nconst AppRoutes = lazy(() => import('./AppRoutes'));\n\nconst Routes: React.FC = () => {\n const location = useLocation();\n\n const { authenticated, validating } = useContext(AuthContext);\n\n useEffect(() => {\n window.scrollTo({ top: 0 });\n\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }, [location.pathname]);\n\n if (validating) {\n return ;\n }\n\n return (\n }>\n \n {authenticated ? : }\n \n \n );\n};\n\nexport default withRouter(Routes);\n","import React, { useRef, useState, useEffect } from 'react';\nimport Confetti from 'react-confetti';\n\nimport { Flex, useDimensions, useUpdateEffect } from '@chakra-ui/react';\n\nconst ConfettiEffect: React.FC = () => {\n const containerRef = useRef(null);\n const dimensions = useDimensions(containerRef, true);\n\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n\n const [display, setDisplay] = useState(true);\n\n useUpdateEffect(() => {\n if (dimensions?.contentBox) {\n setWidth(dimensions.contentBox.width);\n\n setHeight(dimensions.contentBox.height);\n }\n }, [dimensions]);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setDisplay(false);\n }, 5000);\n\n return () => clearTimeout(timeout);\n }, []);\n\n if (!display) {\n return null;\n }\n\n return (\n \n \n \n );\n};\n\nexport default ConfettiEffect;\n","import React, { useMemo } from 'react';\nimport { useLocation } from 'react-router-dom';\n\nimport { CheckCircleFill as CheckIcon } from '@styled-icons/bootstrap/CheckCircleFill';\n\nimport {\n AlertDialog,\n AlertDialogBody,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogContent,\n AlertDialogOverlay,\n AlertDialogCloseButton,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport { AlertRootProps } from 'components/Alert/Root';\nimport ConfettiEffect from 'components/ConfettiEffect';\n\nfunction useQueryString(): URLSearchParams {\n return new URLSearchParams(useLocation().search);\n}\n\nconst BudgetExportSuccessAlert: React.FC = ({\n buttons,\n handleClose,\n size = 'lg',\n ...restProps\n}) => {\n const cancelRef = React.useRef(null);\n const queryString = useQueryString();\n\n const showConfetti = useMemo(() => {\n const easterEgg = queryString.get('easter-egg');\n if (!easterEgg) return false;\n\n return easterEgg === 'confete';\n }, [queryString]);\n\n return (\n \n \n {showConfetti && }\n\n \n \n Deu tudo certo!\n \n\n \n\n \n \n Orçamento enviado com sucesso para o Sienge!\n \n \n\n \n \n \n \n \n );\n};\n\nexport default BudgetExportSuccessAlert;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { Plus as PlusIcon } from '@styled-icons/bootstrap/Plus';\nimport { DollarSign as DollarSignIcon } from '@styled-icons/fa-solid/DollarSign';\nimport { Refresh as RefreshIcon } from '@styled-icons/material-twotone/Refresh';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n Flex,\n Text,\n Box,\n useMediaQuery,\n ModalFooter,\n HStack,\n Button,\n Icon,\n IconButton,\n ModalCloseButton,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport SummaryContainer from 'components/SummaryContainer';\nimport SummaryDataChartCard from 'components/SummaryDataChartCard';\n\nimport useModal from 'hooks/useModal';\n\nimport { Budget } from 'types/budget';\n\nimport FragmentsTable, { FragmentSummary } from './FragmentsTable';\n\ntype Props = ModalRootProps & {\n data: {\n id: number;\n budget_id: number;\n budget_bases: Budget['bases'];\n locale_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n code: string;\n base: string;\n description: string;\n price: number;\n classification: string;\n type: string;\n unit_measure: string;\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\ntype LoadFragmentsFn = () => Promise;\nlet loadFragmentsFn: LoadFragmentsFn;\n\nconst ModalCompositionEdit: React.FC = ({\n data,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [loading, setLoading] = useState(false);\n const [summary, setSummary] = useState(\n {} as FragmentSummary,\n );\n\n const { openModal } = useModal();\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const getSummary = useCallback(async () => {\n setLoading(true);\n setSummary({} as FragmentSummary);\n\n try {\n const { data: response } = await api.get(\n `budget/${data.budget_id}/composition/${data.id}/price`,\n {\n params: {\n 'filter[locale_id]': data.locale_id,\n 'filter[price_type_id]': data.price_type_id,\n },\n },\n );\n\n const [summaryLoaded] = response.data;\n\n setSummary({\n total: summaryLoaded.total,\n material: summaryLoaded.material,\n material_percent: summaryLoaded.material_percent,\n equipment: summaryLoaded.equipment,\n equipment_percent: summaryLoaded.equipment_percent,\n labor: summaryLoaded.labor,\n labor_percent: summaryLoaded.labor_percent,\n third_party: summaryLoaded.third_party,\n third_party_percent: summaryLoaded.third_party_percent,\n other: summaryLoaded.other,\n other_percent: summaryLoaded.other_percent,\n });\n } catch (err) {\n setSummary({} as FragmentSummary);\n } finally {\n setLoading(false);\n }\n }, [data]);\n\n useEffect(() => {\n getSummary();\n }, [getSummary]);\n\n const registerLoadFragments = useCallback((fn: LoadFragmentsFn) => {\n loadFragmentsFn = fn;\n }, []);\n\n const handleConfirm = (): void => {\n if (onConfirm) {\n onConfirm();\n }\n\n handleClose();\n };\n\n return (\n \n \n \n Editar composição\n\n \n\n \n \n \n \n\n \n \n Código\n \n {data.code} / {data.base}\n \n \n\n \n Descrição\n \n {data.description}\n \n \n \n\n \n \n Valor unitário\n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(summary.total || 0)}\n \n \n\n \n Classe\n \n {data.classification}\n \n \n\n \n Tipo\n \n {data.type}\n \n \n\n \n Unidade\n \n {data.unit_measure}\n \n \n \n\n \n }\n colorScheme=\"orange\"\n size=\"md\"\n onClick={() => {\n openModal('budgetCompositionFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: data.budget_id,\n compositionId: data.id,\n bases: data.budget_bases,\n },\n onConfirm: () => {\n loadFragmentsFn();\n getSummary();\n },\n });\n }}\n >\n Adicionar composição\n \n\n }\n size=\"md\"\n onClick={() => {\n openModal('budgetInputFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: data.budget_id,\n compositionId: data.id,\n bases: data.budget_bases,\n },\n onConfirm: () => {\n loadFragmentsFn();\n getSummary();\n },\n });\n }}\n >\n Adicionar insumo\n \n\n }\n isLoading={loading}\n isDisabled={loading}\n onClick={() => {\n loadFragmentsFn();\n getSummary();\n }}\n />\n \n\n \n \n\n \n \n \n Finalizar\n \n \n \n \n \n );\n};\n\nexport default ModalCompositionEdit;\n","import BudgetExportSuccessAlert from 'components/Alert/BudgetExportSuccess';\nimport DangerDeleteAlert from 'components/Alert/DangerDelete';\nimport GenericAlert from 'components/Alert/Generic';\n\nexport default {\n genericAlert: GenericAlert,\n dangerDeleteAlert: DangerDeleteAlert,\n budgetExportSuccess: BudgetExportSuccessAlert,\n};\n","import React, { useMemo } from 'react';\n\nimport { InfoCircleFill as InfoCircleIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { Warning as WarningIcon } from '@styled-icons/fluentui-system-filled/Warning';\n\nimport {\n AlertDialog,\n AlertDialogBody,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogContent,\n AlertDialogOverlay,\n AlertDialogCloseButton,\n Button,\n Icon,\n} from '@chakra-ui/react';\n\nimport { AlertRootProps } from 'components/Alert/Root';\n\nconst GenericAlert: React.FC = ({\n type,\n title,\n description,\n buttons,\n onConfirm,\n handleClose,\n size = 'md',\n ...restProps\n}) => {\n const cancelRef = React.useRef(null);\n\n const getAlertDescription = (\n descr?: string | (() => JSX.Element),\n ): string | JSX.Element => {\n if (descr) {\n return typeof descr === 'string' ? descr : descr();\n }\n\n return '';\n };\n\n const icon = useMemo((): JSX.Element => {\n if (type === 'danger') {\n return ;\n }\n\n if (type === 'warning') {\n return ;\n }\n\n return ;\n }, [type]);\n\n const colorScheme = useMemo(() => {\n if (type === 'danger') {\n return 'red';\n }\n\n if (type === 'warning') {\n return 'orange';\n }\n\n return 'blue';\n }, [type]);\n\n return (\n \n \n\n \n \n {icon} {title}\n \n\n \n\n {getAlertDescription(description)}\n\n \n \n\n {\n if (onConfirm) onConfirm();\n handleClose();\n }}\n >\n {buttons?.[1] || 'Confirmar'}\n \n \n \n \n );\n};\n\nexport default GenericAlert;\n","import React from 'react';\n\nimport { InfoCircleFill as InfoCircleIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { Warning as WarningIcon } from '@styled-icons/fluentui-system-filled/Warning';\n\nimport {\n AlertDialog,\n AlertDialogBody,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogContent,\n AlertDialogOverlay,\n AlertDialogCloseButton,\n Button,\n Icon,\n Text,\n Input,\n} from '@chakra-ui/react';\n\nimport { AlertRootProps } from 'components/Alert/Root';\n\ninterface DangerDeleteAlertProps extends AlertRootProps {\n data: {\n confirmText: string;\n };\n}\n\nconst DangerDeleteAlert: React.FC = ({\n type,\n title,\n description,\n buttons,\n data,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [inputValue, setInputValue] = React.useState('');\n const confirmText = data?.confirmText || 'excluir';\n\n const cancelRef = React.useRef(null);\n\n const getAlertDescription = (\n descr?: string | (() => JSX.Element),\n ): string | JSX.Element => {\n if (descr) {\n return typeof descr === 'string' ? descr : descr();\n }\n\n return '';\n };\n\n const isConfirmTextValid =\n inputValue.localeCompare(confirmText, undefined, {\n sensitivity: 'accent',\n }) === 0;\n\n return (\n \n \n\n \n \n {type === 'danger' ? (\n \n ) : (\n \n )}{' '}\n {title}\n \n\n \n\n \n <>\n {getAlertDescription(description)}\n\n \n Para confirmar a exclusão digite {confirmText} no\n campo abaixo:\n \n\n setInputValue(e.target.value)}\n />\n \n \n\n \n \n\n {\n if (onConfirm) onConfirm();\n handleClose();\n }}\n >\n {buttons?.[1] || 'Confirmar'}\n \n \n \n \n );\n};\n\nexport default DangerDeleteAlert;\n","import React from 'react';\n\nimport useAlert, { AlertProps } from 'hooks/useAlert';\n\nimport alertList from './alertList';\n\nexport interface AlertRootProps extends AlertProps {\n handleClose: () => void;\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\n\nexport type AlertKey = keyof typeof alertList;\n\nconst AlertRoot: React.FC = () => {\n const { alerts, closeAlert } = useAlert();\n\n return (\n <>\n {alerts.map(({ key, props }) => {\n const Component = alertList[key];\n\n if (!Component) return null;\n\n return (\n closeAlert(key)}\n handleClose={() => closeAlert(key)}\n closeOnOverlayClick={false}\n {...props}\n />\n );\n })}\n \n );\n};\n\nexport default AlertRoot;\n","import React, { useCallback, useState } from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Input,\n HStack,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nconst ModalABCValues: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [valueA, setValueA] = useState(50);\n const [valueB, setValueB] = useState(80);\n const [valueC, setValueC] = useState(100);\n\n const handleSubmitValues = useCallback(async () => {\n if (onConfirm) onConfirm(valueA, valueB, valueC);\n handleClose();\n }, [handleClose, onConfirm, valueA, valueB, valueC]);\n\n return (\n \n \n \n Curva ABC\n\n \n\n \n *': {\n marginY: 1,\n },\n }}\n >\n \n \n Índice A\n\n {\n setValueA(v.floatValue || 0);\n }}\n />\n \n\n \n Índice B\n\n {\n setValueB(v.floatValue || 0);\n }}\n />\n \n\n \n Índice C\n\n {\n setValueC(v.floatValue || 0);\n }}\n />\n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n};\n\nexport default ModalABCValues;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n FormErrorMessage,\n SimpleGrid,\n Checkbox,\n Select,\n Tooltip,\n Icon,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect, { SelectedValues } from 'components/OwnSelect';\n\nimport { State } from 'types/address';\nimport { Locale } from 'types/base';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalBaseAddProps extends ModalRootProps {\n data: {\n base_id?: number;\n description?: string;\n use_social_law?: boolean;\n };\n}\n\ntype PriceType = 'taxed,untaxed' | 'default';\n\nconst ModalBaseAdd: React.FC = ({\n onConfirm,\n handleClose,\n data = {},\n mode,\n ...restProps\n}) => {\n const [description, setDescription] = useState(\n data.description || '',\n );\n\n const [modelType] = useState('sinapi');\n\n const descriptionRef = React.useRef(null);\n const [useSocialLaw, setUseSocialLaw] = useState(\n data.use_social_law || false,\n );\n\n const [isAllStates, setIsAllStates] = useState(false);\n const [stateSelected, setStateSelected] = useState([]);\n const [localeList, setLocaleList] = useState([]);\n const [stateList, setStateList] = useState([]);\n\n const [selectedPriceType, setSelectedPriceType] =\n useState('default');\n\n const [loading, setLoading] = useState(false);\n const [isFindingStates, setIsFindingStates] = useState(false);\n const [isFindingLocales, setIsFindingLocales] = useState(false);\n const [, setIsFindingPriceTypes] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (descriptionRef.current) {\n descriptionRef.current.focus();\n }\n }, []);\n\n const statesToSelect = useMemo(\n () =>\n stateList.map((state) => ({\n value: state.id,\n label: state.name,\n })),\n [stateList],\n );\n\n const getStates = useCallback(async () => {\n setIsFindingStates(true);\n try {\n const { data: responseStates } = await api.get(`/state`);\n const states = responseStates.data;\n setStateList(states);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar a lista de estados.',\n status: 'error',\n });\n } finally {\n setIsFindingStates(false);\n }\n }, []);\n\n useEffect(() => {\n getStates();\n }, [getStates]);\n\n const getLocales = useCallback(async () => {\n setIsFindingLocales(true);\n try {\n const { data: responseLocales } = await api.get('/locale', {\n params: {\n 'filter[status]': 'active',\n 'filter[base_id]': data.base_id,\n sort: 'description',\n },\n });\n const locales = responseLocales.data;\n setLocaleList(locales);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar a lista de estados.',\n status: 'error',\n });\n } finally {\n setIsFindingLocales(false);\n }\n }, [data]);\n\n useEffect(() => {\n if (data.base_id) {\n getLocales();\n }\n }, [getLocales, data]);\n\n const getPriceTypes = useCallback(async () => {\n setIsFindingPriceTypes(true);\n try {\n const { data: responsePriceTypes } = await api.get('/price/type', {\n params: {\n 'filter[status]': 'active',\n 'filter[base_id]': data.base_id,\n sort: 'description',\n },\n });\n const locales = responsePriceTypes.data;\n if (locales.length === 2) {\n setSelectedPriceType('taxed,untaxed');\n } else {\n setSelectedPriceType('default');\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar a lista de estados.',\n status: 'error',\n });\n } finally {\n setIsFindingPriceTypes(false);\n }\n }, [data]);\n\n useEffect(() => {\n if (data.base_id) {\n getPriceTypes();\n }\n }, [getPriceTypes, data]);\n\n useEffect(() => {\n if (localeList.length > 0 && stateList.length > 0) {\n const localesIds = stateList\n .filter((state) =>\n localeList.some((locale) => locale.key === state.abbreviation),\n )\n .map((state) => state.id);\n setStateSelected(localesIds);\n }\n }, [localeList, stateList]);\n\n const getStatesNameById = useCallback(\n (stateId: number[]) => {\n const states = stateList.filter((state) => stateId.includes(state.id));\n return states.map((state) => ({\n key: state.abbreviation,\n description: state.name,\n }));\n },\n [stateList],\n );\n\n useEffect(() => {\n if (stateSelected.length === statesToSelect.length) {\n setIsAllStates(true);\n } else {\n setIsAllStates(false);\n }\n }, [stateSelected, statesToSelect]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (stateSelected.length === 0) {\n Object.assign(formErrors, { states: true, type: 'required' });\n }\n\n if (!description) {\n Object.assign(formErrors, { description: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n if (mode === 'add') {\n const { data: newBase } = await api.post(`/base`, {\n key: 'own',\n description,\n model_type: modelType,\n use_social_law: useSocialLaw,\n locales: getStatesNameById(stateSelected),\n price_types:\n selectedPriceType === 'default'\n ? [{ key: 'default', description: 'Padrão' }]\n : [\n {\n key: 'taxed',\n description: 'Não Desonerado',\n },\n {\n key: 'untaxed',\n description: 'Desonerado',\n },\n ],\n });\n\n const newBaseId = newBase.data.id;\n\n await api.post(`/version`, {\n base_id: newBaseId,\n description: 'Ref. Padrão',\n });\n } else if (mode === 'edit') {\n await api.put(`/base/${data.base_id}`, {\n key: 'own',\n description,\n model_type: modelType,\n use_social_law: useSocialLaw,\n locales: getStatesNameById(stateSelected),\n });\n }\n\n if (onConfirm) onConfirm();\n\n toast({\n description:\n mode === 'add'\n ? 'Base adicionada com sucesso!'\n : 'Base editada com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar a base!'\n : 'Houve um erro ao editar a base!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add' ? 'Adicionar base' : 'Editar base'}\n \n\n \n\n \n \n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.description && 'Descrição é obrigatória'}\n \n \n\n \n Modelo\n\n \n\n \n {!!errors?.modelType && 'Modelo é obrigatório'}\n \n \n \n \n \n Estado{' '}\n {\n setIsAllStates(e.target.checked);\n if (e.target.checked) {\n setStateSelected(\n statesToSelect.map((state) => state.value),\n );\n }\n }}\n size=\"sm\"\n />{' '}\n Todos os estados\n \n\n \n stateSelected.includes(s.value),\n )}\n isLoading={isFindingStates || isFindingLocales}\n isDisabled={\n isFindingStates ||\n isFindingLocales ||\n statesToSelect.length === 0\n }\n isClearable\n onChange={(selected: SelectedValues) => {\n const value = selected.map((s) => Number(s.value));\n setStateSelected(value);\n }}\n />\n Estado é obrigatório\n \n \n Tipo de preço\n\n \n setSelectedPriceType(e.target.value as PriceType)\n }\n isDisabled={mode === 'edit'}\n _disabled={{\n background: 'hsl(0, 0%, 95%)',\n border: '1px solid hsl(0, 0%, 90%)',\n }}\n >\n \n \n \n Estado é obrigatório\n \n\n setUseSocialLaw(e.target.checked)}\n >\n Campo de leis sociais (%){' '}\n \n \n \n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalBaseAdd;\n","import React, {\n useState,\n useEffect,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Base } from 'types/base';\n\nconst ModalBaseSelect: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n const [bases, setBases] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [selectedBase, setSelectedBase] = useState();\n\n const getBases = useCallback(async () => {\n setLoading(true);\n\n try {\n const { data: basesLoaded } = await api.get('/base/list', {\n params: {\n 'filter[with_plan]': `.`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n sort: 'description',\n },\n });\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : undefined;\n setSelectedBase(value);\n };\n\n const handleConfirm = (): void => {\n const base = bases.find((item) => item.id === selectedBase);\n\n if (!base) {\n toast({\n description: 'Selecione uma base!',\n status: 'warning',\n });\n\n return;\n }\n\n if (onConfirm) onConfirm(base);\n handleClose();\n };\n\n return (\n \n \n \n Selecionar base de dados\n\n \n\n \n Number(s.value) === selectedBase,\n )}\n isLoading={loading}\n isDisabled={loading || basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n \n\n \n \n Selecionar\n \n \n \n \n );\n};\n\nexport default ModalBaseSelect;\n","import React, { useCallback, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Heading,\n Textarea,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport { Composition } from 'pages/Budget/Add/SubPages/Planning/Common/types';\n\ntype BudgetComponent = Composition;\n\ninterface ModalBudgetComponentObservationProps extends ModalRootProps {\n data: {\n budgetId: number;\n component: BudgetComponent;\n };\n}\n\nconst ModalBudgetCompositionObservation: React.FC =\n ({ onConfirm, handleClose, data: { budgetId, component }, ...restProps }) => {\n const [observation, setObservation] = useState(component.observation);\n const [loading, setLoading] = useState(false);\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.put(`budget/${budgetId}/component/${component.id}`, {\n type: 'composition_original',\n component: {\n quantity: component.quantity,\n observation,\n composition_price_id: component.composition_price?.id,\n },\n });\n\n toast({\n description: 'Composição alterada com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao editar a composição.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [budgetId, component, observation, handleClose, onConfirm]);\n\n return (\n \n \n \n Editar Composição\n\n \n\n \n *': {\n marginY: 1,\n },\n }}\n >\n \n Componente do orçamento:{' '}\n {component.composition_price?.composition.description}\n \n\n \n \n Memória de cálculo\n\n setObservation(e.target.value)}\n placeholder=\"Digite a memória de cálculo\"\n size=\"lg\"\n resize=\"none\"\n />\n \n \n \n \n\n \n \n Confirmar\n \n \n \n \n );\n };\n\nexport default ModalBudgetCompositionObservation;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps, TableCellProps } from '@chakra-ui/react';\n\nimport { Cell, FragmentResource, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n nextComponentId: number;\n nextComponentPriceTypeKey: string;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst FragmentTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original.fragment_type;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n const getCustomCellProps = (cell: Cell): TableCellProps => {\n return {\n onClick: (e) => {\n e.stopPropagation();\n if (cell.column.id !== 'coefficient' && cell.column.id !== 'actions') {\n row.toggleRowExpanded();\n }\n },\n };\n };\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n nextComponentId: row.original.fragment.id,\n nextComponentPriceTypeKey: row.original.price_type?.key,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default FragmentTableRow;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport InputNumberFormat from 'react-number-format';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { Plus as PlusIcon } from '@styled-icons/bootstrap/Plus';\nimport { Cog as CogIcon } from '@styled-icons/boxicons-solid/Cog';\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { Save as SaveIcon } from '@styled-icons/boxicons-solid/Save';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Icon,\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Flex,\n Box,\n Skeleton,\n InputGroup,\n InputRightAddon,\n Input,\n IconButton,\n Menu,\n MenuButton,\n MenuList,\n MenuItem,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport useAlert from 'hooks/useAlert';\nimport useModal from 'hooks/useModal';\n\nimport { Budget } from 'types/budget';\n\nimport FragmentTableRow from './FragmentsTableRow';\nimport { FragmentResource, Row } from './types';\n\nexport type FragmentSummary = {\n total: number;\n material: number;\n material_percent: number;\n equipment: number;\n equipment_percent: number;\n labor: number;\n labor_percent: number;\n third_party: number;\n third_party_percent: number;\n other: number;\n other_percent: number;\n};\n\ntype QttySummary = {\n total_compositions: number;\n total_inputs: number;\n};\n\ntype Props = {\n budget_id: number;\n budget_bases: Budget['bases'];\n component_id: number;\n locale_key: string;\n locale_id: number;\n price_type_id: number;\n price_type_key: string;\n isSubRow?: boolean;\n parentFragments?: FragmentResource[];\n parentQttySummary?: QttySummary;\n registerLoadFragments?: (fn: () => Promise) => void;\n reloadTable: () => void;\n getSummary: () => void;\n};\n\ntype IsEditingFragment = {\n [id: number]: {\n coefficient: boolean;\n price: boolean;\n };\n};\n\nconst FragmentsTable: React.FC = ({\n isSubRow = false,\n parentFragments = [],\n registerLoadFragments,\n budget_id,\n budget_bases,\n component_id,\n locale_id,\n locale_key,\n price_type_id,\n price_type_key,\n getSummary,\n reloadTable,\n}) => {\n const { openModal } = useModal();\n const { openAlert } = useAlert();\n\n const [fragments, setFragments] = useState([]);\n const [isEditingFragment, setIsEditingFragment] = useState(\n {},\n );\n\n const [qttySummary, setQttySummary] = useState(\n {} as QttySummary,\n );\n const [loading, setLoading] = useState(false);\n\n const getData = useCallback(async () => {\n setLoading(true);\n\n try {\n const response = await api.get(\n `budget/${budget_id}/composition/${component_id}/component/fragment`,\n {\n params: {\n page: 1,\n per_page: 999,\n 'filter[locale_key]': locale_key,\n 'filter[price_type_key]': price_type_key,\n },\n },\n );\n\n const fragmentsLoaded = response.data;\n\n const newQttySummary = {\n total_compositions: fragmentsLoaded.summary.total.total_compositions,\n total_inputs: fragmentsLoaded.summary.total.total_inputs,\n };\n\n setFragments(\n fragmentsLoaded.data.map((i: FragmentResource) => ({\n ...i,\n newQuantity: i.coefficient,\n newUnitPrice: i.unit_price,\n })),\n );\n setQttySummary(newQttySummary);\n } catch (err) {\n setFragments([]);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar o mapeamento da composição.',\n status: 'error',\n });\n setQttySummary({} as QttySummary);\n } finally {\n setLoading(false);\n }\n }, [component_id, locale_key, price_type_key, budget_id]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const isInput = (data: FragmentResource): boolean => {\n return data.fragment_type.includes('input');\n };\n\n const getType = (row: Row): string => {\n return row.original.fragment_type;\n };\n\n const getIcon = (row: Row): MdiReactIconComponentType => {\n if (getType(row).includes('input')) {\n return InfoIcon;\n }\n\n return GroupIcon;\n };\n\n const shouldShowInputIcon = (i: FragmentResource): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i.fragment.classification.key);\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: FragmentResource): InputIcon => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputIconType = useCallback((i: FragmentResource): string => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const handleRemoveFragment = useCallback(\n (resource: FragmentResource): void => {\n openAlert({\n type: 'danger',\n title: 'Excluir fragmento',\n description: () => (\n \n Você está prestes a excluir um fragmento da composição.\n {resource.fragment.description}\n Deseja realmente realizar essa ação?\n \n ),\n buttons: ['Cancelar', 'Excluir'],\n onConfirm: async () => {\n try {\n await api.delete(\n `budget/${budget_id}/composition/${component_id}/component/fragment/${resource.id}`,\n );\n\n toast({\n description: 'Fragmento removido com sucesso!',\n status: 'success',\n });\n\n if (!reloadTable) {\n setFragments((oldFragments) => {\n const newFragments = [...oldFragments];\n const index = newFragments.findIndex(\n (i) => i.id === resource.id,\n );\n\n newFragments.splice(index, 1);\n\n return newFragments;\n });\n } else {\n reloadTable();\n }\n\n getSummary();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao excluir o fragmento.',\n status: 'error',\n });\n }\n },\n });\n },\n [reloadTable, openAlert, budget_id, component_id, getSummary],\n );\n\n const handleUpdateQuantity = useCallback(\n async (component) => {\n if (!component.newQuantity) {\n toast({\n description: 'A quantidade deve ser maior que zero.',\n status: 'error',\n });\n return;\n }\n\n setLoading(true);\n\n try {\n await api.put(\n `budget/${budget_id}/composition/${component_id}/component/fragment/${component.id}`,\n {\n fragment: {\n coefficient: component.newQuantity,\n },\n },\n );\n\n toast({\n description: 'Fragmento alterado com sucesso!',\n status: 'success',\n });\n\n reloadTable();\n getSummary();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao editar o fragmento.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n },\n [budget_id, getSummary, reloadTable, component_id],\n );\n\n const handleUpdateUnitPrice = useCallback(\n async (component) => {\n setLoading(true);\n\n try {\n await api.put(\n `budget/${budget_id}/input/${component.fragment.id}/price/${component.price_id}`,\n {\n type: 'unit',\n price_type_id,\n locale_id,\n total: component.newUnitPrice,\n },\n );\n\n toast({\n description: 'Fragmento alterado com sucesso!',\n status: 'success',\n });\n\n reloadTable();\n getSummary();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao editar o fragmento.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n },\n [budget_id, reloadTable, getSummary, locale_id, price_type_id],\n );\n\n useEffect(() => {\n if (!isSubRow && !!registerLoadFragments) {\n registerLoadFragments(getData);\n }\n }, [getData, isSubRow, registerLoadFragments]);\n\n const columns = useMemo(\n () => [\n {\n Header: () => 'Tipo',\n id: 'expander',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n \n \n \n\n {isInput(row.original) && shouldShowInputIcon(row.original) && (\n \n \n \n )}\n\n {getType(row).includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n \n );\n },\n },\n {\n Header: 'Código',\n accessor: 'data.code',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return `${row.original.fragment.code} / ${row.original.fragment.version.base.description}`;\n },\n },\n {\n Header: 'Descrição',\n accessor: 'data.description',\n width: '40%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original.fragment.description}\n \n );\n },\n },\n {\n Header: 'Unidade',\n accessor: 'data.unit_measure_id',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.fragment.unit_measure.description;\n },\n },\n {\n Header: 'Coeficiente',\n accessor: 'data.coefficient',\n id: 'coefficient',\n isNumeric: true,\n width: Object.values(isEditingFragment).some((item) => item.coefficient)\n ? '20%'\n : '1%',\n Cell: ({ row }: { row: Row }) => {\n if (isEditingFragment[row.original.id]?.coefficient) {\n return (\n \n {\n if (e.key === 'Enter') {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: false,\n },\n });\n handleUpdateQuantity(row.original);\n }\n }}\n onValueChange={(v) => {\n setFragments((oldData) => {\n const newData = [...oldData];\n const index = newData.findIndex(\n (item) => item.id === row.original.id,\n );\n newData[index].newQuantity = v.floatValue;\n return newData;\n });\n }}\n customInput={Input}\n style={{\n borderTopRightRadius: '0',\n borderBottomRightRadius: '0',\n textAlign: 'right',\n color: 'black',\n }}\n />\n\n \n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: false,\n },\n });\n\n handleUpdateQuantity(row.original);\n }}\n width=\"30px\"\n >\n \n \n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: false,\n },\n });\n }}\n width=\"30px\"\n >\n \n \n \n \n );\n }\n\n return (\n <>\n {row.original.coefficient_was_changed && (\n \n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 7,\n }).format(row.original.coefficient_original || 0)}\n \n )}\n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: true,\n },\n });\n }}\n >\n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 7,\n }).format(row.original.coefficient || 0)}\n \n \n );\n },\n },\n {\n Header: 'Valor unitário',\n accessor: 'data.unit_value',\n isNumeric: true,\n width: Object.values(isEditingFragment).some((item) => item.price)\n ? '20%'\n : '1%',\n Cell: ({ row }: { row: Row }) => {\n if (!isInput(row.original)) {\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.unit_price || 0);\n }\n\n if (isEditingFragment[row.original.id]?.price) {\n return (\n \n {\n if (e.key === 'Enter') {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: false,\n },\n });\n\n handleUpdateUnitPrice(row.original);\n }\n }}\n onValueChange={(v) => {\n setFragments((oldData) => {\n const newData = [...oldData];\n const index = newData.findIndex(\n (item) => item.id === row.original.id,\n );\n newData[index].newUnitPrice = v.floatValue || 0;\n return newData;\n });\n }}\n customInput={Input}\n style={{\n borderTopRightRadius: '0',\n borderBottomRightRadius: '0',\n textAlign: 'right',\n color: 'black',\n }}\n />\n \n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: false,\n },\n });\n\n handleUpdateUnitPrice(row.original);\n }}\n width=\"30px\"\n >\n \n \n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: false,\n },\n });\n }}\n width=\"30px\"\n >\n \n \n \n \n );\n }\n\n return (\n <>\n {row.original.unit_price_was_changed && (\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.unit_price_original || 0)}\n \n )}\n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: true,\n },\n });\n }}\n >\n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.unit_price || 0)}\n \n \n );\n },\n },\n {\n Header: 'Total',\n accessor: 'data.total',\n isNumeric: true,\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: 'Ações',\n id: 'actions',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n }\n />\n\n \n {!isInput(row.original) && (\n <>\n }\n title=\"Adicionar composição\"\n color=\"black\"\n onClick={() => {\n openModal('budgetCompositionFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: budget_id,\n compositionId: row.original.fragment.id,\n bases: budget_bases,\n },\n onConfirm: () => {\n reloadTable();\n getSummary();\n },\n });\n }}\n >\n Adicionar composição\n \n\n }\n title=\"Adicionar insumo\"\n color=\"black\"\n onClick={() => {\n openModal('budgetInputFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: budget_id,\n compositionId: row.original.fragment.id,\n bases: budget_bases,\n },\n onConfirm: () => {\n reloadTable();\n getSummary();\n },\n });\n }}\n >\n Adicionar insumo\n \n \n )}\n\n }\n title={\n isInput(row.original)\n ? 'Remover insumo'\n : 'Remover composição'\n }\n onClick={() => handleRemoveFragment(row.original)}\n color=\"red.600\"\n >\n {isInput(row.original)\n ? 'Remover insumo'\n : 'Remover composição'}\n \n \n \n );\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getInputIcon, isEditingFragment, reloadTable],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n // @ts-expect-error types\n columns,\n data: fragments,\n getRowId,\n autoResetExpanded: false,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ nextComponentId, nextComponentPriceTypeKey }) => (\n \n ),\n [\n locale_id,\n locale_key,\n price_type_id,\n fragments,\n budget_id,\n budget_bases,\n getSummary,\n reloadTable,\n ],\n );\n\n const parent = useMemo(() => {\n return parentFragments.find((f) => f.fragment.id === component_id);\n }, [parentFragments, component_id]);\n\n return (\n <>\n {isSubRow && (\n \n <>\n \n Classe\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.classification.description || '-'}\n )}\n \n \n\n \n Tipo de preço\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.description || '-'}\n )}\n \n \n\n \n Composições\n \n {loading ? (\n \n ) : (\n <>{qttySummary.total_compositions}\n )}\n \n \n\n \n Insumos\n \n {loading ? (\n \n ) : (\n <> {qttySummary.total_inputs}\n )}\n \n \n \n \n )}\n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && fragments.length === 0 && (\n \n \n Nenhum resultado encontrado.\n \n \n )}\n \n
\n
\n \n );\n};\n\nexport default FragmentsTable;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure, Classification, ClassificationType } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n price_type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [classifications, setClassifications] = useState([]);\n const [selectedClassification, setSelectedClassification] = useState<\n number | null\n >(null);\n const [isLoadingClassifications, setIsLoadingClassifications] =\n useState(false);\n\n const [classificationTypes, setClassificationTypes] = useState<\n ClassificationType[]\n >([]);\n const [selectedClassificationType, setSelectedClassificationType] = useState<\n number | null\n >(null);\n const [isLoadingTypes, setIsLoadingTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getClassifications = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setClassifications([]);\n return;\n }\n\n try {\n setIsLoadingClassifications(true);\n const { data: response } = await api.get('composition/classification', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const classificationsLoaded = response.data;\n setClassifications(classificationsLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingClassifications(false);\n }\n }, []);\n\n const classificationsToSelect = useMemo(() => {\n return classifications.map((classification) => ({\n value: String(classification.id),\n label: classification.description,\n }));\n }, [classifications]);\n\n useEffect(() => {\n getClassifications(selectedBase);\n }, [getClassifications, selectedBase]);\n\n const getClassificationTypes = useCallback(\n async (baseId: number | null, classificationId: number | null) => {\n if (!baseId) {\n setClassificationTypes([]);\n return;\n }\n\n try {\n setIsLoadingTypes(true);\n const { data: response } = await api.get('/composition/type', {\n params: {\n 'filter[base_id]': baseId,\n 'filter[classification_id]': classificationId,\n },\n });\n const classificationTypesLoaded = response.data;\n setClassificationTypes(classificationTypesLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingTypes(false);\n }\n },\n [],\n );\n\n const classificationTypesToSelect = useMemo(() => {\n return classificationTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [classificationTypes]);\n\n useEffect(() => {\n getClassificationTypes(selectedBase, selectedClassification);\n }, [getClassificationTypes, selectedBase, selectedClassification]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const handleClassificationChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassification(value);\n setValue('classification_id', value);\n\n if (!value) {\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n }\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Classe da composição\n\n (\n Number(s.value) === selectedClassification,\n )}\n isLoading={isLoadingClassifications}\n isDisabled={\n isLoadingClassifications ||\n classificationsToSelect.length === 0\n }\n onChange={handleClassificationChange}\n isClearable\n />\n )}\n name=\"classification_id\"\n control={control}\n />\n \n\n \n Tipo da composição\n\n (\n Number(s.value) === selectedClassificationType,\n )}\n isLoading={isLoadingTypes}\n isDisabled={\n isLoadingTypes || classificationTypesToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassificationType(value);\n setValue('classification_type_id', value);\n }}\n isClearable\n />\n )}\n name=\"classification_type_id\"\n control={control}\n />\n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n isClearable\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Input,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n Select,\n HStack,\n IconButton,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport {\n Composition,\n State,\n DefaultPrice,\n StatePrice,\n} from 'types/composition';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalCompositionFragmentSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n budgetId: number;\n compositionId: number;\n };\n}\n\ntype Fragment = {\n composition_id: number;\n coefficient: number;\n type: 'typed' | 'common';\n price_type_id: number;\n locale_key: string;\n};\n\ntype ComponentData = {\n fragments: Fragment[];\n};\n\ntype SelectedComposition = Composition & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetCompositionFragmentSelect: React.FC =\n ({\n data: { budgetId, compositionId, bases },\n handleClose,\n onConfirm,\n ...restProps\n }) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [compositions, setCompositions] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] =\n useState({ last_page: 1 });\n\n const [selectedCompositions, setSelectedCompositions] = useState<\n SelectedComposition[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (composition: Composition): number => {\n const price = getStatePrice(composition);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setCompositions([]);\n\n try {\n const response = await api.get('/composition', {\n params: {\n 'filter[resource]': 'composition',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const compositionsData = response.data;\n\n const newPagination = {\n last_page: compositionsData.meta\n ? compositionsData.meta.last_page\n : compositionsData.last_page,\n };\n\n setCompositions(compositionsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message ||\n 'Houve um erro ao buscar composições',\n });\n\n setCompositions([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComposition = (item: Composition): void => {\n setSelectedCompositions((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteComposition = (item: Composition): void => {\n setSelectedCompositions((selected) =>\n selected.filter((c) => c._id !== item._id),\n );\n };\n\n const getStatePrice = (composition: Composition): State => {\n if (!composition._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return composition._source.prices[state];\n };\n\n const getStateKey = (composition: Composition): string => {\n if (!composition._source.prices) {\n return '';\n }\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return state;\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedComposition[]): ComponentData => {\n if (!searchFilter.price_type_id) {\n return { fragments: [] };\n }\n\n return {\n fragments: selected.map((item) => ({\n composition_id: Number(item._id),\n coefficient: item.quantity || 1,\n type: 'typed',\n price_type_id: Number(searchFilter.price_type_id),\n locale_key: getStateKey(item),\n })),\n };\n },\n [searchFilter.price_type_id],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.post(\n `budget/${budgetId}/composition/${compositionId}/component/fragment`,\n {\n ...prepareComponents(selectedCompositions),\n },\n );\n\n toast({\n description: 'Composições salvas com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar as composições selecionadas.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedCompositions,\n prepareComponents,\n budgetId,\n compositionId,\n handleClose,\n onConfirm,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar composições\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedCompositions.length === 0) ||\n loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedCompositions.length > 0 && (\n \n {selectedCompositions.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectComposition(item)}\n disabled={selectedCompositions.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedCompositions.some(\n (c) => c._id === item._id,\n )\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedCompositions.some(\n (c) => c._id === item._id,\n ) && (\n }\n onClick={() => handleDeleteComposition(item)}\n />\n )}\n \n ),\n active: selectedCompositions.some(\n (c) => c._id === item._id,\n ),\n })}\n data={compositions}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedCompositions.length > 0 ? (\n selectedCompositions.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhuma composição selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedCompositions((selected) =>\n selected.map((composition) =>\n composition._id === item._id\n ? {\n ...composition,\n quantity: v.floatValue,\n }\n : composition,\n ),\n );\n }}\n customInput={Input}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() =>\n handleDeleteComposition(item)\n }\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n };\n\nexport default ModalBudgetCompositionFragmentSelect;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { FragmentResource, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n nextComponentId: number;\n nextComponentPriceTypeKey: string;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst FragmentTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original.fragment_type;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n nextComponentId: row.original.fragment.id,\n nextComponentPriceTypeKey: row.original.price_type?.key,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default FragmentTableRow;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Icon,\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Flex,\n Box,\n Skeleton,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport FragmentTableRow from './FragmentsTableRow';\nimport { FragmentResource, Row } from './types';\n\nexport type FragmentSummary = {\n total: number;\n material: number;\n material_percent: number;\n equipment: number;\n equipment_percent: number;\n labor: number;\n labor_percent: number;\n third_party: number;\n third_party_percent: number;\n other: number;\n other_percent: number;\n};\n\ntype QttySummary = {\n total_compositions: number;\n total_inputs: number;\n};\n\ntype Props = {\n budget_id: number;\n component_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n isSubRow?: boolean;\n parentFragments?: FragmentResource[];\n parentQttySummary?: QttySummary;\n};\n\nconst FragmentsTable: React.FC = ({\n isSubRow = false,\n parentFragments = [],\n component_id,\n budget_id,\n locale_key,\n price_type_id,\n price_type_key,\n}) => {\n const [fragments, setFragments] = useState([]);\n const [qttySummary, setQttySummary] = useState(\n {} as QttySummary,\n );\n const [loading, setLoading] = useState(false);\n\n const getData = useCallback(async () => {\n setLoading(true);\n setFragments([]);\n\n try {\n const response = await api.get(\n `budget/${budget_id}/composition/${component_id}/component/fragment`,\n {\n params: {\n page: 1,\n per_page: 999,\n 'filter[locale_key]': locale_key,\n 'filter[price_type_key]': price_type_key,\n },\n },\n );\n\n const fragmentsLoaded = response.data;\n\n const newQttySummary = {\n total_compositions: fragmentsLoaded.summary.total.total_compositions,\n total_inputs: fragmentsLoaded.summary.total.total_inputs,\n };\n\n setFragments(fragmentsLoaded.data);\n setQttySummary(newQttySummary);\n } catch (err) {\n setFragments([]);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar o mapeamento da composição.',\n status: 'error',\n });\n setQttySummary({} as QttySummary);\n } finally {\n setLoading(false);\n }\n }, [component_id, locale_key, price_type_key, budget_id]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const isInput = (data: FragmentResource): boolean => {\n return data.fragment_type.includes('input');\n };\n\n const getType = (row: Row): string => {\n return row.original.fragment_type;\n };\n\n const getIcon = (row: Row): MdiReactIconComponentType => {\n if (getType(row).includes('input')) {\n return InfoIcon;\n }\n\n return GroupIcon;\n };\n\n const shouldShowInputIcon = (i: FragmentResource): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i.fragment.classification.key);\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: FragmentResource): InputIcon => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputIconType = useCallback((i: FragmentResource): string => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const columns = useMemo(\n () => [\n {\n Header: () => 'Tipo',\n id: 'expander',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n \n \n \n\n {isInput(row.original) && shouldShowInputIcon(row.original) && (\n \n \n \n )}\n\n {getType(row).includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n \n );\n },\n },\n {\n Header: 'Código',\n accessor: 'data.code',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return `${row.original.fragment.code} / ${row.original.fragment.version.base.description}`;\n },\n },\n {\n Header: 'Descrição',\n accessor: 'data.description',\n width: '70%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original.fragment.description}\n \n );\n },\n },\n {\n Header: 'Unidade',\n accessor: 'data.unit_measure_id',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.fragment.unit_measure.description;\n },\n },\n {\n Header: 'Coeficiente',\n accessor: 'data.coefficient',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return (\n <>\n {row.original.coefficient_was_changed && (\n \n {row.original.coefficient_original}\n \n )}\n \n {row.original.coefficient}\n \n \n );\n },\n },\n {\n Header: 'Valor unitário',\n accessor: 'data.unit_value',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.unit_price;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: 'Total',\n accessor: 'data.total',\n isNumeric: true,\n width: '15%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getInputIcon],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n // @ts-expect-error types\n columns,\n data: fragments,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ nextComponentId, nextComponentPriceTypeKey }) => (\n \n ),\n [locale_key, price_type_id, fragments, budget_id],\n );\n\n const parent = useMemo(() => {\n return parentFragments.find((f) => f.fragment.id === component_id);\n }, [parentFragments, component_id]);\n\n return (\n <>\n {isSubRow && (\n \n <>\n \n Classe\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.classification.description || '-'}\n )}\n \n \n\n \n Tipo\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.description || '-'}\n )}\n \n \n\n \n Composições\n \n {loading ? (\n \n ) : (\n <>{qttySummary.total_compositions}\n )}\n \n \n\n \n Insumos\n \n {loading ? (\n \n ) : (\n <> {qttySummary.total_inputs}\n )}\n \n \n \n \n )}\n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && fragments.length === 0 && (\n \n \n Nenhum resultado encontrado.\n \n \n )}\n \n
\n
\n \n );\n};\n\nexport default FragmentsTable;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { DollarSign as DollarSignIcon } from '@styled-icons/fa-solid/DollarSign';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Flex,\n Text,\n Box,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport SummaryContainer from 'components/SummaryContainer';\nimport SummaryDataChartCard from 'components/SummaryDataChartCard';\n\nimport FragmentsTable, { FragmentSummary } from './FragmentsTable';\n\ntype Props = ModalRootProps & {\n data: {\n id: number;\n budget_id: number;\n locale_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n code: string;\n base: string;\n description: string;\n prices: string;\n price: number;\n classification: string;\n type: string;\n unit_measure: string;\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalBudgetCompositionLookup: React.FC = ({\n data,\n ...restProps\n}) => {\n const [loading, setLoading] = useState(false);\n const [summary, setSummary] = useState(\n {} as FragmentSummary,\n );\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const getSummary = useCallback(async () => {\n setLoading(true);\n setSummary({} as FragmentSummary);\n\n try {\n const { data: response } = await api.get(\n `budget/${data.budget_id}/composition/${data.id}/price`,\n {\n params: {\n 'filter[locale_id]': data.locale_id,\n 'filter[price_type_id]': data.price_type_id,\n },\n },\n );\n\n const [summaryLoaded] = response.data;\n\n setSummary({\n total: summaryLoaded.total,\n material: summaryLoaded.material,\n material_percent: summaryLoaded.material_percent,\n equipment: summaryLoaded.equipment,\n equipment_percent: summaryLoaded.equipment_percent,\n labor: summaryLoaded.labor,\n labor_percent: summaryLoaded.labor_percent,\n third_party: summaryLoaded.third_party,\n third_party_percent: summaryLoaded.third_party_percent,\n other: summaryLoaded.other,\n other_percent: summaryLoaded.other_percent,\n });\n } catch (err) {\n setSummary({} as FragmentSummary);\n } finally {\n setLoading(false);\n }\n }, [data]);\n\n useEffect(() => {\n getSummary();\n }, [getSummary]);\n\n return (\n \n \n \n Detalhes da composição\n\n \n\n \n \n \n \n\n \n \n Código\n \n {data.code} \\ {data.base}\n \n \n\n \n Descrição\n \n {data.description}\n \n \n \n\n \n \n Valor unitário\n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(summary.total || 0)}\n \n \n\n \n Classe\n \n {data.classification}\n \n \n\n \n Tipo\n \n {data.type}\n \n \n\n \n Unidade\n \n {data.unit_measure}\n \n \n \n\n \n \n \n \n );\n};\n\nexport default ModalBudgetCompositionLookup;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure, Classification, ClassificationType } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n price_type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [classifications, setClassifications] = useState([]);\n const [selectedClassification, setSelectedClassification] = useState<\n number | null\n >(null);\n const [isLoadingClassifications, setIsLoadingClassifications] =\n useState(false);\n\n const [classificationTypes, setClassificationTypes] = useState<\n ClassificationType[]\n >([]);\n const [selectedClassificationType, setSelectedClassificationType] = useState<\n number | null\n >(null);\n const [isLoadingTypes, setIsLoadingTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getClassifications = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setClassifications([]);\n return;\n }\n\n try {\n setIsLoadingClassifications(true);\n const { data: response } = await api.get('composition/classification', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const classificationsLoaded = response.data;\n setClassifications(classificationsLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingClassifications(false);\n }\n }, []);\n\n const classificationsToSelect = useMemo(() => {\n return classifications.map((classification) => ({\n value: String(classification.id),\n label: classification.description,\n }));\n }, [classifications]);\n\n useEffect(() => {\n getClassifications(selectedBase);\n }, [getClassifications, selectedBase]);\n\n const getClassificationTypes = useCallback(\n async (baseId: number | null, classificationId: number | null) => {\n if (!baseId) {\n setClassificationTypes([]);\n return;\n }\n\n try {\n setIsLoadingTypes(true);\n const { data: response } = await api.get('/composition/type', {\n params: {\n 'filter[base_id]': baseId,\n 'filter[classification_id]': classificationId,\n },\n });\n const classificationTypesLoaded = response.data;\n setClassificationTypes(classificationTypesLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingTypes(false);\n }\n },\n [],\n );\n\n const classificationTypesToSelect = useMemo(() => {\n return classificationTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [classificationTypes]);\n\n useEffect(() => {\n getClassificationTypes(selectedBase, selectedClassification);\n }, [getClassificationTypes, selectedBase, selectedClassification]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const handleClassificationChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassification(value);\n setValue('classification_id', value);\n\n if (!value) {\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n }\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Classe da composição\n\n (\n Number(s.value) === selectedClassification,\n )}\n isLoading={isLoadingClassifications}\n isDisabled={\n isLoadingClassifications ||\n classificationsToSelect.length === 0\n }\n onChange={handleClassificationChange}\n isClearable\n />\n )}\n name=\"classification_id\"\n control={control}\n />\n \n\n \n Tipo da composição\n\n (\n Number(s.value) === selectedClassificationType,\n )}\n isLoading={isLoadingTypes}\n isDisabled={\n isLoadingTypes || classificationTypesToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassificationType(value);\n setValue('classification_type_id', value);\n }}\n isClearable\n />\n )}\n name=\"classification_type_id\"\n control={control}\n />\n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n isClearable\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n IconButton,\n Input,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n Select,\n HStack,\n Progress,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport {\n Composition,\n State,\n DefaultPrice,\n StatePrice,\n} from 'types/composition';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalCompositionSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n subStageId: number;\n budgetId: number;\n };\n}\n\ntype Component = {\n type: 'composition_original';\n quantity: number;\n composition_id: number;\n budget_base_id: number;\n};\n\ntype ComponentData = {\n parent_stage_id: number;\n components: Component[];\n};\n\ntype SelectedComposition = Composition & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetCompositionSelect: React.FC = ({\n data: { budgetId, bases, subStageId },\n handleClose,\n onConfirm,\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [saving, setSaving] = useState(false);\n const [fakeProgress, setFakeProgress] = useState(0);\n\n const [compositions, setCompositions] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedCompositions, setSelectedCompositions] = useState<\n SelectedComposition[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (composition: Composition): number => {\n const price = getStatePrice(composition);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setCompositions([]);\n\n try {\n const response = await api.get('/composition', {\n params: {\n 'filter[resource]': 'composition',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const compositionsData = response.data;\n\n const newPagination = {\n last_page: compositionsData.meta\n ? compositionsData.meta.last_page\n : compositionsData.last_page,\n };\n\n setCompositions(compositionsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message || 'Houve um erro ao buscar composições',\n });\n\n setCompositions([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComposition = (item: Composition): void => {\n setSelectedCompositions((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteComposition = (item: Composition): void => {\n setSelectedCompositions((selected) =>\n selected.filter((c) => c._id !== item._id),\n );\n };\n\n const getStatePrice = (composition: Composition): State => {\n if (!composition._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return composition._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedComposition[]): ComponentData => {\n return {\n parent_stage_id: subStageId,\n components: selected.map((item) => ({\n type: 'composition_original',\n composition_id: Number(item._id),\n quantity: item.quantity || 0,\n budget_base_id:\n bases.find(\n (b) => b.version.base.id === item._source.version.base.id,\n )?.id || 0,\n })),\n };\n },\n [subStageId, bases],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n setSaving(true);\n setFakeProgress(0);\n\n try {\n await api.post(`budget/${budgetId}/component`, {\n ...prepareComponents(selectedCompositions),\n });\n\n toast({\n description: 'Composições salvas com sucesso!',\n status: 'success',\n });\n\n setFakeProgress(99);\n\n setTimeout(() => {\n if (onConfirm) onConfirm();\n handleClose();\n }, 1000);\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar as composições selecionadas.',\n status: 'error',\n });\n }\n } finally {\n setSaving(false);\n setLoading(false);\n }\n }, [\n selectedCompositions,\n prepareComponents,\n budgetId,\n handleClose,\n onConfirm,\n ]);\n\n useEffect(() => {\n if (saving) {\n const interval = setInterval(() => {\n setFakeProgress((oldProgress) => {\n if (oldProgress === 90) {\n return oldProgress;\n }\n\n if (oldProgress === 99.9) {\n // wait 1 second to close modal\n setTimeout(() => {\n setFakeProgress(100);\n }, 1000);\n\n clearInterval(interval);\n return 0;\n }\n\n return Math.min(oldProgress + 10, 100);\n });\n }, 3000);\n\n return () => clearInterval(interval);\n }\n\n return undefined;\n }, [saving]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar composições\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedCompositions.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n {fakeProgress > 0 && fakeProgress <= 100 && (\n <>\n \n Salvando composições...\n \n\n \n \n )}\n\n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedCompositions.length > 0 && (\n \n {selectedCompositions.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectComposition(item)}\n disabled={selectedCompositions.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedCompositions.some(\n (c) => c._id === item._id,\n )\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedCompositions.some(\n (c) => c._id === item._id,\n ) && (\n }\n onClick={() => handleDeleteComposition(item)}\n />\n )}\n \n ),\n active: selectedCompositions.some(\n (c) => c._id === item._id,\n ),\n })}\n data={compositions}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedCompositions.length > 0 ? (\n selectedCompositions.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhuma composição selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedCompositions((selected) =>\n selected.map((composition) =>\n composition._id === item._id\n ? {\n ...composition,\n quantity: v.floatValue,\n }\n : composition,\n ),\n );\n }}\n customInput={Input}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteComposition(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetCompositionSelect;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\nimport InputNumberFormat from 'react-number-format';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n Input,\n FormErrorMessage,\n Heading,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure } from 'types/base';\n\nexport interface FormData {\n code: string;\n type: 'separate';\n description: string;\n unit_measure_id: number;\n observation?: string;\n unit_price: number;\n labor: number;\n material: number;\n equipment: number;\n third_party: number;\n other: number;\n quantity: number;\n total_value: number;\n}\n\ninterface FormProps {\n onSubmit(data: FormData): void;\n initialData?: FormData;\n isSaving?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n initialData,\n onSubmit,\n isSaving = false,\n}) => {\n const [isLoadingFilters, setIsLoadingFilters] = useState(false);\n\n const {\n handleSubmit,\n setValue,\n control,\n register,\n clearErrors,\n setError,\n formState: { errors },\n } = useForm({\n defaultValues: {\n ...initialData,\n },\n });\n\n const [quantity, setQuantity] = useState(initialData?.quantity || 0);\n const [labor, setLabor] = useState(initialData?.labor || 0);\n const [material, setMaterial] = useState(initialData?.material || 0);\n const [equipment, setEquipment] = useState(\n initialData?.equipment || 0,\n );\n const [third_party, setThirdPartyServices] = useState(\n initialData?.third_party || 0,\n );\n const [other, setOther] = useState(initialData?.other || 0);\n\n const [unitPrice, setUnitPrice] = useState(\n initialData?.unit_price || 0,\n );\n const [totalValue, setTotalValue] = useState(\n initialData?.total_value || 0,\n );\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n initialData?.unit_measure_id || null,\n );\n\n const prepareSubmit = useCallback(\n (data) => {\n if (!unitPrice || unitPrice <= 0) {\n setError('unit_price', {\n type: 'required',\n });\n\n setError('total_value', {\n type: 'required',\n });\n\n return;\n }\n\n onSubmit({\n code: data.code,\n type: 'separate',\n description: data.description,\n unit_measure_id: data.unit_measure_id,\n unit_price: unitPrice || 0,\n labor: labor || 0,\n material: material || 0,\n equipment: equipment || 0,\n third_party: third_party || 0,\n other: other || 0,\n quantity: quantity || 0,\n total_value: totalValue || 0,\n });\n },\n [\n onSubmit,\n unitPrice,\n labor,\n material,\n equipment,\n third_party,\n other,\n quantity,\n totalValue,\n setError,\n ],\n );\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingFilters(true);\n\n try {\n const response = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded.data);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingFilters(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n useEffect(() => {\n const unitPriceTotal = labor + material + equipment + third_party + other;\n\n setUnitPrice(unitPriceTotal);\n setValue('unit_price', unitPriceTotal);\n\n if (unitPriceTotal > 0) {\n clearErrors('unit_price');\n }\n }, [labor, material, equipment, third_party, other, setValue, clearErrors]);\n\n useEffect(() => {\n const total = unitPrice * quantity;\n\n setTotalValue(total);\n setValue('total_value', total);\n\n if (total > 0) {\n clearErrors('total_value');\n }\n }, [setValue, unitPrice, quantity, clearErrors]);\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Código\n\n \n\n Código é obrigatória\n \n\n \n Descrição\n\n \n\n Descrição é obrigatória\n \n \n\n \n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isInvalid={!!errors.unit_measure_id}\n isLoading={isLoadingFilters}\n isDisabled={unitMeasuresToSelect.length === 0}\n isClearable\n onChange={(selected) => {\n const value = Number(selected?.value);\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n\n if (value) {\n clearErrors('unit_measure_id');\n } else {\n setError('unit_measure_id', {\n type: 'required',\n });\n }\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n rules={{ required: true }}\n />\n\n Unidade de medida é obrigatória\n \n\n \n Quantidade\n\n (\n {\n setQuantity(v.floatValue || 0);\n setValue('quantity', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"quantity\"\n control={control}\n rules={{ required: true }}\n />\n\n Quantidade é obrigatória\n \n \n\n \n Valores unitários (R$)\n \n\n \n \n Mão de obra\n\n (\n {\n setLabor(v.floatValue || 0);\n setValue('labor', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"labor\"\n control={control}\n />\n\n Mão de obra é obrigatória\n \n\n \n Materiais\n\n (\n {\n setMaterial(v.floatValue || 0);\n setValue('material', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"material\"\n control={control}\n />\n\n Material é obrigatório\n \n\n \n Equipamentos\n\n (\n {\n setEquipment(v.floatValue || 0);\n setValue('equipment', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"equipment\"\n control={control}\n />\n\n Equipamento é obrigatório\n \n\n \n Serviços\n\n (\n {\n setThirdPartyServices(v.floatValue || 0);\n setValue('third_party', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"third_party\"\n control={control}\n />\n\n Serviço é obrigatório\n \n\n \n Outros\n\n (\n {\n setOther(v.floatValue || 0);\n setValue('other', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"other\"\n control={control}\n />\n\n Outros é obrigatório\n \n \n\n \n \n Preço unitário (R$)\n\n (\n \n )}\n name=\"unit_price\"\n control={control}\n rules={{ required: true }}\n />\n\n Ao menos um valor é obrigatório\n \n\n \n Total Geral (R$)\n\n (\n \n )}\n name=\"total_value\"\n control={control}\n rules={{ required: true }}\n />\n\n \n Valor total precisa ser maior que 0\n \n \n \n\n }\n mt=\"4\"\n >\n Salvar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, { useCallback, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport Form, { FormData } from './Form';\n\ntype Component = {\n type: 'composition_custom';\n quantity: number;\n composition: Omit & {\n immobilized: boolean;\n };\n};\n\ntype ComponentData = {\n parent_stage_id: number;\n components: Component[];\n};\n\ntype CustomComposition = {\n id: number;\n budget_composition_price: {\n id: number;\n code: string;\n description: string;\n observation: string;\n immobilized: boolean;\n unit_price: number;\n unit_measure_id: {\n id: number;\n description: string;\n };\n };\n type: 'separate';\n description: string;\n unit_measure_id: number;\n observation: string;\n immobilized: boolean;\n unit_price: number;\n labor: number;\n material: number;\n labor_percent: number;\n material_percent: number;\n equipment: number;\n refund: number;\n third_party: number;\n other: number;\n quantity: number;\n code: string;\n};\n\ninterface ModalCompositionPrices extends ModalRootProps {\n data: {\n id: number;\n subStageId: number;\n budgetId: number;\n composition: CustomComposition;\n quantity: number;\n };\n}\n\nconst ModalBudgetCustomCompositionAdd: React.FC = ({\n data: { id, subStageId, budgetId, quantity, composition },\n handleClose,\n onConfirm,\n mode,\n ...restProps\n}) => {\n const [loading, setLoading] = useState(false);\n\n const getCustomComposition = useCallback(\n (original): FormData => {\n if (!composition) return {} as FormData;\n\n return {\n code: original.budget_composition_price.code,\n type: 'separate',\n description: original.budget_composition_price.description,\n unit_measure_id: original.budget_composition_price.unit_measure_id.id,\n unit_price: original.budget_composition_price.social_law_price,\n labor: original.budget_composition_price.labor,\n material: original.budget_composition_price.material,\n equipment: original.budget_composition_price.equipment,\n third_party: original.budget_composition_price.third_party_services,\n other: original.budget_composition_price.other,\n quantity,\n total_value: original.budget_composition_price.total,\n };\n },\n [quantity, composition],\n );\n\n const prepareComponents = useCallback(\n (data: FormData): ComponentData => {\n return {\n parent_stage_id: subStageId,\n components: [\n {\n type: 'composition_custom',\n quantity: data.quantity,\n composition: {\n code: data.code,\n type: 'separate',\n description: data.description,\n unit_measure_id: data.unit_measure_id,\n unit_price: data.unit_price || 0,\n labor: data.labor || 0,\n material: data.material || 0,\n equipment: data.equipment || 0,\n third_party: data.third_party || 0,\n other: data.other || 0,\n immobilized: false,\n },\n },\n ],\n };\n },\n [subStageId],\n );\n\n const prepareCustomComponent = useCallback(\n (data: FormData) => {\n return {\n id: composition.budget_composition_price.id,\n observation: composition.budget_composition_price.observation,\n labor_percent: composition.labor_percent,\n material_percent: composition.material_percent,\n type: 'separate',\n description: data.description,\n unit_measure_id: data.unit_measure_id,\n immobilized: false,\n unit_price: data.unit_price || 0,\n labor: data.labor || 0,\n material: data.material || 0,\n equipment: data.equipment || 0,\n refund: composition.refund,\n third_party: data.third_party || 0,\n other: data.other || 0,\n quantity: data.quantity,\n code: data.code,\n };\n },\n [composition],\n );\n\n const handleSubmitComponent = useCallback(\n async (data: FormData) => {\n setLoading(true);\n\n try {\n if (mode === 'add') {\n await api.post(`budget/${budgetId}/component`, {\n ...prepareComponents(data),\n });\n } else if (mode === 'edit') {\n await api.put(`budget/${budgetId}/component/${id}`, {\n type: 'composition_custom',\n component: prepareCustomComponent(data),\n });\n }\n\n toast({\n description: 'Item salvo com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm(data.quantity);\n handleClose();\n } catch (err) {\n toast({\n description:\n err?.response?.data?.message || 'Houve um erro ao salvar o item!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n },\n [\n prepareComponents,\n budgetId,\n handleClose,\n onConfirm,\n mode,\n id,\n prepareCustomComponent,\n ],\n );\n\n return (\n \n \n \n \n {mode === 'add'\n ? 'Adicionar serviço a preço informado'\n : 'Editar serviço a preço informado'}\n \n\n \n\n \n \n \n \n \n );\n};\n\nexport default ModalBudgetCustomCompositionAdd;\n","import React, { useState, useMemo, useCallback } from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { Refresh as RefreshIcon } from '@styled-icons/boxicons-regular/Refresh';\nimport { ArrowBoldDown as ArrowBoldDownIcon } from '@styled-icons/entypo/ArrowBoldDown';\nimport { ArrowBoldUp as ArrowBoldUpIcon } from '@styled-icons/entypo/ArrowBoldUp';\nimport { Warning as WarningIcon } from '@styled-icons/fluentui-system-filled/Warning';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n Text,\n Grid,\n Divider,\n RadioGroup,\n VStack,\n Radio,\n Input,\n FormErrorMessage,\n Tooltip,\n Icon,\n useMediaQuery,\n Heading,\n Flex,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport { Table, Thead, Tr, Th, Tbody, Td } from 'components/Table';\n\nimport useAlert from 'hooks/useAlert';\n\nimport { Budget } from 'types/budget';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalBudgetGlobalPriceChangeProps extends ModalRootProps {\n data: {\n budget: Budget;\n };\n}\n\ntype Mode =\n | 'coefficient'\n | 'unitary'\n | 'coefficient_labor'\n | 'unitary_tcu'\n | 'unitary_and_coefficient';\ntype Change = 'increase' | 'decrease' | 'value';\n\ntype PayloadChangeType =\n | 'coefficient'\n | 'labor_coefficient'\n | 'unit_value'\n | 'unit_value_tcu'\n | 'labor_coefficient_and_unit_value';\ntype PayloadCalculationType = 'increase' | 'discount' | 'value';\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalBudgetGlobalPriceChange: React.FC =\n ({ onConfirm, handleClose, data: { budget }, ...restProps }) => {\n const { openAlert } = useAlert();\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [mode, setMode] = useState('coefficient');\n const [change, setChange] = useState('increase');\n const [value, setValue] = useState();\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState();\n\n type Client = Budget['identification']['client'];\n const clientNameByType = (client: Client): JSX.Element => {\n if (client.type_person === 'legal') {\n return (\n <>\n {client.fantasy_name}\n
\n {client.corporate_name}\n \n );\n }\n\n return <>{client.name};\n };\n\n const changeLabel = useMemo((): string => {\n switch (change) {\n case 'increase':\n return 'Acréscimo (%)';\n case 'decrease':\n return 'Desconto (%)';\n case 'value':\n return 'Novo valor aproximado (R$)';\n default:\n return 'Alteração';\n }\n }, [change]);\n\n const changeInputsProps = useMemo(() => {\n switch (change) {\n case 'increase':\n case 'decrease':\n return {\n placeholder: '0 %',\n decimalScale: 2,\n fixedDecimalScale: true,\n thousandSeparator: '.',\n decimalSeparator: ',',\n suffix: ' %',\n };\n case 'value':\n return {\n placeholder: 'R$ 0,00',\n decimalScale: 2,\n fixedDecimalScale: true,\n thousandSeparator: '.',\n decimalSeparator: ',',\n prefix: 'R$ ',\n };\n default:\n return {};\n }\n }, [change]);\n\n const changeIcon = useMemo(() => {\n switch (change) {\n case 'increase':\n return (\n \n );\n case 'decrease':\n return (\n \n );\n case 'value':\n return (\n \n );\n default:\n return null;\n }\n }, [change]);\n\n const isAllowedToChangeValue = useMemo(() => {\n if (mode === 'coefficient_labor' || mode === 'unitary_and_coefficient') {\n return false;\n }\n\n return true;\n }, [mode]);\n\n const approximateValue = useCallback(\n (n: number, type: 'gross_total' | 'total_bdi' | 'total'): number => {\n switch (change) {\n case 'increase': {\n return n * (1 + Number(value) / 100);\n }\n case 'decrease': {\n const decreased = n * (1 - Number(value) / 100);\n return decreased < 0 ? 0 : decreased;\n }\n case 'value': {\n const difference = Number(value) / budget.total - 1; // percentual de diferença\n\n if (type === 'gross_total') {\n if (budget.total_bdi === 0) {\n return Number(value);\n }\n\n return budget.gross_total * (difference + 1);\n }\n\n if (type === 'total_bdi') {\n if (budget.total_bdi === 0) {\n return 0;\n }\n\n return budget.total_bdi * (difference + 1);\n }\n\n if (type === 'total') {\n if (budget.total_bdi === 0) {\n return Number(value);\n }\n\n return budget.total * (difference + 1);\n }\n\n return 0;\n }\n default: {\n return 0;\n }\n }\n },\n [change, value, budget],\n );\n\n const payloadChangeType = useMemo((): PayloadChangeType => {\n switch (mode) {\n case 'coefficient':\n return 'coefficient';\n case 'coefficient_labor':\n return 'labor_coefficient';\n case 'unitary':\n return 'unit_value';\n case 'unitary_tcu':\n return 'unit_value_tcu';\n case 'unitary_and_coefficient':\n return 'labor_coefficient_and_unit_value';\n default:\n return 'coefficient';\n }\n }, [mode]);\n\n const payloadCalculationType = useMemo((): PayloadCalculationType => {\n switch (change) {\n case 'increase':\n return 'increase';\n case 'decrease':\n return 'discount';\n case 'value':\n return 'value';\n default:\n return 'increase';\n }\n }, [change]);\n\n const onConfirmSubmit = useCallback(async (): Promise => {\n try {\n setLoading(true);\n\n await api.post(`/budget/${budget.id}/global/change`, {\n change_type: payloadChangeType,\n calculation_type: payloadCalculationType,\n total: value || 0,\n });\n\n if (onConfirm) onConfirm();\n\n toast({\n description: 'Solicitação de alteração realizada com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao solicitar a alteração!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [\n budget.id,\n handleClose,\n onConfirm,\n payloadCalculationType,\n payloadChangeType,\n value,\n ]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!mode) {\n toast({\n description: 'Selecione a forma de alteração!',\n status: 'warning',\n });\n\n Object.assign(formErrors, { mode: true, type: 'required' });\n }\n\n if (!change) {\n toast({\n description: 'Selecione o tipo de alteração!',\n status: 'warning',\n });\n\n Object.assign(formErrors, { change: true, type: 'required' });\n }\n\n if (!value) {\n Object.assign(formErrors, { value: true, type: 'required' });\n }\n\n if (change === 'decrease' && value && value >= 100) {\n toast({\n description: `O valor de desconto não pode ser maior que 100%! O ajuste não pode resultar em valores negativos ou zerados.`,\n status: 'warning',\n });\n\n Object.assign(formErrors, { value: true, type: 'invalid' });\n }\n\n if (change === 'value' && value && value <= 0) {\n toast({\n description: `O valor deve ser maior que zero! O ajuste não pode resultar em valores negativos ou zerados.`,\n status: 'warning',\n });\n\n Object.assign(formErrors, { value: true, type: 'invalid' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n openAlert({\n type: 'info',\n size: '3xl',\n title: 'Confirmação de alteração global',\n description: () => (\n \n \n Você está prestes a alterar os valores do orçamento com base nos\n novos parâmetros definidos. Abaixo, confira a prévia do novo custo\n total recalculado:\n \n\n \n Esses valores são aproximados e podem sofrer variações devido a\n arredondamentos e cálculos internos do sistema.\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
DescriçãoValor Atual (R$)\n Novo valor (R$)\n {change === 'value' ? ' ' : ` - ${Number(value)}% `}{' '}\n {changeIcon}\n
\n Custo sem BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.gross_total || 0)}\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(\n approximateValue(budget.gross_total, 'gross_total'),\n )}\n
\n Custo do BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total_bdi || 0)}\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(approximateValue(budget.total_bdi, 'total_bdi'))}\n
\n Custo total do orçamento\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total)}\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(approximateValue(budget.total, 'total'))}\n
\n\n \n \n \n Após a confirmação, não será possível restaurar os preços atuais\n automáticamente. Caso precise reverter as alterações, será\n necessário ajustar os valores manualmente.\n \n
\n \n ),\n buttons: ['Cancelar', 'Confirmar'],\n onConfirm: onConfirmSubmit,\n });\n };\n\n return (\n \n \n \n Alterar valor global do orçamento\n\n \n\n \n \n Ao realizar essa ação, todo o orçamento será alterado de acordo\n com os dados atuais, incluindo edições já realizadas. Se a\n alteração for por coeficiente, ela refletirá apenas na estrutura\n das composições (primeiro nível de mapeamento)\n \n\n \n \n \n Para que a alteração global funcione corretamente, todas as\n bases devem ter a mesma referência. Misturas de bases diferentes\n ou bases próprias com outras bases podem gerar inconsistências.\n Certifique-se de que todas as referências são iguais.\n \n \n\n \n\n \n \n Descrição do orçamento\n \n {budget.identification?.description || 'Não especificada'}\n \n \n\n {budget.identification?.client && (\n \n Cliente\n \n {clientNameByType(budget.identification.client)}\n \n \n )}\n \n \n \n Total sem BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.gross_total || 0)}\n \n \n\n \n Total do BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total_bdi || 0)}{' '}\n (\n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 2,\n }).format(budget.bdi_percent || 0)}\n %)\n \n \n\n \n Total Geral\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total || 0)}\n \n \n \n\n \n\n \n \n Forma de alteração\n {\n setMode(v as Mode);\n if (\n v === 'coefficient_labor' ||\n v === 'unitary_and_coefficient'\n ) {\n setChange('increase');\n }\n }}\n >\n \n \n Alterar coeficiente{' '}\n \n \n \n \n\n \n Alterar valor unitário{' '}\n \n \n \n \n\n \n Alterar coeficiente - mão de obra{' '}\n \n \n \n \n\n \n Alterar valor unitário - Acórdão 938/2014 TCU{' '}\n \n \n \n \n\n \n Alterar valor e coeficiente{' '}\n \n \n \n \n \n \n \n\n \n Alteração do valor\n setChange(v as Change)}\n >\n \n Acréscimo (%)\n Desconto (%)\n \n Novo valor aproximado (R$){' '}\n \n \n \n \n\n \n {changeLabel}\n {\n if (v.floatValue) {\n setErrors((prev) => {\n if (prev?.value) {\n return { ...prev, value: false };\n }\n\n return prev;\n });\n }\n\n setValue(v.floatValue || 0);\n }}\n customInput={Input}\n />\n\n \n {!value && errors?.value === true\n ? 'Valor é obrigatório'\n : 'Valor inválido'}\n \n \n \n \n\n \n \n Salvar\n \n \n \n \n );\n };\n\nexport default ModalBudgetGlobalPriceChange;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\ntype Props = {\n description: string;\n color: string;\n};\n\nconst FlowStatusBadge: React.FC = ({ color, description }: Props) => {\n return (\n \n {description || 'Não definido'}\n \n );\n};\n\nexport default FlowStatusBadge;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Text,\n Grid,\n HStack,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { User } from 'types/access-control';\nimport { Budget } from 'types/budget';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport FlowStatusBadge from './StatusBadge';\n\ninterface ModalManageFlowProps extends ModalRootProps {\n data: {\n budget: Budget;\n };\n}\n\ntype FlowHistory = {\n id: number;\n type: string;\n user: {\n id: number;\n name: string;\n email: string;\n profile_verified: true;\n corporate_name: null;\n fantasy_name: null;\n document_type: null;\n document: null;\n address: null;\n number: null;\n complement: null;\n district: null;\n zip_code: null;\n city: null;\n created_at: string;\n updated_at: string;\n deleted_at: null;\n };\n object: {\n status: {\n color: string;\n icon: string;\n name: string;\n };\n };\n status: {\n color: string;\n icon: string;\n name: string;\n };\n message: string;\n created_at: string;\n updated_at: string;\n};\n\ntype FlowUser = FlowHistory['user'];\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalManageFlow: React.FC = ({\n handleClose,\n data: budgetData,\n ...restProps\n}) => {\n const { budget } = budgetData;\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get('/flow/history', {\n params: {\n 'filter[object_id]': budget.id,\n 'filter[object_type]': 'budget',\n page: pagination.page,\n per_page: pagination.per_page,\n sort: '-created_at',\n },\n });\n\n const history = response.data;\n\n const newPagination = {\n last_page: history.meta.last_page,\n };\n\n setData(history.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [pagination, budget]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleConfirm = (): void => {\n handleClose();\n };\n\n const getBudgetUserName = (item: User): string => {\n if (item.document_type === 'cnpj') {\n return `${item.corporate_name} - ${item.fantasy_name}`;\n }\n\n return item.name;\n };\n\n const getUserName = (item: FlowUser): string => {\n if (item.document_type === 'cnpj') {\n return `${item.corporate_name} - ${item.fantasy_name}`;\n }\n\n return item.name;\n };\n\n return (\n \n \n \n Histórico de aprovação\n\n \n\n \n \n \n Descrição: \n \n {budget.identification.description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Criação: \n \n {formatDate(budget.created_at)}\n \n \n\n {!!budget.user && (\n <>\n \n Usuário: \n {getBudgetUserName(budget.user)}\n \n \n )}\n\n \n Total: \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total)}{' '}\n {`(${Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 2,\n }).format(\n budget.total_separate_percent || 0,\n )}% complementares)`}\n \n \n \n\n ({\n id: item.id,\n responsible: (\n <>\n {formatDate(item.created_at)}\n\n \n {getUserName(item.user)}\n \n \n ),\n status: (\n \n ),\n message: {item.message},\n actions: null,\n })}\n data={data}\n noDataMessage=\"Nenhuma ação registrada.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n Fechar\n \n \n \n \n \n );\n};\n\nexport default ModalManageFlow;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n IconButton,\n Input as ChakraInput,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport { Input, State, DefaultPrice, StatePrice } from 'types/input';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalInputSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n budgetId: number;\n compositionId: number;\n };\n}\n\ntype Fragment = {\n input_id: number;\n coefficient: number;\n type: 'typed' | 'common';\n price_type_id: number;\n locale_key: string;\n};\n\ntype ComponentData = {\n fragments: Fragment[];\n};\n\ntype SelectedInput = Input & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetInputFragmentSelect: React.FC = ({\n data: { budgetId, bases, compositionId },\n handleClose,\n onConfirm,\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [inputs, setInputs] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedInputs, setSelectedInputs] = useState([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (input: Input): number => {\n const price = getStatePrice(input);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setInputs([]);\n\n try {\n const response = await api.get('/input', {\n params: {\n 'filter[resource]': 'input',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const inputsData = response.data;\n\n const newPagination = {\n last_page: inputsData.meta\n ? inputsData.meta.last_page\n : inputsData.last_page,\n };\n\n setInputs(inputsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message || 'Houve um erro ao buscar os insumos.',\n });\n\n setInputs([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectInput = (item: Input): void => {\n setSelectedInputs((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteInput = (item: Input): void => {\n setSelectedInputs((selected) => selected.filter((c) => c._id !== item._id));\n };\n\n const getStatePrice = (item: Input): State => {\n if (!item._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(item._source.prices));\n const state = states[0];\n\n return item._source.prices[state];\n };\n\n const getStateKey = (input: Input): string => {\n if (!input._source.prices) {\n return '';\n }\n\n const states = Array.from(Object.keys(input._source.prices));\n const state = states[0];\n\n return state;\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedInput[]): ComponentData => {\n if (!searchFilter.price_type_id) {\n return { fragments: [] };\n }\n\n return {\n fragments: selected.map((item) => ({\n input_id: Number(item._id),\n coefficient: item.quantity || 1,\n type: 'typed',\n price_type_id: Number(searchFilter.price_type_id),\n locale_key: getStateKey(item),\n })),\n };\n },\n [searchFilter.price_type_id],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.post(\n `budget/${budgetId}/composition/${compositionId}/component/fragment`,\n {\n ...prepareComponents(selectedInputs),\n },\n );\n\n toast({\n description: 'Insumos salvos com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar os insumos selecionados.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedInputs,\n prepareComponents,\n budgetId,\n handleClose,\n onConfirm,\n compositionId,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar insumos\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedInputs.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedInputs.length > 0 && (\n \n {selectedInputs.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectInput(item)}\n disabled={selectedInputs.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedInputs.some((c) => c._id === item._id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedInputs.some((c) => c._id === item._id) && (\n }\n onClick={() => handleDeleteInput(item)}\n />\n )}\n \n ),\n active: selectedInputs.some((c) => c._id === item._id),\n })}\n data={inputs}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedInputs.length > 0 ? (\n selectedInputs.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhum insumo selecionado\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedInputs((selected) =>\n selected.map((input) =>\n input._id === item._id\n ? {\n ...input,\n quantity: v.floatValue,\n }\n : input,\n ),\n );\n }}\n customInput={ChakraInput}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteInput(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetInputFragmentSelect;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Input as ChakraInput,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n IconButton,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport { Input, State, DefaultPrice, StatePrice } from 'types/input';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalInputSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n subStageId: number;\n budgetId: number;\n };\n}\n\ntype Component = {\n type: 'input_original';\n quantity: number;\n input_id: number;\n budget_base_id: number;\n};\n\ntype ComponentData = {\n parent_stage_id: number;\n components: Component[];\n};\n\ntype SelectedInput = Input & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetInputSelect: React.FC = ({\n data: { budgetId, bases, subStageId },\n handleClose,\n onConfirm,\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [inputs, setInputs] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedInputs, setSelectedInputs] = useState([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (input: Input): number => {\n const price = getStatePrice(input);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setInputs([]);\n\n try {\n const response = await api.get('/input', {\n params: {\n 'filter[resource]': 'input',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const inputsData = response.data;\n\n const newPagination = {\n last_page: inputsData.meta\n ? inputsData.meta.last_page\n : inputsData.last_page,\n };\n\n setInputs(inputsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message || 'Houve um erro ao buscar os insumos.',\n });\n\n setInputs([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectInput = (item: Input): void => {\n setSelectedInputs((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteInput = (item: Input): void => {\n setSelectedInputs((selected) => selected.filter((c) => c._id !== item._id));\n };\n\n const getStatePrice = (item: Input): State => {\n if (!item._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(item._source.prices));\n const state = states[0];\n\n return item._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedInput[]): ComponentData => {\n return {\n parent_stage_id: subStageId,\n components: selected.map((item) => ({\n type: 'input_original',\n input_id: Number(item._id),\n quantity: item.quantity || 0,\n budget_base_id:\n bases.find(\n (b) => b.version.base.id === item._source.version.base.id,\n )?.id || 0,\n })),\n };\n },\n [subStageId, bases],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.post(`budget/${budgetId}/component`, {\n ...prepareComponents(selectedInputs),\n });\n\n toast({\n description: 'Insumos salvos com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar os insumos selecionados.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [selectedInputs, prepareComponents, budgetId, handleClose, onConfirm]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar insumos\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedInputs.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedInputs.length > 0 && (\n \n {selectedInputs.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectInput(item)}\n disabled={selectedInputs.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedInputs.some((c) => c._id === item._id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedInputs.some((c) => c._id === item._id) && (\n }\n onClick={() => handleDeleteInput(item)}\n />\n )}\n \n ),\n active: selectedInputs.some((c) => c._id === item._id),\n })}\n data={inputs}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedInputs.length > 0 ? (\n selectedInputs.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhum insumo selecionado\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedInputs((selected) =>\n selected.map((input) =>\n input._id === item._id\n ? {\n ...input,\n quantity: v.floatValue,\n }\n : input,\n ),\n );\n }}\n customInput={ChakraInput}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteInput(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetInputSelect;\n","import React from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Warning as WarningIcon } from '@styled-icons/entypo/Warning';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport MdiGroupIcon from 'mdi-react/GroupIcon';\n\nimport {\n Box,\n Icon,\n Tr,\n Td,\n Text,\n Flex,\n Tooltip,\n HStack,\n Button,\n IconButton,\n} from '@chakra-ui/react';\n\nimport { Row, FlattenedComponent } from './types';\n\nexport type Composition = {\n price: number;\n unit_price_was_changed: boolean;\n unit_price_original: number;\n newQuantity: number;\n recursive_quantity: number;\n outdated_price: boolean;\n composition_price: {\n base: {\n description: string;\n };\n version: {\n description: string;\n };\n composition: {\n code: string;\n description: string;\n version: {\n year?: number;\n month?: number;\n description: string;\n base: {\n description: string;\n };\n };\n unit_measure: {\n description: string;\n };\n };\n };\n};\n\ninterface RowProps {\n row: Row & { original: FlattenedComponent & Composition };\n activeTab: 'list' | 'selected';\n isSiengeBudget: boolean;\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n}\n\nconst CompositionRow: React.FC = ({\n row,\n activeTab,\n isSiengeBudget,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n}) => {\n return (\n \n \n \n {row.original.location} \n \n \n\n \n \n {row.original.composition_price.base?.description}\n \n\n \n {row.original.composition_price.version?.description}\n \n \n\n {row.original.composition_price.composition.code}\n\n \n \n {row.original.composition_price.composition.description}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 4,\n }).format(row.original.quantity)}\n \n\n \n \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.social_law_price)}\n \n\n {row.original.outdated_price && !isSiengeBudget && (\n \n \n \n )}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.price)}\n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.total)}\n \n\n \n {activeTab === 'list' ? (\n \n }\n onClick={() => handleSelectComponent(row.original)}\n disabled={selectedComponents.some(\n (c) => c.id === row.original.id,\n )}\n >\n {selectedComponents.some((c) => c.id === row.original.id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedComponents.some((c) => c.id === row.original.id) && (\n }\n onClick={() => handleDeleteComponent(row.original)}\n />\n )}\n \n ) : (\n }\n onClick={() => handleDeleteComponent(row.original)}\n >\n Remover\n \n )}\n \n \n );\n};\n\nexport default CompositionRow;\n","import React from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Warning as WarningIcon } from '@styled-icons/entypo/Warning';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\n\nimport {\n Box,\n Icon,\n Td,\n Text,\n Input,\n Flex,\n Tooltip,\n Tr,\n HStack,\n Button,\n IconButton,\n} from '@chakra-ui/react';\n\nimport { Row, FlattenedComponent } from './types';\n\nexport type Input = {\n price: number;\n newQuantity: number;\n recursive_quantity: number;\n input_price: {\n base: {\n description: string;\n };\n version: {\n description: string;\n };\n input: {\n code: string;\n description: string;\n version: {\n year?: number;\n month?: number;\n description: string;\n base: {\n description: string;\n };\n };\n unit_measure: {\n description: string;\n };\n };\n };\n};\n\ninterface RowProps {\n row: Row & { original: FlattenedComponent & Input };\n activeTab: 'list' | 'selected';\n isSiengeBudget: boolean;\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n}\n\nconst InputRow: React.FC = ({\n row,\n selectedComponents,\n activeTab,\n isSiengeBudget,\n handleSelectComponent,\n handleDeleteComponent,\n}) => {\n return (\n \n \n \n {row.original.location} \n \n \n\n \n \n {row.original.input_price.base?.description}{' '}\n \n\n \n {row.original.input_price.version?.description ||\n row.original.input_price.input?.version?.description}\n \n \n\n {row.original.input_price.input.code}\n \n \n {row.original.input_price.input.description}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 4,\n }).format(row.original.quantity)}\n \n\n \n \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.social_law_price)}\n \n\n {row.original.outdated_price && !isSiengeBudget && (\n \n \n \n )}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.price)}\n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.total)}\n \n\n \n {activeTab === 'list' ? (\n \n }\n onClick={() => handleSelectComponent(row.original)}\n disabled={selectedComponents.some(\n (c) => c.id === row.original.id,\n )}\n >\n {selectedComponents.some((c) => c.id === row.original.id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedComponents.some((c) => c.id === row.original.id) && (\n }\n onClick={() => handleDeleteComponent(row.original)}\n />\n )}\n \n ) : (\n }\n onClick={() => handleDeleteComponent(row.original)}\n >\n Remover\n \n )}\n \n \n );\n};\n\nexport default InputRow;\n","import React, { useCallback } from 'react';\nimport {\n TableBodyPropGetter,\n TableBodyProps,\n Row,\n ColumnInstance,\n} from 'react-table';\n\nimport { Tbody, Tr } from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport { Td } from 'components/Table';\n\nimport CompositionRow from './CompositionRow';\nimport InputRow from './InputRow';\nimport { FlattenedComponent, Stage } from './types';\n\ntype RowType = Stage['type'];\n\ninterface OutdatedComponentsBodyProps {\n getTableBodyProps: (\n propGetter?: TableBodyPropGetter | undefined,\n ) => TableBodyProps;\n loading: boolean;\n data: FlattenedComponent[];\n rows: Row[];\n\n visibleColumns: ColumnInstance[];\n prepareRow: (row: Row) => void;\n\n activeTab: 'list' | 'selected';\n isSiengeBudget: boolean;\n\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n}\n\nconst OutdatedComponentsBody: React.FC = ({\n getTableBodyProps,\n loading,\n data,\n rows,\n prepareRow,\n activeTab,\n isSiengeBudget,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n}) => {\n const getRow = useCallback(\n (type: RowType, row: Row) => {\n if (type === 'composition_original') {\n return (\n \n );\n }\n\n if (type === 'input_original') {\n return (\n \n );\n }\n\n return null;\n },\n [\n isSiengeBudget,\n activeTab,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n ],\n );\n\n return (\n \n {(!loading || data.length >= 0) &&\n rows.map((row) => {\n prepareRow(row);\n return getRow(row.original.type, row);\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && data.length === 0 && (\n \n \n {activeTab === 'list'\n ? 'Nenhum componente desatualizado encontrado'\n : 'Nenhum componente selecionado'}\n \n \n )}\n \n );\n};\n\nexport default OutdatedComponentsBody;\n","import React, { useMemo, useCallback } from 'react';\nimport { useTable } from 'react-table';\n\nimport {\n TableContainer,\n Table,\n Thead,\n Tr,\n Th,\n Text,\n Box,\n Checkbox,\n Flex,\n} from '@chakra-ui/react';\n\nimport OutdatedComponentsTableBody from './OutdatedComponentsTableBody';\nimport { Row, FlattenedComponent } from './types';\n\ninterface OutdatedComponentsTableProps {\n data: FlattenedComponent[];\n loading: boolean;\n activeTab: 'list' | 'selected';\n isSiengeBudget: boolean;\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n toggleSelectAllComponents: () => void;\n}\n\nconst OutdatedComponentsTable: React.FC = ({\n data,\n loading,\n activeTab,\n isSiengeBudget,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n toggleSelectAllComponents,\n}) => {\n const columns = useMemo(\n () => [\n {\n Header: 'Item',\n key: 'item',\n width: '5%',\n isCentered: true,\n },\n {\n Header: 'Base',\n width: '10%',\n key: 'base',\n isCentered: true,\n },\n {\n Header: 'Código',\n width: '5%',\n key: 'code',\n },\n\n {\n Header: 'Descrição',\n width: '50%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {`${row.original.location} -`}\n {row.original.title}\n \n );\n },\n },\n {\n Header: 'Qtde',\n width: '1%',\n colSpan: 10,\n isNumeric: true,\n key: 'quantity',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.quantity;\n\n return Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 7,\n }).format(value || 0);\n },\n },\n {\n Header: 'Unit.',\n width: '1%',\n isNumeric: true,\n key: 'unitary_value',\n },\n {\n Header: 'Com BDI',\n width: '1%',\n key: 'with_bdi',\n isNumeric: true,\n },\n {\n id: 'total',\n Header: 'Total',\n width: '1%',\n isNumeric: true,\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: () => (\n \n {activeTab === 'list' && (\n 0 && selectedComponents.length === data.length\n }\n title=\"Selecionar todos\"\n />\n )}\n \n Ações\n \n \n ),\n id: 'actions',\n width: '5%',\n Cell: () => {\n return <>;\n },\n },\n ],\n [data, activeTab, selectedComponents, toggleSelectAllComponents],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable({\n columns,\n data,\n getRowId,\n });\n\n return (\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n
\n
\n );\n};\n\nexport default OutdatedComponentsTable;\n","import React, { Suspense, useCallback, useEffect, useState } from 'react';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Box,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport OutdatedComponentsTable from './OutdatedComponentsTable';\nimport { FlattenedComponent } from './types';\n\ninterface ModalOutdatedComponentSelect extends ModalRootProps {\n data: {\n budgetId: number;\n isSiengeBudget?: boolean;\n };\n}\n\ntype SelectedComponent = FlattenedComponent;\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalBudgetOutdatedComponentSelect: React.FC =\n ({\n data: { budgetId, isSiengeBudget },\n handleClose,\n onConfirm,\n ...restProps\n }) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [saving, setSaving] = useState(false);\n\n const [components, setComponents] = useState([]);\n const [selectedComponents, setSelectedComponents] = useState<\n SelectedComponent[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const getData = useCallback(async () => {\n setLoading(true);\n setComponents([]);\n\n try {\n const { data: response } = await api.get(\n `/budget/${budgetId}/component`,\n {\n params: {\n 'filter[outdated_price]': 1,\n sort: 'position',\n },\n },\n );\n\n const componentsData = response.data;\n setComponents(componentsData);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message ||\n 'Houve um erro ao buscar composições',\n });\n\n setComponents([]);\n } finally {\n setLoading(false);\n }\n }, [budgetId]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComponent = (item: FlattenedComponent): void => {\n setSelectedComponents((prepared) => [\n ...prepared,\n {\n ...item,\n },\n ]);\n };\n\n const handleDeleteComponent = (item: FlattenedComponent): void => {\n setSelectedComponents((selected) =>\n selected.filter((c) => c.id !== item.id),\n );\n };\n\n const toggleSelectAllComponents = (): void => {\n if (selectedComponents.length === components.length) {\n setSelectedComponents([]);\n } else {\n setSelectedComponents(components);\n }\n };\n const handleSubmitComponents = useCallback(async () => {\n setSaving(true);\n\n try {\n await api.post(`budget/${budgetId}/restore/prices`, {\n budget_components: selectedComponents.map(\n (component) => component.id,\n ),\n });\n\n toast({\n description:\n 'Solicitação de atualização enviada com sucesso. Você será notificado quando a atualização for concluída.',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao enviar a solicitação de atualização',\n status: 'error',\n });\n }\n } finally {\n setSaving(false);\n }\n }, [handleClose, onConfirm, budgetId, selectedComponents]);\n\n return (\n \n \n \n Selecionar componentes para atualização\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedComponents.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n \n {isSiengeBudget\n ? 'Lista de componentes'\n : 'Componentes desatualizados'}\n \n \n Selecionados{' '}\n {selectedComponents.length > 0 && (\n \n {selectedComponents.length}\n \n )}\n \n \n\n }>\n \n \n \n \n\n \n \n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n \n \n \n \n \n \n \n );\n };\n\nexport default ModalBudgetOutdatedComponentSelect;\n","import React from 'react';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Box,\n Radio,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype BudgetType = 'sienge_plataform' | 'common';\n\nconst ModalBudgetTypeSelect: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [type, setType] = React.useState('sienge_plataform');\n\n const handleConfirm = async (): Promise => {\n if (onConfirm) {\n onConfirm(type);\n }\n\n handleClose();\n };\n\n return (\n \n \n \n Novo orçamento\n\n \n\n \n \n Selecione o tipo de orçamento que deseja criar.\n\n \n Se desejar integrar seu orçamento com o Sienge Plataforma,\n selecione a opção "Orçamento Sienge".\n \n \n\n \n {\n setType('sienge_plataform');\n }}\n >\n \n \n Orçamento Sienge\n \n \n\n {\n setType('common');\n }}\n >\n \n \n Orçamento padrão\n \n \n \n \n\n \n \n \n \n \n );\n};\n\nexport default ModalBudgetTypeSelect;\n","import React, { useState, useEffect, useCallback, useContext } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport useDebouncedState from 'hooks/useDebouncedState';\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Client } from 'types/client';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nconst ModalClientLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const [clientList, setClientList] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [keyword, setKeyword] = useDebouncedState('');\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 10,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getClientList = useCallback(async () => {\n setLoading(true);\n setClientList([]);\n\n try {\n const response = await api.get('/client', {\n params: {\n 'filter[keyword]': keyword,\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[organization_id]': user.managed_organization.organization.id,\n },\n });\n\n const clients = response.data;\n\n const newPagination = {\n last_page: clients.meta.last_page,\n };\n\n setClientList(clients.data);\n setServicePagination(newPagination);\n } catch (err) {\n setClientList([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [keyword, pagination, user]);\n\n useEffect(() => {\n getClientList();\n }, [getClientList]);\n\n const clientNameByType = (client: Client): React.ReactNode => {\n if (client.type_person === 'legal') {\n return (\n <>\n {client.fantasy_name}\n
\n {client.corporate_name}\n \n );\n }\n\n return client.name;\n };\n\n const handleConfirm = (client: Client): void => {\n if (onConfirm) onConfirm(client);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar cliente\n\n \n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n setKeyword(e.target.value)}\n mb={{ base: 3, md: 0 }}\n />\n \n \n\n ({\n id: item.id,\n name: (\n <>\n {clientNameByType(item)}\n \n {item.document}\n \n \n ),\n phone: (\n <>\n {item.phone}\n
\n {item.cell_phone}\n \n ),\n email: item.email,\n contact: item.contact,\n actions: (\n }\n onClick={() => handleConfirm(item)}\n >\n Selecionar\n \n ),\n })}\n data={clientList}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n
\n
\n
\n );\n};\n\nexport default ModalClientLookup;\n","import React from 'react';\n\nimport {\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Input,\n Select,\n Textarea,\n} from '@chakra-ui/react';\n\nimport { PreparedClient } from 'types/client';\n\ninterface FormProps {\n initialData?: PreparedClient;\n}\n\nconst FormClientLookup: React.FC = ({ initialData }) => {\n return (\n *': {\n marginY: 1,\n },\n }}\n >\n \n \n Tipo\n\n \n \n\n \n \n {initialData?.type_person === 'legal' ? 'CNPJ' : 'CPF'}\n \n\n \n \n \n\n {initialData?.type_person === 'physical' && (\n \n Nome completo\n\n \n \n )}\n\n {initialData?.type_person === 'legal' && (\n \n \n Razão Social\n\n \n \n\n \n Nome fantasia\n\n \n \n \n )}\n\n \n \n Telefone (fixo)\n \n \n\n \n Telefone (celular / WhatsApp)\n\n \n \n \n\n \n \n Email\n\n \n \n\n \n Contato\n\n \n \n \n\n \n \n CEP\n \n \n\n \n Estado\n\n \n \n\n \n Cidade\n\n \n \n \n\n \n \n Endereço\n\n \n \n\n \n Número\n\n \n \n\n \n Complemento\n\n \n \n\n \n Bairro\n \n \n \n\n \n Observação\n \n \n \n );\n};\n\nexport default FormClientLookup;\n","import React, { useState, useCallback, useEffect } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport { ServiceClient, PreparedClient } from 'types/client';\n\nimport Form from './Form';\n\ntype Props = ModalRootProps & {\n data?: {\n client_id?: number;\n };\n};\n\nconst ModalClientLookup: React.FC = ({ data, ...rest }) => {\n const [client, setClient] = useState({} as ServiceClient);\n\n const getClient = useCallback(async (): Promise => {\n try {\n if (data?.client_id) {\n const response = await api.get(`/client/${data.client_id}`);\n\n const clientLoaded = response.data;\n\n setClient({\n ...clientLoaded.data,\n });\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar o cliente',\n status: 'error',\n });\n }\n }, [setClient, data]);\n\n useEffect(() => {\n getClient();\n }, [getClient]);\n\n const prepareClient = (value: ServiceClient): PreparedClient => ({\n ...value,\n type_person: value.type_person || 'physical',\n document: value.document,\n cep: value.zip_code || '',\n state_name: value.city_id?.state.name,\n city_name: value.city_id?.name,\n });\n\n return (\n \n \n \n Visualizar cliente\n\n \n\n \n
\n \n \n \n );\n};\n\nexport default ModalClientLookup;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { FragmentResource, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n nextComponentId: number;\n nextComponentPriceTypeKey: string;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst FragmentTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original.fragment_type;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n nextComponentId: row.original.fragment.id,\n nextComponentPriceTypeKey: row.original.price_type?.key,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default FragmentTableRow;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Icon,\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Flex,\n Box,\n Skeleton,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport FragmentTableRow from './FragmentsTableRow';\nimport { FragmentResource, Row } from './types';\n\nexport type FragmentSummary = {\n total: number;\n material: number;\n material_percent: number;\n equipment: number;\n equipment_percent: number;\n labor: number;\n labor_percent: number;\n third_party: number;\n third_party_percent: number;\n other: number;\n other_percent: number;\n};\n\ntype QttySummary = {\n total_compositions: number;\n total_inputs: number;\n};\n\ntype Props = {\n component_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n isSubRow?: boolean;\n parentFragments?: FragmentResource[];\n parentQttySummary?: QttySummary;\n};\n\nconst FragmentsTable: React.FC = ({\n isSubRow = false,\n parentFragments = [],\n component_id,\n locale_key,\n price_type_id,\n price_type_key,\n}) => {\n const [fragments, setFragments] = useState([]);\n const [qttySummary, setQttySummary] = useState(\n {} as QttySummary,\n );\n const [loading, setLoading] = useState(false);\n\n const getData = useCallback(async () => {\n setLoading(true);\n setFragments([]);\n\n try {\n const response = await api.get(\n `/composition/${component_id}/component/fragment`,\n {\n params: {\n page: 1,\n per_page: 999,\n 'filter[locale_key]': locale_key,\n 'filter[price_type_key]': price_type_key,\n },\n },\n );\n\n const fragmentsLoaded = response.data;\n\n const newQttySummary = {\n total_compositions: fragmentsLoaded.summary.total.total_compositions,\n total_inputs: fragmentsLoaded.summary.total.total_inputs,\n };\n\n setFragments(fragmentsLoaded.data);\n setQttySummary(newQttySummary);\n } catch (err) {\n setFragments([]);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar o mapeamento da composição.',\n status: 'error',\n });\n setQttySummary({} as QttySummary);\n } finally {\n setLoading(false);\n }\n }, [component_id, locale_key, price_type_key]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const isInput = (data: FragmentResource): boolean => {\n return data.fragment_type.includes('input');\n };\n\n const getType = (row: Row): string => {\n return row.original.fragment_type;\n };\n\n const getIcon = (row: Row): MdiReactIconComponentType => {\n if (getType(row).includes('input')) {\n return InfoIcon;\n }\n\n return GroupIcon;\n };\n\n const shouldShowInputIcon = (i: FragmentResource): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i.fragment.classification.key);\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: FragmentResource): InputIcon => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputIconType = useCallback((i: FragmentResource): string => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const columns = useMemo(\n () => [\n {\n Header: () => 'Tipo',\n id: 'expander',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n \n \n \n\n {isInput(row.original) && shouldShowInputIcon(row.original) && (\n \n \n \n )}\n\n {getType(row).includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n \n );\n },\n },\n {\n Header: 'Código',\n accessor: 'data.code',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return `${row.original.fragment.code} / ${row.original.fragment.version.base.description}`;\n },\n },\n {\n Header: 'Descrição',\n accessor: 'data.description',\n width: '70%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original.fragment.description}\n \n );\n },\n },\n {\n Header: 'Unidade',\n accessor: 'data.unit_measure_id',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.fragment.unit_measure.description;\n },\n },\n {\n Header: 'Coeficiente',\n accessor: 'data.coefficient',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.coefficient;\n },\n },\n {\n Header: 'Valor unitário',\n accessor: 'data.unit_value',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.unit_price;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: 'Total',\n accessor: 'data.total',\n isNumeric: true,\n width: '15%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getInputIcon],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n // @ts-expect-error types\n columns,\n data: fragments,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ nextComponentId, nextComponentPriceTypeKey }) => (\n \n ),\n [locale_key, price_type_id, fragments],\n );\n\n const parent = useMemo(() => {\n return parentFragments.find((f) => f.fragment.id === component_id);\n }, [parentFragments, component_id]);\n\n return (\n <>\n {isSubRow && (\n \n <>\n \n Classe\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.classification.description || '-'}\n )}\n \n \n\n \n Tipo\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.description || '-'}\n )}\n \n \n\n \n Composições\n \n {loading ? (\n \n ) : (\n <>{qttySummary.total_compositions}\n )}\n \n \n\n \n Insumos\n \n {loading ? (\n \n ) : (\n <> {qttySummary.total_inputs}\n )}\n \n \n \n \n )}\n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && fragments.length === 0 && (\n \n \n Nenhum resultado encontrado.\n \n \n )}\n \n
\n
\n \n );\n};\n\nexport default FragmentsTable;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { DollarSign as DollarSignIcon } from '@styled-icons/fa-solid/DollarSign';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Flex,\n Text,\n Box,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport SummaryContainer from 'components/SummaryContainer';\nimport SummaryDataChartCard from 'components/SummaryDataChartCard';\n\nimport FragmentsTable, { FragmentSummary } from './FragmentsTable';\n\ntype Props = ModalRootProps & {\n data: {\n id: number;\n locale_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n code: string;\n base: string;\n description: string;\n prices: string;\n price: number;\n classification: string;\n type: string;\n unit_measure: string;\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalCompositionLookup: React.FC = ({ data, ...restProps }) => {\n const [loading, setLoading] = useState(false);\n const [summary, setSummary] = useState(\n {} as FragmentSummary,\n );\n\n const price: number = (() => {\n const prices = JSON.parse(data.prices);\n\n if (prices.length === 0) {\n return data.price || 0;\n }\n\n const states = Array.from(Object.keys(prices));\n const state = states[0];\n\n const price_ = prices[state];\n\n if (price_.default) {\n return price_.default.total;\n }\n\n if (price_.taxed) {\n return price_.taxed.total;\n }\n\n if (price_.untaxed) {\n return price_.untaxed.total;\n }\n\n return 0;\n })();\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const getSummary = useCallback(async () => {\n setLoading(true);\n setSummary({} as FragmentSummary);\n\n try {\n const { data: response } = await api.get(\n `/composition/${data.id}/price`,\n {\n params: {\n 'filter[locale_id]': data.locale_id,\n 'filter[price_type_id]': data.price_type_id,\n },\n },\n );\n\n const [summaryLoaded] = response.data;\n\n setSummary({\n total: summaryLoaded.total,\n material: summaryLoaded.material,\n material_percent: summaryLoaded.material_percent,\n equipment: summaryLoaded.equipment,\n equipment_percent: summaryLoaded.equipment_percent,\n labor: summaryLoaded.labor,\n labor_percent: summaryLoaded.labor_percent,\n third_party: summaryLoaded.third_party,\n third_party_percent: summaryLoaded.third_party_percent,\n other: summaryLoaded.other,\n other_percent: summaryLoaded.other_percent,\n });\n } catch (err) {\n setSummary({} as FragmentSummary);\n } finally {\n setLoading(false);\n }\n }, [data]);\n\n useEffect(() => {\n getSummary();\n }, [getSummary]);\n\n return (\n \n \n \n Detalhes da composição\n\n \n\n \n \n \n \n\n \n \n Código\n \n {data.code} / {data.base}\n \n \n\n \n Descrição\n \n {data.description}\n \n \n \n\n \n \n Valor unitário\n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(price)}\n \n \n\n \n Classe\n \n {data.classification}\n \n \n\n \n Tipo\n \n {data.type}\n \n \n\n \n Unidade\n \n {data.unit_measure}\n \n \n \n\n \n \n \n \n );\n};\n\nexport default ModalCompositionLookup;\n","export const stateDescriptionByKey: Record = {\n AC: 'Acre',\n AL: 'Alagoas',\n AP: 'Amapá',\n AM: 'Amazonas',\n BA: 'Bahia',\n CE: 'Ceará',\n DF: 'Distrito Federal',\n ES: 'Espírito Santo',\n GO: 'Goías',\n MA: 'Maranhão',\n MT: 'Mato Grosso',\n MS: 'Mato Grosso do Sul',\n MG: 'Minas Gerais',\n PA: 'Pará',\n PB: 'Paraíba',\n PR: 'Paraná',\n PE: 'Pernambuco',\n PI: 'Piauí',\n RJ: 'Rio de Janeiro',\n RN: 'Rio Grande do Norte',\n RS: 'Rio Grande do Sul',\n RO: 'Rondônia',\n RR: 'Roraíma',\n SC: 'Santa Catarina',\n SP: 'São Paulo',\n SE: 'Sergipe',\n TO: 'Tocantins',\n};\n","import React from 'react';\n\nimport { stateDescriptionByKey } from 'shared/locale';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n TableContainer,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport { Table, Thead, Tbody, Tr, Th, Td } from 'components/Table';\n\ninterface ModalCompositionPrices extends ModalRootProps {\n data: {\n composition_description: string;\n prices: string;\n };\n}\n\ntype Prices = {\n taxed: { total: number };\n untaxed: { total: number };\n};\n\ntype PricesMap = {\n locale: string;\n taxed_total: number | null;\n untaxed_total: number | null;\n};\n\nfunction sortLocales(a: PricesMap, b: PricesMap): number {\n if (a.locale < b.locale) return -1;\n if (a.locale > b.locale) return 1;\n return 0;\n}\n\nconst ModalCompositionPricesLookup: React.FC = ({\n data,\n ...restProps\n}) => {\n const mappedPrices = (() => {\n const prices = JSON.parse(data.prices);\n const entries = Object.entries(prices);\n\n const pricesMap = entries\n .map(([locale, price]) => {\n return {\n locale: stateDescriptionByKey[locale],\n taxed_total: price.taxed ? price.taxed.total : null,\n untaxed_total: price.untaxed ? price.untaxed.total : null,\n };\n })\n .sort(sortLocales);\n\n return pricesMap;\n })();\n\n return (\n \n \n \n Preços da composição\n\n \n\n \n \n {data.composition_description}\n \n\n \n \n \n \n \n \n \n \n \n \n {mappedPrices.map((item, i) => (\n \n \n \n \n \n ))}\n \n
EstadoDesoneradoNão desonerado
{item.locale}\n {item.untaxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.untaxed_total)\n : null}\n \n {item.taxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.taxed_total)\n : null}\n
\n
\n
\n
\n
\n );\n};\n\nexport default ModalCompositionPricesLookup;\n","import React, { useState, useEffect, useCallback, useRef } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { Search as SearchIcon } from '@styled-icons/boxicons-regular/Search';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n FormControl,\n FormLabel,\n InputRightAddon,\n IconButton,\n InputGroup,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Enterprise } from 'types/enterprise';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nconst ModalEnterpriseLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [id, setId] = useState('');\n const idInputRef = useRef(null);\n\n const [initialLoad, setInitialLoad] = useState(false);\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 10,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getEnterpriseList = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n let enterprises: Enterprise[] = [];\n\n try {\n if (id) {\n const response = await api.get(`/enterprise/${id}`);\n const found = response.data;\n enterprises = [found.data];\n } else {\n const response = await api.get('/enterprise', {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const enterprisesData = response.data;\n enterprises = enterprisesData.data;\n\n const newPagination = {\n last_page: enterprisesData.meta.last_page,\n };\n\n setServicePagination(newPagination);\n }\n setData(enterprises);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Ocorreu um erro ao buscar as obras.',\n status: 'error',\n });\n\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [pagination, id]);\n\n useEffect(() => {\n getEnterpriseList();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pagination]);\n\n const handleConfirm = (enterprise: Enterprise): void => {\n if (onConfirm) onConfirm(enterprise);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n useEffect(() => {\n if (!initialLoad) {\n setInitialLoad(true);\n }\n }, [initialLoad]);\n\n useEffect(() => {\n if (initialLoad && idInputRef.current) {\n idInputRef.current.focus();\n }\n }, [initialLoad]);\n\n return (\n \n \n \n Selecionar obra\n\n \n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n \n Pesquisar por código\n \n setId(e.target.value)}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n getEnterpriseList();\n }\n }}\n mb={{ base: 3, md: 0 }}\n />\n \n \n \n \n \n \n \n \n \n\n ({\n id: item.external_id,\n name: (\n \n \n {item.external_id}\n \n . {item.name}\n \n ),\n actions: (\n }\n onClick={() => handleConfirm(item)}\n >\n Selecionar\n \n ),\n })}\n data={data}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n \n );\n};\n\nexport default ModalEnterpriseLookup;\n","import React, { useCallback, useState, useContext } from 'react';\n\nimport { api } from 'services/api';\nimport { isSuperAdmin } from 'shared/roles';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Input,\n HStack,\n Textarea,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport AuthContext from 'contexts/AuthContext';\n\ntype ModalGPTModelProps = ModalRootProps & {\n data: {\n budgetId: number;\n prompt: string;\n model: string;\n };\n};\n\nconst ModalGPTModel: React.FC = ({\n data,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const [model, setModel] = useState(data.model);\n const [prompt, setPrompt] = useState(data.prompt);\n\n const handleSubmitValues = useCallback(async () => {\n if (!model || !prompt) {\n toast({\n status: 'error',\n title: 'Preencha todos os campos.',\n });\n\n return;\n }\n\n if (!isSuperAdmin(user)) {\n toast({\n status: 'error',\n title: 'Acesso negado.',\n });\n\n return;\n }\n\n try {\n await api.post(`/parametric/budget/${data.budgetId}`, {\n model,\n prompt,\n });\n\n await api.post(`/parametric/budget/${data.budgetId}/calculate`);\n\n toast({\n description: `Orçamento paramétrico solicitado com sucesso! Você será notificado quando estiver pronto.`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar gerar o orçamento.',\n status: 'error',\n });\n }\n }, [handleClose, onConfirm, user, model, prompt, data.budgetId]);\n\n return (\n \n \n \n Curva ABC\n\n \n\n \n *': {\n marginY: 1,\n },\n }}\n >\n \n \n Modelo GPT\n\n setModel(e.target.value)}\n />\n \n\n \n Prompt\n\n setPrompt(e.target.value)}\n resize=\"none\"\n rows={10}\n />\n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n};\n\nexport default ModalGPTModel;\n","import React, {\n useState,\n useCallback,\n useMemo,\n useEffect,\n useContext,\n} from 'react';\nimport { useDropzone } from 'react-dropzone';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Input,\n Tooltip,\n Icon,\n Box,\n Progress,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Base, Version } from 'types/base';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n type: 'own_input' | 'own_composition';\n };\n}\n\nconst baseStyle: React.CSSProperties = {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: '20px',\n borderWidth: 2,\n borderRadius: 4,\n borderColor: '#eeeeee',\n borderStyle: 'dashed',\n backgroundColor: '#fafafa',\n color: '#bdbdbd',\n outline: 'none',\n transition: 'border .24s ease-in-out',\n cursor: 'pointer',\n textAlign: 'center',\n fontSize: '14px',\n};\n\nconst focusedStyle = {\n borderColor: '#2196f3',\n};\n\nconst selectedStyle = {\n borderColor: '#2196f3',\n color: '#2196f3',\n};\n\nconst acceptStyle = {\n borderColor: '#00e676',\n color: '#00e676',\n};\n\nconst rejectStyle = {\n borderColor: '#ff1744',\n color: '#ff1744',\n};\n\nconst MotionBox = motion(Box);\n\nconst ModalImport: React.FC = ({\n data: { type = 'own_input' },\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const [bases, setBases] = useState([]);\n const [selectedBase, setSelectedBase] = useState();\n const [isLoadingBases, setIsLoadingBases] = useState(false);\n\n const [baseVersions, setBaseVersions] = useState([]);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState();\n const [isLoadingBaseVersions, setIsLoadingBaseVersions] = useState(false);\n\n const [progress, setProgress] = useState(0);\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState({} as FormErrors);\n\n const [file, setFile] = React.useState(null);\n const [headerLine, setHeaderLine] = React.useState();\n\n const getBases = useCallback(async () => {\n setIsLoadingBases(true);\n\n try {\n const { data: response } = await api.get('/base', {\n params: {\n sort: `description`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n },\n });\n const basesLoaded = response.data;\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n setErrors({ ...errors, base: false });\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setIsLoadingBases(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n const getBaseVersions = useCallback(async (baseId?: number) => {\n if (!baseId) {\n setBaseVersions([]);\n return;\n }\n\n try {\n setIsLoadingBaseVersions(true);\n const { data: response } = await api.get('version', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const baseVersionsLoaded = response.data;\n setBaseVersions(baseVersionsLoaded);\n\n if (baseVersionsLoaded.length === 1) {\n const [baseVersion] = baseVersionsLoaded;\n setSelectedBaseVersion(baseVersion.id);\n setErrors({ ...errors, baseVersion: false });\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as versões da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseVersions(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseVersionsToSelect = useMemo(() => {\n return baseVersions.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [baseVersions]);\n\n useEffect(() => {\n getBaseVersions(selectedBase);\n }, [getBaseVersions, selectedBase]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : undefined;\n\n setSelectedBase(value);\n };\n\n const onDrop = useCallback((acceptedFiles) => {\n setFile(acceptedFiles[0]);\n }, []);\n\n const accept = {\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': [\n '.xlsx',\n '.xls',\n ],\n 'text/csv': ['.csv'],\n };\n\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n isFocused,\n isDragAccept,\n isDragReject,\n } = useDropzone({\n accept,\n onDrop,\n });\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!headerLine) {\n formErrors.header = 'Linha do cabeçalho é obrigatório';\n }\n\n if (!file) {\n formErrors.file = 'Arquivo é obrigatório';\n }\n\n if (!selectedBase) {\n formErrors.base = 'Base é obrigatório';\n }\n\n if (!selectedBaseVersion) {\n formErrors.baseVersion = 'Versão da base é obrigatório';\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length || !file) {\n return;\n }\n\n try {\n setLoading(true);\n\n const formData = new FormData();\n formData.append('type', type);\n formData.append('header_row', String(headerLine));\n formData.append('description', String(file.name));\n formData.append('version_id', String(selectedBaseVersion));\n formData.append('file', file);\n\n const {\n data: {\n id: importId,\n mapped_header: mappedHeaders,\n header_row: headerRow,\n version,\n file: importedFile,\n },\n } = await api\n .post(`/import`, formData, {\n onUploadProgress: (progressEvent) => {\n const uploadPercentage = Math.round(\n (progressEvent.loaded * 100) / progressEvent.total,\n );\n\n if (uploadPercentage < 100) {\n setProgress(uploadPercentage);\n }\n },\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n })\n .then((response) => {\n setProgress(100);\n\n return response.data;\n });\n\n if (onConfirm)\n onConfirm({\n id: importId,\n mappedHeaders,\n headerRow,\n baseId: selectedBase,\n baseName: version?.base?.description || 'Não definido',\n versionName: version?.description || 'Não definido',\n fileName: importedFile.name,\n });\n\n handleClose();\n } catch (err) {\n setProgress(0);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const style = useMemo(\n () => ({\n ...baseStyle,\n ...(file ? selectedStyle : {}),\n ...(isFocused ? focusedStyle : {}),\n ...(isDragAccept ? acceptStyle : {}),\n ...(isDragReject ? rejectStyle : {}),\n ...(errors.file ? rejectStyle : {}),\n }),\n [isFocused, isDragAccept, isDragReject, file, errors],\n );\n\n useEffect(() => {\n if (file && errors.file) {\n const newErrors = errors;\n delete newErrors.file;\n setErrors(newErrors);\n }\n }, [file, errors]);\n\n const extensions = Object.values(accept).flat().join(', ');\n\n const dropMessage = useMemo(() => {\n if (file) {\n return `Selecionado: ${file.name}`;\n }\n\n if (isDragAccept) {\n return 'Tudo certo! Pode soltar os arquivos aqui.';\n }\n\n if (isDragReject) {\n return `Tipo de arquivo não suportado. Tipos suportados: ${extensions}.`;\n }\n\n if (isDragActive) {\n return 'Solte os arquivos aqui...';\n }\n\n return 'Arraste ou clique para selecionar o arquivo do orçamento.';\n }, [file, extensions, isDragAccept, isDragReject, isDragActive]);\n\n return (\n \n \n \n Importar Excel / CSV\n\n \n\n \n \n Base de dados\n Number(s.value) === selectedBase,\n )}\n isLoading={isLoadingBases}\n isDisabled={isLoadingBases || basesToSelect.length === 0}\n // isClearable\n onChange={handleBaseChange}\n />\n \n\n \n Referência\n\n Number(s.value) === selectedBaseVersion,\n )}\n isLoading={isLoadingBases || isLoadingBaseVersions}\n isDisabled={\n isLoadingBaseVersions || baseVersionsToSelect.length === 0\n }\n // isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : undefined;\n\n setSelectedBaseVersion(value);\n }}\n />\n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Arquivo\n\n
\n \n\n

{dropMessage}

\n
\n\n \n {!!errors?.file && 'Arquivo é obrigatório'}\n \n
\n\n \n \n Linha do cabeçalho{' '}\n \n \n \n \n\n {\n if (e.target.value === '') {\n setHeaderLine(undefined);\n return;\n }\n\n const value = Number(e.target.value);\n\n if (value < 1) {\n return;\n }\n\n setHeaderLine(value);\n }}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n handleConfirm();\n }\n }}\n />\n\n \n {!!errors?.header && 'Linha do cabeçalho é obrigatória'}\n \n \n\n \n {progress > 0 && progress <= 100 ? (\n \n \n Enviando arquivo...\n \n \n \n ) : null}\n \n
\n\n \n \n Próximo\n \n \n
\n
\n );\n};\n\nexport default ModalImport;\n","import React, { useMemo, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n Input,\n Grid,\n Text,\n Heading,\n Select,\n FormErrorMessage,\n FormLabel,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Header = {\n [column: string]: string | number;\n};\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n mappedHeaders: Header;\n headerRow: number;\n baseId: number;\n baseName: string;\n versionName: string;\n fileName: string;\n };\n}\n\nconst modalMarginHeight = 15;\nconst modalMobileFix = 100;\n\nconst ModalImport: React.FC = ({\n onConfirm,\n handleClose,\n data: { importId, mappedHeaders, headerRow, baseName, versionName, fileName },\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [headers, setHeaders] = useState
(mappedHeaders);\n const actualHeaders = useMemo(() => Object.keys(headers), [headers]);\n\n const [isUpdatingHeader, setIsUpdatingHeader] = useState(false);\n const [newHeaderLine, setNewHeaderLine] = useState(0);\n\n const [errors, setErrors] = useState({} as FormErrors);\n const [loading, setLoading] = useState(false);\n\n const [fields, setFields] = useState({\n type_: '',\n code: '',\n integration_code: '',\n composition_code: '',\n composition_type: '',\n class: '',\n description: '',\n unit_measure: '',\n unit_price: '',\n coefficient: '',\n untaxed_price: '',\n taxed_price: '',\n });\n\n const mappedColumns = useMemo(() => {\n return {\n type: fields.type_,\n code: fields.integration_code,\n integration_code: fields.integration_code,\n composition_code: fields.composition_code,\n composition_type: fields.composition_type,\n class: fields.class,\n description: fields.description,\n unit_measure: fields.unit_measure,\n unit_price: fields.unit_price,\n coefficient: fields.coefficient,\n };\n }, [fields]);\n\n const handleUpdateHeader = async (): Promise => {\n try {\n setLoading(true);\n\n const {\n data: {\n data: { mapped_header },\n },\n } = await api.put(`/import/${importId}`, {\n header_row: newHeaderLine,\n });\n\n setHeaders(mapped_header);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao atualizar a linha do cabeçalho',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!fields.type_) {\n formErrors.type_ = 'Tipo é obrigatório';\n }\n\n if (!fields.integration_code) {\n formErrors.integration_code = 'Código é obrigatório';\n }\n\n if (!fields.composition_code) {\n formErrors.composition_code = 'Código da composição é obrigatório';\n }\n\n if (!fields.composition_type) {\n formErrors.composition_type = 'Tipo da composição é obrigatório';\n }\n\n if (!fields.class) {\n formErrors.class = 'Classe é obrigatório';\n }\n\n if (!fields.description) {\n formErrors.description = 'Descrição é obrigatório';\n }\n\n if (!fields.unit_measure) {\n formErrors.unit_measure = 'Unidade é obrigatório';\n }\n\n if (!fields.unit_price) {\n formErrors.unit_price = 'Preço é obrigatório';\n }\n\n if (!fields.coefficient) {\n formErrors.coefficient = 'Coeficiente é obrigatório';\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n const {\n data: {\n data: { id },\n },\n } = await api.put(`/import/${importId}`, {\n mapped_columns: mappedColumns,\n header_row: newHeaderLine || headerRow,\n });\n\n if (onConfirm) onConfirm(id);\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Configurar campos\n\n \n Base: {baseName}\n /\n Referência: {versionName}\n /\n Arquivo: {fileName}\n \n\n \n\n \n \n Indique a coluna do arquivo importado que corresponda a cada campo\n do orçamento\n \n\n \n \n Orçamento\n \n \n Arquivo importado (Colunas)\n \n \n\n \n \n \n \n\n \n {\n setFields({ ...fields, type_: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.type_ && 'Tipo é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, integration_code: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.integration_code && 'Código do item é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, composition_code: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.composition_code && 'Código é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, composition_type: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.composition_type && 'Tipo é obrigatório'}\n \n \n\n \n \n\n
\n
\n\n \n {\n setFields({ ...fields, class: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.class &&\n 'Classe da composição ou tipo do insumo é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, description: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.description && 'Descrição é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_measure: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_measure && 'Unidade de medida é obrigatório'}\n \n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_price: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_price && 'Preço é obrigatório'}\n \n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, coefficient: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.coefficient && 'Preço é obrigatório'}\n \n \n \n \n\n {\n setIsUpdatingHeader(true);\n }}\n >\n Modificar linha do cabeçalho\n \n\n {isUpdatingHeader && (\n <>\n \n Selecione a nova linha do cabeçalho\n {\n setNewHeaderLine(Number(e.target.value));\n }}\n />\n \n\n {\n await handleUpdateHeader();\n setIsUpdatingHeader(false);\n }}\n >\n Atualizar\n \n \n )}\n
\n\n \n \n Próximo\n \n \n \n
\n );\n};\n\nexport default ModalImport;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\ntype Status = 'error' | 'warning' | 'success' | 'all';\n\ntype Props = {\n status: Status;\n};\n\nconst ImportStatusBadge: React.FC = ({ status }: Props) => {\n const getBadgeColor = (s: Status): string => {\n switch (s) {\n case 'error':\n return 'red';\n case 'warning':\n return 'orange';\n case 'success':\n return 'green';\n case 'all':\n return 'gray';\n default:\n return 'gray';\n }\n };\n\n const getBadgeDescription = (s: Status): string => {\n switch (s) {\n case 'error':\n return 'Erro';\n case 'warning':\n return 'Aviso';\n case 'success':\n return 'Sucesso';\n default:\n return 'Não definido';\n }\n };\n\n const color = getBadgeColor(status);\n const description = getBadgeDescription(status);\n\n return (\n \n {description}\n \n );\n};\n\nexport default ImportStatusBadge;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { ImportPreview, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n compositionCode: number;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst ElementPreviewTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original._index;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n compositionCode: row.original._source.raw_data.code,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default ElementPreviewTableRow;\n","import React, { useCallback, useMemo, useEffect, useState } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Icon,\n Box,\n SimpleGrid,\n Select,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { ServicePagination, Pagination } from 'types/pagination';\n\nimport ImportStatusBadge from '../StatusBadge';\nimport ElementPreviewRow from './ElementPreviewTableRow';\nimport { ImportPreview, Row } from './types';\n\ntype Props = {\n importId: number;\n compositionCode: number;\n};\n\ntype Status = 'all' | 'error' | 'warning' | 'success';\n\nconst ElementPreviewTable: React.FC = ({\n importId,\n compositionCode,\n}) => {\n const [importPreview, setImportPreview] = useState([]);\n const [loading, setLoading] = useState(false);\n const [status, setStatus] = useState('all');\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getImportPreview = useCallback(async () => {\n setLoading(true);\n try {\n const { data: responseData } = await api.get(\n `/import/${importId}/preview`,\n {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[status]': status === 'all' ? undefined : status,\n 'filter[composition_code]': compositionCode,\n 'filter[_index]': 'import_element.*',\n },\n },\n );\n setImportPreview(responseData.data);\n setServicePagination({\n last_page: responseData.meta.last_page,\n });\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao obter o preview do arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [importId, pagination, compositionCode, status]);\n\n useEffect(() => {\n getImportPreview();\n }, [getImportPreview]);\n\n const shouldShowInputIcon = (i: ImportPreview): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i._source.data?.class?.key || '');\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: ImportPreview): InputIcon => {\n const value = i._source.data?.class?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputTitle = useCallback((i: ImportPreview): string => {\n const value = i._source.data?.class?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const columns = useMemo(\n () => [\n {\n id: 'expander',\n Header: 'Tipo',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._index.includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n\n {row.original._index.includes('composition') && (\n \n \n \n )}\n\n {row.original._index.includes('input') && (\n \n \n \n )}\n\n {shouldShowInputIcon(row.original) && (\n \n \n \n )}\n \n );\n },\n },\n {\n Header: 'Linha',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.index;\n },\n },\n {\n Header: 'Descrição',\n width: '40%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._source.raw_data.description || '-'}\n \n );\n },\n },\n {\n Header: 'Código',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.code || '-';\n },\n },\n {\n Header: 'Unidade',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.unit_measure;\n },\n },\n {\n Header: 'Valor unit',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original._source.raw_data.unit_price;\n\n return value\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value)\n : '-';\n },\n },\n {\n Header: 'Status',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return ;\n },\n },\n {\n Header: 'Erros',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return (\n row.original._source?.message && (\n \n {Object.keys(row.original._source?.message).length > 0\n ? Object.values(row.original._source?.message).join(', ')\n : '-'}\n \n )\n );\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n const getRowId = useCallback((row) => {\n return row._id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n columns,\n data: importPreview,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ compositionCode: nextCompositionCode }) => (\n \n ),\n [importId],\n );\n\n return (\n <>\n \n \n \n Por página:\n \n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n \n Status:\n \n {\n setStatus(e.target.value as Status);\n }}\n >\n {[\n ['all', 'Todos'],\n ['success', 'Sucesso'],\n ['warning', 'Atenção'],\n ['error', 'Erro'],\n ].map(([key, description]) => (\n \n ))}\n \n \n \n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && importPreview.length === 0 && (\n \n \n Nenhum dado encontrado\n \n \n )}\n \n
\n
\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n );\n};\n\nexport default ElementPreviewTable;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { ImportPreview, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n compositionCode: number;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst ImportPreviewTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original._index;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n compositionCode: row.original._source.raw_data.code,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default ImportPreviewTableRow;\n","import React, { useCallback, useMemo, useEffect } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport GroupIcon from 'mdi-react/GroupIcon';\n\nimport {\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Icon,\n Box,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport ImportStatusBadge from '../StatusBadge';\nimport ElementPreviewTable from './ElementPreviewTable';\nimport ImportPreviewRow from './ImportPreviewTableRow';\nimport { ImportPreview, Row } from './types';\n\ntype Props = {\n data: ImportPreview[];\n importId: number;\n loading?: boolean;\n};\n\nconst ImportPreviewTable: React.FC = ({ data, loading, importId }) => {\n const [importPreview, setImportPreview] = React.useState(data);\n\n useEffect(() => {\n setImportPreview(data);\n }, [data]);\n\n const columns = useMemo(\n () => [\n {\n id: 'expander',\n Header: 'Tipo',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._index.includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n\n \n \n \n \n );\n },\n },\n {\n Header: 'Linha',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.index;\n },\n },\n {\n Header: 'Descrição',\n width: '40%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._source.raw_data.description || '-'}\n \n );\n },\n },\n {\n Header: 'Código',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.code || '-';\n },\n },\n {\n Header: 'Unidade',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.unit_measure;\n },\n },\n {\n Header: 'Valor unit',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original._source.raw_data.unit_price;\n\n return value\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value)\n : '-';\n },\n },\n {\n Header: 'Status',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return ;\n },\n },\n {\n Header: 'Erros',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return (\n row.original._source?.message && (\n \n {Object.keys(row.original._source?.message).length > 0\n ? Object.values(row.original._source?.message).join(', ')\n : '-'}\n \n )\n );\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n const getRowId = useCallback((row) => {\n return row._id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n columns,\n data: importPreview,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ compositionCode }) => (\n \n ),\n [importId],\n );\n\n return (\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && data.length === 0 && (\n \n \n Suas importações aparecerão aqui.\n \n \n )}\n \n
\n
\n );\n};\n\nexport default ImportPreviewTable;\n","import React, { useState, useCallback, useEffect, useRef } from 'react';\nimport { useQuery } from 'react-query';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { Globe as GlobeIcon } from '@styled-icons/boxicons-regular/Globe';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Heading,\n Progress,\n HStack,\n Text,\n Box,\n useMediaQuery,\n Select,\n SimpleGrid,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport SummaryCard from 'components/SummaryCard';\nimport SummaryContainer from 'components/SummaryContainer';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Import } from 'types/import';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport ImportPreviewTable from './ImportPreviewTable';\nimport { ImportPreview } from './types';\n\ntype Status = 'all' | 'error' | 'warning' | 'success';\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n };\n}\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalImport: React.FC = ({\n data: { importId },\n handleClose,\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [refetchInterval, setRefetchInterval] = useState(1000 * 1); // 1 second\n const [saving, setSaving] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const scrollingBody = useRef(null);\n const targetElement = useRef(null);\n\n const [status, setStatus] = useState('all');\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [importPreview, setImportPreview] = useState([]);\n const [summary, setSummary] = useState({\n total: 0,\n success: 0,\n error: 0,\n });\n\n const getImport = useCallback(async () => {\n const { data: responseData } = await api.get(`/import/${importId}`);\n return responseData.data as Import;\n }, [importId]);\n\n const getImportPreview = useCallback(async () => {\n setLoading(true);\n try {\n const { data: responseData } = await api.get(\n `/import/${importId}/preview`,\n {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[status]': status === 'all' ? undefined : status,\n 'filter[_index]': 'import_element.own_composition',\n 'filter[composition_code]': 'NULL',\n },\n },\n );\n setImportPreview(responseData.data);\n setSummary({\n total: responseData.meta.total,\n success: responseData.summary?.status?.success || 0,\n error: responseData.summary?.status?.error || 0,\n });\n setServicePagination({\n last_page: responseData.meta.last_page,\n });\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao obter o preview do arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [importId, pagination, status]);\n\n const queryImport = useQuery(['Import', importId], getImport, {\n refetchInterval,\n refetchOnWindowFocus: false,\n onSuccess: (data) => {\n if (data.status !== 'processing' && data.status !== 'storing') {\n setRefetchInterval(1000 * 30); // 30 seconds\n }\n },\n });\n\n // const queryPreview = useQuery(['ImportPreview', importId], getImportPreview, {\n // refetchInterval,\n // refetchOnWindowFocus: false,\n // });\n\n const isImporting = queryImport.data?.status === 'processing';\n const isStoring = queryImport.data?.status === 'storing';\n\n useEffect(() => {\n if (!isImporting) {\n getImportPreview();\n }\n }, [getImportPreview, isImporting]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n const handleConfirm = async (): Promise => {\n if (scrollingBody.current && targetElement.current) {\n scrollingBody.current.scrollTo({\n top: targetElement.current.offsetTop - 500,\n behavior: 'smooth',\n });\n }\n\n try {\n setSaving(true);\n await api.post(`/import/${importId}/persist`);\n\n toast({\n description: 'Os dados serão salvos na base.',\n status: 'success',\n });\n\n setRefetchInterval(1000 * 1); // 1 second\n\n // handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setSaving(false);\n }\n };\n\n return (\n \n \n \n Resumo do processamento\n\n {queryImport.data?.version && (\n \n Base: {queryImport.data.version.base.description}\n /\n Referência: {queryImport.data.version.description}\n \n )}\n\n \n\n \n \n \n\n \n\n \n \n\n \n {queryImport.data?.file &&\n `Arquivo: \"${queryImport.data?.file.name}\"`}\n \n\n {queryImport.data?.progress_bar && (\n \n {isImporting || isStoring\n ? 'Importação iniciada'\n : 'Importação realizada'}{' '}\n {queryImport.data?.progress_bar?.elapsed_for_humans} (\n {formatDate(queryImport.data?.progress_bar?.start_time_iso)})\n \n )}\n\n {(isImporting || isStoring) && (\n \n )}\n\n {(isImporting || isStoring) && (\n \n \n Tempo restante:{' '}\n {queryImport.data?.progress_bar?.remaining_for_humans}\n \n\n \n Tempo estimado:{' '}\n {queryImport.data?.progress_bar?.estimated_for_humans}\n \n \n )}\n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n Status:\n {\n setStatus(e.target.value as Status);\n }}\n >\n {[\n ['all', 'Todos'],\n ['success', 'Sucesso'],\n ['warning', 'Atenção'],\n ['error', 'Erro'],\n ].map(([key, description]) => (\n \n ))}\n \n \n \n\n \n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n\n \n \n \n\n \n Consolidar importação (salvar dados na base)\n \n \n \n \n \n );\n};\n\nexport default ModalImport;\n","import React, { useMemo, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n Input,\n Grid,\n Text,\n Heading,\n Select,\n FormErrorMessage,\n FormLabel,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Header = {\n [column: string]: string | number;\n};\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n mappedHeaders: Header;\n headerRow: number;\n baseId: number;\n baseName: string;\n versionName: string;\n fileName: string;\n };\n}\n\nconst ModalImport: React.FC = ({\n onConfirm,\n handleClose,\n data: { importId, mappedHeaders, headerRow, baseName, versionName, fileName },\n ...restProps\n}) => {\n const [headers, setHeaders] = useState
(mappedHeaders);\n const actualHeaders = useMemo(() => Object.keys(headers), [headers]);\n\n const [isUpdatingHeader, setIsUpdatingHeader] = useState(false);\n const [newHeaderLine, setNewHeaderLine] = useState(0);\n\n const [errors, setErrors] = useState({} as FormErrors);\n const [loading, setLoading] = useState(false);\n\n const [fields, setFields] = useState({\n code: '',\n integration_code: '',\n class: '',\n description: '',\n unit_measure: '',\n unit_price: '',\n untaxed_price: '',\n taxed_price: '',\n });\n\n const mappedColumns = useMemo(() => {\n return {\n code: fields.integration_code,\n integration_code: fields.integration_code,\n class: fields.class,\n description: fields.description,\n unit_measure: fields.unit_measure,\n unit_price: fields.unit_price,\n };\n }, [fields]);\n\n const handleUpdateHeader = async (): Promise => {\n try {\n setLoading(true);\n\n const {\n data: {\n data: { mapped_header },\n },\n } = await api.put(`/import/${importId}`, {\n header_row: newHeaderLine,\n });\n\n setHeaders(mapped_header);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao atualizar a linha do cabeçalho',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!fields.integration_code) {\n formErrors.integration_code = 'Código é obrigatório';\n }\n\n if (!fields.class) {\n formErrors.class = 'Classe é obrigatório';\n }\n\n if (!fields.description) {\n formErrors.description = 'Descrição é obrigatório';\n }\n\n if (!fields.unit_measure) {\n formErrors.unit_measure = 'Unidade é obrigatório';\n }\n\n if (!fields.unit_price) {\n formErrors.unit_price = 'Preço é obrigatório';\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n const {\n data: {\n data: { id },\n },\n } = await api.put(`/import/${importId}`, {\n mapped_columns: mappedColumns,\n header_row: newHeaderLine || headerRow,\n });\n\n if (onConfirm) onConfirm(id);\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Configurar campos\n\n \n Base: {baseName}\n /\n Referência: {versionName}\n \n\n \n Arquivo: {fileName}\n \n\n \n\n \n \n Indique a coluna do arquivo importado que corresponda a cada campo\n do orçamento\n \n\n \n \n Orçamento\n \n \n Arquivo importado (Colunas)\n \n \n\n \n \n \n \n\n \n {\n setFields({ ...fields, integration_code: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.integration_code && 'Código do item é obrigatório'}\n \n \n\n \n \n\n
\n
\n\n \n {\n setFields({ ...fields, class: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.class && 'Classe é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, description: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.description && 'Descrição é obrigatória'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_measure: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_measure && 'Código é obrigatório'}\n \n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_price: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_price && 'Preço é obrigatório'}\n \n \n \n \n\n {\n setIsUpdatingHeader(true);\n }}\n >\n Modificar linha do cabeçalho\n \n\n {isUpdatingHeader && (\n <>\n \n Selecione a nova linha do cabeçalho\n {\n setNewHeaderLine(Number(e.target.value));\n }}\n />\n \n\n {\n await handleUpdateHeader();\n setIsUpdatingHeader(false);\n }}\n >\n Atualizar\n \n \n )}\n
\n\n \n \n Próximo\n \n \n
\n
\n );\n};\n\nexport default ModalImport;\n","import React, { useState, useCallback, useEffect } from 'react';\nimport { useQuery } from 'react-query';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { Globe as GlobeIcon } from '@styled-icons/boxicons-regular/Globe';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Heading,\n Progress,\n HStack,\n Text,\n Box,\n useMediaQuery,\n Select,\n SimpleGrid,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport SummaryCard from 'components/SummaryCard';\nimport SummaryContainer from 'components/SummaryContainer';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Import } from 'types/import';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport ImportStatusBadge from '../StatusBadge';\n\ntype Status = 'all' | 'error' | 'warning' | 'success';\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n };\n}\n\ntype ImportPreview = {\n _id: string;\n _source: {\n status: Status;\n raw_data: {\n class: string;\n code: number;\n description: string;\n unit_measure: string;\n unit_price: number;\n };\n index: string;\n message: {\n [key: string]: string[];\n };\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalImport: React.FC = ({\n data: { importId },\n handleClose,\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [refetchInterval, setRefetchInterval] = useState(1000 * 1); // 1 second\n const [saving, setSaving] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const [status, setStatus] = useState('all');\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [importPreview, setImportPreview] = useState([]);\n const [summary, setSummary] = useState({\n total: 0,\n success: 0,\n error: 0,\n });\n\n const getImport = useCallback(async () => {\n const { data: responseData } = await api.get(`/import/${importId}`);\n return responseData.data as Import;\n }, [importId]);\n\n const getImportPreview = useCallback(async () => {\n setLoading(true);\n try {\n const { data: responseData } = await api.get(\n `/import/${importId}/preview`,\n {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[status]': status === 'all' ? undefined : status,\n },\n },\n );\n setImportPreview(responseData.data);\n setSummary({\n total: responseData.meta.total,\n success: responseData.summary?.status?.success || 0,\n error: responseData.summary?.status?.error || 0,\n });\n setServicePagination({\n last_page: responseData.meta.last_page,\n });\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao obter o preview do arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [importId, pagination, status]);\n\n const queryImport = useQuery(['Import', importId], getImport, {\n refetchInterval,\n refetchOnWindowFocus: false,\n onSuccess: (data) => {\n if (data.status !== 'processing' && data.status !== 'storing') {\n setRefetchInterval(1000 * 30); // 30 seconds\n }\n },\n });\n\n // const queryPreview = useQuery(['ImportPreview', importId], getImportPreview, {\n // refetchInterval,\n // refetchOnWindowFocus: false,\n // });\n\n const isImporting = queryImport.data?.status === 'processing';\n const isStoring = queryImport.data?.status === 'storing';\n\n useEffect(() => {\n if (!isImporting) {\n getImportPreview();\n }\n }, [getImportPreview, isImporting]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n const handleConfirm = async (): Promise => {\n try {\n setSaving(true);\n await api.post(`/import/${importId}/persist`);\n toast({\n description: 'Os dados serão salvos na base.',\n status: 'success',\n });\n\n setRefetchInterval(1000 * 1); // 1 second\n\n // handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setSaving(false);\n }\n };\n\n return (\n \n \n \n Resumo do processamento\n\n {queryImport.data?.version && (\n \n Base: {queryImport.data.version.base.description}\n /\n Referência: {queryImport.data.version.description}\n \n )}\n\n \n\n \n \n \n\n \n\n \n \n\n \n {queryImport.data?.file &&\n `Arquivo: \"${queryImport.data?.file.name}\"`}\n \n\n {queryImport.data?.progress_bar && (\n \n {isImporting || isStoring\n ? 'Importação iniciada'\n : 'Importação realizada'}{' '}\n {queryImport.data?.progress_bar?.elapsed_for_humans} (\n {formatDate(queryImport.data?.progress_bar?.start_time_iso)})\n \n )}\n\n {(isImporting || isStoring) && (\n \n )}\n\n {(isImporting || isStoring) && (\n \n \n Tempo restante:{' '}\n {queryImport.data?.progress_bar?.remaining_for_humans}\n \n\n \n Tempo estimado:{' '}\n {queryImport.data?.progress_bar?.estimated_for_humans}\n \n \n )}\n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n Status:\n {\n setStatus(e.target.value as Status);\n }}\n >\n {[\n ['all', 'Todos'],\n ['success', 'Sucesso'],\n ['warning', 'Atenção'],\n ['error', 'Erro'],\n ].map(([key, description]) => (\n \n ))}\n \n \n \n\n ({\n id: item._id,\n line: item._source.index,\n description: (\n \n {item._source.raw_data.description || '-'}\n \n ),\n code: item._source.raw_data.code,\n class: item._source.raw_data.class,\n unit_measure: item._source.raw_data.unit_measure,\n unit_price: item._source.raw_data.unit_price,\n status: ,\n errors: (\n <>\n {item._source?.message && (\n \n {Object.keys(item._source?.message).length > 0\n ? Object.values(item._source?.message).join(', ')\n : '-'}\n \n )}\n \n ),\n actions: null,\n })}\n data={importPreview}\n noDataMessage=\"Suas importações aparecerão aqui.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n\n \n \n \n\n \n Consolidar importação (salvar dados na base)\n \n \n \n \n \n );\n};\n\nexport default ModalImport;\n","import React from 'react';\n\nimport { stateDescriptionByKey } from 'shared/locale';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n TableContainer,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport { Table, Thead, Tbody, Tr, Th, Td } from 'components/Table';\n\ninterface ModalInputPrices extends ModalRootProps {\n data: {\n inputs_description: string;\n prices: string;\n };\n}\n\ntype Prices = {\n taxed: { total: number };\n untaxed: { total: number };\n};\n\ntype PricesMap = {\n locale: string;\n taxed_total: number | null;\n untaxed_total: number | null;\n};\n\nfunction sortLocales(a: PricesMap, b: PricesMap): number {\n if (a.locale < b.locale) return -1;\n if (a.locale > b.locale) return 1;\n return 0;\n}\n\nconst ModalInputPricesLookup: React.FC = ({\n data,\n ...restProps\n}) => {\n const mappedPrices = (() => {\n const prices = JSON.parse(data.prices);\n const entries = Object.entries(prices);\n\n const pricesMap = entries\n .map(([locale, price]) => {\n return {\n locale: stateDescriptionByKey[locale],\n taxed_total: price.taxed ? price.taxed.total : null,\n untaxed_total: price.untaxed ? price.untaxed.total : null,\n };\n })\n .sort(sortLocales);\n\n return pricesMap;\n })();\n\n return (\n \n \n \n Preços da composição\n\n \n\n \n \n {data.inputs_description}\n \n\n \n \n \n \n \n \n \n \n \n \n {mappedPrices.map((item, i) => (\n \n \n \n \n \n ))}\n \n
EstadoDesoneradoNão desonerado
{item.locale}\n {item.untaxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.untaxed_total)\n : null}\n \n {item.taxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.taxed_total)\n : null}\n
\n
\n
\n
\n
\n );\n};\n\nexport default ModalInputPricesLookup;\n","import React from 'react';\nimport ReactJson, { ThemeKeys } from 'react-json-view';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n HStack,\n Text,\n Select,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport usePersistedState from 'hooks/usePersistedState';\n\ntype ModalJSONViewerProps = ModalRootProps & {\n data: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n json: any;\n };\n};\n\nconst themes = [\n { key: 'apathy', description: 'Apathy' },\n { key: 'apathy:inverted', description: 'Apathy (Inverted)' },\n { key: 'ashes', description: 'Ashes' },\n { key: 'bespin', description: 'Bespin' },\n { key: 'brewer', description: 'Brewer' },\n { key: 'bright', description: 'Bright' },\n { key: 'bright:inverted', description: 'Bright (Inverted)' },\n { key: 'chalk', description: 'Chalk' },\n { key: 'codeschool', description: 'Codeschool' },\n { key: 'colors', description: 'Colors' },\n { key: 'eighties', description: 'Eighties' },\n { key: 'embers', description: 'Embers' },\n { key: 'flat', description: 'Flat' },\n { key: 'google', description: 'Google' },\n { key: 'grayscale', description: 'Grayscale' },\n { key: 'grayscale:inverted', description: 'Grayscale (Inverted)' },\n { key: 'greenscreen', description: 'Greenscreen' },\n { key: 'harmonic', description: 'Harmonic' },\n { key: 'hopscotch', description: 'Hopscotch' },\n { key: 'isotope', description: 'Isotope' },\n { key: 'marrakesh', description: 'Marrakesh' },\n { key: 'mocha', description: 'Mocha' },\n { key: 'monokai', description: 'Monokai' },\n { key: 'ocean', description: 'Ocean' },\n { key: 'paraiso', description: 'Paraiso' },\n { key: 'pop', description: 'Pop' },\n { key: 'railscasts', description: 'Railscasts' },\n { key: 'rjv-default', description: 'RJV Default' },\n { key: 'shapeshifter', description: 'Shapeshifter' },\n { key: 'shapeshifter:inverted', description: 'Shapeshifter (Inverted)' },\n { key: 'solarized', description: 'Solarized' },\n { key: 'summerfruit', description: 'Summerfruit' },\n { key: 'summerfruit:inverted', description: 'Summerfruit (Inverted)' },\n { key: 'threezerotwofour', description: 'Threezerotwofour' },\n { key: 'tomorrow', description: 'Tomorrow' },\n { key: 'tube', description: 'Tube' },\n { key: 'twilight', description: 'Twilight' },\n];\n\nconst ModalJSONViewer: React.FC = ({\n data = {},\n handleClose,\n ...restProps\n}) => {\n const [theme, setTheme] = usePersistedState(\n 'ecustos:json-theme',\n 'rjv-default',\n );\n\n return (\n \n \n \n Visualizar resposta\n\n \n\n \n \n Tema:\n {\n setTheme(e.target.value as ThemeKeys);\n }}\n >\n {themes.map((item) => (\n \n ))}\n \n \n\n {\n let src = '';\n\n if (\n typeof copy.src === 'string' ||\n typeof copy.src === 'number'\n ) {\n src = copy.src;\n } else {\n src = JSON.stringify(copy.src, null, 2);\n }\n\n navigator.clipboard.writeText(src);\n }}\n style={{\n borderRadius: '0.25rem',\n padding: '1rem',\n fontFamily: 'Fira Code, monospace',\n }}\n />\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ModalJSONViewer;\n","import React, { useState, useEffect, useMemo, useCallback } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport { Locale, PriceTypes } from 'types/base';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalLocaleAndPriceTypeSelectProps extends ModalRootProps {\n data: {\n base_id: number | null;\n };\n}\n\nconst ModalLocaleAndPriceTypeSelect: React.FC =\n ({ onConfirm, handleClose, data, ...restProps }) => {\n const { base_id } = data;\n\n const [baseLocales, setBaseLocales] = useState([]);\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [isLoadingBaseLocales, setIsLoadingBaseLocales] = useState(false);\n\n const [basePriceTypes, setBasePriceTypes] = useState([]);\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n const [isLoadingPriceTypes, setIsLoadingPriceTypes] = useState(false);\n\n const [errors, setErrors] = useState({} as FormErrors);\n\n const isLoadingFilters = isLoadingBaseLocales || isLoadingPriceTypes;\n\n const getBaseLocales = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBaseLocales([]);\n return;\n }\n\n try {\n setIsLoadingBaseLocales(true);\n const { data: response } = await api.get('locale', {\n params: {\n 'filter[base_id]': baseId,\n sort: 'description',\n },\n });\n const baseLocalesLoaded = response.data;\n setBaseLocales(baseLocalesLoaded);\n\n if (baseLocalesLoaded.length === 1) {\n const [baseLocale] = baseLocalesLoaded;\n setSelectedBaseLocale(baseLocale.id);\n\n if (errors.locale_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.locale_id;\n return newErrors;\n });\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os estados da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseLocales(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseLocalesToSelect = useMemo(() => {\n return baseLocales.map((locale) => ({\n value: String(locale.id),\n label: locale.description,\n }));\n }, [baseLocales]);\n\n useEffect(() => {\n getBaseLocales(base_id);\n }, [getBaseLocales, base_id]);\n\n const getBasePriceTypes = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBasePriceTypes([]);\n return;\n }\n\n try {\n setIsLoadingPriceTypes(true);\n const { data: response } = await api.get('price/type', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const basePriceTypesLoaded = response.data;\n setBasePriceTypes(basePriceTypesLoaded);\n\n if (basePriceTypesLoaded.length === 1) {\n const [basePriceType] = basePriceTypesLoaded;\n setSelectedBasePriceType(basePriceType.id);\n\n if (errors.type_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.type_id;\n return newErrors;\n });\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os tipos de preço da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingPriceTypes(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basePriceTypesToSelect = useMemo(() => {\n return basePriceTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [basePriceTypes]);\n\n useEffect(() => {\n getBasePriceTypes(base_id);\n }, [getBasePriceTypes, base_id]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!selectedBaseLocale) {\n Object.assign(formErrors, { locale_id: true, type: 'required' });\n }\n\n if (!selectedBasePriceType) {\n Object.assign(formErrors, { type_id: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n const locale = {\n id: selectedBaseLocale,\n key: baseLocales.find((l) => l.id === selectedBaseLocale)?.key,\n description: baseLocales.find((l) => l.id === selectedBaseLocale)\n ?.description,\n };\n\n const priceType = {\n id: selectedBasePriceType,\n key: basePriceTypes.find((t) => t.id === selectedBasePriceType)?.key,\n description: basePriceTypes.find((t) => t.id === selectedBasePriceType)\n ?.description,\n };\n\n if (onConfirm) onConfirm({ locale, priceType });\n handleClose();\n };\n\n return (\n \n \n \n Selecionar Estado e Tipo de Preço\n\n \n\n \n \n Estado\n\n Number(s.value) === selectedBaseLocale,\n )}\n isLoading={isLoadingBaseLocales}\n isDisabled={\n isLoadingBaseLocales || baseLocalesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseLocale(value);\n\n if (value && errors.locale_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.locale_id;\n return newErrors;\n });\n }\n }}\n />\n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n Number(s.value) === selectedBasePriceType,\n )}\n isLoading={isLoadingPriceTypes}\n isDisabled={\n isLoadingPriceTypes || basePriceTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBasePriceType(value);\n\n if (value && errors.type_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.type_id;\n return newErrors;\n });\n }\n }}\n />\n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Confirmar\n \n \n \n \n );\n };\n\nexport default ModalLocaleAndPriceTypeSelect;\n","import React, { Fragment, useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Flex,\n Text,\n Grid,\n Textarea,\n HStack,\n Box,\n keyframes,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport useModal from 'hooks/useModal';\n\nimport { Budget } from 'types/budget';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Action = Budget['flow_status']['actions'][number];\n\ninterface ModalManageFlowProps extends ModalRootProps {\n data: {\n budget: Budget;\n };\n}\n\nconst spin = keyframes`\n 0% {opacity: 0; scale: 0;}\n 50% {opacity: 0.3; scale: 1;}\n 100% {opacity: 0; scale: 0;}\n`;\n\ntype Option = {\n label: string;\n description: string;\n color: string;\n};\n\nconst formatOptionLabel = ({\n label,\n description,\n color,\n}: Option): JSX.Element => {\n const spinAnimation = `${spin} infinite 2s ease`;\n\n return (\n <>\n \n \n {label}\n \n {description}\n \n );\n};\n\nconst ModalManageFlow: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const { budget } = data;\n\n const { openModal } = useModal();\n\n const [selectedAction, setSelectedAction] = useState();\n\n const [observation, setObservation] = useState();\n\n const [actions, setData] = useState([]);\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState();\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get(\n `flow/status/${budget.flow_status.id}/action`,\n );\n\n const actionList = response.data;\n\n setData(actionList.data);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as ações!',\n status: 'error',\n });\n setData([]);\n } finally {\n setLoading(false);\n }\n }, [budget]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const actionsToSelect = actions.map((item) => ({\n value: item.id,\n label: item.name,\n description: item.description,\n color: item.color,\n }));\n\n type Client = Budget['identification']['client'];\n const clientNameByType = (client: Client): JSX.Element => {\n if (client.type_person === 'legal') {\n return (\n <>\n {client.fantasy_name}\n
\n {client.corporate_name}\n \n );\n }\n\n return <>{client.name};\n };\n\n const getClientName = useCallback(\n (item: Budget): JSX.Element => {\n if (!item.identification) return -;\n\n if (item.identification.client) {\n return clientNameByType(item.identification.client);\n }\n\n if (item.integrated_sienge) {\n if (!item.identification.enterprise) {\n return -;\n }\n\n return (\n \n \n {item.identification.enterprise.external_id}\n {' '}\n - {item.identification.enterprise?.name}\n \n );\n }\n\n return Não especificado;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n const handleConfirm = async (): Promise => {\n const formErrors = {} as FormErrors;\n\n if (!selectedAction) {\n Object.assign(formErrors, { selectedAction: true, type: 'required' });\n }\n\n if (!observation) {\n Object.assign(formErrors, { observation: true, type: 'required' });\n }\n\n setErrors(formErrors);\n\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.post(`/flow/action/${selectedAction?.id}`, {\n object_type: 'budget',\n object_id: budget.id,\n flow_key: 'use_flow',\n type: 'manual',\n message: observation,\n });\n\n toast({\n description: `Status atualizado com sucesso!`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao performar a ação!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Atualizar status do orçamento\n\n \n\n \n \n \n Descrição: \n \n {budget.identification.description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Cliente / Obra:\n \n {getClientName(budget)}\n \n \n\n \n Total: \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total)}{' '}\n {`(${Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 2,\n }).format(\n budget.total_separate_percent || 0,\n )}% complementares)`}\n \n \n \n\n \n Ação\n {\n const value = actions.find(\n (item) => item.id === Number(selected?.value),\n );\n setSelectedAction(value);\n }}\n formatOptionLabel={formatOptionLabel}\n />\n Ação é obrigatória\n \n\n \n Justificativa\n setObservation(e.target.value)}\n />\n Justificativa é obrigatória\n \n \n\n \n \n \n openModal('budgetHistory', {\n mode: 'lookup',\n data: {\n budget,\n },\n })\n }\n >\n Ver histórico\n \n\n \n Salvar\n \n \n \n \n \n );\n};\n\nexport default ModalManageFlow;\n","import React, { Fragment, useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Flex,\n Text,\n Grid,\n Textarea,\n HStack,\n Box,\n keyframes,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport useModal from 'hooks/useModal';\n\nimport { ParametricBudget } from 'types/budget/parametric-budget';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Action = ParametricBudget['flow_status']['actions'][number];\n\ninterface ModalManageParametricFlowProps extends ModalRootProps {\n data: {\n budget: ParametricBudget;\n };\n}\n\nconst spin = keyframes`\n 0% {opacity: 0; scale: 0;}\n 50% {opacity: 0.3; scale: 1;}\n 100% {opacity: 0; scale: 0;}\n`;\n\ntype Option = {\n label: string;\n description: string;\n color: string;\n};\n\nconst formatOptionLabel = ({ label, color }: Option): JSX.Element => {\n const spinAnimation = `${spin} infinite 2s ease`;\n\n return (\n \n \n {label}\n \n );\n};\n\nconst ModalManageParametricFlow: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const { budget } = data;\n\n const { openModal } = useModal();\n\n const [selectedAction, setSelectedAction] = useState();\n\n const [observation, setObservation] = useState();\n\n const [actions, setData] = useState([]);\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState();\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get(\n `flow/status/${budget.flow_status.id}/action`,\n );\n\n const actionList = response.data;\n\n setData(actionList.data);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as ações!',\n status: 'error',\n });\n setData([]);\n } finally {\n setLoading(false);\n }\n }, [budget]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const actionsToSelect = actions.map((item) => ({\n value: item.id,\n label: item.name,\n description: item.description,\n color: item.color,\n }));\n\n type Organization = ParametricBudget['organization'];\n const getOrganizationName = (organization: Organization): JSX.Element => {\n if (organization.document_type === 'cnpj') {\n return (\n <>\n {organization.fantasy_name}\n
\n {organization.corporate_name}\n \n );\n }\n\n return <>{organization.name};\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors = {} as FormErrors;\n\n if (!selectedAction) {\n Object.assign(formErrors, { selectedAction: true, type: 'required' });\n }\n\n if (!observation) {\n Object.assign(formErrors, { observation: true, type: 'required' });\n }\n\n setErrors(formErrors);\n\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.post(`/flow/action/${selectedAction?.id}`, {\n object_type: 'parametric_budget',\n object_id: budget.id,\n flow_key: 'use_flow',\n type: 'manual',\n message: observation,\n });\n\n toast({\n description: `Status atualizado com sucesso!`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao performar a ação!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Atualizar status do orçamento\n\n \n\n \n \n \n Descrição: \n \n {budget.build_description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Organização\n \n {getOrganizationName(budget.organization)}\n \n \n \n\n \n Ação\n {\n const value = actions.find(\n (item) => item.id === Number(selected?.value),\n );\n setSelectedAction(value);\n }}\n formatOptionLabel={formatOptionLabel}\n />\n Ação é obrigatória\n \n\n \n Justificativa\n setObservation(e.target.value)}\n />\n Justificativa é obrigatória\n \n \n\n \n \n \n openModal('parametricBudgetHistory', {\n mode: 'lookup',\n data: {\n budget,\n },\n })\n }\n >\n Ver histórico\n \n\n \n Salvar\n \n \n \n \n \n );\n};\n\nexport default ModalManageParametricFlow;\n","import React, {\n useCallback,\n useMemo,\n useState,\n useEffect,\n useContext,\n} from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport {\n Base,\n Version,\n Locale,\n UnitMeasure,\n PriceTypes,\n Classification,\n ClassificationType,\n} from 'types/base';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst OWN_BASE_KEY_PREFIX = 'own.';\n\nconst SearchFilter: React.FC = ({ onSubmit, loading = false }) => {\n const { user } = useContext(AuthContext);\n\n const {\n handleSubmit,\n setValue,\n formState: { errors },\n control,\n register,\n clearErrors,\n } = useForm();\n\n const [bases, setBases] = useState([]);\n const [selectedBase, setSelectedBase] = useState(null);\n const [isLoadingBases, setIsLoadingBases] = useState(false);\n\n const selectedBaseObj = useMemo(\n () => bases.find((b) => b.id === Number(selectedBase)),\n [bases, selectedBase],\n );\n\n const [baseVersions, setBaseVersions] = useState([]);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [isLoadingBaseVersions, setIsLoadingBaseVersions] = useState(false);\n\n const [baseLocales, setBaseLocales] = useState([]);\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [isLoadingBaseLocales, setIsLoadingBaseLocales] = useState(false);\n\n const [basePriceTypes, setBasePriceTypes] = useState([]);\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n const [isLoadingPriceTypes, setIsLoadingPriceTypes] = useState(false);\n\n const [classifications, setClassifications] = useState([]);\n const [selectedClassification, setSelectedClassification] = useState<\n number | null\n >(null);\n const [isLoadingClassifications, setIsLoadingClassifications] =\n useState(false);\n\n const [classificationTypes, setClassificationTypes] = useState<\n ClassificationType[]\n >([]);\n const [selectedClassificationType, setSelectedClassificationType] = useState<\n number | null\n >(null);\n const [isLoadingTypes, setIsLoadingTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const getBases = useCallback(async () => {\n setIsLoadingBases(true);\n\n try {\n const { data: response } = await api.get('/base', {\n params: {\n 'filter[with_plan]': `.`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n sort: 'description',\n },\n });\n const basesLoaded = response.data;\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n setValue('base_id', base.id);\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setIsLoadingBases(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n const getBaseVersions = useCallback(\n async (baseId: number | null) => {\n if (!baseId) {\n setBaseVersions([]);\n return;\n }\n\n try {\n setIsLoadingBaseVersions(true);\n const { data: response } = await api.get('version', {\n params: {\n 'filter[base_id]': baseId,\n sort: selectedBaseObj?.key.startsWith(OWN_BASE_KEY_PREFIX)\n ? `-created_at`\n : `-pointer`,\n },\n });\n const baseVersionsLoaded = response.data;\n setBaseVersions(baseVersionsLoaded);\n\n if (baseVersionsLoaded.length === 1) {\n const [baseVersion] = baseVersionsLoaded;\n setSelectedBaseVersion(baseVersion.id);\n setValue('version_id', baseVersion.id);\n\n if (errors.version_id) {\n clearErrors('version_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as versões da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseVersions(false);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selectedBaseObj],\n );\n\n const baseVersionsToSelect = useMemo(() => {\n return baseVersions.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [baseVersions]);\n\n useEffect(() => {\n getBaseVersions(selectedBase);\n }, [getBaseVersions, selectedBase]);\n\n const getBaseLocales = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBaseLocales([]);\n return;\n }\n\n try {\n setIsLoadingBaseLocales(true);\n const { data: response } = await api.get('locale', {\n params: {\n 'filter[base_id]': baseId,\n sort: 'description',\n },\n });\n const baseLocalesLoaded = response.data;\n setBaseLocales(baseLocalesLoaded);\n\n if (baseLocalesLoaded.length === 1) {\n const [baseLocale] = baseLocalesLoaded;\n setSelectedBaseLocale(baseLocale.id);\n setValue('locale_id', baseLocale.id);\n\n if (errors.locale_id) {\n clearErrors('locale_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os estados da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseLocales(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseLocalesToSelect = useMemo(() => {\n return baseLocales.map((locale) => ({\n value: String(locale.id),\n label: locale.description,\n }));\n }, [baseLocales]);\n\n useEffect(() => {\n getBaseLocales(selectedBase);\n }, [getBaseLocales, selectedBase]);\n\n const getBasePriceTypes = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBasePriceTypes([]);\n return;\n }\n\n try {\n setIsLoadingPriceTypes(true);\n const { data: response } = await api.get('price/type', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const basePriceTypesLoaded = response.data;\n setBasePriceTypes(basePriceTypesLoaded);\n\n if (basePriceTypesLoaded.length === 1) {\n const [basePriceType] = basePriceTypesLoaded;\n setSelectedBasePriceType(basePriceType.id);\n setValue('type_id', basePriceType.id);\n\n if (errors.type_id) {\n clearErrors('type_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os tipos de preço da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingPriceTypes(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basePriceTypesToSelect = useMemo(() => {\n return basePriceTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [basePriceTypes]);\n\n useEffect(() => {\n getBasePriceTypes(selectedBase);\n }, [getBasePriceTypes, selectedBase]);\n\n const getClassifications = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setClassifications([]);\n return;\n }\n\n try {\n setIsLoadingClassifications(true);\n const { data: response } = await api.get('composition/classification', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const classificationsLoaded = response.data;\n setClassifications(classificationsLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingClassifications(false);\n }\n }, []);\n\n const classificationsToSelect = useMemo(() => {\n return classifications.map((classification) => ({\n value: String(classification.id),\n label: classification.description,\n }));\n }, [classifications]);\n\n useEffect(() => {\n getClassifications(selectedBase);\n }, [getClassifications, selectedBase]);\n\n const getClassificationTypes = useCallback(\n async (baseId: number | null, classificationId: number | null) => {\n if (!baseId) {\n setClassificationTypes([]);\n return;\n }\n\n try {\n setIsLoadingTypes(true);\n const { data: response } = await api.get('/composition/type', {\n params: {\n 'filter[base_id]': baseId,\n 'filter[classification_id]': classificationId,\n },\n });\n const classificationTypesLoaded = response.data;\n setClassificationTypes(classificationTypesLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingTypes(false);\n }\n },\n [],\n );\n\n const classificationTypesToSelect = useMemo(() => {\n return classificationTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [classificationTypes]);\n\n useEffect(() => {\n getClassificationTypes(selectedBase, selectedClassification);\n }, [getClassificationTypes, selectedBase, selectedClassification]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n const clearBaseDependentValues = (): void => {\n setSelectedBaseVersion(null);\n setValue('version_id', null);\n\n setSelectedBaseLocale(null);\n setValue('locale_id', null);\n\n setSelectedBasePriceType(null);\n setValue('type_id', null);\n\n setSelectedClassification(null);\n setValue('classification_id', null);\n\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n };\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n clearBaseDependentValues();\n\n const value = selected ? Number(selected.value) : null;\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n\n setSelectedBase(value);\n setValue('base_id', value);\n };\n\n const handleClassificationChange = (selected: Selected): void => {\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassification(value);\n setValue('classification_id', value);\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isLoading={isLoadingBases}\n isDisabled={isLoadingBases || basesToSelect.length === 0}\n isClearable\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n (\n Number(s.value) === selectedBaseVersion,\n )}\n isLoading={isLoadingBaseVersions}\n isDisabled={\n isLoadingBaseVersions || baseVersionsToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseVersion(value);\n setValue('version_id', value);\n\n if (value && errors.version_id) {\n clearErrors('version_id');\n }\n }}\n />\n )}\n name=\"version_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n (\n Number(s.value) === selectedBaseLocale,\n )}\n isLoading={isLoadingBaseLocales}\n isDisabled={\n isLoadingBaseLocales || baseLocalesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseLocale(value);\n setValue('locale_id', value);\n\n if (value && errors.locale_id) {\n clearErrors('locale_id');\n }\n }}\n />\n )}\n name=\"locale_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n (\n Number(s.value) === selectedBasePriceType,\n )}\n isLoading={isLoadingPriceTypes}\n isDisabled={\n isLoadingPriceTypes || basePriceTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBasePriceType(value);\n setValue('type_id', value);\n\n if (value && errors.type_id) {\n clearErrors('type_id');\n }\n }}\n />\n )}\n name=\"type_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Classe da composição\n\n (\n Number(s.value) === selectedClassification,\n )}\n isLoading={isLoadingClassifications}\n isDisabled={\n isLoadingClassifications ||\n classificationsToSelect.length === 0\n }\n isClearable\n onChange={handleClassificationChange}\n />\n )}\n name=\"classification_id\"\n control={control}\n />\n \n\n \n Tipo da composição\n\n (\n Number(s.value) === selectedClassificationType,\n )}\n isLoading={isLoadingTypes}\n isDisabled={\n isLoadingTypes || classificationTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassificationType(value);\n setValue('classification_type_id', value);\n }}\n />\n )}\n name=\"classification_type_id\"\n control={control}\n />\n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n IconButton,\n Input,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport {\n Composition,\n State,\n DefaultPrice,\n StatePrice,\n} from 'types/composition';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ntype ModalCompositionSelect = ModalRootProps & {\n data: {\n composition_id: string;\n };\n};\n\ntype SelectedComposition = Composition & {\n quantity: number | undefined;\n price_type_id: number | undefined;\n};\n\nexport type CompositionParam = {\n composition_id: string;\n price_type_id: number;\n coefficient: number;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\ntype ElasticSort = {\n 'sort[field]': string;\n 'sort[mode]': 'asc' | 'desc';\n};\n\nconst ModalBudgetCompositionSelect: React.FC = ({\n handleClose,\n onConfirm,\n data: { composition_id },\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [compositions, setCompositions] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedCompositions, setSelectedCompositions] = useState<\n SelectedComposition[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.type_id) {\n Object.assign(validFilter, { 'filter[price_type_id]': filter.type_id });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (composition: Composition): number => {\n const price = getStatePrice(composition);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback((sortString: string | null): ElasticSort => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n }, []);\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setCompositions([]);\n\n try {\n const response = await api.get('/composition', {\n params: {\n 'filter[resource]': 'composition',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const compositionsData = response.data;\n\n const newPagination = {\n last_page: compositionsData.meta\n ? compositionsData.meta.last_page\n : compositionsData.last_page,\n };\n\n setCompositions(compositionsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n setCompositions([]);\n setServicePagination({ last_page: 1 });\n\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao pesquisar as composições. Tente novamente mais tarde!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComposition = (item: Composition): void => {\n setSelectedCompositions((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n price_type_id: searchFilter.type_id ? searchFilter.type_id : undefined,\n },\n ]);\n };\n\n const handleDeleteComposition = (item: Composition): void => {\n setSelectedCompositions((selected) =>\n selected.filter((c) => c._id !== item._id),\n );\n };\n\n const getStatePrice = (composition: Composition): State => {\n if (!composition._source.prices)\n return {\n default: {\n total: 0,\n },\n } as State;\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return composition._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedComposition[]): CompositionParam[] => {\n return selected.map((item) => ({\n composition_id: item._id,\n coefficient: item.quantity || 0,\n price_type_id: item.price_type_id || 0,\n }));\n },\n [],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n const preparedComponents = prepareComponents(selectedCompositions);\n\n await api.post(`/composition/${composition_id}/component/fragment`, {\n fragments: preparedComponents,\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar as composições selecionadas.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedCompositions,\n prepareComponents,\n handleClose,\n onConfirm,\n composition_id,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar composições\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isDisabled={\n (activeTab === 1 && selectedCompositions.length === 0) ||\n selectedCompositions.some(\n (item) => item.price_type_id === undefined,\n ) ||\n loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedCompositions.length > 0 && (\n \n {selectedCompositions.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(filter)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectComposition(item)}\n disabled={selectedCompositions.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedCompositions.some(\n (c) => c._id === item._id,\n )\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedCompositions.some(\n (c) => c._id === item._id,\n ) && (\n }\n onClick={() => handleDeleteComposition(item)}\n />\n )}\n \n ),\n active: selectedCompositions.some(\n (c) => c._id === item._id,\n ),\n })}\n data={compositions}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedCompositions.length > 0 ? (\n selectedCompositions.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhuma composição selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedCompositions((selected) =>\n selected.map((composition) =>\n composition._id === item._id\n ? {\n ...composition,\n quantity: v.floatValue,\n }\n : composition,\n ),\n );\n }}\n customInput={Input}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteComposition(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetCompositionSelect;\n","import React, {\n useCallback,\n useMemo,\n useState,\n useEffect,\n useContext,\n} from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Base, Version, Locale, UnitMeasure, PriceTypes } from 'types/base';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst OWN_BASE_KEY_PREFIX = 'own.';\n\nconst SearchFilter: React.FC = ({ onSubmit, loading = false }) => {\n const { user } = useContext(AuthContext);\n\n const {\n handleSubmit,\n setValue,\n formState: { errors },\n control,\n register,\n clearErrors,\n } = useForm();\n\n const [bases, setBases] = useState([]);\n const [selectedBase, setSelectedBase] = useState(null);\n const [isLoadingBases, setIsLoadingBases] = useState(false);\n\n const selectedBaseObj = useMemo(\n () => bases.find((b) => b.id === Number(selectedBase)),\n [bases, selectedBase],\n );\n\n const [baseVersions, setBaseVersions] = useState([]);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [isLoadingBaseVersions, setIsLoadingBaseVersions] = useState(false);\n\n const [baseLocales, setBaseLocales] = useState([]);\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [isLoadingBaseLocales, setIsLoadingBaseLocales] = useState(false);\n\n const [basePriceTypes, setBasePriceTypes] = useState([]);\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n const [isLoadingPriceTypes, setIsLoadingPriceTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const getBases = useCallback(async () => {\n setIsLoadingBases(true);\n\n try {\n const { data: response } = await api.get('/base', {\n params: {\n 'filter[with_plan]': `.`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n sort: 'description',\n },\n });\n const basesLoaded = response.data;\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n setValue('base_id', base.id);\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setIsLoadingBases(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n const getBaseVersions = useCallback(\n async (baseId: number | null) => {\n if (!baseId) {\n setBaseVersions([]);\n return;\n }\n\n try {\n setIsLoadingBaseVersions(true);\n const { data: response } = await api.get('version', {\n params: {\n 'filter[base_id]': baseId,\n sort: selectedBaseObj?.key.startsWith(OWN_BASE_KEY_PREFIX)\n ? `-created_at`\n : `-pointer`,\n },\n });\n const baseVersionsLoaded = response.data;\n setBaseVersions(baseVersionsLoaded);\n\n if (baseVersionsLoaded.length === 1) {\n const [baseVersion] = baseVersionsLoaded;\n setSelectedBaseVersion(baseVersion.id);\n setValue('version_id', baseVersion.id);\n\n if (errors.version_id) {\n clearErrors('version_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as versões da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseVersions(false);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selectedBaseObj],\n );\n\n const baseVersionsToSelect = useMemo(() => {\n return baseVersions.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [baseVersions]);\n\n useEffect(() => {\n getBaseVersions(selectedBase);\n }, [getBaseVersions, selectedBase]);\n\n const getBaseLocales = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBaseLocales([]);\n return;\n }\n\n try {\n setIsLoadingBaseLocales(true);\n const { data: response } = await api.get('locale', {\n params: {\n 'filter[base_id]': baseId,\n sort: 'description',\n },\n });\n const baseLocalesLoaded = response.data;\n setBaseLocales(baseLocalesLoaded);\n\n if (baseLocalesLoaded.length === 1) {\n const [baseLocale] = baseLocalesLoaded;\n setSelectedBaseLocale(baseLocale.id);\n setValue('locale_id', baseLocale.id);\n\n if (errors.locale_id) {\n clearErrors('locale_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os estados da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseLocales(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseLocalesToSelect = useMemo(() => {\n return baseLocales.map((locale) => ({\n value: String(locale.id),\n label: locale.description,\n }));\n }, [baseLocales]);\n\n useEffect(() => {\n getBaseLocales(selectedBase);\n }, [getBaseLocales, selectedBase]);\n\n const getBasePriceTypes = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBasePriceTypes([]);\n return;\n }\n\n try {\n setIsLoadingPriceTypes(true);\n const { data: response } = await api.get('price/type', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const basePriceTypesLoaded = response.data;\n setBasePriceTypes(basePriceTypesLoaded);\n\n if (basePriceTypesLoaded.length === 1) {\n const [basePriceType] = basePriceTypesLoaded;\n setSelectedBasePriceType(basePriceType.id);\n setValue('type_id', basePriceType.id);\n\n if (errors.type_id) {\n clearErrors('type_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os tipos de preço da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingPriceTypes(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basePriceTypesToSelect = useMemo(() => {\n return basePriceTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [basePriceTypes]);\n\n useEffect(() => {\n getBasePriceTypes(selectedBase);\n }, [getBasePriceTypes, selectedBase]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n const clearBaseDependentValues = (): void => {\n setSelectedBaseVersion(null);\n setValue('version_id', null);\n\n setSelectedBaseLocale(null);\n setValue('locale_id', null);\n\n setSelectedBasePriceType(null);\n setValue('type_id', null);\n };\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n clearBaseDependentValues();\n\n const value = selected ? Number(selected.value) : null;\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n\n setSelectedBase(value);\n setValue('base_id', value);\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isLoading={isLoadingBases}\n isDisabled={isLoadingBases || basesToSelect.length === 0}\n isClearable\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n (\n Number(s.value) === selectedBaseVersion,\n )}\n isLoading={isLoadingBaseVersions}\n isDisabled={\n isLoadingBaseVersions || baseVersionsToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseVersion(value);\n setValue('version_id', value);\n\n if (value && errors.version_id) {\n clearErrors('version_id');\n }\n }}\n />\n )}\n name=\"version_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n (\n Number(s.value) === selectedBaseLocale,\n )}\n isLoading={isLoadingBaseLocales}\n isDisabled={\n isLoadingBaseLocales || baseLocalesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseLocale(value);\n setValue('locale_id', value);\n\n if (value && errors.locale_id) {\n clearErrors('locale_id');\n }\n }}\n />\n )}\n name=\"locale_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo\n\n (\n Number(s.value) === selectedBasePriceType,\n )}\n isLoading={isLoadingPriceTypes}\n isDisabled={\n isLoadingPriceTypes || basePriceTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBasePriceType(value);\n setValue('type_id', value);\n\n if (value && errors.type_id) {\n clearErrors('type_id');\n }\n }}\n />\n )}\n name=\"type_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da insumo\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Input as ChakraInput,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n IconButton,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Input, State, DefaultPrice, StatePrice } from 'types/input';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ntype ModalInputSelect = ModalRootProps & {\n data: {\n composition_id: string;\n };\n};\n\ntype SelectedInput = Input & {\n quantity: number | undefined;\n price_type_id: number | undefined;\n};\n\nexport type InputParam = {\n input_id: string;\n coefficient: number;\n price_type_id: number;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\ntype ElasticSort = {\n 'sort[field]': string;\n 'sort[mode]': 'asc' | 'desc';\n};\n\nconst ModalOwnInputSelect: React.FC = ({\n handleClose,\n onConfirm,\n data: { composition_id },\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [inputs, setInputs] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedInputs, setSelectedInputs] = useState([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.type_id) {\n Object.assign(validFilter, { 'filter[price_type_id]': filter.type_id });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (input: Input): number => {\n const price = getStatePrice(input);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback((sortString: string | null): ElasticSort => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n }, []);\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setInputs([]);\n\n try {\n const response = await api.get('/input', {\n params: {\n 'filter[resource]': 'input',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const inputsData = response.data;\n\n const newPagination = {\n last_page: inputsData.meta\n ? inputsData.meta.last_page\n : inputsData.last_page,\n };\n\n setInputs(inputsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n setInputs([]);\n setServicePagination({ last_page: 1 });\n\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao pesquisar os insumos. Tente novamente mais tarde!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectInput = (item: Input): void => {\n setSelectedInputs((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n price_type_id: searchFilter.type_id ? searchFilter.type_id : undefined,\n },\n ]);\n };\n\n const handleDeleteInput = (item: Input): void => {\n setSelectedInputs((selected) => selected.filter((c) => c._id !== item._id));\n };\n\n const getStatePrice = (input: Input): State => {\n if (!input._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(input._source.prices));\n const state = states[0];\n\n return input._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedInput[]): InputParam[] => {\n return selected.map((item) => ({\n input_id: item._id,\n coefficient: item.quantity || 0,\n price_type_id: item.price_type_id || 0,\n }));\n },\n [],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n const preparedComponents = prepareComponents(selectedInputs);\n\n await api.post(`/composition/${composition_id}/component/fragment`, {\n fragments: preparedComponents,\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar os insumos selecionados.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedInputs,\n prepareComponents,\n handleClose,\n onConfirm,\n composition_id,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar insumos\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isDisabled={\n (activeTab === 1 && selectedInputs.length === 0) ||\n selectedInputs.some((item) => item.price_type_id === undefined) ||\n loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedInputs.length > 0 && (\n \n {selectedInputs.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(filter)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectInput(item)}\n disabled={selectedInputs.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedInputs.some((c) => c._id === item._id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedInputs.some((c) => c._id === item._id) && (\n }\n onClick={() => handleDeleteInput(item)}\n />\n )}\n \n ),\n active: selectedInputs.some((c) => c._id === item._id),\n })}\n data={inputs}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedInputs.length > 0 ? (\n selectedInputs.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhum insumo selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedInputs((selected) =>\n selected.map((input) =>\n input._id === item._id\n ? {\n ...input,\n quantity: v.floatValue,\n }\n : input,\n ),\n );\n }}\n customInput={ChakraInput}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteInput(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalOwnInputSelect;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\ntype Props = {\n description: string;\n color: string;\n};\n\nconst FlowStatusBadge: React.FC = ({ color, description }: Props) => {\n return (\n \n {description || 'Não definido'}\n \n );\n};\n\nexport default FlowStatusBadge;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Text,\n Grid,\n HStack,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { ParametricBudget } from 'types/budget/parametric-budget';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport FlowStatusBadge from './StatusBadge';\n\ninterface ModalParametricBudgetHistoryProps extends ModalRootProps {\n data: {\n budget: ParametricBudget;\n };\n}\n\ntype FlowHistory = {\n id: number;\n type: string;\n user: {\n id: number;\n name: string;\n email: string;\n profile_verified: true;\n corporate_name: null;\n fantasy_name: null;\n document_type: null;\n document: null;\n address: null;\n number: null;\n complement: null;\n district: null;\n zip_code: null;\n city: null;\n created_at: string;\n updated_at: string;\n deleted_at: null;\n };\n object: {\n status: {\n color: string;\n icon: string;\n name: string;\n };\n };\n status: {\n color: string;\n icon: string;\n name: string;\n };\n message: string;\n created_at: string;\n updated_at: string;\n};\n\ntype FlowUser = FlowHistory['user'];\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalParametricBudgetHistory: React.FC =\n ({ handleClose, data: budgetData, ...restProps }) => {\n const { budget } = budgetData;\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] =\n useState({ last_page: 1 });\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get('/flow/history', {\n params: {\n 'filter[object_id]': budget.id,\n 'filter[object_type]': 'parametric_budget',\n page: pagination.page,\n per_page: pagination.per_page,\n sort: '-created_at',\n },\n });\n\n const history = response.data;\n\n const newPagination = {\n last_page: history.meta.last_page,\n };\n\n setData(history.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [pagination, budget]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleConfirm = (): void => {\n handleClose();\n };\n\n const getUserName = (item: FlowUser): string => {\n if (item.document_type === 'cnpj') {\n return `${item.corporate_name} - ${item.fantasy_name}`;\n }\n\n return item.name;\n };\n\n type Organization = ParametricBudget['organization'];\n const getOrganizationName = (organization: Organization): JSX.Element => {\n if (organization.document_type === 'cnpj') {\n return (\n <>\n {organization.fantasy_name}\n
\n {organization.corporate_name}\n \n );\n }\n\n return <>{organization.name};\n };\n\n return (\n \n \n \n Histórico de aprovação\n\n \n\n \n \n \n Descrição: \n \n {budget.build_description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Criação: \n \n {formatDate(budget.created_at)}\n \n \n\n <>\n \n Organização: \n {getOrganizationName(budget.organization)}\n \n \n \n\n ({\n id: item.id,\n responsible: (\n <>\n {formatDate(item.created_at)}\n\n \n {getUserName(item.user)}\n \n \n ),\n status: (\n \n ),\n message: {item.message},\n actions: null,\n })}\n data={data}\n noDataMessage=\"Nenhuma ação registrada.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n Fechar\n \n \n \n \n \n );\n };\n\nexport default ModalParametricBudgetHistory;\n","import React, { memo } from 'react';\n\nimport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverHeader,\n PopoverBody,\n PopoverArrow,\n PopoverCloseButton,\n PopoverProps,\n Text,\n Box,\n} from '@chakra-ui/react';\n\ninterface Props extends PopoverProps {\n description: string;\n}\n\nconst BuildingDetailsPopover: React.FC = ({ description, ...rest }) => {\n return (\n \n \n \n {description?.substr(0, 30) || '-'}\n {description?.length > 30 && '...'}\n \n \n\n \n \n DESCRIÇÃO DA OBRA\n \n\n \n \n\n \n {description ? (\n \n ) : (\n '-'\n )}\n \n \n \n );\n};\n\nexport default memo(BuildingDetailsPopover);\n","export const typeMap = {\n single_family_residence: 'R1 (Residência Unifamiliar)',\n affordable_housing_pp: 'PP (Prédio Popular)',\n multi_family_residence_r8: 'R8 (Residência Multifamiliar)',\n multi_family_residence_r16: 'R16 (Residência Multifamiliar)',\n social_interest_project: 'PIS (Projeto de Interesse Social)',\n affordable_housing_rp1q: 'RP1Q (Residência Popular)',\n commercial_open_floors: 'CAL8 (Comercial Andares Livre)',\n commercial_offices_and_stores_csl8: 'CSL8 (Comercial Salas e Lojas)',\n commercial_offices_and_stores_csl16: 'CSL16 (Comercial Salas e Lojas)',\n industrial_warehouse: 'GI (Galpão Industrial)',\n};\n\nexport const patternMap = {\n 'single_family_residence:low': 'R1-B (Baixo)',\n 'single_family_residence:normal': 'R1-N (Normal)',\n 'single_family_residence:high': 'R1-A (Alto)',\n 'affordable_housing_pp:low': 'PP-4B (Baixo)',\n 'affordable_housing_pp:normal': 'PP-4N (Normal)',\n 'multi_family_residence_r8:low': 'R8-B (Baixo)',\n 'multi_family_residence_r8:normal': 'R8-N (Normal)',\n 'multi_family_residence_r8:high': 'R8-A (Alto)',\n 'multi_family_residence_r16:normal': 'R16-N (Normal)',\n 'multi_family_residence_r16:high': 'R16-A (Alto)',\n social_interest_project: 'PIS (Projeto de Interesse Social)',\n affordable_housing_rp1q: 'RP1Q (Residência Popular)',\n 'commercial_open_floors:normal': 'CAL8-N (Normal)',\n 'commercial_open_floors:high': 'CAL8-A (Alto)',\n 'commercial_offices_and_stores_csl8:normal': 'CSL8-N (Normal)',\n 'commercial_offices_and_stores_csl8:high': 'CSL8-A (Alto)',\n 'commercial_offices_and_stores_csl16:normal': 'CSL16-N (Normal)',\n 'commercial_offices_and_stores_csl16:high': 'CSL16-A (Alto)',\n industrial_warehouse: 'GI (Galpão Industrial)',\n};\n","import React, { useState, useEffect, useCallback } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalCloseButton,\n ModalBody,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useDebouncedState from 'hooks/useDebouncedState';\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { ParametricBudget } from 'types/budget/parametric-budget';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport BuildingDescriptionPopover from './BuildingDescriptionPopover';\nimport { typeMap, patternMap } from './shared';\n\nconst ModalParametricBudgetLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [keyword, setKeyword] = useDebouncedState('');\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 5,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get('/parametric/budget', {\n params: {\n 'filter[keyword]': keyword,\n page: pagination.page,\n per_page: pagination.per_page,\n sort: '-created_at',\n },\n });\n\n const parametricBudgets = response.data;\n\n const newPagination = {\n last_page: parametricBudgets.meta.last_page,\n };\n\n setData(parametricBudgets.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [keyword, pagination]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n type Organization = ParametricBudget['organization'];\n const getOrganizationName = (organization: Organization): JSX.Element => {\n if (organization.document_type === 'cnpj') {\n return (\n \n {organization.fantasy_name\n ? organization.fantasy_name\n : organization.corporate_name}\n \n );\n }\n\n return <>{organization.name};\n };\n\n const getBuildTypeDescription = (buildType: string): string => {\n return typeMap[buildType as keyof typeof typeMap] || 'Não definido';\n };\n\n const getPatternDescription = (\n buildType: string,\n pattern: string | undefined,\n ): string => {\n let key = buildType;\n if (pattern) {\n key = `${buildType}:${pattern}`;\n }\n return patternMap[key as keyof typeof patternMap] || 'Não definido';\n };\n\n const handleConfirm = (parametricBudget: ParametricBudget): void => {\n if (onConfirm) onConfirm(parametricBudget);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar orçamento paramétrico\n\n \n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n setKeyword(e.target.value)}\n mb={{ base: 3, md: 0 }}\n />\n \n \n\n ({\n id: item.id,\n created_at: (\n <>\n {formatDate(item.created_at)}\n {!!item.organization && (\n \n {getOrganizationName(item.organization)}\n \n )}\n \n ),\n build_description: (\n \n ),\n build_type: (\n <>\n \n {getBuildTypeDescription(item.build_type)}\n \n\n \n {getPatternDescription(item.build_type, item.build_pattern)}\n {item.state && ` - ${item.state.name}`}\n \n \n ),\n total_cost: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.total_cost),\n actions: (\n handleConfirm(item)}\n leftIcon={}\n >\n Selecionar\n \n ),\n })}\n data={data}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n \n );\n};\n\nexport default ModalParametricBudgetLookup;\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalPositionUpdateProps extends ModalRootProps {\n data: {\n budget_id: number;\n item_id: number;\n code: string;\n description: string;\n position: string;\n constructive_unit_position?: string;\n };\n}\n\nconst ModalPositionUpdate: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const [position, setPosition] = useState();\n const positionRef = React.useRef(null);\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (positionRef.current) {\n positionRef.current.focus();\n }\n }, []);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!position) {\n Object.assign(formErrors, { position: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n const targetPosition = data.constructive_unit_position\n ? `${data.constructive_unit_position}.${position}`\n : String(position);\n\n await api.put(\n `/budget/${data.budget_id}/component/${data.item_id}/move`,\n {\n location: targetPosition,\n },\n );\n\n if (onConfirm) onConfirm();\n\n toast({\n description: 'Componente movido com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao mover o componente!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Alterar posição\n\n \n\n \n \n Código\n {data.code}\n \n\n \n Descrição\n {data.description}\n \n\n \n Posição atual\n {data.position}\n \n\n \n Nova posição\n\n setPosition(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n Nova posição é obrigatória\n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalPositionUpdate;\n","import React, { useState, useEffect, useCallback } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n Icon,\n Text,\n Box,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype SiengeOrganization = {\n docNumber: string;\n id: string;\n name: string;\n provider: string;\n};\n\ninterface ModalSiengeOrganizationLookupProps extends ModalRootProps {\n data: {\n state: string;\n code: string;\n };\n}\n\nconst ModalSiengeOrganizationLookup: React.FC =\n ({ data: modalData, onConfirm, handleClose, ...restProps }) => {\n const [data, setData] = useState([]);\n const [token, setToken] = useState(null);\n const [loading, setLoading] = useState(false);\n\n const [initialLoad, setInitialLoad] = useState(false);\n\n const getOrganizations = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n let organizations: SiengeOrganization[] = [];\n\n try {\n const response = await api.get('/organization/external/siengeId', {\n params: {\n code: modalData.code,\n state: modalData.state,\n },\n });\n\n const organizationsData = response.data;\n organizations = organizationsData['0'];\n\n const userInfo = organizationsData.user_info;\n\n setData(organizations);\n setToken(userInfo?.token);\n } catch (err) {\n toast({\n description: 'Não foi possível carregar as organizações.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [modalData]);\n\n useEffect(() => {\n if (initialLoad) {\n getOrganizations();\n }\n }, [initialLoad, getOrganizations]);\n\n const handleConfirm = (org: SiengeOrganization): void => {\n if (onConfirm) onConfirm(org, token);\n handleClose();\n };\n\n useEffect(() => {\n if (!initialLoad) {\n setInitialLoad(true);\n }\n }, [initialLoad]);\n\n return (\n \n \n \n Selecionar organização Sienge ID\n\n \n\n \n ({\n id: item.id,\n name: (\n \n {item.name}\n \n ),\n actions: (\n }\n onClick={() => handleConfirm(item)}\n >\n Selecionar\n \n ),\n })}\n data={data}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n \n \n \n \n );\n };\n\nexport default ModalSiengeOrganizationLookup;\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n Textarea,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalStageAddProps extends ModalRootProps {\n data: {\n budget_id: number;\n parent_stage_id: number | null;\n stage_id?: number;\n title?: string;\n description?: string;\n quantity?: number;\n type?: string;\n composition_price_id?: number;\n isSiengeBudget?: boolean;\n };\n}\n\nconst ModalStageAdd: React.FC = ({\n onConfirm,\n handleClose,\n data,\n mode,\n ...restProps\n}) => {\n const [initialLoad, setInitialLoad] = useState(false);\n\n const [title, setTitle] = useState(data.title || '');\n const titleRef = React.useRef(null);\n\n const [description, setDescription] = useState(\n data.description || '',\n );\n\n const [quantity, setQuantity] = useState(data.quantity || 1);\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (!initialLoad) {\n setInitialLoad(true);\n }\n }, [initialLoad]);\n\n useEffect(() => {\n if (initialLoad && titleRef.current) {\n titleRef.current.focus();\n }\n }, [initialLoad]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!title) {\n Object.assign(formErrors, { title: true, type: 'required' });\n }\n\n if (!data.isSiengeBudget && (!quantity || quantity <= 0)) {\n Object.assign(formErrors, { quantity: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n if (mode === 'add') {\n await api.post(`/budget/${data.budget_id}/component`, {\n parent_stage_id: data.parent_stage_id,\n components: [\n {\n type: 'stage',\n title,\n description,\n quantity: data.isSiengeBudget ? 1 : quantity,\n },\n ],\n });\n } else if (mode === 'edit') {\n await api.put(`/budget/${data.budget_id}/component/${data.stage_id}`, {\n ...(data.type?.includes('composition')\n ? {\n type: 'composition_original',\n component: {\n composition_price_id: data.composition_price_id,\n quantity: data.isSiengeBudget ? 1 : quantity,\n },\n }\n : {\n type: 'stage',\n component: {\n title,\n quantity: data.isSiengeBudget ? 1 : quantity,\n description,\n },\n }),\n });\n }\n\n if (onConfirm) onConfirm();\n\n toast({\n description:\n mode === 'add'\n ? 'Item adicionado com sucesso!'\n : 'Item editado com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar o item!'\n : 'Houve um erro ao editar o item!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add' ? 'Adicionar item' : 'Editar item'}\n \n\n \n\n \n \n Título\n\n setTitle(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.title && 'Título é obrigatório'}\n \n \n\n {!data.isSiengeBudget && (\n \n Quantidade\n\n setQuantity(e.target.valueAsNumber)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.quantity && 'Quantidade é obrigatória'}\n \n \n )}\n\n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalStageAdd;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\nimport { Subscription } from 'types/access-control';\n\nexport const getStatusBadge = (\n item: Subscription['histories']['0'],\n): React.ReactElement => {\n if (item.status === 'approved') {\n return Aprovado;\n }\n\n if (item.status === 'delayed') {\n return Em atraso;\n }\n\n if (item.status === 'chargeback') {\n return Chargeback;\n }\n\n if (item.status === 'refunded') {\n return Recusado;\n }\n\n return Outro;\n};\n","import React from 'react';\n\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n HStack,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport { Subscription } from 'types/access-control';\n\nimport { getPaymentMethod } from './getPaymentMethod';\nimport { getStatusBadge } from './getStatusBadge';\n\ninterface ModalSubscriptionHistoryProps extends ModalRootProps {\n data: {\n histories: Subscription['histories'];\n };\n}\n\nconst modalMargin = 300;\nconst modalMobileFix = modalMargin - 20;\n\nconst ModalSubscriptionHistory: React.FC = ({\n handleClose,\n data: { histories },\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const handleConfirm = (): void => {\n handleClose();\n };\n\n const reversedHistories = [...histories].reverse();\n\n return (\n \n \n \n Histórico da transação\n\n \n\n \n ({\n id: item.id,\n transaction_id: item.transaction_id,\n created_at: formatDate(item.created_at),\n status: getStatusBadge(item),\n payment_method: getPaymentMethod(item.payment_method),\n actions: null,\n })}\n data={reversedHistories}\n noDataMessage=\"Nenhuma ação registrada.\"\n loading={false}\n onUpdateSort={() => {\n //\n }}\n />\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ModalSubscriptionHistory;\n","export const getPaymentMethod = (paymentMethod: string): string => {\n if (paymentMethod === 'credit_card') {\n return 'Cartão de crédito';\n }\n\n if (paymentMethod === 'bankin_ticket') {\n return 'Boleto';\n }\n\n if (paymentMethod === 'pix') {\n return 'Pix';\n }\n\n return 'Não identificado';\n};\n","import React from 'react';\n\nimport { Whatsapp as WhatsAppIcon } from '@styled-icons/boxicons-logos/Whatsapp';\nimport { Mail as MailIcon } from '@styled-icons/fluentui-system-filled/Mail';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n HStack,\n Heading,\n Box,\n Icon,\n Link,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nconst ModalSupport: React.FC = ({\n handleClose,\n ...restProps\n}) => {\n return (\n \n \n \n Suporte ecustos\n\n \n\n \n \n Fale com a gente\n \n\n *': {\n marginY: 1,\n },\n }}\n >\n \n \n \n \n +55 48 3027-8104\n \n \n\n \n \n \n suporte@ecustos.com.br\n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ModalSupport;\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n Textarea,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalUnitConstructiveAddProps extends ModalRootProps {\n data: {\n budget_id: number;\n parent_stage_id: number | null;\n stage_id?: number;\n title?: string;\n description?: string;\n type?: string;\n composition_price_id?: number;\n isSiengeBudget?: boolean;\n };\n}\n\nconst ModalUnitConstructiveAdd: React.FC = ({\n onConfirm,\n handleClose,\n data,\n mode,\n ...restProps\n}) => {\n const [initialLoad, setInitialLoad] = useState(false);\n\n const [title, setTitle] = useState(data.title || '');\n const titleRef = React.useRef(null);\n\n const [description, setDescription] = useState(\n data.description || '',\n );\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (!initialLoad) {\n setInitialLoad(true);\n }\n }, [initialLoad]);\n\n useEffect(() => {\n if (initialLoad && titleRef.current) {\n titleRef.current.focus();\n }\n }, [initialLoad]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!title) {\n Object.assign(formErrors, { title: true, type: 'required' });\n }\n\n if (!description) {\n Object.assign(formErrors, { description: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n if (mode === 'add') {\n await api.post(`/budget/${data.budget_id}/component`, {\n parent_stage_id: data.parent_stage_id,\n components: [\n {\n type: 'unit_constructive',\n title,\n description,\n quantity: 1,\n },\n ],\n });\n } else if (mode === 'edit') {\n await api.put(`/budget/${data.budget_id}/component/${data.stage_id}`, {\n type: 'unit_constructive',\n component: {\n title,\n quantity: 1,\n description,\n },\n });\n }\n\n if (onConfirm) onConfirm();\n\n toast({\n description:\n mode === 'add'\n ? 'Unidade construtiva adicionado com sucesso!'\n : 'Unidade construtiva editado com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar o unidade construtiva!'\n : 'Houve um erro ao editar o unidade construtiva!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add'\n ? 'Adicionar unidade construtiva'\n : 'Editar unidade construtiva'}\n \n\n \n\n \n \n Título\n\n setTitle(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.title && 'Título é obrigatório'}\n \n \n\n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n \n\n \n {!!errors?.description && 'Descrição é obrigatória'}\n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalUnitConstructiveAdd;\n","import React, { useState, useEffect, useCallback } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n SimpleGrid,\n HStack,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Pagination, ServicePagination } from 'types/pagination';\nimport { UnitConstructive } from 'types/unit-constructive';\n\ninterface ModalUnitConstructiveLookupProps extends ModalRootProps {\n data: {\n enterprise_id: string;\n };\n}\n\nconst ModalUnitConstructiveLookup: React.FC =\n ({ onConfirm, handleClose, data, ...restProps }) => {\n const [unitConstructiveList, setUnitConstructiveList] = useState<\n UnitConstructive[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 10,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] =\n useState({ last_page: 1 });\n\n const getUnitConstructiveList = useCallback(async () => {\n if (!data.enterprise_id) {\n return;\n }\n\n setLoading(true);\n setUnitConstructiveList([]);\n\n try {\n const response = await api.get('/unit/constructive', {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'params[building_id]': data.enterprise_id,\n },\n });\n\n const units = response.data;\n\n const newPagination = {\n last_page: units.meta.last_page,\n };\n\n setUnitConstructiveList(units.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Ocorreu um erro ao buscar as unidades construtivas.',\n status: 'error',\n });\n\n setUnitConstructiveList([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [pagination, data.enterprise_id]);\n\n useEffect(() => {\n getUnitConstructiveList();\n }, [getUnitConstructiveList]);\n\n const handleConfirm = (unit: UnitConstructive): void => {\n if (onConfirm) onConfirm(unit);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar unidade construtiva\n\n \n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n \n\n ({\n id: item.external_id,\n name: (\n \n \n {item.external_id}\n \n . {item.description}\n \n ),\n actions: (\n }\n onClick={() => handleConfirm(item)}\n >\n Selecionar\n \n ),\n })}\n data={unitConstructiveList}\n noDataMessage=\"Nenhuma unidade construtiva encontrada. Digite um código para pesquisar.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n \n );\n };\n\nexport default ModalUnitConstructiveLookup;\n","import ModalABCValues from 'components/Modal/ABCValues';\nimport ModalBaseAdd from 'components/Modal/BaseAdd';\nimport ModalBaseSelect from 'components/Modal/BaseSelect';\nimport ModalBudgetComponentObservation from 'components/Modal/BudgetComponentObservation';\nimport ModalBudgetCompositionEdit from 'components/Modal/BudgetCompositionEdit';\nimport ModalBudgetCompositionFragmentSelect from 'components/Modal/BudgetCompositionFragmentSelect';\nimport ModalBudgetCompositionLookup from 'components/Modal/BudgetCompositionLookup';\nimport ModalBudgetCompositionSelect from 'components/Modal/BudgetCompositionSelect';\nimport ModalBudgetCustomCompositionAdd from 'components/Modal/BudgetCustomCompositionAdd';\nimport ModalBudgetGlobalPriceChange from 'components/Modal/BudgetGlobalPriceChange';\nimport ModalBudgetHistory from 'components/Modal/BudgetHistory';\nimport ModalBudgetInputFragmentSelect from 'components/Modal/BudgetInputFragmentSelect';\nimport ModalBudgetInputSelect from 'components/Modal/BudgetInputSelect';\nimport ModalBudgetOutdatedComponentSelect from 'components/Modal/BudgetOutdatedComponentSelect';\nimport ModalBudgetTypeSelect from 'components/Modal/BudgetTypeSelect';\nimport ModalClientLookup from 'components/Modal/ClientLookup';\nimport ModalClientSelfLookup from 'components/Modal/ClientSelfLookup';\nimport ModalCompositionLookup from 'components/Modal/CompositionLookup';\nimport ModalCompositionPricesLookup from 'components/Modal/CompositionPriceLookup';\nimport ModalEnterpriseLookup from 'components/Modal/EnterpriseLookup';\nimport ModalGPTModel from 'components/Modal/GPTModel';\nimport ModalImport from 'components/Modal/Import';\nimport ModalImportCompositionFields from 'components/Modal/Import/Composition/Fields';\nimport ModalImportCompositionOverview from 'components/Modal/Import/Composition/Overview';\nimport ModalImportInputFields from 'components/Modal/Import/Input/Fields';\nimport ModalImportInputOverview from 'components/Modal/Import/Input/Overview';\nimport ModalInputPricesLookup from 'components/Modal/InputPriceLookup';\nimport ModalJSONViewer from 'components/Modal/JSONViewer';\nimport ModalLocaleAndPriceTypeSelect from 'components/Modal/LocaleAndPriceTypeSelect';\nimport ModalManageFlow from 'components/Modal/ManageFlow';\nimport ModalManageParametricFlow from 'components/Modal/ManageParametricFlow';\nimport ModalOwnCompositionSelect from 'components/Modal/OwnCompositionSelect';\nimport ModalOwnInputSelect from 'components/Modal/OwnInputSelect';\nimport ModalParametricBudgetHistory from 'components/Modal/ParametricBudgetHistory';\nimport ModalParametricBudgetLookup from 'components/Modal/ParametricBudgetLookup';\nimport ModalPositionUpdate from 'components/Modal/PositionUpdate';\nimport ModalSiengeOrganizationLookup from 'components/Modal/SiengeOrganizationLookup';\nimport ModalStageAdd from 'components/Modal/StageAdd';\nimport ModalSubscriptionHistory from 'components/Modal/SubscriptionHistory';\nimport ModalSupport from 'components/Modal/Support';\nimport ModalUnitConstructiveAdd from 'components/Modal/UnitConstructiveAdd';\nimport ModalUnitConstructiveLookup from 'components/Modal/UnitConstructiveLookup';\nimport ModalUserInvite from 'components/Modal/UserInvite';\nimport ModalUserOrganizationLookup from 'components/Modal/UserOrganizationLookup';\nimport ModalVersionAdd from 'components/Modal/VersionAdd';\n\nexport default {\n baseAdd: ModalBaseAdd,\n baseSelect: ModalBaseSelect,\n versionAdd: ModalVersionAdd,\n clientLookup: ModalClientLookup,\n clientSelfLookup: ModalClientSelfLookup,\n compositionLookup: ModalCompositionLookup,\n budgetCompositionLookup: ModalBudgetCompositionLookup,\n compositionPriceLookup: ModalCompositionPricesLookup,\n inputPriceLookup: ModalInputPricesLookup,\n userInvite: ModalUserInvite,\n budgetCompositionSelect: ModalBudgetCompositionSelect,\n budgetCompositionFragmentSelect: ModalBudgetCompositionFragmentSelect,\n budgetComponentObservation: ModalBudgetComponentObservation,\n budgetInputSelect: ModalBudgetInputSelect,\n budgetInputFragmentSelect: ModalBudgetInputFragmentSelect,\n stageAdd: ModalStageAdd,\n positionUpdate: ModalPositionUpdate,\n ownCompositionSelect: ModalOwnCompositionSelect,\n ownInputSelect: ModalOwnInputSelect,\n import: ModalImport,\n inputImportFields: ModalImportInputFields,\n compositionImportFields: ModalImportCompositionFields,\n importInputOverview: ModalImportInputOverview,\n importCompositionOverview: ModalImportCompositionOverview,\n budgetCompositionEdit: ModalBudgetCompositionEdit,\n subscriptionHistory: ModalSubscriptionHistory,\n userOrganizationLookup: ModalUserOrganizationLookup,\n abcValues: ModalABCValues,\n support: ModalSupport,\n budgetTypeSelect: ModalBudgetTypeSelect,\n enterpriseLookup: ModalEnterpriseLookup,\n unitConstructiveLookup: ModalUnitConstructiveLookup,\n jsonViewer: ModalJSONViewer,\n siengeOrganizationLookup: ModalSiengeOrganizationLookup,\n flowChange: ModalManageFlow,\n budgetHistory: ModalBudgetHistory,\n parametricFlowChange: ModalManageParametricFlow,\n parametricBudgetHistory: ModalParametricBudgetHistory,\n gptModel: ModalGPTModel,\n unitConstructiveAdd: ModalUnitConstructiveAdd,\n parametricBudgetLookup: ModalParametricBudgetLookup,\n budgetCustomCompositionAdd: ModalBudgetCustomCompositionAdd,\n budgetOutdatedComponentSelect: ModalBudgetOutdatedComponentSelect,\n localeAndPriceTypeSelect: ModalLocaleAndPriceTypeSelect,\n budgetGlobalPriceChange: ModalBudgetGlobalPriceChange,\n};\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalVersionAddProps extends ModalRootProps {\n data: {\n base_id?: number;\n version_id?: number;\n description?: string;\n reference?: string;\n };\n}\n\nconst ModalVersionAdd: React.FC = ({\n onConfirm,\n handleClose,\n data = {},\n mode,\n ...restProps\n}) => {\n const [description, setDescription] = useState(\n data.description || '',\n );\n const [referenceMonth] = useState(data.reference || '');\n\n const descriptionRef = React.useRef(null);\n // const referenceMonthRef = React.useRef(null);\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (descriptionRef.current) {\n descriptionRef.current.focus();\n }\n }, []);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!description) {\n Object.assign(formErrors, { description: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n const [year, month] = referenceMonth.split('-');\n const yearNum = Number(year);\n const monthNum = Number(month);\n\n try {\n setLoading(true);\n if (mode === 'add') {\n await api.post(`/version`, {\n base_id: data.base_id,\n description,\n ...(!!referenceMonth && { month: monthNum, year: yearNum }),\n });\n } else if (mode === 'edit') {\n await api.put(`/version/${data.version_id}`, {\n base_id: data.base_id,\n description,\n ...(!!referenceMonth && { month: monthNum, year: yearNum }),\n });\n }\n if (onConfirm) onConfirm();\n toast({\n description:\n mode === 'add'\n ? 'Referência adicionada com sucesso!'\n : 'Referência editada com sucesso!',\n status: 'success',\n });\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar a referência!'\n : 'Houve um erro ao editar a referência!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add' ? 'Adicionar referência' : 'Editar referência'}\n \n\n \n\n \n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.description && 'Descrição é obrigatória'}\n \n \n {/*\n \n Mês/Ano\n\n setReferenceMonth(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.reference && 'Referência é obrigatória'}\n \n */}\n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalVersionAdd;\n","import React, { useState } from 'react';\n\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\nimport * as yup from 'yup';\n\nimport { ChevronDownIcon } from '@chakra-ui/icons';\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n Menu,\n MenuButton,\n MenuItem,\n MenuList,\n MenuDivider,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalUserInviteProps extends ModalRootProps {\n data: {\n organization_id: number;\n };\n}\n\nconst ModalUserInvite: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const emailValidator = yup.string().email();\n\n const { organization_id } = data;\n\n const [email, setEmail] = useState();\n const [role, setRole] = useState(() => '');\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n const roleDescriptionByKey = (key: string): string => {\n switch (key) {\n case 'organization-admin':\n case 'group-admin':\n return 'Administrador';\n\n case 'organization-user':\n return 'Gestor';\n\n default:\n return key;\n }\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!email) {\n Object.assign(formErrors, { email: true, type: 'required' });\n }\n\n if (!(await emailValidator.isValid(email))) {\n Object.assign(formErrors, { email: true, type: 'invalid' });\n }\n\n if (!role) {\n Object.assign(formErrors, { role: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.post(`/organization/${organization_id}/user`, {\n email,\n role,\n group_id: null,\n organization_id,\n });\n\n toast({\n description: `Foi enviado um e-mail com o convite para ${email}.`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n if (err.response?.data.message) {\n toast({\n description: err.response?.data.message,\n status: 'error',\n });\n } else {\n toast({\n description:\n 'Houve um erro ao tentar enviar o e-mail. Verifique se o endereço está correto e tente novamente.',\n status: 'error',\n });\n }\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Convidar usuário para organização\n\n \n\n \n \n E-mail\n setEmail(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.email && errors?.type === 'invalid'\n ? 'E-mail inválido'\n : 'E-mail é obrigatório'}\n \n \n\n \n Permissão\n \n }\n size=\"md\"\n textAlign=\"left\"\n borderColor={errors?.role ? 'red.500' : 'unset'}\n color={errors?.role ? 'white.200' : 'unset'}\n bgColor={errors?.role ? 'red.200' : 'gray.200'}\n _hover={{\n bgColor: errors?.role ? 'red.200' : 'gray.200',\n }}\n _active={{\n bgColor: errors?.role ? 'red.200' : 'gray.200',\n }}\n >\n {role ? roleDescriptionByKey(role) : 'Selecione'}\n \n\n \n {\n setRole('organization-admin');\n }}\n >\n Administrador Pode gerenciar usuários, além de ter\n acesso total ao sistema.\n \n\n \n\n {\n setRole('organization-user');\n }}\n >\n Gestor Usuário comum do sistema.\n \n \n \n\n Permissão é obrigatória\n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalUserInvite;\n","import React, {\n useState,\n useEffect,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\nimport { isSuperOrEcustosAdmin } from 'shared/roles';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalCloseButton,\n ModalBody,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Organization } from 'hooks/useAuth';\nimport useDebouncedState from 'hooks/useDebouncedState';\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nconst ModalUserOrganizationLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user, jwtManagement } = useContext(AuthContext);\n\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [keyword, setKeyword] = useDebouncedState('');\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 10,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n const user_id = isSuperOrEcustosAdmin(user) ? undefined : user.id;\n\n try {\n const response = await api.get('/organization/user', {\n params: {\n 'filter[keyword]': keyword,\n 'filter[status]': 'active',\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[user_id]': user_id,\n },\n });\n\n const userOrganizations = response.data;\n\n const newPagination = {\n last_page: userOrganizations.meta.last_page,\n };\n\n setData(userOrganizations.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [keyword, pagination, user]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const getOrganizationName = ({ organization }: Organization): string => {\n if (organization.document_type === 'cnpj') {\n if (!organization.fantasy_name) {\n return organization.corporate_name;\n }\n\n return `${organization.corporate_name} - ${organization.fantasy_name}`;\n }\n\n return organization.name;\n };\n\n const getUserName = ({ user: u }: Organization): string => {\n if (u.document_type === 'cnpj') {\n if (!u.fantasy_name) {\n return u.corporate_name;\n }\n\n return `${u.corporate_name} - ${u.fantasy_name}`;\n }\n\n return u.name;\n };\n\n const handleConfirm = (organization: Organization): void => {\n if (onConfirm) onConfirm(organization);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n const canCloseModal = useMemo(() => {\n if (!user.managed_organization) {\n return false;\n }\n\n if (!jwtManagement) {\n return false;\n }\n\n return true;\n }, [user.managed_organization, jwtManagement]);\n\n return (\n \n \n \n Selecionar Organização\n\n {canCloseModal && }\n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n setKeyword(e.target.value)}\n mb={{ base: 3, md: 0 }}\n />\n \n \n\n ({\n id: item.id,\n name: (\n <>\n \n {getUserName(item)}\n \n {item.user.email}\n \n ),\n organization: (\n \n {getOrganizationName(item)}\n \n ),\n email_verified_at:\n item.user.email_verified_at &&\n formatDate(item.user.email_verified_at),\n actions: (\n }\n onClick={() => handleConfirm(item)}\n disabled={item.id === user.managed_organization?.id}\n >\n Selecionar\n \n ),\n })}\n data={data}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n \n );\n};\n\nexport default ModalUserOrganizationLookup;\n","import React from 'react';\n\nimport { ModalProps as ChakraModalProps } from '@chakra-ui/react';\n\nimport useModal, { ModalProps } from 'hooks/useModal';\n\nimport modalList from './modalList';\n\ntype ChakraProps = Omit;\n\nexport interface ModalRootProps extends ModalProps, ChakraProps {\n handleClose: () => void;\n}\n\nexport type ModalKey = keyof typeof modalList;\n\nconst ModalRoot: React.FC = () => {\n const { modals, closeModal } = useModal();\n\n return (\n <>\n {modals.map(({ key, props }) => {\n const Component = modalList[key];\n\n if (!Component) return null;\n\n return (\n closeModal(key)}\n handleClose={() => closeModal(key)}\n closeOnOverlayClick={false}\n {...props}\n />\n );\n })}\n \n );\n};\n\nexport default ModalRoot;\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Badge: ComponentStyleConfig = {\n baseStyle: {\n fontSize: 10,\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Box: ComponentStyleConfig = {\n defaultProps: {\n boxShadow: '0px 0px 15px rgba(0, 0, 0, 0.1)',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Button: ComponentStyleConfig = {\n defaultProps: {\n size: 'sm',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const FormLabel: ComponentStyleConfig = {\n baseStyle: {\n fontSize: 'sm',\n _invalid: {\n color: 'red.500',\n },\n },\n};\n\nexport const FormError: ComponentStyleConfig = {\n baseStyle: {\n text: {\n color: 'red.500',\n mb: 3,\n },\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const IconButton: ComponentStyleConfig = {\n defaultProps: {\n isRound: true,\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Input: ComponentStyleConfig = {\n variants: {\n ecustos: {\n field: {\n background: '#FFF',\n color: 'blackAplha',\n borderWidth: 1,\n borderRadius: 5,\n borderColor: 'gray.300',\n errorBorderColor: 'red.300',\n transitionDuration: '100ms',\n _readOnly: {\n bg: `gray.100`,\n },\n _focus: {\n borderColor: 'blue.300',\n },\n _invalid: {\n borderColor: 'red.500',\n background: 'red.100',\n _placeholder: {\n color: 'red.600',\n },\n },\n },\n },\n },\n defaultProps: {\n size: 'md',\n variant: 'ecustos',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Select: ComponentStyleConfig = {\n baseStyle: {\n borderRadius: 6,\n },\n defaultProps: {\n size: 'md',\n variant: 'ecustos',\n },\n variants: {\n ecustos: {\n field: {\n background: '#FFF',\n color: 'blackAplha',\n borderWidth: 1,\n borderRadius: 5,\n borderColor: 'gray.300',\n transitionDuration: '100ms',\n _readOnly: {\n bg: `gray.100`,\n pointerEvents: 'none',\n touchAction: 'none',\n tabIndex: '-1',\n ariaDisabled: 'true',\n },\n _focus: {\n borderColor: 'blue.300',\n },\n _invalid: {\n borderColor: 'red.500',\n background: 'red.100',\n _placeholder: {\n color: 'red.600',\n },\n },\n },\n // addon: {\n // borderColor: '#0f9',\n // },\n },\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Table: ComponentStyleConfig = {\n defaultProps: {\n size: 'sm',\n variant: 'striped',\n },\n};\n\nexport const Td: ComponentStyleConfig = {\n baseStyle: {\n bg: 'gray.400',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Tooltip: ComponentStyleConfig = {\n baseStyle: {\n borderRadius: 6,\n padding: 2,\n },\n};\n","import { extendTheme } from '@chakra-ui/react';\n\nimport colors from './colors';\nimport * as components from './components';\nimport config from './config';\n\nconst styles = {\n global: {\n ':root': {\n fontSize: '15px',\n },\n 'html, body': {\n background: 'gray.50',\n },\n },\n};\n\nconst customTheme = extendTheme({\n config,\n colors,\n styles,\n fonts: {\n body: 'Nunito Sans, system-ui, sans-serif',\n heading: 'Nunito Sans, system-ui, sans-serif',\n mono: 'Fira Code, monospace',\n },\n transition: {\n transitionTimingFunction: 'ease-in-out',\n transitionDuration: '200ms',\n },\n components: {\n ...components,\n },\n});\n\nexport default customTheme;\n","export default {\n brand: {\n 50: '#698b95',\n 100: '#507783',\n 200: '#376471',\n 300: '#1e5060',\n 400: '#053d4e',\n 500: '#053746',\n 600: '#04313e',\n 700: '#042b37',\n 800: '#03252f',\n 900: '#031f27 ',\n },\n siengeRed: {\n 50: '#FDF2F1',\n 100: '#FADBD9',\n 200: '#F3ACA7',\n 300: '#EC7C76',\n 400: '#E64A44',\n 500: '#D5211D',\n 600: '#C31C1B',\n 700: '#B11819',\n 800: '#9F1619',\n 900: '#8D1318',\n },\n siengeBlue: {\n 50: '#F2F5FC',\n 100: '#CCD7F4',\n 200: '#809BE4',\n 300: '#345DD5',\n 400: '#1E398F',\n 500: '#0E1A43',\n 600: '#0A1332',\n 700: '#0A1332',\n 800: '#070C21',\n 900: '#000000',\n },\n purple: {\n 100: '#BD8BF0',\n 200: '#B77FEE',\n 300: '#B074ED',\n 400: '#AA68EB',\n 500: '#A55EEA',\n 600: '#9848E7',\n 700: '#8C33E5',\n 800: '#801FE2',\n 900: '#751BCE',\n },\n pink: {\n 100: '#F0758B',\n 200: '#EF6780',\n 300: '#EE5974',\n 400: '#EC4B69',\n 500: '#EB3B5A',\n 600: '#E92A4D',\n 700: '#E5183E',\n 800: '#D21639',\n 900: '#BF1433',\n },\n yellow: {\n 100: '#FEDE6A',\n 200: '#FEDB5C',\n 300: '#FED84D',\n 400: '#FED43E',\n 500: '#FED330',\n 600: '#FECC1A',\n 700: '#FEC804',\n 800: '#A78301',\n 900: '#896B01',\n },\n green: {\n 100: '#24FF7C',\n 200: '#0FFF6F',\n 300: '#00F863',\n 400: '#00E25A',\n 500: '#00CD52',\n 600: '#00BD4C',\n 700: '#00AF46',\n 800: '#005020',\n 900: '#00421A',\n },\n lime: {\n 50: '#f2ffde',\n 100: '#defcb2',\n 200: '#caf884',\n 300: '#b5f554',\n 400: '#a1f226',\n 500: '#88d90d',\n 600: '#69a905',\n 700: '#4a7801',\n 800: '#2b4800',\n 900: '#0b1900',\n },\n blue: {\n 100: '#4992FF',\n 200: '#3787FF',\n 300: '#247CFF',\n 400: '#1271FF',\n 500: '#0066FF',\n 600: '#0057DB',\n 700: '#0049B6',\n 800: '#003A92',\n 900: '#002C6D',\n },\n oceanBlue: {\n 100: '#CAF0F8',\n 200: '#ADE8F4',\n 300: '#90E0EF',\n 400: '#48CAE4',\n 500: '#00B4D8',\n 600: '#0096C7',\n 700: '#0077B6',\n 800: '#023E8A',\n 900: '#03045E',\n },\n gray: {\n // 50: '#F7FAFC',\n 50: '#F8F9FA',\n 100: '#E9ECEF',\n 200: '#DEE2E6',\n 300: '#CED4DA',\n 400: '#ADB5BD',\n 500: '#A5B1C2',\n 600: '#6C757D',\n 700: '#495057',\n 800: '#343A40',\n 900: '#212529',\n },\n indigo: {\n 50: '#eef2ff',\n 100: '#e0e7ff',\n 200: '#c7d2fe',\n 300: '#a5b4fc',\n 400: '#818cf8',\n 500: '#6366f1',\n 600: '#4f46e5',\n 700: '#4338ca',\n 800: '#3730a3',\n 900: '#312e81',\n },\n};\n","import React from 'react';\nimport { DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\nimport { QueryClientProvider, QueryClient } from 'react-query';\nimport { ReactQueryDevtools } from 'react-query/devtools';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport Routes from 'routes';\n\nimport { ChakraProvider } from '@chakra-ui/react';\n\nimport AlertRoot from 'components/Alert/Root';\nimport ModalRoot from 'components/Modal/Root';\n\nimport { AlertProvider } from 'contexts/AlertContext';\nimport { AuthProvider } from 'contexts/AuthContext';\nimport { ModalProvider } from 'contexts/ModalContext';\n\nimport customTheme from 'styles/theme/customTheme';\n\nimport 'react-perfect-scrollbar/dist/css/styles.css';\n\nimport 'styles/css/all.scss';\n\nconst queryClient = new QueryClient();\n\nconst App: React.FC = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n );\n};\n\nexport default App;\n","import React from 'react'; // { Suspense, lazy }\nimport ReactDOM from 'react-dom';\n\nimport { ColorModeScript } from '@chakra-ui/react';\n\n// import FallbackSpinner from 'components/FallbackSpinner';\nimport App from './App';\n\n// const LazyApp = lazy(() => import('./App'));\n\nReactDOM.render(\n \n \n\n {/* }> */}\n \n {/* */}\n ,\n document.getElementById('root'),\n);\n","import { format } from 'date-fns';\nimport { utcToZonedTime } from 'date-fns-tz';\n\nexport function formatDate(date: string | Date): string {\n return format(new Date(date), 'dd/MM/yyyy HH:mm');\n}\n\nexport function toFilterFormat(date: string | Date): string {\n return format(utcToZonedTime(new Date(date), 'UTC'), 'yyyy-MM-dd HH:mm');\n}\n","import React from 'react';\n\nimport { Flex, Text, Box, keyframes } from '@chakra-ui/react';\n\ntype Size = 'xs' | 'x-small' | 'sm' | 'md' | 'lg';\ntype Weight = 'normal' | 'medium' | 'semibold' | 'bold';\n\ntype CenteredProps = {\n height: string;\n display: string;\n alignItems: string;\n justifyContent: string;\n};\n\ninterface StatusCircleProps {\n colorScheme: string;\n colorSchemeType?: 'manual' | 'chakra';\n children: string | React.ReactNode;\n hasCircle?: boolean;\n centered?: boolean;\n onClick?: () => void;\n title?: string;\n size?: Size;\n weight?: Weight;\n}\n\nconst spin = keyframes`\n 0% {opacity: 0; scale: 0;}\n 50% {opacity: 0.3; scale: 1;}\n 100% {opacity: 0; scale: 0;}\n`;\n\nconst StatusCircle: React.FC = ({\n colorScheme,\n colorSchemeType,\n children,\n hasCircle = true,\n centered = false,\n onClick,\n title,\n size = 'x-small',\n weight = 'bold',\n}) => {\n const spinAnimation = `${spin} infinite 2s ease`;\n\n const [color] = colorScheme.split('.');\n\n const getCenteredProps = (): CenteredProps => {\n return {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n };\n };\n\n return (\n \n {hasCircle && (\n \n )}\n \n {children}\n \n \n );\n};\n\nexport default StatusCircle;\n","import { createContext } from 'react';\n\nconst TableContext = createContext>({});\n\nexport default TableContext;\n","import React from 'react';\n\nimport { Table as ChakraTable, TableProps } from '@chakra-ui/react';\n\nimport TableContext from 'contexts/TableContext';\n\nexport const Table = (props: TableProps): React.ReactElement => {\n const { className, ...rest } = props;\n const classes = `${className || ''} table-responsible`;\n\n return (\n \n \n \n );\n};\n","import React from 'react';\n\nimport { TableBodyProps, Tbody as ChakraTbody } from '@chakra-ui/react';\n\nexport const Tbody = (props: TableBodyProps): React.ReactElement => (\n \n);\n","import React from 'react';\n\nimport { TableHeadProps, Thead as ChakraThead } from '@chakra-ui/react';\n\nexport const Thead = (props: TableHeadProps): React.ReactElement => {\n const { children, ...rest } = props;\n\n return (\n \n {React.isValidElement(children) &&\n React.cloneElement(children, { inHeader: true })}\n \n );\n};\n","import React from 'react';\n\nimport { TableCellProps, Td as ChakraTd } from '@chakra-ui/react';\n\nimport TableContext from 'contexts/TableContext';\n\ninterface ITdInnerProps extends TableCellProps {\n columnKey: number;\n narrowHeaders: Record;\n noData?: boolean;\n}\n\nexport type ITdProps = Omit;\n\nconst TdInner = ({\n className,\n children,\n ...restProps\n}: ITdInnerProps): React.ReactElement => {\n const {\n narrowHeaders = {},\n columnKey = 0,\n onClick,\n colSpan,\n ...rest\n } = restProps;\n\n const classes = !restProps?.noData ? className : '';\n const innerOnClick = !restProps?.noData ? onClick : undefined;\n\n return (\n \n {!restProps?.noData && colSpan !== 10 && (\n // eslint-disable-next-line\n \n {narrowHeaders[columnKey]}\n \n )}\n\n {children ??
 
}\n
\n );\n};\n\nexport const Td = (props: ITdProps): JSX.Element => (\n \n {(headers) => {\n return ;\n }}\n \n);\n","import React, { ReactElement } from 'react';\n\nimport { TableRowProps, Tr as ChakraTr } from '@chakra-ui/react';\n\nimport TableContext from 'contexts/TableContext';\n\ninterface ITrInnerProps extends TableRowProps {\n headers: Record;\n inHeader: boolean;\n}\n\nexport type ITrProps = Omit;\n\nconst TrInner = (props: ITrInnerProps): React.ReactElement => {\n const { headers, children, inHeader, ...rest } = props;\n\n if (headers && inHeader) {\n React.Children.map(props.children, (child, i) => {\n if (child) {\n headers[i] = (child as ReactElement).props.children;\n }\n });\n }\n\n const childProps = (idx: number): React.ReactElement =>\n inHeader ? { key: idx } : { key: idx, columnKey: idx };\n\n return (\n \n {children &&\n React.Children.map(\n children,\n (child, idx) =>\n React.isValidElement(child) &&\n React.cloneElement(child, childProps(idx)),\n )}\n \n );\n};\n\nexport const Tr = (props: ITrProps): React.ReactElement => (\n \n {(headers) => }\n \n);\n","import React from 'react';\n\nimport { TableColumnHeaderProps, Th as ChakraTh } from '@chakra-ui/react';\n\nexport const Th = (props: TableColumnHeaderProps): ChakraTh => (\n \n);\n","import { useContext } from 'react';\n\nimport ModalContext, { IModalContext } from 'contexts/ModalContext';\n\nfunction useModal(): IModalContext {\n const modal = useContext(ModalContext);\n\n if (!modal) {\n throw new Error('You have to use \"useModal()\" inside ModalProvider');\n }\n\n return modal;\n}\n\nexport type { ModalProps, IModalContext } from 'contexts/ModalContext';\n\nexport default useModal;\n","import React from 'react';\n\nimport { Grid, GridProps } from '@chakra-ui/react';\n\ninterface SummaryContainerProps extends GridProps {\n loading: boolean;\n}\n\nconst SummaryContainer = (props: SummaryContainerProps): React.ReactElement => {\n const { children, loading, ...rest } = props;\n\n return (\n \n {children &&\n React.Children.map(children, (child, idx) => {\n return (\n React.isValidElement(child) &&\n React.cloneElement(child, { idx, loading })\n );\n })}\n \n );\n};\n\nexport default SummaryContainer;\n"],"sourceRoot":""}