{"version":3,"sources":["serviceWorker.js","interfaces/model/Common.ts","interfaces/model/MaterialIndex.ts","interfaces/model/MaterialFamily.ts","interfaces/model/MaterialSubFamily.ts","interfaces/model/MaterialReferential.ts","interfaces/model/Material.ts","components/Filters/InputFilter.tsx","components/Filters/ResetFilter.tsx","helpers/index.ts","components/Filters/SelectFilter.tsx","components/TypeSelector/context/TypeSelectorContext.tsx","components/TypeSelector/TypeSelector.tsx","i18n/index.ts","contexts/LanguageContext.tsx","contexts/MixedChartContext.tsx","components/Chart/Analysis/Filters.tsx","interfaces/model/Chart.ts","interfaces/model/CompanySubType.ts","interfaces/model/CompanyType.ts","interfaces/model/Company.ts","interfaces/model/Container.ts","interfaces/model/ContainerDemand.ts","interfaces/model/ContainerDemandStatus.ts","interfaces/model/InvoiceType.ts","interfaces/model/KPI.ts","interfaces/model/Organization.ts","interfaces/serializer/AbstractSerializer.ts","actions/API.ts","actions/Contact.ts","actions/Currency.ts","actions/User.ts","actions/Preference.ts","interfaces/providers/abstractAPIPlatform.ts","actions/Document.ts","interfaces/providers/abstract.ts","interfaces/providers/abstractBCMPortal.ts","interfaces/providers/Chart.ts","actions/BCM_Constant.ts","interfaces/providers/Company.ts","interfaces/providers/Container.ts","interfaces/providers/ContainerDemand.ts","interfaces/providers/ContainerDemandStatus.ts","interfaces/providers/KPI.ts","interfaces/serializer/MaterialSerializer.ts","interfaces/providers/Material.ts","interfaces/providers/MaterialFamily.ts","interfaces/providers/MaterialSubFamily.ts","interfaces/providers/Organization.ts","contexts/UserContext.tsx","contexts/BaseStoreContext.tsx","contexts/ChartContext.tsx","contexts/FormContext.tsx","contexts/AppInsightContext.tsx","routes/withTracker.jsx","routes/CustomRoute.tsx","hooks/useLogged.ts","hooks/useNotLogged.ts","components/Dropdown/index.tsx","hooks/useOutsideClick.ts","components/Layout/AppBar/Items/NavDropdown.tsx","components/Dropdown/DropdownItem.tsx","components/Layout/AppBar/Items/NavItem.tsx","components/Layout/AppBar/FiltersBar.tsx","components/Layout/AppBar/index.tsx","components/Layout/ReturnToTop.tsx","components/Layout/index.tsx","components/Common/index.tsx","components/Loader/index.tsx","components/Chart/Abstract/Bar.tsx","components/Chart/Abstract/FilterMaterials.tsx","components/Chart/Abstract/Mixed.tsx","components/Chart/Analysis/Co2.tsx","components/Chart/Analysis/IndexValue.tsx","components/Chart/Abstract/CutsomBar.tsx","components/Tile/index.tsx","components/Chart/Analysis/KPI.tsx","hooks/useWindowSize.ts","components/Chart/Abstract/Bars.tsx","components/Chart/Analysis/Revenue.tsx","components/Chart/Analysis/Volume.tsx","contexts/Co2ChartContext.tsx","contexts/VolumeChartContext.tsx","components/Button/Export/AllSerializer.ts","components/Button/ExportButton.tsx","components/Button/Export/MovementSerializer.ts","components/TypeSelector/context/MovementTypeSelectorContext.tsx","components/Button/MovementExportButton.tsx","components/Chart/Abstract/StackedBars.tsx","components/Chart/Analysis/CircularEconomy.tsx","contexts/CircularEconomyChartContext.tsx","components/Button/ExportIndexButton.tsx","pages/Analysis.tsx","contexts/MovementCo2ChartContext.tsx","contexts/MovementVolumeChartContext.tsx","components/TypeSelector/MovementTypeSelector.tsx","pages/Movement.tsx","components/Card/Card.tsx","components/Card/EmbedCard.tsx","components/Catalog/CatalogItems.tsx","components/Catalog/Catalog.tsx","hooks/useDebounce.ts","pages/Catalog.tsx","pages/CatalogItem.tsx","components/Form/Form.tsx","components/Form/Field.ts","components/Form/Contact.tsx","components/Form/Currency.tsx","components/Form/Language.tsx","components/Form/Login.tsx","components/Form/Password/PasswordValidationBlock.tsx","components/Form/Password/ResetPasswordApplyForm.tsx","components/Form/Password/PasswordValidator.ts","components/Form/Password/ResetPasswordRequestForm.tsx","pages/Contact.tsx","pages/ResetPassword/CommonResetPassword.tsx","pages/user/Account.tsx","pages/Welcome.tsx","components/TableContainer/TableColumnFilter.js","components/TableContainer/TablePagination.js","components/TableContainer/Table.js","components/Chip/Chip.tsx","pages/Demands/Materials.tsx","pages/Demands/DemandsInternal.tsx","pages/Demands/DemandsExternal.tsx","pages/Documents/Documents.tsx","routes/passwordRoutes.ts","pages/ResetPassword/ResetPasswordRequest.tsx","pages/ResetPassword/ResetPasswordApply.tsx","pages/Login.tsx","pages/Consent.tsx","pages/Demands/CreateDemand.tsx","index.tsx"],"names":["Boolean","window","location","hostname","match","ModelInstance","object","_classCallCheck","_defineProperty","this","createdBy","createdAt","updatedBy","updatedAt","deletedBy","deletedAt","ModelActions","objects","MaterialIndexInstance","_ModelInstance","_inherits","_super","_createSuper","materialIndex","_this","call","_assertThisInitialized","code","materialIndexSourceCode","currencyCode","id","idMaterialIndexSource","name","materialIndexSourceName","MaterialIndex","_ModelActions","_super2","_this2","_len","arguments","length","args","Array","_key","apply","concat","materialIndexes","map","MaterialFamilyInstance","materialFamily","materialFamilyCode","idMaterialFamily","materialFamilyName","MaterialFamily","materialFamilies","MaterialSubFamilyInstance","materialSubFamily","materialSubFamilyCode","idMaterialSubFamily","materialSubFamilyName","MaterialSubFamily","materialSubFamilies","MaterialReferentialInstance","materialReferential","idMaterialsReferential","materialsReferentialName","MaterialInstance","material","_material$photo","undefined","materialCode","countryCode","description","idMaterial","materialName","photos","photo","split","p","Material","materials","SearchFilter","_ref","className","onChange","value","translate","useContext","LanguageContext","React","createElement","SzInput","groupClassName","icon","_ref2","currentTarget","placeholder","ResetFilter","resetFilters","onClick","SzIcon","variant","SzTypographie","sprintf","haystack","values","v","forEach","item","index","parseInt","toString","getDate","date","moment","format","getDecodedToken","token","jwtDecode","LocalStorage","_createClass","key","localStorage","getItem","setItem","removeItem","RefreshToken","_LocalStorage","Token","_LocalStorage2","_len3","_key3","get","Username","_LocalStorage3","_super3","_this3","_len5","_key5","UserId","_LocalStorage4","_super4","_this4","_len7","_key7","DecodedStorage","_LocalStorage5","_super5","JSON","parse","_get","_getPrototypeOf","prototype","stringify","Organization","_DecodedStorage","_super6","_this5","_len9","_key9","Company","_DecodedStorage2","_super7","_this6","_len11","_key11","Indexes","_DecodedStorage4","_super9","_this8","_len15","_key15","Preference","_DecodedStorage5","_super10","_this9","_len17","_key17","Currency","_Preference","_super11","currency","preference","Language","_Preference2","_super12","language","axiosInterceptorError","response","status","Promise","reject","config","url","provider","pathname","_","SzSelectInternal","options","isMulti","isDisabled","isMultiList","isSearchable","isClearable","defaultOptions","noOptionsMessage","SzSelect","propTypes","PropTypes","string","array","bool","oneOfType","any","func","node","SelectFilter","rest","_objectWithoutProperties","_objectSpread","MaterialFamilyFilter","_ref3","Object","assign","MaterialSubFamilyFilter","_ref4","OrganizationFilter","_ref9","organizations","BaseStoreContext","filters","PlantFilter","_ref10","plants","ContractFilter","_ref11","t","label","TypeSelectorContext","createContext","selected","setSelected","TypeSelectorProvider","children","roles","getDecoded","filter","r","includes","_useState","useState","_useState2","_slicedToArray","Provider","TypeSelector","_useContext2","_useContext3","setSelectedMaterials","contract","itemFiltersSelected","useEffect","isArray","SzButton","translations","languageInitier","initSelectedLanguage","navigator","initialState","languages","selectedLanguage","setSelectedLanguage","findTranslation","keys","shift","LanguageProvider","RESET","SET_SELECTED_INDEX","SET_SELECTED_MATERIAL","COLORS","defaultStore","dispatch","selectedIndex","selectedMaterial","defaultContext","data","indexes","total","reducer","state","payload","type","MixedChartContext","MixedChartProvider","_state$selectedIndex","_state$selectedMateri","_ref2$color","color","startDate","endDate","_useReducer","useReducer","_useReducer2","endDeliveryDate","startDeliveryDate","setData","_useState3","_useState4","setMaterials","_useState5","_useState6","setIndexes","_useState7","_useState8","setTotal","idIndex","memoizedState","useMemo","memoizedFilters","_Currency$getDecoded","isService","role","hasSelectedIndex","year","Date","getFullYear","month","getMonth","currentMonth","formatLabelYearMonthUTC","toISOString","MixedChart","getChart","then","userIndexes","formatedIndexes","sort","a","b","localeCompare","x","datas","labels","m","indexValues","i","push","first","second","getTime","colorIterator","l","dateString","toLocaleDateString","replace","toUpperCase","datasets","_ref5","borderColor","backgroundColor","pointBorderColor","pointBackgroundColor","pointHoverBackgroundColor","pointHoverBorderColor","yAxisID","divideBy1000","n","loop","formatToUnits","symbols","_divideBy","_divideBy2","toFixed","formattedTitle","result","symbol","formatTitleToK","_formatToUnits","_formatToUnits2","formatTitleToKg","_formatToUnits3","_formatToUnits4","UTC","TopFilters","_ref$additional","additional","formatTitle","OverlayTrigger","placement","delay","show","hide","overlay","Tooltip","BottomFilters","_useContext","ChartInstance","chart","mvtTonnageDistributed","Chart","results","MultiGraphInstance","line","VolumeGraph","CircularGraph","lines","self","findIndex","_item$domainName","domainName","reduce","initRow","fill","indexOf","create","Co2ChartInstance","volumeTeqCO2","Co2Chart","MixedChartIndexValueInstance","materialUnitValue","MixedChartInstance","materialIndexValues","getOne","getMany","CompanySubTypeInstance","companySubType","idCompanySubType","companySubTypeCode","companySubTypeName","CompanyTypeInstance","companyType","idCompanyType","companyTypeCode","companyTypeName","CompanyInstance","company","idCompany","companyLocalName","companies","ContainerInstance","container","idContainer","containerName","Container","containers","ContainerDemandInstance","demand","idContainerDemand","idDemand","ContainerDemandStatusInstance","internalOperator","externalOperator","bookingDate","ContainerDemand","demandStatus","idContainerDemandStatus","demandStatusCode","demandStatusName","ContainerDemandStatus","demandeStatus","KPIInstance","kpi","revenue","valorisationRevenue","volume","revenueTotal","serviceRevenue","KPI","OrganizationInstance","organization","idOrganization","organizationName","parent","parentOrganization","level","organizationLevel","AbstractSerializer","obj","o","getHeaders","h","Accept","API","instance","axios","baseURL","getBaseUrl","headers","interceptors","use","_deleteRequest","_asyncToGenerator","_regeneratorRuntime","mark","_callee","endpoint","wrap","_context","prev","next","abrupt","request","stop","_x","_getRequest","_callee2","_ref2$endpoint","_context2","URLSearchParams","pagination","_x2","_patchRequest","_callee3","_ref3$endpoint","_context3","patch","Authorization","_x3","_postRequest","_callee4","_ref4$config","_ref4$endpoint","_context4","post","_x4","_putRequest","_callee5","_context5","put","_x5","APIPlatform","_API","process","Contact","_APIPlatform","postRequest","getRequest","User","updateClient","append","accessToken","access_token","decoded","Error","set","refresh_token","username","user_id","setDecoded","UPDATE_CLIENT","organization_id","OrganizationStorage","company_id","CompanyStorage","ref","_ref6","resetForm","_ref7","_ref8","current","reset","FormData","_ref12","_ref13","logout","_ref14","console","log","_ref15","_ref16","LOGOUT","patchRequest","RefreshTokenSingleton","fetching","refreshToken","AbstractAPIPlatformProvider","REACT_APP_ENV","queryParametersObject","entries","serializer","serialize","k","join","withQueryParameters","formatQueryParameters","getUrl","all","ids","model","_config$url","exp","now","refresh","responseType","error","Document","_AbstractAPIPlatformP","AbstractProvider","management","count","AbstractBCMPortal","_AbstractProvider","withParams","ROLES","ROUTES","CO2","VOLUMES","_AbstractBCMPortal","ChartModel","FilterChart","_AbstractBCMPortal2","VolumeChart","_AbstractBCMPortal3","VolumeGraphModel","CircularEconomyChart","_AbstractBCMPortal4","MovementVolumeChart","_AbstractBCMPortal5","_AbstractBCMPortal6","Co2ChartModel","MovementCo2Chart","_AbstractBCMPortal7","_this7","_len13","_key13","_AbstractBCMPortal8","_super8","ExportChart","_AbstractBCMPortal9","MovementExportChart","_AbstractBCMPortal10","_this10","_len19","_key19","PROVIDER","MANAGEMENT","EXCLUDED_ROUTES","Login","ResetPasswordRequest","ResetPasswordApply","CompanyModel","ContainerModel","ContainerDemandModel","ContainerDemandStatusModel","KPIModel","MaterialSerializer","_AbstractSerializer","perPage","page","idOrganizations","idCompanies","materialFamilyFilterValues","materialSubFamilyFilterValues","fullname","searchMaterialFilter","MaterialModel","MaterialFamilyModel","MaterialSubFamilyModel","OrganizationModel","defaultValue","isLogged","user","decode","UserContext","UserProvider","ADD_ITEM_CATALOG","SET_CATALOG","SET_FILTERS","SET_ITEM_FILTERS_SELECTED","SET_OPEN_FILTERS","SET_SELECTED_ITEM","INIT_ANALYSIS_MATERIALS","SET_ANALYSIS_MATERIALS","SET_ANALYSIS_SELECTED_MATERIALS","INIT_MOVEMENT_MATERIALS","SET_MOVEMENT_MATERIALS","SET_MOVEMENT_SELECTED_MATERIALS","loading","catalog","analysis","selectedMaterials","movement","contracts","plant","itemSelected","openFilters","selection","_toConsumableArray","objectToOptionInterface","fields","separator","field","BaseStoreProvider","_useReducer2$","getList","getSelector","ChartContext","ChartProvider","_useContext$itemFilte","_useContext$analysis","finalSelectedMaterials","idMaterials","graph","graphOptions","d","sum","unit","order","compute","_ref4$reset","getMaterials","getFilterMaterials","SET_ERROR","SET_LOADING","SET_SUCCESS","SET_VALUE","isLoading","success","FormContext","FormProvider","defaultState","initialized","appInsights","AppInsightsContext","AppInsightProvider","history","useHistory","instrumentationKey","setAppInsights","setInitialized","ai","reactPlugin","ReactPlugin","ApplicationInsights","maxBatchInterval","disableFetchTracking","disableTelemetry","enableUnhandledPromiseRejectionTracking","extensions","extensionConfig","identifier","loadAppInsights","trackException","exception","severityLevel","SeverityLevel","withTracker","WrappedComponent","HOC","_Component","props","Component","displayName","roleNamesToNumber","roleNames","roleName","myEnum","enumValue","getEnumKeyByValue","CustomRoute","useLocation","Route","returnedRoute","setReturnedRoute","condition","path","businessRoles","currentRoles","find","businessRole","currentRole","String","useLogged","some","DemandsInternal","DemandsExternal","Movement","useNotLogged","Dropdown","alignRight","dropdownToggleClass","dropdownTogglerIcon","disabled","title","withoutChildren","open","setOpen","useRef","callback","handleClick","e","contains","target","document","addEventListener","removeEventListener","useOutsideClick","event","preventDefault","NavDropdown","DropdownItem","to","Link","NavItem","FiltersBar","Navbar","expand","expanded","Collapse","Divider","AppBarDropdown","_ref$withoutCaret","withoutCaret","setCount","_useContext2$itemFilt","Fragment","AvatarDropdown","src","alt","routes","navitems","AppBar","setExpanded","_useContext4","baseStore","isExternalOperator","isInternalOperator","isUserMovement","_n$roles","splice","height","navitem","_extends","ReturnToTop","scrollY","top","setTop","handleScroll","scrollTo","behavior","LayoutBase","withFooter","Nav","Item","href","Layout","noContainer","withDisclaimer","ComponentWithTitle","button","customIcon","logo","withoutTranslation","style","display","Loader","text","Spinner","as","animation","Bar","_ref$options","_ref$unit","ChartBar","redraw","plugins","legend","position","align","tooltip","enabled","displayColors","external","context","tooltipEl","getElementById","innerHTML","body","appendChild","_tooltipModel$labelCo","tooltipModel","opacity","formated","replaceAll","parseFloat","toLocaleString","renderToString","CustomTooltip","labelColors","classList","remove","yAlign","add","canvas","getBoundingClientRect","left","pageXOffset","caretX","pageYOffset","caretY","elements","tension","responsive","maintainAspectRatio","scales","grid","y","beginAtZero","FilterMaterials","setShow","search","setSearch","family","setFamily","subFamily","setSubFamily","_useState9","_useState10","setSelection","update","updater","updateSelection","newMaterials","_m$materialFamily","_m$materialSubFamily","toLowerCase","subFamilies","f","_m$materialSubFamily2","_m$materialSubFamily3","SzModal","handleClose","every","s","size","_m$materialFamily2","_m$materialFamily3","SzCheckbox","checked","_m$materialFamily4","_m$materialSubFamily4","Set","Mixed","_ref$type","titleFontSize","bodyFontColor","bodyFontSize","Co2","IndexValue","roundToUpperInt","repeat","subtype","Math","floor","CustomBar","_ref2$placement","_ref2$trigger","trigger","_ref2$type","setDate","Tile","_selectedLanguage$val","_useWindowSize","width","innerWidth","innerHeight","windowSize","setWindowSize","handleResize","useWindowSize","setValues","isServices","filterDate","KPIProvider","Bars","_dataset$unit","dataset","dataPoints","datasetIndex","Revenue","Volume","Co2ChartProvider","_ref$color","_useContext2$analysis","VolumeChartProvider","AllSerializer","monthlyData","detailsData","monthlyColumns","detailsColumns","columns","acc","column","serializedDetailsData","serializedMonthlyData","_loop","mapColumnValue","_loop2","setHours","getHours","round","Number","EPSILON","XlsxTemplate","require","ExportAllChart","setIsLoading","today","dataLayer","sz_conversion_type","ExportChartProvider","fetch","arrayBuffer","buffer","template","templateData","substitute","file","_arr","_i","content","archive","asText","re","matches","exec","subType","full","extractPlaceholders","substitution","xlsx","generate","link","URL","createObjectURL","Blob","filename","toLocaleTimeString","setAttribute","click","err","loader","MovementSerializer","MovementTypeSelectorContext","MovementTypeSelectorProvider","MovementExportAllChart","MovementExportChartProvider","formatNumber","number","Intl","NumberFormat","minimumFractionDigits","maximumFractionDigits","StackedBars","_data$datasets","layout","mode","callbacks","tooltipItem","_total","totals","dataIndex","raw","titleColor","titleFont","titleSpacing","titleMarginBottom","padding","bodyColor","bodyFont","bodySpacing","stacked","CircularEconomy","CircularEconomyChartProvider","mvtTypeCode","ExportIndexButton","serializeData","_data$labels","headersMonth","headersMaterials","headersValue","day","volumeCharts","component","Tonnages","Unites","co2Charts","mixedCharts","circularEconomyCharts","Automotive","Construction","Railway","Recycling","Aeronotic","scrapRetail","transport","oilAndGas","energy","varnishesPowderPaint","tractorVehicle","Other","NA","labelsLegendCO2","activeKey","setActiveKey","finalLegendCO2","indexLegend","SzAccordion","SzCollapse","header","eventKey","SET_END_DATE","SET_START_DATE","setFullYear","getLastYear","Analysis","showCircularChart","setShowCircularChart","charts","setCharts","_Currency$getDecoded2","_Currency$getDecoded3","Revenues","SzDatePicker","dateRange","endMinDate","onChangeEndDate","onChangeStartDate","MovementCo2ChartProvider","_useContext2$movement","_ref2$reset","MovementVolumeChartProvider","MovementTypeSelector","Card","EmbedCard","image","CatalogItems","hasMore","setHasMore","InfiniteScroll","pageStart","loadMore","Catalog","isFirstCall","setIsFirstCall","setMaterialFamilyFilterValues","setMaterialSubFamilyFilterValues","setSearchMaterialFilter","setMaterialFamily","_useState11","_useState12","setMaterialSubFamily","debounced","debouncedValue","setDebouncedValue","handler","setTimeout","clearTimeout","useDebounce","_useState13","setter","providers","callMaterialAPI","useCallback","CatalogComponent","CatalogItem","_itemSelected$materia","_itemSelected$materia2","_itemSelected$materia3","_itemSelected$photos","goBack","useRouteMatch","params","jsonToFormData","element","fd","Field","SzTextArea","autocomplete","rows","labelClassName","required","formProperties","recaptchaRef","submitForm","validate","setCaptchaOk","onSubmit","formData","fromEntries","formatformToJson","resolve","resetRecaptchaIfNeeded","Alerts","successMessage","SzAlert","hasCaptcha","BaseForm","additionalLinks","_ref6$alertsTop","alertsTop","_ref6$back","back","buttonContent","buttonText","_ref6$keepButton","keepButton","withRecaptcha","_useContext5","setRecaptchaRef","captchaOk","_useHistory","formProps","_renderGrecaptcha","execute","additionalLink","Recaptcha","hl","verifyCallback","resp","querySelector","sitekey","onloadCallback","Form","password","confirmPassword","messageBody","ContactAction","send","email","currencyHelper","CurrencyHelper","currencies","setCurrencies","setCurrency","CurrencyProvider","PreferenceProvider","option","LanguageLS","login","userLanguage","lang","requirements","PasswordValidationBlock","requirement","ResetPasswordApplyForm","hasError","setHasError","isValidated","strongRegex","RegExp","validatePassword","resetPasswordApply","ResetPasswordRequestForm","resetPasswordRequest","ResetPasswordForCurrentUserRequestForm","ContactForm","CommonResetPassword","AccountItem","Account","accountItems","Welcome","TableColumnFilter","setFilter","setValue","timer","TablePagination","pageIndex","pageCount","pageSize","canPreviousPage","pageOptions","canNextPage","gotoPage","nextPage","previousPage","setPageSize","Table","_ref$disabledList","disabledList","_ref$disabledColumnAc","disabledColumnActionsList","_ref$paginationDispla","paginationDisplayed","_ref$checkedList","checkedList","_ref$onSelectedItemCh","onSelectedItemChanged","_ref$onCheckAll","onCheckAll","itemIds","_ref$onSelectionChang","onSelectionChange","_ref$onPageChange","onPageChange","_ref$pageCount","_ref$headerVisible","headerVisible","_ref$resultPerPage","resultPerPage","REACT_APP_TABLE_DEFAULT_RESULT_PER_PAGE","_ref$onSortTableChang","onSortTableChange","_ref$initialFilters","initialFilters","_ref$onFiltersChange","onFiltersChange","_ref$nbPerPage","nbPerPage","_ref$onNbPerPageChang","onNbPerPageChange","_ref$isLoading","_ref$isInternalPagina","isInternalPagination","_ref$initialSortBy","initialSortBy","_ref$resetOrgaInsti","resetOrgaInsti","_ref$forceReset","forceReset","_ref$currentPage","currentPage","_ref$manualPagination","manualPagination","_ref$autoResetPage","autoResetPage","_ref$embeddedFilter","embeddedFilter","_ref$autoResetSort","autoResetSort","_ref$withFilters","withFilters","defaultColumn","Filter","checkedArrayToObject","checkedArray","curr","useSwitchStateManagement","memoValue","selectedRowIds","useStateMemo","_useTable","useTable","autoResetSelectedRows","manualSortBy","autoResetFilters","autoResetSortBy","defaultFilters","manualFilters","getRowId","row","useControlledState","sortBy","useFilters","useSortBy","usePagination","useRowSelect","hooks","visibleColumns","columnsData","Header","getToggleAllRowsSelectedProps","IndeterminateCheckbox","isHeader","Cell","getToggleRowSelectedProps","getTableProps","getTableBodyProps","headerGroups","prepareRow","allColumns","setAllFilters","_useTable$state","actions","resetPage","sorted","desc","TableHeader","toDisplay","getRowProps","cells","cell","getCellProps","render","ceil","foundDisabled","_headerGroups$","_headerGroups$$header","_headerGroups$$header2","colName","headerGroup","getHeaderGroupProps","getHeaderProps","getSortByToggleProps","isSorted","isSortedDesc","canFilter","forwardRef","indeterminate","defaultRef","resolvedRef","arrayOf","defaultProps","Chip","Materials","_demand$materials","STATUS","INPROGRESS_STATUS","CLOSED_STATUS","inProgressTableData","setInprogressTableData","closedTableData","setClosedTableData","pageInprogress","setPageInprogress","pageClosed","setPageClosed","pgCountClosed","setPgCountClosed","pgCountInprogress","setPgCountInprogress","_useState14","perPageClosed","setPerPageClosed","_useState15","_useState16","perPageInprogress","setPerPageInprogress","_useState17","_useState18","inprogressStatusList","setInprogressStatusList","_useState19","_useState20","closedStatusList","setClosedStatusList","_useState21","_useState22","isClosedTableLoading","setIsClosedTableLoading","_useState23","_useState24","isInprogressTableLoading","setIsInprogressTableLoading","_useState25","_useState26","StatusList","setStatusList","_useState27","_useState28","setBookingDate","_useState29","_useState30","bookingTime","setBookingTime","_useState31","_useState32","selectedDemand","setSelectedDemand","_useState33","_useState34","successUpdate","setSucessUpdate","_useState35","_useState36","failureUpdate","setFailureUpadate","_useState37","_useState38","setSuccessMessage","_useState39","_useState40","_useState41","_useState42","failureMessage","setFailureMessage","_useState43","_useState44","inprogressFilters","setInprogressFilters","_useState45","_useState46","closedFilters","setClosedFilters","_useState47","_useState48","sortInprogressTable","setSortInprogressTable","_useState49","_useState50","sortClosedTable","setSortClosedTable","TABLE_COLUMN","accessor","disableFilters","disableSortBy","INPROGRESS_TABLE_CULUMN","filterList","_column$filterValue","filterValue","CLOSED_TABLE_COLUMN","_column$filterValue2","formatedTableData","demands","_demand$company","companyName","substring","utc","controlButtons","getStatus","loadDataInprogress","_loadDataInprogress","statusFilter","statusFilterValue","idStatus","orderByDate","loadDataClosed","_loadDataClosed","handleUpdateDemand","statusLabel","booking","_StatusList$find","formatedBookingDate","idDemandStatus","sendDemandMail","operators","_loadStatus","inprogressStatus","closedStatus","loadStatus","transparent","centered","startMinDate","classNameStartDate","TimePicker","showSecond","popupClassName","minuteStep","sucessCreate","setSucessCreate","handleStatusChange","operator","idOperator","Documents","documents","setPage","setPerPage","pgCount","setPgCount","sortTable","setSortTable","isTableLoading","setIsTableLoading","tableData","setTableData","currentDownloadId","setCurrentDownloadId","downloadFile","documentObject","extension","blobname","pop","downloadDocument","sent","t0","_loadData","loadData","passwordRoutes","strict","exact","background","LoginForm","rel","CreateDemands","containerList","setContainerList","selectedContainer","setSelectedContainer","isSelectLoading","setIsSelectLoading","minutes","startOf","handleCreateDemand","CreatedBy","_loadContainers","idUser","loadContainers","createBrowserHistory","RoutingComponent","Switch","BrowserRouter","ROLE_CUSTOMER","ROLE_SUPPLIER","ROLE_MOVEMENT_CUSTOMER","ROLE_MOVEMENT_SUPPLIER","ROLE_EXTERNAL_OPERATOR","ROLE_INTERNAL_OPERATOR","ROLE_DOCUMENTS_ACCESS","route","App","tarteaucitronForceLanguage","ReactDOM","serviceWorker","ready","registration","unregister"],"mappings":"8pBAaoBA,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,qLCPOC,G,2BAYX,SAAAA,EAAYC,GAAqCC,IAAA,KAAAF,GAAAG,IAAA,KAXjD,MAAQ,IAAEA,IAAA,UACL,IAAEA,IAAA,YACA,IAAEA,IAAA,YACF,IAAEA,IAAA,iBACG,IAAEA,IAAA,iBACF,IAAEA,IAAA,iBACF,IAAEA,IAAA,iBACF,IAAEA,IAAA,iBACF,IAAEA,IAAA,iBACF,IAGVC,KAAK,OAASH,EAAO,OACrBG,KAAKC,UAAYJ,EAAOI,UACxBD,KAAKE,UA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Rj+C,IAAAC,cAAC0b,GAAO,OAEV3b,IAAAC,cAAC4pB,GAAW,CACV0yB,OAAK,EACLpyB,KAAMjK,GAAO26B,UACb3wB,UAAW,CACTjK,GAAMk+B,wBAGRn+C,IAAAC,cAAC46C,GAAS,OAEXwB,GAAe/+C,KACd,SAAAmC,EAAsC2B,GAAa,IAAhD68B,EAASx+B,EAATw+B,UAAcmgB,EAAKn2C,IAAAxI,EAAA,sBACpBO,IAAAC,cAAC8pB,IAAKuE,IAAA,CAACtsB,IAAKZ,EAAO68B,UAAWjV,GAAYiV,IAAgBmgB,GAAS,KAIlE,EAGLC,GAAgB,WAAO,IACnBjzC,EAAqBtL,qBAAWC,IAAhCqL,iBAOR,OANAT,qBAAU,WACRnQ,OAAO8jD,2BACLlzC,EAAiBxL,MACjBR,MAAM,KAAK,EACf,GAAG,CAAC5E,SAGFwF,IAAAC,cAAC6jB,GAAY,KACX9jB,IAAAC,cAACylB,GAAiB,KAChB1lB,IAAAC,cAACwL,GAAgB,KACfzL,IAAAC,cAAC29C,IAAa,KACZ59C,IAAAC,cAACynB,GAAkB,KACjB1nB,IAAAC,cAACy9C,GAAgB,UAO/B,EAEAa,IAAS1N,OAAO7wC,IAAAC,cAACo+C,GAAG,MAAKtyB,SAASkF,eAAe,SpIhD3C,kBAAmBhmB,WACrBA,UAAUuzC,cAAcC,MAAMtvC,MAAK,SAAAuvC,GACjCA,EAAaC,YACf,G","file":"static/js/main.1224745618.chunk.js","sourcesContent":["/* eslint-disable */\n// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","export interface ModelInterface {\n '@id': string;\n code?: string;\n name?: string;\n createdBy?: string | null;\n createdAt?: string | null;\n updatedBy?: string | null;\n updatedAt?: string | null;\n deletedBy?: string | null;\n deletedAt?: string | null;\n}\n\nexport class ModelInstance {\n '@id' = '';\n id = '';\n code = '';\n name = '';\n createdBy = '';\n createdAt = '';\n updatedBy = '';\n updatedAt = '';\n deletedBy = '';\n deletedAt = '';\n\n constructor(object: any /*eslint-disable-line*/) {\n this['@id'] = object['@id'];\n this.createdBy = object.createdBy;\n this.createdAt = object.createdAt;\n this.updatedBy = object.updatedBy;\n this.updatedAt = object.updatedAt;\n this.deletedBy = object.deletedBy;\n this.deletedAt = object.deletedAt;\n }\n}\n\nexport class ModelActions {\n getMany = (objects: any[]): any[] => objects; //eslint-disable-line\n getOne = (object: any): any => object; //eslint-disable-line\n}\n","import { ModelActions, ModelInstance } from './Common';\n\nexport interface MaterialIndexInterface {\n idMaterialIndexSource: string;\n materialIndexSourceCode: string;\n materialIndexSourceName: string;\n currencyCode: string;\n}\n\nexport class MaterialIndexInstance extends ModelInstance {\n code = '';\n currencyCode = '';\n\n constructor(materialIndex: MaterialIndexInterface) {\n super(materialIndex);\n this.code = materialIndex.materialIndexSourceCode;\n this.currencyCode = materialIndex.currencyCode;\n this.id = materialIndex.idMaterialIndexSource;\n this.name = materialIndex.materialIndexSourceName;\n }\n}\n\nexport class MaterialIndex extends ModelActions {\n getMany = (\n materialIndexes: MaterialIndexInterface[]\n ): MaterialIndexInstance[] =>\n materialIndexes.map(\n (materialIndex) => new MaterialIndexInstance(materialIndex)\n );\n getOne = (materialIndex: MaterialIndexInterface): MaterialIndexInstance =>\n new MaterialIndexInstance(materialIndex);\n}\n","import { ModelActions, ModelInstance } from './Common';\n\nexport interface MaterialFamilyInterface {\n idMaterialFamily: string;\n materialFamilyCode: string;\n materialFamilyName: string;\n}\n\nexport class MaterialFamilyInstance extends ModelInstance {\n code = '';\n\n constructor(materialFamily: MaterialFamilyInterface) {\n super(materialFamily);\n this.code = materialFamily.materialFamilyCode;\n this.id = materialFamily.idMaterialFamily;\n this.name = materialFamily.materialFamilyName;\n }\n}\n\nexport class MaterialFamily extends ModelActions {\n getMany = (\n materialFamilies: MaterialFamilyInterface[]\n ): MaterialFamilyInstance[] =>\n materialFamilies.map(\n (materialFamily) => new MaterialFamilyInstance(materialFamily)\n );\n getOne = (materialFamily: MaterialFamilyInterface): MaterialFamilyInstance =>\n new MaterialFamilyInstance(materialFamily);\n}\n","import { ModelActions, ModelInstance } from './Common';\n\nexport interface MaterialSubFamilyInterface {\n idMaterialSubFamily: string;\n materialSubFamilyCode: string;\n materialSubFamilyName: string;\n}\n\nexport class MaterialSubFamilyInstance extends ModelInstance {\n constructor(materialSubFamily: MaterialSubFamilyInterface) {\n super(materialSubFamily);\n this.code = materialSubFamily.materialSubFamilyCode;\n this.id = materialSubFamily.idMaterialSubFamily;\n this.name = materialSubFamily.materialSubFamilyName;\n }\n}\n\nexport class MaterialSubFamily extends ModelActions {\n getMany = (\n materialSubFamilies: MaterialSubFamilyInterface[]\n ): MaterialSubFamilyInstance[] =>\n materialSubFamilies.map(\n (materialSubFamily) => new MaterialSubFamilyInstance(materialSubFamily)\n );\n getOne = (\n materialSubFamily: MaterialSubFamilyInterface\n ): MaterialSubFamilyInstance =>\n new MaterialSubFamilyInstance(materialSubFamily);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\n\nexport interface MaterialReferentialInterface extends ModelInterface {\n idMaterialsReferential: string;\n materialsReferentialName: string;\n}\n\nexport class MaterialReferentialInstance extends ModelInstance {\n constructor(materialReferential: MaterialReferentialInterface) {\n super(materialReferential);\n this.id = materialReferential.idMaterialsReferential;\n this.name = materialReferential.materialsReferentialName;\n }\n}\n\nexport class MaterialReferential extends ModelActions {\n getMany = (\n materialReferentials: MaterialReferentialInterface[]\n ): MaterialReferentialInstance[] =>\n materialReferentials.map(\n (materialReferential) =>\n new MaterialReferentialInstance(materialReferential)\n );\n getOne = (\n materialReferential: MaterialReferentialInterface\n ): MaterialReferentialInstance =>\n new MaterialReferentialInstance(materialReferential);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\nimport {\n MaterialFamilyInstance,\n MaterialFamilyInterface,\n} from './MaterialFamily';\nimport {\n MaterialSubFamilyInstance,\n MaterialSubFamilyInterface,\n} from './MaterialSubFamily';\nimport {\n MaterialReferentialInstance,\n MaterialReferentialInterface,\n} from './MaterialReferential';\n\nexport interface MaterialInterface extends ModelInterface {\n countryCode: string;\n description: string;\n idDefaultUnit: string;\n idMaterial: string;\n localCountryLegalMaterialCode: string;\n localCountryMaterialName: string;\n localDefaultUnit: string;\n localITSystemMaterialUID: string;\n localMaterialFamilyCode: string;\n localMaterialFamilyName: string;\n localMaterialSubFamilyCode: string;\n localMaterialSubFamilyName: string;\n materialCode: string;\n materialFamily: MaterialFamilyInterface;\n materialName: string;\n materialSubFamily: MaterialSubFamilyInterface;\n materialReferential: MaterialReferentialInterface;\n photo?: string;\n}\n\nexport class MaterialInstance extends ModelInstance {\n code = '';\n countryCode = '';\n description = '';\n materialFamily?: MaterialFamilyInstance = undefined;\n materialReferential?: MaterialSubFamilyInstance = undefined;\n materialSubFamily?: MaterialReferentialInstance = undefined;\n photos?: string[] = undefined;\n\n constructor(material: MaterialInterface) {\n super(material);\n this.code = material.materialCode;\n this.countryCode = material.countryCode;\n this.description = material.description;\n this.id = material.idMaterial;\n this.name = material.materialName;\n this.materialFamily =\n material.materialFamily &&\n new MaterialFamilyInstance(material.materialFamily);\n this.materialSubFamily =\n material.materialSubFamily &&\n new MaterialSubFamilyInstance(material.materialSubFamily);\n this.materialReferential =\n material.materialReferential &&\n new MaterialReferentialInstance(material.materialReferential);\n this.photos = material.photo?.split(';').map((p) => p);\n }\n}\n\nexport class Material extends ModelActions {\n getMany = (materials: MaterialInterface[]): MaterialInstance[] =>\n materials.map((material) => new MaterialInstance(material));\n getOne = (material: MaterialInterface): MaterialInstance =>\n new MaterialInstance(material);\n}\n","import React, { Dispatch, SetStateAction, useContext } from 'react';\nimport { SzIcon, SzInput } from 'react-theme-components';\nimport './filter.scss';\nimport { ClassNameInterface } from '../../interfaces';\nimport { LanguageContext } from '../../contexts';\n\ninterface InputFilterInterface {\n onChange: Dispatch>;\n value: string;\n}\n\nexport const SearchFilter: React.FC<\n ClassNameInterface & InputFilterInterface\n> = ({ className, onChange, value }) => {\n const { translate } = useContext(LanguageContext);\n return (\n ): void => onChange(value),\n placeholder: translate('filters.search.placeholder'),\n value,\n }}\n />\n );\n};\n","import React, { useContext } from 'react';\nimport { SzIcon, SzTypographie } from 'react-theme-components';\nimport { ClassNameInterface } from '../../interfaces';\nimport { LanguageContext } from '../../contexts';\n\ninterface ResetFilterInterface {\n resetFilters: () => void;\n}\n\nexport const ResetFilter: React.FC<\n ClassNameInterface & ResetFilterInterface\n> = ({ className, resetFilters }) => {\n const { translate } = useContext(LanguageContext);\n return (\n resetFilters()}\n >\n \n \n \n {translate('filters.reset.label')}\n \n \n \n );\n};\n","import jwtDecode from 'jwt-decode';\nimport {\n CompanyInstance,\n CurrencyInterface,\n ModelInterface,\n OrganizationInstance,\n PreferenceInterface,\n TokenInterface,\n} from '../interfaces';\nimport { RoleInterface } from '../interfaces/RoleInterface';\nimport { AxiosResponse } from 'axios';\nimport moment from 'moment';\n\nexport const sprintf = (haystack: string, values: string[]): string => {\n let v = '';\n haystack\n .split('%s')\n .forEach(\n (item, index) =>\n (v += `${item}${values[parseInt(index.toString())] || ''}`)\n );\n return v;\n};\n\nexport const getTimeOffset = (): number => new Date().getTimezoneOffset();\n\nexport const getDate = (date): string => moment(date).format('YYYY-MM-DD');\n\nexport const getDecodedToken = (token: string): TokenInterface =>\n token ? (jwtDecode(token) as TokenInterface) : ({} as TokenInterface);\n\nabstract class LocalStorage {\n protected key = '';\n\n public get(): string | null {\n return localStorage.getItem(this.key);\n }\n\n public set(value: string): void {\n return localStorage.setItem(this.key, value);\n }\n\n public delete(): void {\n return localStorage.removeItem(this.key);\n }\n}\n\nexport class RefreshToken extends LocalStorage {\n protected key = 'refresh_token';\n}\n\nexport class Token extends LocalStorage {\n protected key = 'token';\n\n public getDecoded(): TokenInterface {\n return getDecodedToken(this.get() || '');\n }\n}\n\nexport class Username extends LocalStorage {\n protected key = 'username';\n}\nexport class UserId extends LocalStorage {\n protected key = 'userId';\n}\n\nabstract class DecodedStorage extends LocalStorage {\n public getDecoded(): ModelInterface | RoleInterface | string[] | null {\n return JSON.parse(super.get() || '{}') as ModelInterface;\n }\n\n public setDecoded(value: ModelInterface | null): void {\n super.set(JSON.stringify(value));\n }\n}\n\nexport class Organization extends DecodedStorage {\n protected key = 'organization';\n\n public getDecoded(): OrganizationInstance {\n return super.getDecoded() as OrganizationInstance;\n }\n\n public setDecoded(value: OrganizationInstance): void {\n super.setDecoded(value);\n }\n}\n\nexport class Company extends DecodedStorage {\n protected key = 'company';\n\n public getDecoded(): CompanyInstance {\n return super.getDecoded() as CompanyInstance;\n }\n\n public setDecoded(value: CompanyInstance): void {\n super.setDecoded(value);\n }\n}\nexport class Roles extends DecodedStorage {\n protected key = 'roles';\n\n public getDecoded(): RoleInterface {\n return super.getDecoded() as RoleInterface;\n }\n\n public setDecoded(value: ModelInterface | string[] | null): void {\n super.set(JSON.stringify(value));\n }\n}\n\nexport class Indexes extends DecodedStorage {\n protected key = 'indexes';\n\n public getDecoded(): string[] {\n return super.getDecoded() as string[];\n }\n\n public setDecoded(value: ModelInterface | string[] | null): void {\n super.set(JSON.stringify(value));\n }\n}\n\nexport class Preference extends DecodedStorage {\n protected key = 'preference';\n\n public getDecoded(): PreferenceInterface | CurrencyInterface {\n return super.getDecoded() as PreferenceInterface;\n }\n\n public setDecoded(value: PreferenceInterface | CurrencyInterface): void {\n super.setDecoded(value);\n }\n}\n\nexport class Currency extends Preference {\n public getDecoded(): CurrencyInterface {\n const preference = super.getDecoded() as PreferenceInterface;\n return preference.currency || {};\n }\n\n public setDecoded(value: CurrencyInterface): void {\n const preference = super.getDecoded() as PreferenceInterface;\n preference.currency = value;\n super.setDecoded(preference);\n }\n}\n\nexport class Language extends Preference {\n public get(): string {\n const preference = super.getDecoded() as PreferenceInterface;\n return preference.language || '';\n }\n\n public set(value: string): void {\n const preference = super.getDecoded() as PreferenceInterface;\n preference.language = value;\n super.setDecoded(preference);\n }\n}\n\nexport const axiosInterceptorError = (\n response: AxiosResponse\n): Promise | undefined => {\n if (!response.status) {\n return Promise.reject(response);\n }\n const { status } = response;\n if (401 === status || 403 === status) {\n if (response.config.url == '/refresh') {\n const providers = [Token, Preference, Username, Company, Organization];\n providers.forEach((provider) => new provider().delete());\n window.location.pathname = '/';\n return new Promise((_, reject) => {\n reject(response);\n });\n }\n }\n};\n","import React, { Dispatch, SetStateAction, useContext } from 'react';\nimport { SzSelect } from 'react-theme-components';\nimport { ClassNameInterface } from '../../interfaces';\nimport './filter.scss';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport { sprintf } from '../../helpers';\n\nimport PropTypes from 'prop-types';\n\nfunction SzSelectInternal({\n id,\n options,\n value,\n className,\n isDisabled,\n isMulti,\n isMultiList,\n isSearchable,\n name,\n onChange,\n placeholder,\n isClearable,\n defaultOptions,\n noOptionsMessage,\n}) {\n return (\n \n );\n}\n\nSzSelectInternal.propTypes = {\n id: PropTypes.string,\n defaultOptions: PropTypes.array,\n isClearable: PropTypes.bool,\n options: PropTypes.array,\n value: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.array,\n PropTypes.any,\n ]),\n className: PropTypes.string,\n isDisabled: PropTypes.bool,\n isMulti: PropTypes.bool,\n isMultiList: PropTypes.bool,\n isSearchable: PropTypes.bool,\n name: PropTypes.string,\n onChange: PropTypes.func,\n placeholder: PropTypes.node,\n noOptionsMessage: PropTypes.string,\n};\n\nexport interface OptionInterface {\n label: string;\n value?: string | boolean;\n}\n\ninterface DropdownFilterInterface {\n isMulti?: boolean | undefined;\n options?: OptionInterface[];\n placeholder?: string;\n}\n\ninterface SelectFilterInterface extends DropdownFilterInterface {\n onChange: Dispatch>;\n value: OptionInterface[] | OptionInterface;\n}\n\ninterface SelectOneFilterInterface {\n onChange: Dispatch>;\n value: OptionInterface | [] | undefined | null;\n}\n\nexport const SelectFilter: React.FC<\n ClassNameInterface & DropdownFilterInterface\n> = ({ placeholder, ...rest }) => {\n const { translate } = useContext(LanguageContext);\n return (\n \n );\n};\n\nexport const MaterialFamilyFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => (\n \n);\n\nexport const MaterialSubFamilyFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => (\n \n);\n\nexport const MaterialReferentialFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => (\n \n);\n\nexport const IndexFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => (\n \n);\n\nexport const ByFilter: React.FC<\n ClassNameInterface & SelectOneFilterInterface\n> = ({ ...rest }) => (\n \n);\n\nexport const YearFilter: React.FC<\n ClassNameInterface & SelectOneFilterInterface\n> = ({ ...rest }) => {\n const options: OptionInterface[] = [];\n for (let i = 0; i < 20; i++) {\n const value = `${2020 - i}`;\n options.push({ label: value, value });\n }\n return ;\n};\n\nexport const OrganizationFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => {\n const {\n filters: { organizations },\n } = useContext(BaseStoreContext);\n return (\n \n );\n};\n\nexport const PlantFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => {\n const {\n filters: { plants },\n } = useContext(BaseStoreContext);\n return (\n \n );\n};\n\nexport const ContractFilter: React.FC<\n ClassNameInterface & SelectFilterInterface\n> = ({ ...rest }) => {\n const { translate } = useContext(LanguageContext);\n const t = (value: string): string =>\n translate(sprintf('filters.contract.options.%s', [value]));\n return (\n \n );\n};\n","import React, {\n createContext,\n Dispatch,\n SetStateAction,\n useState,\n} from 'react';\nimport { Token } from '../../../helpers';\n\nexport interface TypeSelectorContextInterface {\n selected: string;\n setSelected: Dispatch>;\n}\n\nexport const TypeSelectorContext = createContext({\n selected: '',\n setSelected: () => null,\n});\n\nexport const TypeSelectorProvider: React.FC = ({ children }) => {\n const roles = new Token()\n .getDecoded()\n .roles.filter((r) => ['ROLE_SUPPLIER', 'ROLE_CUSTOMER'].includes(r));\n const [selected, setSelected] = useState(roles[0] || '');\n\n return (\n \n {children}\n \n );\n};\n","import React, { useContext, useEffect } from 'react';\nimport { Token } from '../../helpers';\nimport { TypeSelectorContext } from './context/TypeSelectorContext';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport { ClassNameInterface } from '../../interfaces';\nimport './typeSelector.scss';\nimport { SzButton } from 'react-theme-components';\n\nexport const TypeSelector: React.FC = ({ className }) => {\n const t = new Token().getDecoded().roles || [];\n if (!(t.includes('ROLE_CUSTOMER') && t.includes('ROLE_SUPPLIER'))) {\n return null;\n }\n\n const { translate } = useContext(LanguageContext);\n const { selected, setSelected } = useContext(TypeSelectorContext);\n const {\n setSelectedMaterials,\n itemFiltersSelected: { contract },\n } = useContext(BaseStoreContext);\n\n useEffect(() => {\n if (\n contract &&\n !Array.isArray(contract) &&\n typeof contract['value'] === 'boolean'\n ) {\n if (contract['value'] && selected !== 'ROLE_CUSTOMER') {\n setSelected('ROLE_CUSTOMER');\n } else if (!contract['value'] && selected !== 'ROLE_SUPPLIER') {\n setSelected('ROLE_SUPPLIER');\n }\n }\n }, [contract]);\n\n const handleTypeSelected = (type) => {\n setSelected(type);\n setSelectedMaterials([], 'analysis');\n setSelectedMaterials([], 'movement');\n setSelectedMaterials([], 'circularEconomy');\n };\n\n return (\n
\n
\n
\n {[\n {\n label: 'customer',\n value: 'ROLE_CUSTOMER',\n },\n {\n label: 'supplier',\n value: 'ROLE_SUPPLIER',\n },\n ].map(({ label, value }, key) => (\n handleTypeSelected(value)}\n variant={selected === value ? 'primary' : 'secondary'}\n >\n {translate(`charts.typeSelector.${label}`)}\n \n ))}\n
\n
\n
\n );\n};\n","import en from './en.json';\nimport fr from './fr.json';\n\ninterface DescriptionInterface {\n description: string;\n}\n\ninterface LabelInterface {\n label: string;\n}\n\ninterface NavFileInterface extends LabelInterface {\n filename: string;\n}\n\ninterface PlaceholderInterface {\n placeholder: string;\n}\n\ninterface FieldInterface extends LabelInterface, PlaceholderInterface {}\n\ninterface TextInterface {\n text: string;\n}\n\ninterface TitleInterface {\n title: string;\n}\n\ninterface FiltersInterface {\n filters: string;\n}\n\nexport interface TranslationInterface {\n [key: string]: {\n appbar: {\n routes: {\n account: string;\n analysis: string;\n catalog: string;\n contact: string;\n login: string;\n logout: string;\n overview: string;\n };\n };\n charts: {\n export: string;\n kpi: {\n loader: string;\n };\n revenue: LabelInterface & {\n loader: string;\n };\n volume: LabelInterface & {\n loader: string;\n };\n };\n export: {\n common: {\n filters: string;\n informations: string;\n };\n index: {\n material: string;\n source: string;\n values: string;\n };\n revenueVolume: {\n materials: string;\n values: string;\n };\n };\n filters: {\n bar: {\n all: string;\n contract: string;\n numberSelected: string;\n organization: string;\n plant: string;\n };\n contract: PlaceholderInterface;\n materialFamily: PlaceholderInterface;\n materialReferential: PlaceholderInterface;\n organization: PlaceholderInterface;\n plant: PlaceholderInterface;\n reset: LabelInterface;\n search: PlaceholderInterface;\n year: PlaceholderInterface;\n };\n forms: {\n contact: {\n successMessage: string;\n };\n errorMessage: string;\n fields: {\n confirmPassword: FieldInterface;\n email: FieldInterface;\n firstname: PlaceholderInterface;\n lastname: PlaceholderInterface;\n messageBody: FieldInterface;\n messageHeader: FieldInterface;\n newPassword: FieldInterface;\n password: FieldInterface;\n };\n login: {\n additionalLink: string;\n };\n resetPasswordApply: {\n successMessage: string;\n };\n resetPasswordRequest: {\n successMessage: string;\n };\n submit: {\n classic: string;\n };\n };\n layout: {\n disclaimer: string;\n footer: {\n nav: {\n 'general-usage-terms': NavFileInterface;\n 'cookies-policy': NavFileInterface;\n 'legal-terms': NavFileInterface;\n 'privacy-policy': NavFileInterface;\n };\n };\n };\n pages: {\n account: TitleInterface & {\n currency: string;\n email: string;\n informations: string;\n language: string;\n };\n analysis: {\n indexes: TitleInterface;\n revenue: TitleInterface;\n volume: TitleInterface;\n };\n catalog: TitleInterface & {\n item: {\n more: string;\n };\n };\n catalogItem: {\n back: string;\n };\n contact: DescriptionInterface & TitleInterface;\n login: {\n form: TitleInterface;\n block: DescriptionInterface & TitleInterface;\n };\n resetPasswordApply: DescriptionInterface & TitleInterface;\n resetPasswordRequest: DescriptionInterface & TitleInterface;\n welcome: {\n card: {\n discover: TextInterface & TitleInterface;\n manage: TextInterface & TitleInterface;\n need: TextInterface & TitleInterface;\n };\n overview: DescriptionInterface & TitleInterface;\n };\n };\n };\n}\n\nexport const translations: TranslationInterface = {\n 'en-US': en,\n 'fr-FR': fr,\n};\n","import React, {\n createContext,\n Dispatch,\n SetStateAction,\n useState,\n} from 'react';\nimport { Language } from '../helpers';\nimport { OptionInterface } from '../components/Filters';\nimport { translations } from '../i18n';\n\ninterface LanguageProviderInterface {\n languages: OptionInterface[];\n selectedLanguage: OptionInterface;\n setSelectedLanguage: Dispatch>;\n translate: (value: string) => string;\n}\n\nconst allowedLanguages = (): OptionInterface[] => [\n {\n label: 'Français',\n value: 'fr-FR',\n },\n {\n label: 'English',\n value: 'en-US',\n },\n];\n\nconst languageInitier = (value: string): OptionInterface[] =>\n allowedLanguages().filter((item) => value === item.value);\nconst initSelectedLanguage = (): OptionInterface =>\n languageInitier(new Language().get())[0] ||\n languageInitier(navigator.language)[0] || {\n label: 'English',\n value: 'en-US',\n };\n\nconst initialState = {\n languages: allowedLanguages(),\n selectedLanguage: initSelectedLanguage(),\n setSelectedLanguage: (): void => {\n return;\n },\n translate: (value: string): string => {\n return value;\n },\n};\n\nexport const LanguageContext =\n createContext(initialState);\n\nconst findTranslation = (\n keys: string[],\n translations: any /*eslint-disable-line*/\n): string | undefined => {\n const key = keys[0];\n if (keys.length && translations[key.toString()]) {\n keys.shift();\n return findTranslation(keys, translations[key.toString()]);\n } else if (!keys.length) {\n return translations;\n }\n return undefined;\n};\n\nexport const LanguageProvider: React.FC = ({ children }) => {\n const [selectedLanguage, setSelectedLanguage] = useState(\n initSelectedLanguage()\n );\n const translate = (value: string): string =>\n findTranslation(\n value.split('.'),\n translations[selectedLanguage.value as string]\n ) || value;\n return (\n \n {children}\n \n );\n};\n","import React, {\n createContext,\n Dispatch,\n SetStateAction,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useState,\n} from 'react';\nimport { MixedChart } from '../interfaces/providers';\nimport { Currency, getDate, Indexes } from '../helpers';\nimport { BaseStoreContext } from './BaseStoreContext';\nimport { MaterialIndexInstance, MaterialInstance } from '../interfaces/model';\nimport { OptionInterface } from '../components/Filters';\nimport { TypeSelectorContext } from '../components/TypeSelector';\nimport { LanguageContext } from './LanguageContext';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\nimport { ChartProviderInterface } from '../interfaces/ChartInterface';\n\nexport const RESET = 'RESET';\nexport const SET_SELECTED_INDEX = 'SET_SELECTED_INDEX';\nexport const SET_SELECTED_MATERIAL = 'SET_SELECTED_MATERIAL';\n\nconst COLORS: string[] = [\n '#030f40',\n '#f67536',\n '#ffc229',\n '#ef8143',\n '#eb4a65',\n '#8FD4FF',\n '#0f1319',\n];\n\ninterface ActionInterface {\n payload:\n | SetStateAction\n | SetStateAction\n | SetStateAction\n | undefined;\n type: string;\n}\n\ninterface ChartInterface {\n dispatch: Dispatch;\n selectedIndex: OptionInterface | null;\n selectedMaterial: OptionInterface | null;\n}\n\ninterface ChartContextInterface extends ChartInterface {\n data: any;\n indexes: MaterialIndexInstance[];\n materials: MaterialInstance[];\n total: number;\n}\n\ninterface MixedChartDatasetInterface {\n label: string;\n type: string;\n data: number[];\n borderColor: string;\n backgroundColor: string;\n pointBorderColor: string;\n pointBackgroundColor: string;\n pointHoverBackgroundColor: string;\n pointHoverBorderColor: string;\n}\n\nexport type DataInterface =\n | { labels: string[]; datasets: MixedChartDatasetInterface[] }\n | undefined;\n\nconst defaultStore: ChartInterface = {\n dispatch: () => {\n return;\n },\n selectedIndex: null,\n selectedMaterial: null,\n};\n\nconst defaultContext: ChartContextInterface = {\n ...defaultStore,\n data: undefined,\n indexes: [],\n materials: [],\n total: 0,\n};\n\nconst reducer = (\n state: ChartInterface = defaultStore,\n { payload, type }: ActionInterface\n): ChartInterface => {\n switch (type) {\n case RESET: {\n return {\n ...defaultStore,\n };\n }\n case SET_SELECTED_INDEX: {\n return {\n ...state,\n selectedIndex: payload as OptionInterface,\n selectedMaterial: null,\n };\n }\n case SET_SELECTED_MATERIAL: {\n return {\n ...state,\n selectedIndex: null,\n selectedMaterial: payload as OptionInterface,\n };\n }\n default:\n return state;\n }\n};\n\nexport const MixedChartContext =\n createContext(defaultContext);\n\nexport const MixedChartProvider: React.FC = ({\n children,\n color = '#77B7FC',\n label,\n startDate,\n endDate,\n}) => {\n const [state, dispatch] = useReducer(reducer, defaultStore);\n const {\n itemFiltersSelected: { contract },\n } = useContext(BaseStoreContext);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [materials, setMaterials] = useState(\n defaultContext.materials\n );\n const [indexes, setIndexes] = useState(\n defaultContext.indexes\n );\n const { selected } = useContext(TypeSelectorContext);\n const { selectedLanguage } = useContext(LanguageContext);\n\n const [total, setTotal] = useState(defaultContext.total);\n const idIndex = state.selectedIndex?.value;\n const idMaterial = state.selectedMaterial?.value;\n const memoizedState = useMemo(\n () => ({\n idIndex,\n idMaterial,\n }),\n [idIndex, idMaterial]\n );\n const memoizedFilters = useMemo(\n () => ({\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n role: selected,\n ...memoizedState,\n startDeliveryDate,\n }),\n [contract, endDeliveryDate, memoizedState, selected, startDeliveryDate]\n );\n\n const hasSelectedIndex: boolean = useMemo(\n (): boolean => !!(memoizedState.idMaterial || memoizedState.idIndex),\n [memoizedState]\n );\n\n useEffect(() => {\n if (!hasSelectedIndex && indexes.length) {\n dispatch({\n payload: {\n label: indexes[0].name,\n value: indexes[0].id,\n },\n type: SET_SELECTED_INDEX,\n });\n }\n }, [indexes]);\n\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n\n const currentMonth = {\n label: formatLabelYearMonthUTC(year, month).toISOString(),\n value: 0,\n };\n\n useEffect(() => {\n setData(undefined);\n new MixedChart({ filters: memoizedFilters })\n .getChart()\n .then(({ data, materials, indexes }) => {\n setMaterials(materials);\n const userIndexes = new Indexes().getDecoded()\n let formatedIndexes = indexes.sort((a, b) => a.name.localeCompare(b.name))\n if(userIndexes.length)\n formatedIndexes = formatedIndexes.filter(x => userIndexes.includes(x.id) )\n \n setIndexes(formatedIndexes);\n const datas: {\n color: string;\n data: number[];\n material: MaterialInstance;\n name: string;\n }[] = [];\n let labels: string[] = [];\n let t = 0;\n data.forEach((item) =>\n item.materials.forEach((m) =>\n m.indexValues.forEach(\n (i) =>\n !labels.includes(i.label) &&\n JSON.stringify(i) !== JSON.stringify(currentMonth) &&\n labels.push(i.label)\n )\n )\n );\n labels = labels.sort(\n (first, second) =>\n new Date(first).getTime() - new Date(second).getTime()\n );\n let colorIterator = 0;\n data.forEach((item) => {\n item.materials.forEach((m) => {\n datas.push({\n color: COLORS[parseInt(`${colorIterator % COLORS.length}`)],\n data: labels.map((l) => {\n const v = m.indexValues.filter((i) => l === i.label);\n if (v.length) {\n return v[0].value;\n }\n return 0;\n }),\n material: m.material,\n name: item.name,\n });\n colorIterator++;\n m.indexValues.forEach((i) => (t += i.value || 0));\n });\n });\n setTotal(t);\n setData({\n labels: labels.map((l) => {\n const dateString = new Date(l).toLocaleDateString(\n (selectedLanguage.value as string) ?? navigator.language,\n {\n month: 'short',\n year: 'numeric',\n }\n );\n return dateString.replace(/^./, dateString[0].toUpperCase());\n }),\n datasets: datas.map(({ data, color, material, name }) => ({\n label: `${material.code}`,\n type: 'line',\n data,\n borderColor: color,\n backgroundColor: 'transparent',\n pointBorderColor: color,\n pointBackgroundColor: color,\n pointHoverBackgroundColor: color,\n pointHoverBorderColor: color,\n yAxisID: 'y-axis-1',\n })),\n });\n });\n }, [color, label, memoizedFilters]);\n\n return (\n \n {children}\n \n );\n};\n","import React, { useContext } from 'react';\nimport { OptionInterface, ResetFilter, SelectFilter } from '../../Filters';\nimport { OverlayTrigger, Tooltip } from 'react-bootstrap';\nimport {\n MixedChartContext,\n RESET,\n SET_SELECTED_INDEX,\n SET_SELECTED_MATERIAL,\n} from '../../../contexts/MixedChartContext';\n\nconst divideBy1000 = (n: number, loop = 0): [number, number] =>\n n < 1000 ? [n, loop] : divideBy1000(n / 1000, loop + 1);\n\nconst formatToUnits = (total: number, symbols: string[]): [string, string] => {\n const [n, l]: [number, number] = divideBy1000(total);\n return [n.toFixed(2), symbols[parseInt(l.toString())]];\n};\n\nconst formattedTitle = (result: string, symbol: string): JSX.Element => (\n \n {result}\n {symbol}\n \n);\n\nexport const formatTitleToK = (\n total: number,\n currency: string\n): JSX.Element => {\n const [result, symbol] = formatToUnits(total, ['', 'K', 'M', 'B', 'T']);\n return formattedTitle(result, `${symbol}${currency}`);\n};\n\nexport const formatTitleToKg = (total: number): JSX.Element => {\n const [result, symbol] = formatToUnits(total, ['t', 'Kt', 'Mt', 'Tt']);\n return formattedTitle(result, symbol);\n};\nexport const formatLabelYearMonthUTC = (year: number, month: number): Date => {\n return new Date(\n Date.UTC( year, parseInt(`${month < 10 ? '0' : ''}${month})`)-1, 2)\n );\n};\n\ninterface TopFiltersInterface {\n additional?: string;\n formatTitle: (total: number) => JSX.Element;\n total: number;\n}\n\nexport const TopFilters: React.FC = ({\n additional = '',\n children,\n formatTitle,\n total,\n}) => (\n
\n
\n {children || (\n \n {total\n .toFixed(2)\n .toString()\n .replace(\n /\\B(?=(\\d{3})+(?!\\d))/g /*eslint-disable-line*/,\n ','\n )}\n {additional}\n \n ),\n }}\n >\n
\n {formatTitle(total)}\n
\n \n )}\n
\n
\n);\n\nexport const BottomFilters: React.FC = () => {\n const { dispatch, materials, indexes, selectedIndex, selectedMaterial } =\n useContext(MixedChartContext);\n return (\n
\n
\n
\n \n dispatch({ type: RESET, payload: undefined })\n }\n />\n
\n
\n \n dispatch({\n payload: v,\n type: SET_SELECTED_INDEX,\n }),\n options: indexes.map((i) => ({\n label: i.name,\n value: i.id,\n })),\n placeholder: 'indexes',\n value: selectedIndex,\n }}\n />\n
\n
\n \n dispatch({\n payload: v,\n type: SET_SELECTED_MATERIAL,\n }),\n options: materials.map((m) => ({\n label: `${m.code} - ${m.name}`,\n value: m.id,\n })),\n placeholder: 'material',\n value: selectedMaterial,\n }}\n />\n
\n
\n );\n};\n","import {\n MaterialIndex,\n MaterialIndexInstance,\n MaterialIndexInterface,\n} from './MaterialIndex';\nimport { Material, MaterialInstance, MaterialInterface } from './Material';\nimport { formatLabelYearMonthUTC } from '../../components/Chart/Analysis/Filters';\n\nexport interface ChartInterface {\n year: number;\n month: number;\n value: number;\n materialUnitValue: number;\n mvtTonnageDistributed?: number;\n}\n\nexport interface VolumeGraphInterface {\n [key: string]: ChartInterface[];\n}\n\nexport class ChartInstance {\n label = new Date();\n value = 0;\n\n constructor(chart: ChartInterface) {\n this.label = formatLabelYearMonthUTC(chart.year, chart.month);\n this.value = chart.value || chart.mvtTonnageDistributed || 0;\n }\n}\n\nexport class Chart {\n getMany = (data: VolumeGraphInterface): MultiGraphInstance[] => {\n const results: MultiGraphInstance[] = [];\n for (const key in data) {\n results.push(\n new MultiGraphInstance(\n key,\n data[key].map((line) => new ChartInstance(line))\n )\n );\n }\n return results;\n };\n}\n\nexport class MultiGraphInstance {\n type = '';\n data: ChartInstance[] = [];\n\n constructor(type: string, data: ChartInstance[]) {\n this.type = type;\n this.data = data;\n }\n}\n\nexport class VolumeGraph {\n getMany = (data: VolumeGraphInterface): MultiGraphInstance[] => {\n const results: MultiGraphInstance[] = [];\n for (const key in data) {\n results.push(\n new MultiGraphInstance(\n key,\n data[key].map((line) => new ChartInstance(line))\n )\n );\n }\n return results;\n };\n}\nexport interface CircularChartInterface {\n year: number;\n month: number;\n mvtTonnageDistributed: number;\n domainName?: string | null;\n}\n\nexport class CircularChartInstance {\n type = '';\n data: ChartInstance[] = [];\n\n constructor(type: string, data: ChartInstance[]) {\n this.type = type;\n this.data = data;\n }\n}\n\nexport class CircularGraph {\n getMany = (lines: CircularChartInterface[]): CircularChartInstance[] => {\n //get Labels + remove duplicates\n const labels = lines\n .map((item) => `${item.year}-${item.month}`)\n .filter(\n (value, index, self) => index === self.findIndex((t) => t === value)\n );\n const data = lines\n .map((item) => {\n item.domainName = item.domainName ?? 'NA';\n return item;\n })\n .reduce((r, a) => {\n if (a.domainName != null) {\n const initRow = {\n year: a.year,\n month: a.month,\n domainName: a.domainName,\n mvtTonnageDistributed: 0,\n };\n r[a.domainName] =\n r[a.domainName] ||\n new Array(labels.length).fill(initRow, 0, labels.length);\n r[a.domainName][labels.indexOf(`${a.year}-${a.month}`)] = a;\n }\n return r;\n }, Object.create(null));\n const results: MultiGraphInstance[] = [];\n for (const key in data) {\n results.push(\n new MultiGraphInstance(\n key,\n data[key].map((line) => new ChartInstance(line))\n )\n );\n }\n\n return results;\n };\n}\n\nexport interface Co2ChartInterface {\n year: number;\n month: number;\n volumeTeqCO2: number;\n}\n\nexport class Co2ChartInstance {\n label = new Date();\n value = 0;\n\n constructor(chart: Co2ChartInterface) {\n this.label = formatLabelYearMonthUTC(chart.year, chart.month);\n this.value = chart.volumeTeqCO2;\n }\n}\n\nexport class Co2Chart {\n getMany = (lines: Co2ChartInterface[]): Co2ChartInstance[] =>\n lines.map((line) => new Co2ChartInstance(line));\n}\n\ninterface MixedDataChartInterface extends MaterialIndexInterface {\n materials: {\n material: MaterialInterface;\n materialIndexValues: ChartInterface[];\n }[];\n}\n\nexport interface MixedChartInterface {\n data: MixedDataChartInterface[];\n indexes: MaterialIndexInterface[];\n materials: MaterialInterface[];\n}\n\nexport class MixedChartIndexValueInstance {\n label: string = new Date().toISOString();\n value = 0;\n\n constructor(chart: ChartInterface) {\n this.label = formatLabelYearMonthUTC(chart.year, chart.month).toISOString();\n this.value = chart.materialUnitValue;\n }\n}\n\nexport type DataMixedChartType = {\n materials: {\n indexValues: MixedChartIndexValueInstance[];\n material: MaterialInstance;\n }[];\n} & MaterialIndexInstance;\n\nexport class MixedChartInstance {\n data: DataMixedChartType[] = [];\n materials: MaterialInstance[] = [];\n indexes: MaterialIndexInstance[] = [];\n constructor({ data, indexes, materials }: MixedChartInterface) {\n this.data = data.map((item) => ({\n ...new MaterialIndexInstance(item),\n materials: item.materials.map((m) => ({\n indexValues: m.materialIndexValues.map(\n (i) => new MixedChartIndexValueInstance(i)\n ),\n material: new Material().getOne(m.material),\n })),\n }));\n this.indexes = new MaterialIndex().getMany(indexes);\n this.materials = new Material().getMany(materials);\n }\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\n\nexport interface CompanySubTypeInterface extends ModelInterface {\n idCompanySubType: string;\n companySubTypeCode: string;\n companySubTypeName: string;\n}\n\nexport class CompanySubTypeInstance extends ModelInstance {\n constructor(companySubType: CompanySubTypeInterface) {\n super(companySubType);\n this.id = companySubType.idCompanySubType;\n this.code = companySubType.companySubTypeCode;\n this.name = companySubType.companySubTypeName;\n }\n}\n\nexport class Company extends ModelActions {\n getMany = (\n companySubTypes: CompanySubTypeInterface[]\n ): CompanySubTypeInstance[] =>\n companySubTypes.map(\n (companySubType) => new CompanySubTypeInstance(companySubType)\n );\n getOne = (companySubType: CompanySubTypeInterface): CompanySubTypeInstance =>\n new CompanySubTypeInstance(companySubType);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\n\nexport interface CompanyTypeInterface extends ModelInterface {\n idCompanyType: string;\n companyTypeCode: string;\n companyTypeName: string;\n}\n\nexport class CompanyTypeInstance extends ModelInstance {\n constructor(companyType: CompanyTypeInterface) {\n super(companyType);\n this.id = companyType.idCompanyType;\n this.code = companyType.companyTypeCode;\n this.name = companyType.companyTypeName;\n }\n}\n\nexport class Company extends ModelActions {\n getMany = (companyTypes: CompanyTypeInterface[]): CompanyTypeInstance[] =>\n companyTypes.map((companyType) => new CompanyTypeInstance(companyType));\n getOne = (companyType: CompanyTypeInterface): CompanyTypeInstance =>\n new CompanyTypeInstance(companyType);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\nimport {\n CompanySubTypeInstance,\n CompanySubTypeInterface,\n} from './CompanySubType';\nimport { CompanyTypeInstance, CompanyTypeInterface } from './CompanyType';\n\nexport interface CompanyInterface extends ModelInterface {\n companyType: CompanyTypeInterface;\n companySubType: CompanySubTypeInterface;\n idCompany: string;\n companyLocalName: string;\n}\n\nexport class CompanyInstance extends ModelInstance {\n companyType?: CompanyTypeInstance = undefined;\n companySubType?: CompanySubTypeInstance = undefined;\n\n constructor(company: CompanyInterface) {\n super(company);\n this.id = company.idCompany;\n this.name = company.companyLocalName;\n this.companyType =\n company.companyType && new CompanyTypeInstance(company.companyType);\n this.companySubType =\n company.companySubType &&\n new CompanySubTypeInstance(company.companySubType);\n }\n}\n\nexport class Company extends ModelActions {\n getMany = (companies: CompanyInterface[]): CompanyInstance[] =>\n companies.map((company) => new CompanyInstance(company));\n getOne = (company: CompanyInterface): CompanyInstance =>\n new CompanyInstance(company);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\nimport { CompanyInstance, CompanyInterface } from './Company';\n\nexport interface ContainerInterface extends ModelInterface {\n idContainer: string;\n containerName: string;\n}\n\nexport class ContainerInstance extends ModelInstance {\n constructor(container: ContainerInterface) {\n super(container);\n this.id = container.idContainer;\n this.name = container.containerName;\n }\n}\n\nexport class Container extends ModelActions {\n getMany = (containers: ContainerInterface[]): ContainerInstance[] =>\n containers.map((container) => new ContainerInstance(container));\n getOne = (container: ContainerInterface): ContainerInstance =>\n new ContainerInstance(container);\n}\n","import {\n CompanyInstance,\n CompanyInterface,\n ContainerDemandStatusInstance,\n ContainerDemandStatusInterface,\n ContainerInstance,\n ContainerInterface,\n} from '.';\nimport { ModelActions, ModelInstance, ModelInterface } from './Common';\nimport { MaterialInstance, MaterialInterface } from './Material';\n\nexport interface ContainerDemandInterface extends ModelInterface {\n idContainerDemand: string;\n idDemand: number;\n company: CompanyInterface;\n container: ContainerInterface;\n status: ContainerDemandStatusInterface;\n internalOperator: string;\n externalOperator: string;\n bookingDate: string;\n materials: MaterialInterface[];\n}\n\nexport class ContainerDemandInstance extends ModelInstance {\n container?: ContainerInstance = undefined;\n company?: CompanyInstance = undefined;\n status?: ContainerDemandStatusInstance = undefined;\n internalOperator?: string = undefined;\n idDemand?: number = undefined;\n externalOperator?: string = undefined;\n materials?: any[] = [];\n bookingDate?;\n\n constructor(demand: ContainerDemandInterface) {\n super(demand);\n this.id = demand.idContainerDemand;\n this.idDemand = demand.idDemand;\n this.company = demand.company && new CompanyInstance(demand.company);\n this.container =\n demand.container && new ContainerInstance(demand.container);\n this.status =\n demand.status && new ContainerDemandStatusInstance(demand.status);\n this.internalOperator = demand.internalOperator;\n this.externalOperator = demand.externalOperator;\n this.bookingDate = new Date(demand.bookingDate);\n this.materials = demand.materials.map(\n (material) => new MaterialInstance(material)\n );\n }\n}\n\nexport class ContainerDemand extends ModelActions {\n getMany = (\n containers: ContainerDemandInterface[]\n ): ContainerDemandInstance[] =>\n containers.map((container) => new ContainerDemandInstance(container));\n getOne = (container: ContainerDemandInterface): ContainerDemandInstance =>\n new ContainerDemandInstance(container);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\n\nexport interface ContainerDemandStatusInterface extends ModelInterface {\n idContainerDemandStatus: string;\n demandStatusCode: string;\n demandStatusName: string;\n}\n\nexport class ContainerDemandStatusInstance extends ModelInstance {\n constructor(demandStatus: ContainerDemandStatusInterface) {\n super(demandStatus);\n this.id = demandStatus.idContainerDemandStatus;\n this.code = demandStatus.demandStatusCode;\n this.name = demandStatus.demandStatusName;\n }\n}\n\nexport class ContainerDemandStatus extends ModelActions {\n getMany = (\n demandeStatus: ContainerDemandStatusInterface[]\n ): ContainerDemandStatusInstance[] =>\n demandeStatus.map((status) => new ContainerDemandStatusInstance(status));\n getOne = (\n status: ContainerDemandStatusInterface\n ): ContainerDemandStatusInstance => new ContainerDemandStatusInstance(status);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\n\nexport interface InvoiceTypeInterface extends ModelInterface {\n idInvoiceType: string;\n invoiceTypeCode: string;\n invoiceTypeName: string;\n}\n\nexport class InvoiceTypeInstance extends ModelInstance {\n constructor(invoiceType: InvoiceTypeInterface) {\n super(invoiceType);\n this.id = invoiceType.idInvoiceType;\n this.code = invoiceType.invoiceTypeCode;\n this.name = invoiceType.invoiceTypeName;\n }\n}\n\nexport class InvoiceType extends ModelActions {\n getMany = (invoiceType: InvoiceTypeInterface[]): InvoiceTypeInstance[] =>\n invoiceType.map((type) => new InvoiceTypeInstance(type));\n getOne = (type: InvoiceTypeInterface): InvoiceTypeInstance =>\n new InvoiceTypeInstance(type);\n}\n","export interface KPIInterface {\n serviceRevenue: number;\n valorisationRevenue: number;\n volume: number;\n volumeTeqCO2: number;\n}\n\nexport class KPIInstance {\n revenue = 0;\n volume = 0;\n volumeTeqCO2 = 0;\n revenueTotal = 0;\n\n constructor(kpi: KPIInterface) {\n this.revenue = kpi.valorisationRevenue;\n this.volume = kpi.volume || 0;\n this.volumeTeqCO2 = kpi.volumeTeqCO2 || 0;\n this.revenueTotal = kpi.valorisationRevenue + kpi.serviceRevenue;\n }\n}\n\nexport class KPI {\n getOne = (line: KPIInterface): KPIInstance => new KPIInstance(line);\n}\n","import { ModelActions, ModelInstance, ModelInterface } from './Common';\n\nexport interface OrganizationInterface extends ModelInterface {\n idOrganization: string;\n organizationLevel: string;\n organizationName: string;\n parentOrganization?: OrganizationInterface;\n}\n\nexport class OrganizationInstance extends ModelInstance {\n parent?: OrganizationInstance = undefined;\n level: string;\n\n constructor(organization: OrganizationInterface) {\n super(organization);\n this.id = organization.idOrganization;\n this.name = organization.organizationName;\n this.id = organization.idOrganization;\n this.name = organization.organizationName;\n this.parent =\n organization.parentOrganization &&\n new OrganizationInstance(organization.parentOrganization);\n this.level = organization.organizationLevel;\n }\n}\n\nexport class Organization extends ModelActions {\n getMany = (organizations: OrganizationInterface[]): OrganizationInstance[] =>\n organizations.map((organization) => new OrganizationInstance(organization));\n getOne = (organization: OrganizationInterface): OrganizationInstance =>\n new OrganizationInstance(organization);\n}\n","export class AbstractSerializer {\n [key: string]: any; /* eslint-disable-line */\n\n serialize(obj: any /* eslint-disable-line */) {\n obj &&\n Object.keys(obj).forEach((o) => (this[o.toString()] = obj[o.toString()]));\n return this;\n }\n}\n","import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { axiosInterceptorError, Token } from '../helpers';\n\ninterface EndpointInterface {\n endpoint?: string;\n}\n\ninterface ConfigInterface {\n config?: AxiosRequestConfig;\n}\n\ninterface CustomHeadersInterface {\n Accept: string;\n Authorization?: string;\n 'Content-Type': string;\n}\n\nconst getHeaders = (): Record => {\n const h: Record = {\n Accept: 'application/ld+json',\n 'Content-Type': 'application/ld+json',\n };\n if (new Token().get()) {\n h['Authorization'] = `Bearer ${new Token().get()}`;\n }\n\n return h;\n};\n\nclass API {\n endpoint = '';\n filter = {};\n pagination = {};\n\n getBaseUrl = (): string => '';\n\n request(): AxiosInstance {\n const instance = axios.create({\n baseURL: this.getBaseUrl(),\n headers: getHeaders(),\n });\n instance.interceptors.response.use((r) => r, axiosInterceptorError);\n return instance;\n }\n\n async deleteRequest({ endpoint }: EndpointInterface): Promise {\n return this.request().delete(`${this.endpoint}${endpoint || ''}`);\n }\n\n async getRequest({\n endpoint = '',\n }: EndpointInterface): Promise {\n return this.request().get(\n `${this.endpoint}${endpoint}${\n new URLSearchParams({\n ...this.pagination,\n ...this.filter,\n }).toString() || ''\n }`\n );\n }\n\n async patchRequest({\n data,\n endpoint = '',\n }: AxiosRequestConfig & EndpointInterface): Promise {\n return this.request().patch(\n `${this.endpoint}${endpoint}`,\n JSON.stringify(data),\n {\n headers: {\n Authorization: `Bearer ${new Token().get()}`,\n 'Content-Type': 'application/merge-patch+json',\n },\n }\n );\n }\n\n async postRequest({\n config = {},\n data,\n endpoint = '',\n }: AxiosRequestConfig &\n EndpointInterface &\n ConfigInterface): Promise {\n return this.request().post(`${this.endpoint}${endpoint}`, data, config);\n }\n\n public async putRequest({\n data,\n endpoint,\n }: AxiosRequestConfig & EndpointInterface): Promise {\n return this.request().put(\n `${this.endpoint}${endpoint || ''}`,\n JSON.stringify(data)\n );\n }\n}\n\nexport class APIPlatform extends API {\n endpoint = '';\n\n getBaseUrl = (): string => process.env.REACT_APP_API_ENTRYPOINT || '';\n}\n","import { APIPlatform } from './API';\nimport { SyntheticEvent } from 'react';\n\ninterface ContactInterface {\n data: SyntheticEvent;\n}\n\nexport class Contact extends APIPlatform {\n public endpoint = '/users';\n\n public send({ data }: ContactInterface): Promise {\n this.endpoint = '';\n return this.postRequest({\n data,\n endpoint: '/contact',\n })\n .then(() => {\n return;\n })\n .catch();\n }\n}\n","import { APIPlatform } from './API';\nimport { OptionInterface } from '../components/Filters';\n\nexport class Currency extends APIPlatform {\n public endpoint = '/currencies';\n\n public get(): Promise {\n return this.getRequest({}).then(({ data }) => {\n return data['hydra:member'];\n });\n }\n}\n","import { AxiosResponse } from 'axios';\nimport { APIPlatform } from './API';\nimport { Dispatch, MutableRefObject } from 'react';\nimport { LOGOUT, UPDATE_CLIENT, UserActionInterface } from '../contexts';\nimport {\n Company as CompanyStorage,\n getDecodedToken,\n Indexes,\n Organization as OrganizationStorage,\n Preference,\n RefreshToken,\n Token,\n UserId,\n Username,\n} from '../helpers';\nimport { Company, Organization } from '../interfaces/providers';\n\ninterface RefInterface {\n ref: MutableRefObject<{\n reset: () => void;\n }>;\n}\ninterface FormdataInterface {\n data: FormData;\n}\n\ninterface ResetPasswordInterface extends RefInterface, FormdataInterface {}\n\ntype ValueInterface =\n | { payload: Record | string; type: string }\n | Record;\n\ninterface LoginInterface extends ResetPasswordInterface {\n updateClient: any; // eslint-disable-line\n}\n\ninterface RegisterInterface extends ResetPasswordInterface {\n updateClient: (value: ValueInterface) => void;\n}\n\ninterface RegisterInterface extends ResetPasswordInterface {\n updateClient: (value: ValueInterface) => void;\n}\n\ninterface LogoutInterface {\n updateClient: Dispatch;\n}\n\nexport class User extends APIPlatform {\n public endpoint = '/users';\n\n public login({ data, updateClient }: LoginInterface): Promise {\n data.append('grant_type', 'password');\n data.append('client_id', '' + process.env.REACT_APP_OAUTH_CLIENT_ID);\n data.append(\n 'client_secret',\n '' + process.env.REACT_APP_OAUTH_CLIENT_SECRET\n );\n this.endpoint = '';\n return this.postRequest({\n config: {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n },\n data,\n endpoint: '/login',\n }).then(({ status, data }: AxiosResponse) => {\n if (200 !== status) {\n return;\n }\n\n const accessToken = data.access_token;\n const token = new Token();\n const decoded = getDecodedToken(accessToken);\n // Administrators are not allowed on this platform\n if (\n decoded.roles.includes('ROLE_ADMIN') ||\n (decoded.roles.includes('ROLE_EXTERNAL_OPERATOR') &&\n decoded.roles.includes('ROLE_INTERNAL_OPERATOR'))\n ) {\n // the empty message has been asked by the client\n throw new Error();\n }\n new RefreshToken().set(data.refresh_token);\n token.set(accessToken);\n new Username().set(decoded.username);\n new UserId().set(decoded.user_id);\n new Preference().setDecoded(decoded.preference);\n new Indexes().setDecoded(decoded.indexes);\n updateClient({\n payload: accessToken,\n type: UPDATE_CLIENT,\n });\n decoded.organization_id &&\n new Organization()\n .getOne({ id: decoded.organization_id })\n .then(({ data }) => new OrganizationStorage().setDecoded(data));\n new Company()\n .getOne({ id: decoded.company_id })\n .then(({ data }) => new CompanyStorage().setDecoded(data));\n });\n }\n\n public resetPasswordRequest({\n data,\n ref,\n }: ResetPasswordInterface): Promise {\n this.endpoint = '';\n return this.postRequest({\n data,\n endpoint: `/reset-password/request`,\n })\n .then(({ status }: AxiosResponse) => User.resetForm({ ref, status }))\n .catch();\n }\n\n static resetForm({ ref, status }: RefInterface & { status: number }): void {\n if (200 === status) {\n ref.current.reset();\n }\n }\n\n public resetPasswordApply({\n data,\n ref,\n }: ResetPasswordInterface): Promise {\n this.endpoint = '';\n return this.postRequest({\n data: {\n ...data,\n },\n endpoint: '/reset-password/apply',\n })\n .then(({ status }: AxiosResponse) => User.resetForm({ ref, status }))\n .catch();\n }\n\n public static logout({ updateClient }: LogoutInterface): void {\n const providers = [\n Token,\n Preference,\n Username,\n CompanyStorage,\n OrganizationStorage,\n ];\n providers.forEach((provider) => new provider().delete());\n updateClient({\n type: LOGOUT,\n });\n }\n\n public register({ data, ref }: RegisterInterface): Promise {\n return this.postRequest({\n data,\n endpoint: '/users',\n }).then(({ status }: AxiosResponse) => {\n if (201 === status) {\n ref.current.reset();\n }\n return;\n });\n }\n\n public refreshToken(): Promise {\n const data = new FormData();\n data.append('grant_type', 'refresh_token');\n data.append('client_id', '' + process.env.REACT_APP_OAUTH_CLIENT_ID);\n data.append('refresh_token', new RefreshToken().get() || '');\n this.endpoint = '';\n return this.postRequest({\n config: {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n },\n data,\n endpoint: '/login',\n }).then(({ status, data }: AxiosResponse) => {\n if (200 === status) {\n const accessToken = data.access_token;\n const token = new Token();\n const decoded = getDecodedToken(accessToken);\n if (decoded.roles.includes('ROLE_ADMIN')) {\n throw new Error();\n }\n new RefreshToken().set(data.refresh_token);\n token.set(accessToken);\n new Username().set(decoded.username);\n new Preference().setDecoded(decoded.preference);\n decoded.organization_id &&\n new Organization()\n .getOne({ id: decoded.organization_id })\n .then(({ data }) => new OrganizationStorage().setDecoded(data));\n new Company()\n .getOne({ id: decoded.company_id })\n .then(({ data }) => new CompanyStorage().setDecoded(data));\n } else {\n User.logout({ updateClient: () => null });\n window.location.pathname = '/login';\n }\n });\n }\n\n public sendDemandMail({ data }): Promise {\n this.endpoint = '';\n return this.postRequest({\n data,\n endpoint: `/send_demand_mail`,\n })\n .then(() => console.log())\n .catch();\n }\n}\n","import { APIPlatform } from './API';\n\nexport class Preference extends APIPlatform {\n public endpoint = '/user_preferences';\n\n public update({\n data,\n id,\n }: {\n data: Record;\n id: string;\n }): void {\n this.patchRequest({ data, endpoint: `/${id}` })\n .then(() => {\n return;\n })\n .catch();\n }\n}\n","import axios, { AxiosInstance } from 'axios';\nimport { axiosInterceptorError, Language, Token } from '../../helpers';\nimport { AbstractSerializer } from '../serializer/AbstractSerializer';\nimport { PossibleValueType } from '../KeyValueInterface';\nimport { User } from '../../actions';\n\nexport interface AbstractProviderConstructorInterface {\n filters?: any; //eslint-disable-line\n pagination?: any; //eslint-disable-line\n}\n\ninterface OneInterface {\n data: any; //eslint-disable-line\n}\n\nclass RefreshTokenSingleton {\n static fetching = false;\n\n static refresh(): Promise {\n if (this.fetching) {\n return new Promise(() => null);\n } else {\n this.fetching = true;\n return new User().refreshToken().finally(() => (this.fetching = false));\n }\n }\n}\n\nexport class AbstractAPIPlatformProvider {\n endpoint = '';\n env = process.env.REACT_APP_ENV || 'int';\n filters: any = {}; //eslint-disable-line\n ids: string[] = [];\n management = '';\n model: any; //eslint-disable-line\n name = '';\n pagination = {};\n token = new Token().get() || '';\n serializer = new AbstractSerializer();\n\n constructor({\n filters,\n pagination,\n }: AbstractProviderConstructorInterface = {}) {\n this.filters = { ...filters, language: new Language().get() };\n this.pagination = pagination;\n }\n\n getHeaders = (): Record => {\n const h: Record = {\n 'Content-Type': 'application/json',\n };\n if (this.token) {\n h['Authorization'] = `Bearer ${this.token}`;\n }\n\n return h;\n };\n\n request(): AxiosInstance {\n const instance = axios.create({\n headers: this.getHeaders(),\n });\n instance.interceptors.request.use(\n async (config) => {\n if (config.url !== '/login') {\n if (new Token().getDecoded().exp - Date.now() / 1000 <= 60 * 60) {\n RefreshTokenSingleton.refresh().catch(() => {\n User.logout({ updateClient: () => null });\n window.location.pathname = '/';\n });\n }\n }\n // Ajouter responseType `blob` dans le config axios pour toutes les url de téléchargement \n if (config?.url?.includes('/download')) {\n config.responseType = 'blob';\n }\n return config;\n },\n (error) => Promise.reject(error)\n );\n instance.interceptors.response.use((r) => r, axiosInterceptorError);\n return instance;\n }\n\n formatQueryParameters = (): string => {\n const queryParametersObject = Object.entries({\n ...this.pagination,\n ...this.serializer.serialize(this.filters),\n }).reduce(\n (a, [k, v]: [string, PossibleValueType]) =>\n v === false\n ? { ...a, [k]: v }\n : v\n ? Array.isArray(v) && v.length\n ? {\n ...a,\n [k]: `[${\n v[0].value ? v.map((x) => x.value).join(',') : v.join(',')\n }]`,\n }\n : v.value || v.value === false\n ? { ...a, [k]: v.value }\n : v.length || (!Array.isArray(v) && v)\n ? { ...a, [k]: '[]' === v ? '' : v }\n : a\n : a,\n {}\n );\n\n return Object.keys(queryParametersObject).length\n ? `?${new URLSearchParams(queryParametersObject).toString()}`\n : '';\n };\n\n getUrl = (value = '', withQueryParameters?: boolean): string =>\n `${process.env.REACT_APP_API_ENTRYPOINT}/${\n this.endpoint || this.name\n }${value}${withQueryParameters ? this.formatQueryParameters() : ''}`;\n\n create = ({\n data,\n }: any): Promise => //eslint-disable-line\n this.request()\n .post(this.getUrl(), data)\n .then(({ data }) => ({\n data: data,\n }));\n\n update = ({ data }) =>\n this.request()\n .put(this.getUrl(`/${data.id}`), data, {\n headers: {\n 'Content-Type': 'application/merge-patch+json',\n },\n })\n .then(({ data }) => ({\n data: data?.data,\n }));\n\n deleteMany = (): void => {\n Promise.all(\n this.ids.map((id) => this.request().delete(this.getUrl(`/${id}`)))\n );\n };\n\n getList = (): Promise =>\n this.request()\n .get(this.getUrl('', true))\n .then(({ data }) => {\n return {data: data['hydra:member'], total: data['hydra:totalItems']}\n })\n getOne = ({ id }: { id: string }): Promise =>\n this.request()\n .get(this.getUrl(`/${id}`, true))\n .then(({ data }) => ({\n data: this.model.getOne(data),\n }));\n}\n","import { AbstractAPIPlatformProvider } from '../interfaces/providers/abstractAPIPlatform';\n\nexport class Document extends AbstractAPIPlatformProvider {\n public endpoint = 'documents';\n\n downloadDocument = ({ id }: { id: string }): Promise =>\n this.request()\n .get(this.getUrl(`/${id}`, true))\n .then((data) => data.data);\n}\n","import axios, { AxiosInstance } from 'axios';\nimport { axiosInterceptorError, Language, Token } from '../../helpers';\nimport { AbstractSerializer } from '../serializer/AbstractSerializer';\nimport { PossibleValueType } from '../KeyValueInterface';\nimport { User } from '../../actions';\n\nexport interface AbstractProviderConstructorInterface {\n filters?: any; //eslint-disable-line\n pagination?: any; //eslint-disable-line\n}\n\ninterface OneInterface {\n data: any; //eslint-disable-line\n}\n\ninterface ListInterface {\n data: any[]; //eslint-disable-line\n total: number;\n}\n\ninterface CustomHeadersInterface {\n Accept: string;\n Authorization?: string;\n 'Content-Type': string;\n}\n\nclass RefreshTokenSingleton {\n static fetching = false;\n\n static refresh(): Promise {\n if (this.fetching) {\n return new Promise(() => null);\n } else {\n this.fetching = true;\n return new User().refreshToken().finally(() => (this.fetching = false));\n }\n }\n}\n\nexport class AbstractProvider {\n endpoint = '';\n env = process.env.REACT_APP_ENV || 'int';\n filters: any = {}; //eslint-disable-line\n ids: string[] = [];\n management = '';\n model: any; //eslint-disable-line\n name = '';\n pagination = {};\n token = new Token().get() || '';\n serializer = new AbstractSerializer();\n\n constructor({\n filters,\n pagination,\n }: AbstractProviderConstructorInterface = {}) {\n this.filters = { ...filters, language: new Language().get() };\n this.pagination = pagination;\n }\n\n getHeaders = (): Record => {\n const h: Record = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n };\n if (this.token) {\n h['Authorization'] = `Bearer ${this.token}`;\n }\n\n return h;\n };\n\n request(): AxiosInstance {\n const instance = axios.create({\n headers: this.getHeaders(),\n });\n instance.interceptors.request.use(\n async (config) => {\n if (config.url !== '/login') {\n if (new Token().getDecoded().exp - Date.now() / 1000 <= 60 * 60) {\n RefreshTokenSingleton.refresh().catch(() => {\n User.logout({ updateClient: () => null });\n window.location.pathname = '/';\n });\n }\n }\n return config;\n },\n (error) => Promise.reject(error)\n );\n instance.interceptors.response.use((r) => r, axiosInterceptorError);\n return instance;\n }\n\n formatQueryParameters = (): string => {\n const queryParametersObject = Object.entries({\n ...this.pagination,\n ...this.serializer.serialize(this.filters),\n }).reduce(\n (a, [k, v]: [string, PossibleValueType]) =>\n v === false\n ? { ...a, [k]: v }\n : v\n ? Array.isArray(v) && v.length\n ? {\n ...a,\n [k]: `[${\n v[0].value ? v.map((x) => x.value).join(',') : v.join(',')\n }]`,\n }\n : v.value || v.value === false\n ? { ...a, [k]: v.value }\n : v.length || (!Array.isArray(v) && v)\n ? { ...a, [k]: '[]' === v ? '' : v }\n : a\n : a,\n {}\n );\n return Object.keys(queryParametersObject).length\n ? `?${new URLSearchParams(queryParametersObject).toString()}`\n : '';\n };\n\n getUrl = (value = '', withQueryParameters?: boolean): string =>\n `${process.env.REACT_APP_WDH_API_URL}/${this.management}_management/v1/${\n this.endpoint || this.name\n }${value}${withQueryParameters ? this.formatQueryParameters() : ''}`;\n\n create = ({\n data,\n }: any): Promise => //eslint-disable-line\n this.request()\n .post(this.getUrl(), data)\n .then(({ data }) => ({\n data: data,\n }));\n\n update = ({ data }) =>\n this.request()\n .put(this.getUrl(`/${data.id}`), data, {\n headers: {\n 'Content-Type': 'application/merge-patch+json',\n },\n })\n .then(({ data }) => ({\n data: data?.data,\n }));\n\n deleteMany = (): void => {\n Promise.all(\n this.ids.map((id) => this.request().delete(this.getUrl(`/${id}`)))\n );\n };\n\n getList = (): Promise =>\n this.request()\n .get(this.getUrl('', true))\n .then(({ data }) => ({\n data: this.model.getMany(data.data ? data.data : data),\n total: data.count ? data.count : data.length,\n }));\n\n getOne = ({ id }: { id: string }): Promise =>\n this.request()\n .get(this.getUrl(`/${id}`, true))\n .then(({ data }) => ({\n data: this.model.getOne(data),\n }));\n}\n","import { AbstractProvider } from './abstract';\n\ninterface BCMInterface {\n [key: string]: number;\n}\n\nexport class AbstractBCMPortal extends AbstractProvider {\n withParams = true;\n\n getUrl = (value = '', withQueryParameters?: boolean): string =>\n `${process.env.REACT_APP_WDH_API_URL}/bcm_customer_portal/v1${\n this.endpoint || this.name\n }${value}${withQueryParameters ? this.formatQueryParameters() : ''}`;\n\n get = (): Promise =>\n this.request()\n .get(this.getUrl('', this.withParams))\n .then(({ data }) => this.model.getOne(data.data ? data.data : data));\n}\n","import {\n Chart as ChartModel,\n VolumeGraph as VolumeGraphModel,\n MultiGraphInstance,\n Co2Chart as Co2ChartModel,\n Co2ChartInstance,\n Material,\n MixedChartInstance,\n MaterialInstance,\n CircularGraph,\n CircularChartInstance,\n} from '../model';\nimport { AbstractBCMPortal } from './abstractBCMPortal';\nimport { ExportAllDataInterface } from '../../components/Button/Export/AllSerializer';\nimport { ExportMovementDataInterface } from '../../components/Button/Export/MovementSerializer';\nimport { ChartRestInterface } from '../ChartInterface';\n\nconst CO2 = '/co2';\nconst REVENUES = '/revenues';\nconst VOLUMES = '/volumes';\nconst CIRCULAR_ECONOMY = '/circular_economy';\nconst MATERIALS = '/materials';\nconst INDEXES = '/indexes';\n\n\nexport class Chart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting';\n model = new ChartModel();\n\n getChart = (\n rest?: ChartRestInterface\n ): Promise<\n {\n data: MultiGraphInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(REVENUES, true))\n .then(({ data }) => {\n return {data: this.model.getMany(data?.data || data), ...rest}\n });\n };\n}\nexport class FilterChart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting';\n model = new ChartModel();\n\n getMaterials = (\n rest?: ChartRestInterface\n ): Promise<\n {\n materials: MaterialInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(MATERIALS, true))\n .then(({ data }) => ({\n materials: new Material().getMany(data),\n ...rest,\n }));\n };\n}\n\nexport class VolumeChart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting';\n model = new VolumeGraphModel();\n\n getChart = (\n rest?: ChartRestInterface\n ): Promise<\n {\n data: MultiGraphInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(VOLUMES, true))\n .then(({ data }) => ({\n data: this.model.getMany(data?.data || data),\n ...rest,\n }));\n };\n}\nexport class CircularEconomyChart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting';\n model = new CircularGraph();\n\n getChart = (\n rest?: ChartRestInterface\n ): Promise<\n {\n data: CircularChartInstance[];\n materials: MaterialInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(CIRCULAR_ECONOMY, true))\n .then(({ data }) => ({\n data: this.model.getMany(data?.data || data),\n materials: new Material().getMany(data.materials),\n ...rest,\n }));\n };\n}\n\nexport class MovementVolumeChart extends AbstractBCMPortal {\n endpoint = '/movement';\n model = new VolumeGraphModel();\n\n getChart = (\n rest?: ChartRestInterface\n ): Promise<\n {\n data: MultiGraphInstance[];\n materials: MaterialInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(VOLUMES, true))\n .then(({ data }) => ({\n data: this.model.getMany(data?.data || data),\n materials: new Material().getMany(data.materials),\n ...rest,\n }));\n };\n}\n\nexport class Co2Chart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting';\n model = new Co2ChartModel();\n\n getChart = (\n rest?: ChartRestInterface\n ): Promise<\n {\n data: Co2ChartInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(CO2, true))\n .then(({ data }) => ({\n data: this.model.getMany(data?.data || data),\n ...rest,\n }));\n };\n}\n\nexport class MovementCo2Chart extends AbstractBCMPortal {\n endpoint = '/movement';\n model = new Co2ChartModel();\n\n getChart = (\n rest?: ChartRestInterface\n ): Promise<\n {\n data: Co2ChartInstance[];\n materials: MaterialInstance[];\n } & ChartRestInterface\n > => {\n return this.request()\n .get(this.getUrl(CO2, true))\n .then(({ data }) => ({\n data: this.model.getMany(data?.data || data),\n materials: new Material().getMany(data.materials),\n ...rest,\n }));\n };\n}\n\nexport class MixedChart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting';\n\n getChart = (): Promise => {\n return this.request()\n .get(this.getUrl(INDEXES, true))\n .then(({ data }) => new MixedChartInstance(data));\n };\n}\n\nexport class ExportChart extends AbstractBCMPortal {\n endpoint = '/analysis_and_reporting/export';\n\n getChart = (): Promise => {\n return this.request()\n .get(this.getUrl('', true))\n .then(({ data }) => data as ExportAllDataInterface);\n };\n}\nexport class MovementExportChart extends AbstractBCMPortal {\n endpoint = '/movement/export';\n\n getChart = (): Promise => {\n return this.request()\n .get(this.getUrl('', true))\n .then(({ data }) => data as ExportMovementDataInterface);\n };\n}\n","export const PROVIDER = {\n COMPANIES: 'companies',\n COMPANY_SUB_TYPES: 'company_sub_types',\n COMPANY_TYPES: 'company_types',\n INVOICES: 'invoices',\n INVOICE_LINES: 'invoice_lines',\n INVOICE_STATUS: 'invoice_status',\n INVOICE_TYPE: 'invoice_types',\n MATERIALS: 'materials',\n MATERIAL_FAMILIES: 'material_families',\n MATERIAL_INDEX_SOURCES: 'material_index_sources',\n MATERIAL_INDEX_VALUES: 'material_index_values',\n MATERIAL_REFERENTIALS: 'material_referentials',\n MATERIAL_SUB_FAMILIES: 'material_subfamilies',\n ORGANIZATIONS: 'organizations',\n ORGANIZATION_HIERARCHIES: 'organization_hierarchies',\n ORGANIZATION_TYPES: 'organization_types',\n CONTAINERS: 'containers',\n CONTAINER_DEMANDS: 'container_demands',\n CONTAINER_DEMAND_STATUS: 'container_demand_status',\n};\nexport const MANAGEMENT = {\n COMPANY: 'company',\n INVOICE: 'invoice',\n MATERIAL: 'material',\n ORGANIZATION: 'organization',\n};\n\nexport enum ROLES {\n ROLE_CUSTOMER = 1,\n ROLE_SUPPLIER = 2,\n ROLE_ADMIN = 3,\n ROLE_INTERNAL_OPERATOR = 3,\n ROLE_EXTERNAL_OPERATOR = 4,\n ROLE_DOCUMENTS_ACCESS = 5,\n ROLE_MOVEMENT_CUSTOMER = 6,\n ROLE_MOVEMENT_SUPPLIER = 7,\n}\n\n\nexport enum ROUTES {\n Welcome = '/',\n Analysis = '/analysis',\n Login = '/login',\n Catalog = '/catalogs',\n Account = '/account',\n Movement = '/movement',\n DemandsExternal = '/demandsExternal',\n DemandsInternal = '/demandsInternal',\n CreateDemands = '/demandsExternal/create',\n ResetPasswordRequest = '/reset-password',\n ResetPasswordApply = '/reset-password/:token',\n CatalogItem = '/catalogs/:id',\n Contact = '/contact',\n Consent = '/consent',\n Documents = '/documents',\n}\n\nexport const EXCLUDED_ROUTES: string[] = [\n ROUTES.Login,\n ROUTES.ResetPasswordRequest,\n ROUTES.ResetPasswordApply,\n];\n","import { AbstractProvider } from './abstract';\nimport { Company as CompanyModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\n\nexport class Company extends AbstractProvider {\n management = MANAGEMENT.COMPANY;\n model = new CompanyModel();\n name = PROVIDER.COMPANIES;\n}\n","import { AbstractProvider } from './abstract';\nimport { Container as ContainerModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\n\nexport class Container extends AbstractProvider {\n endpoint = PROVIDER.CONTAINERS;\n management = MANAGEMENT.COMPANY;\n model = new ContainerModel();\n name = PROVIDER.CONTAINERS;\n}\n","import { AbstractProvider } from './abstract';\nimport { ContainerDemand as ContainerDemandModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\n\nexport class ContainerDemand extends AbstractProvider {\n endpoint = PROVIDER.CONTAINER_DEMANDS;\n management = MANAGEMENT.COMPANY;\n model = new ContainerDemandModel();\n name = PROVIDER.CONTAINERS;\n}\n","import { AbstractProvider } from './abstract';\nimport { ContainerDemandStatus as ContainerDemandStatusModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\n\nexport class ContainerDemandStatus extends AbstractProvider {\n endpoint = PROVIDER.CONTAINER_DEMAND_STATUS;\n management = MANAGEMENT.COMPANY;\n model = new ContainerDemandStatusModel();\n name = PROVIDER.CONTAINERS;\n}\n","import { KPI as KPIModel } from '../model';\nimport { AbstractBCMPortal } from './abstractBCMPortal';\n\nexport class KPI extends AbstractBCMPortal {\n endpoint = '/overview';\n model = new KPIModel();\n withParams = true;\n}\n","import { AbstractSerializer } from './AbstractSerializer';\n\nexport class MaterialSerializer extends AbstractSerializer {\n serialize(\n obj: { [key: string]: string | number | [] } /* eslint-disable-line */\n ): this {\n this.perPage = obj.perPage;\n this.page = obj.page;\n this.language = obj.language;\n this.idOrganizations = obj.idOrganizations;\n this.idCompanies = obj.idCompanies;\n this.idMaterialFamily = obj.materialFamilyFilterValues;\n this.idMaterialSubFamily = obj.materialSubFamilyFilterValues;\n this.fullname = obj.searchMaterialFilter;\n return this;\n }\n}\n","import { AbstractProvider } from './abstract';\nimport { Material as MaterialModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\nimport { MaterialSerializer } from '../serializer/MaterialSerializer';\n\nexport class Material extends AbstractProvider {\n management = MANAGEMENT.MATERIAL;\n model = new MaterialModel();\n name = PROVIDER.MATERIALS;\n serializer = new MaterialSerializer();\n}\n","import { AbstractProvider } from './abstract';\nimport { MaterialFamily as MaterialFamilyModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\n\nexport class MaterialFamily extends AbstractProvider {\n endpoint = PROVIDER.MATERIAL_FAMILIES;\n management = MANAGEMENT.MATERIAL;\n model = new MaterialFamilyModel();\n name = PROVIDER.MATERIALS;\n}\n","import { AbstractProvider } from './abstract';\nimport { MaterialSubFamily as MaterialSubFamilyModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\n\nexport class MaterialSubFamily extends AbstractProvider {\n endpoint = PROVIDER.MATERIAL_SUB_FAMILIES;\n management = MANAGEMENT.MATERIAL;\n model = new MaterialSubFamilyModel();\n name = PROVIDER.MATERIALS;\n}\n","import { AbstractProvider } from './abstract';\nimport { Organization as OrganizationModel } from '../model';\nimport { MANAGEMENT, PROVIDER } from '../../actions/BCM_Constant';\nimport { Token } from '../../helpers';\n\nexport class Organization extends AbstractProvider {\n management = MANAGEMENT.ORGANIZATION;\n model = new OrganizationModel();\n name = PROVIDER.ORGANIZATIONS;\n token = new Token().get() || '';\n}\n","import React, { createContext, Dispatch, useReducer } from 'react';\nimport decode from 'jwt-decode';\nimport { Token, Username } from '../helpers';\n\nexport const UPDATE_CLIENT = 'UPDATE_CLIENT';\nexport const LOGOUT = 'LOGOUT';\n\ninterface UserInterface {\n dispatch: Dispatch;\n isLogged: boolean;\n user: string | null;\n username: string | null;\n}\n\nconst defaultValue: UserInterface = {\n dispatch: () => {\n return;\n },\n isLogged: !!new Token().get(),\n user: new Token().get(),\n username: new Username().get(),\n};\n\nexport interface UserActionInterface {\n payload?: string;\n type: string;\n}\n\nfunction reducer(\n state: UserInterface,\n { payload, type }: UserActionInterface\n): UserInterface {\n switch (type) {\n case UPDATE_CLIENT: {\n const { username } = decode(payload || '') as UserInterface;\n new Username().set(username || '');\n return {\n ...state,\n isLogged: true,\n user: payload || '',\n username,\n };\n }\n case LOGOUT: {\n return {\n ...state,\n ...defaultValue,\n isLogged: false,\n };\n }\n default:\n return state;\n }\n}\n\nexport const UserContext = createContext(defaultValue);\n\nexport const UserProvider: React.FC = ({ children }) => {\n const [state, dispatch] = useReducer(reducer, defaultValue);\n\n return (\n \n {children}\n \n );\n};\n","import React, {\n createContext,\n Dispatch,\n useContext,\n useEffect,\n useReducer,\n} from 'react';\nimport { MaterialInstance } from '../interfaces/model';\nimport {\n CommonFilterInterface,\n CommonFilterSelectedInterface,\n MaterialFilterInterface,\n} from '../interfaces/Filter';\nimport { Organization } from '../interfaces/providers';\nimport { OptionInterface } from '../components/Filters';\nimport { UserContext } from './UserContext';\n\nexport const ADD_ITEM_CATALOG = 'ADD_ITEM_CATALOG';\nexport const SET_CATALOG = 'SET_CATALOG';\nexport const SET_FILTERS = 'SET_FILTERS';\nexport const SET_ITEM_FILTERS_SELECTED = 'SET_ITEM_FILTERS_SELECTED';\nexport const SET_OPEN_FILTERS = 'SET_OPEN_FILTERS';\nexport const SET_SELECTED_ITEM = 'SET_SELECTED_ITEM';\n\nexport const INIT_ANALYSIS_MATERIALS = 'INIT_ANALYSIS_MATERIALS';\nexport const SET_ANALYSIS_MATERIALS = 'SET_ANALYSIS_MATERIALS';\nexport const SET_ANALYSIS_SELECTED_MATERIALS =\n 'SET_ANALYSIS_SELECTED_MATERIALS';\n\nexport const INIT_MOVEMENT_MATERIALS = 'INIT_MOVEMENT_MATERIALS';\nexport const SET_MOVEMENT_MATERIALS = 'SET_MOVEMENT_MATERIALS';\nexport const SET_MOVEMENT_SELECTED_MATERIALS =\n 'SET_MOVEMENT_SELECTED_MATERIALS';\n\ninterface BaseStoreInterface {\n dispatch: Dispatch;\n catalog: MaterialInstance[];\n analysis: MaterialFilterInterface;\n movement: MaterialFilterInterface;\n filters: CommonFilterInterface;\n itemFiltersSelected: CommonFilterSelectedInterface;\n itemSelected?: MaterialInstance;\n openFilters: boolean;\n loading?: boolean;\n setSelectedMaterials: (selection: MaterialInstance[], page: string) => void;\n}\n\nconst defaultValue: BaseStoreInterface = {\n dispatch: () => {\n return;\n },\n loading: false,\n catalog: [],\n analysis: {\n materials: [],\n selectedMaterials: [],\n },\n movement: {\n materials: [],\n selectedMaterials: [],\n },\n filters: {\n contracts: [],\n organizations: [],\n plants: [],\n },\n itemFiltersSelected: {\n contract: [],\n organization: [],\n plant: [],\n },\n itemSelected: undefined,\n openFilters: false,\n setSelectedMaterials: (selection) => {\n return;\n },\n};\n\nexport interface ActionInterface {\n payload:\n | boolean\n | CommonFilterInterface\n | CommonFilterSelectedInterface\n | MaterialInstance\n | MaterialInstance[]\n | OptionInterface[]\n | string[]\n | { [key: string]: OptionInterface[] }\n | string\n | { loading: boolean; data: MaterialInstance[] };\n type: string;\n}\n\nfunction reducer(\n state: BaseStoreInterface,\n { payload, type }: ActionInterface\n): BaseStoreInterface {\n switch (type) {\n case ADD_ITEM_CATALOG: {\n const catalog = payload as MaterialInstance[];\n return {\n ...state,\n catalog: [...state.catalog, ...catalog],\n };\n }\n case SET_CATALOG: {\n const catalog = (payload as any).data as MaterialInstance[];\n return {\n ...state,\n catalog,\n loading: (payload as any).loading,\n };\n }\n case SET_FILTERS: {\n const filters = payload as CommonFilterInterface;\n return {\n ...state,\n filters: {\n ...state.filters,\n ...filters,\n },\n };\n }\n case SET_ITEM_FILTERS_SELECTED: {\n const filters = payload as CommonFilterSelectedInterface;\n if (filters.organization) {\n filters.plant = [];\n }\n return {\n ...state,\n itemFiltersSelected: {\n ...state.itemFiltersSelected,\n ...filters,\n },\n };\n }\n case SET_OPEN_FILTERS: {\n return {\n ...state,\n openFilters: !!payload,\n };\n }\n case SET_SELECTED_ITEM: {\n const itemSelected = payload as MaterialInstance;\n return {\n ...state,\n itemSelected,\n };\n }\n case INIT_ANALYSIS_MATERIALS: {\n return {\n ...state,\n analysis: {\n materials: payload as MaterialInstance[],\n selectedMaterials: (payload as MaterialInstance[]).map((i) => i.id),\n },\n };\n }\n case SET_ANALYSIS_MATERIALS: {\n return {\n ...state,\n analysis: {\n ...state.analysis,\n materials: payload as MaterialInstance[],\n },\n };\n }\n case SET_ANALYSIS_SELECTED_MATERIALS: {\n return {\n ...state,\n analysis: {\n ...state.analysis,\n selectedMaterials: payload as string[],\n },\n };\n }\n case INIT_MOVEMENT_MATERIALS: {\n return {\n ...state,\n movement: {\n materials: payload as MaterialInstance[],\n selectedMaterials: (payload as MaterialInstance[]).map((i) => i.id),\n },\n };\n }\n case SET_MOVEMENT_MATERIALS: {\n return {\n ...state,\n movement: {\n ...state.movement,\n materials: payload as MaterialInstance[],\n },\n };\n }\n case SET_MOVEMENT_SELECTED_MATERIALS: {\n return {\n ...state,\n movement: {\n ...state.movement,\n selectedMaterials: payload as string[],\n },\n };\n }\n default:\n return state;\n }\n}\n\nexport const BaseStoreContext = createContext(defaultValue);\n\nexport const objectToOptionInterface = (\n data: any[] /*eslint-disable-line*/,\n fields: string[] = [],\n separator = ''\n): OptionInterface[] =>\n data.map((item) => ({\n label: fields.length\n ? fields.map((field) => item[field.toString()]).join(separator)\n : item.name,\n value: item.id,\n }));\n\nexport const BaseStoreProvider: React.FC = ({ children }) => {\n const [{ filters, ...rest }, dispatch] = useReducer(reducer, defaultValue);\n const { isLogged } = useContext(UserContext);\n\n useEffect(() => {\n if (isLogged) {\n new Organization({ filters: { perPage: 1000 } })\n .getList()\n .then(({ data }) =>\n dispatch({\n payload: {\n organizations: objectToOptionInterface(\n data,\n ['level', 'name'],\n ' - '\n ),\n },\n type: SET_FILTERS,\n })\n );\n }\n return;\n }, [dispatch, isLogged]);\n\n const getSelector = (page) => {\n switch (page) {\n case 'analysis':\n return SET_ANALYSIS_SELECTED_MATERIALS;\n case 'movement':\n return SET_MOVEMENT_SELECTED_MATERIALS;\n default:\n return SET_ANALYSIS_SELECTED_MATERIALS;\n }\n };\n\n const setSelectedMaterials = (\n selection: MaterialInstance[],\n page: string\n ) => {\n dispatch({\n payload: selection,\n type: getSelector(page),\n });\n };\n\n return (\n \n {children}\n \n );\n};\n","import React, {\n createContext,\n Dispatch,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { BarDataInterface } from '../components/Chart';\nimport { Chart, FilterChart } from '../interfaces/providers';\nimport { Currency, getDate } from '../helpers';\nimport {\n ActionInterface,\n BaseStoreContext,\n INIT_ANALYSIS_MATERIALS,\n SET_ANALYSIS_MATERIALS,\n} from './BaseStoreContext';\nimport { ChartInstance, MaterialInstance } from '../interfaces/model';\nimport { OptionInterface } from '../components/Filters';\nimport { TypeSelectorContext } from '../components/TypeSelector';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\nimport { LanguageContext } from './LanguageContext';\nimport { GraphInterface, InternalChartProviderInterface } from '../interfaces/ChartInterface';\n\nexport type DataInterface = BarDataInterface | undefined;\n\ninterface ChartInterface {\n dispatch: Dispatch;\n materials: MaterialInstance[];\n selectedMaterials: string[];\n}\n\ninterface ChartContextInterface extends ChartInterface {\n data: any;\n total: number;\n}\n\nexport const defaultStore: ChartInterface = {\n dispatch: () => {\n return;\n },\n materials: [],\n selectedMaterials: [],\n};\n\nexport const defaultContext: ChartContextInterface = {\n ...defaultStore,\n data: undefined,\n total: 0,\n};\n\nexport const ChartContext =\n createContext(defaultContext);\n\nexport const ChartProvider: React.FC = ({\n children,\n startDate,\n endDate,\n options,\n}) => {\n const {\n itemFiltersSelected: { organization, plant, contract },\n analysis: { materials, selectedMaterials },\n dispatch,\n } = useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [total, setTotal] = useState(defaultContext.total);\n const { selected } = useContext(TypeSelectorContext);\n const finalSelectedMaterials: string[] = useMemo(\n () =>\n !materials.length || materials.length === selectedMaterials.length\n ? []\n : selectedMaterials.length\n ? selectedMaterials\n : [],\n [materials.length, selectedMaterials]\n );\n\n const filters = {\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idMaterials: finalSelectedMaterials,\n idOrganizations: organization,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n role: selected,\n startDeliveryDate,\n };\n\n const compute = (filters: any, { reset = true }) => {\n new Chart({ filters }).getChart().then(({ data }) => {\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n\n const currentMonth: ChartInstance = {\n label: formatLabelYearMonthUTC(year, month),\n value: 0,\n };\n\n const labels: string[] = [];\n const datasets: any[] = [];\n let t = 0;\n data.forEach((graph) => {\n const graphOptions: GraphInterface = options[graph.type];\n if (!graphOptions) return;\n\n const d: number[] = [];\n graph.data\n .filter(\n (item) => JSON.stringify(item) !== JSON.stringify(currentMonth)\n )\n .forEach((item) => {\n let dateString = item.label.toLocaleDateString(navigator.language, {\n month: 'short',\n year: 'numeric',\n });\n dateString = dateString.replace(/^./, dateString[0].toUpperCase());\n if (!labels.includes(dateString)) {\n // Based on the fact that the api \"fill\" empty dates before returning data\n // So only first graph will add labels\n labels.push(dateString);\n }\n d.push(item.value);\n if (graphOptions.sum) t += item.value;\n });\n\n if (graphOptions.type === 'line') {\n datasets.push({\n label: translate(graphOptions.label),\n data: d,\n type: 'line',\n unit: graphOptions.unit,\n borderColor: graphOptions.color,\n backgroundColor: 'transparent',\n pointBorderColor: graphOptions.color,\n pointBackgroundColor: graphOptions.color,\n pointHoverBackgroundColor: graphOptions.color,\n pointHoverBorderColor: graphOptions.color,\n yAxisID: 'y-axis-1',\n order: 1,\n });\n } else {\n datasets.push({\n label: translate(graphOptions.label),\n backgroundColor: graphOptions.color,\n data: d,\n unit: graphOptions.unit,\n order: 2,\n });\n }\n });\n setTotal(t);\n setData({\n labels,\n datasets,\n });\n });\n };\n\n const getFilterMaterials = (filters: any, { reset = true }) => {\n new FilterChart({ filters }).getMaterials().then(({ materials: m }) => {\n dispatch({\n payload: m,\n type: reset ? INIT_ANALYSIS_MATERIALS : SET_ANALYSIS_MATERIALS,\n });\n });\n };\n\n useEffect(() => {\n setData(undefined);\n compute({ ...filters }, { reset: true });\n }, [\n options,\n filters.currencyCode,\n filters.endDeliveryDate,\n JSON.stringify(filters.idMaterials),\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.isService,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n useEffect(() => {\n getFilterMaterials({ ...filters }, { reset: true });\n }, [\n filters.endDeliveryDate,\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.isService,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n return (\n \n {children}\n \n );\n};\n","import React, { createContext, Dispatch, useReducer } from 'react';\n\nexport const SET_ERROR = 'SET_ERROR';\nexport const SET_LOADING = 'SET_LOADING';\nexport const SET_SUCCESS = 'SET_SUCCESS';\nexport const SET_VALUE = 'SET_VALUE';\n\ninterface FormInterface {\n dispatch: Dispatch;\n error: boolean;\n isLoading: boolean;\n success: boolean;\n values?: any; // eslint-disable-line\n}\n\nconst defaultValue: FormInterface = {\n dispatch: () => {\n return;\n },\n error: false,\n isLoading: false,\n success: false,\n values: {},\n};\n\ninterface PayloadInterface {\n name: string;\n value: string;\n}\n\nexport interface FormActionInterface {\n payload?: PayloadInterface | boolean | string;\n type: string;\n}\n\nfunction reducer(\n state: FormInterface,\n { payload, type }: FormActionInterface\n): FormInterface {\n const { values } = state;\n switch (type) {\n case SET_ERROR: {\n return {\n ...state,\n error: true,\n success: false,\n };\n }\n case SET_LOADING: {\n return {\n ...state,\n isLoading: !!payload,\n };\n }\n case SET_SUCCESS: {\n return {\n ...state,\n error: false,\n success: true,\n };\n }\n case SET_VALUE: {\n values[(payload as PayloadInterface).name] = (\n payload as PayloadInterface\n ).value;\n return {\n ...state,\n values,\n };\n }\n default:\n return state;\n }\n}\n\nexport const FormContext = createContext(defaultValue);\n\nexport const FormProvider: React.FC = ({ children }) => {\n const [state, dispatch] = useReducer(reducer, defaultValue);\n\n return (\n \n {children}\n \n );\n};\n","import React, { createContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport {\n ApplicationInsights,\n SeverityLevel,\n} from '@microsoft/applicationinsights-web';\nimport { ReactPlugin } from '@microsoft/applicationinsights-react-js';\n\ninterface AppInsightContextStateInterface {\n initialized: boolean;\n appInsights?: ApplicationInsights;\n}\n\nconst defaultState: AppInsightContextStateInterface = {\n initialized: false,\n appInsights: undefined,\n};\n\nexport const AppInsightsContext =\n createContext(defaultState);\n\nexport const AppInsightProvider: React.FC = ({ children }) => {\n const history = useHistory();\n const instrumentationKey = process.env.REACT_APP_APP_INSIGHTS || '';\n\n const [appInsights, setAppInsights] = useState<\n ApplicationInsights | undefined\n >(defaultState.appInsights);\n const [initialized, setInitialized] = useState(\n defaultState.initialized\n );\n useEffect(() => {\n let ai = appInsights;\n if (!initialized) {\n const reactPlugin = new ReactPlugin();\n ai = new ApplicationInsights({\n config: {\n instrumentationKey: instrumentationKey,\n maxBatchInterval: 0,\n disableFetchTracking: false,\n disableTelemetry: false,\n enableUnhandledPromiseRejectionTracking: true,\n /*eslint-disable-next-line*/\n extensions: [reactPlugin as any],\n extensionConfig: {\n [reactPlugin.identifier]: { history },\n },\n },\n });\n\n ai.loadAppInsights();\n setInitialized(true);\n }\n\n if (!ai) {\n setAppInsights(ai);\n } else {\n ai.trackException({\n exception: new Error('some error'),\n severityLevel: SeverityLevel.Error,\n });\n }\n }, [appInsights, history, initialized, instrumentationKey]);\n return (\n \n {children}\n \n );\n};\n","import React, { Component } from 'react';\n\nexport default function withTracker(WrappedComponent) {\n const HOC = class extends Component {\n render() {\n return ;\n }\n };\n HOC.displayName = 'hoc';\n\n return HOC;\n}\n","/* eslint-disable react/require-default-props */\n/* eslint-disable react/jsx-props-no-spreading */\n\nimport React, { useState } from 'react';\nimport { useHistory, Route, useLocation } from 'react-router-dom';\n\nimport { Token } from '../helpers';\nimport { EXCLUDED_ROUTES, ROLES, ROUTES } from '../actions/BCM_Constant';\n\ninterface CustomRouteProps {\n children?: React.ReactNode;\n path: string | string[];\n exact: boolean;\n condition: ROLES[];\n personnalizedCondition?: boolean;\n}\n\nfunction hasAccessTo(\n businessRoles: Array,\n currentRoles: Array\n) {\n return businessRoles.find((businessRole) =>\n currentRoles.find((currentRole) => currentRole === businessRole)\n );\n}\n\nfunction getEnumKeyByValue(myEnum: any, enumValue: any): any {\n const keys = Object.keys(myEnum).filter((x) => myEnum[x] === enumValue);\n return keys.length > 0 ? keys[0] : null;\n}\n\nfunction roleNamesToNumber(roleNames: Array): Array {\n return roleNames.map((roleName: string) =>\n parseInt(getEnumKeyByValue(ROLES, roleName), 10)\n );\n}\n\nconst CustomRoute = (props: CustomRouteProps) => {\n const history = useHistory();\n const location = useLocation();\n\n const roleNames = new Token().getDecoded().roles;\n\n const [returnedRoute, setReturnedRoute] = useState();\n\n const { condition, path } = props;\n\n React.useEffect(() => {\n if (\n roleNames?.length > 0 &&\n !hasAccessTo(condition, roleNamesToNumber(roleNames)) &&\n !EXCLUDED_ROUTES.includes(String(path)) &&\n path === location.pathname\n ) {\n history.push(ROUTES.Login);\n }\n\n setReturnedRoute();\n }, [path]);\n\n return returnedRoute;\n};\n\nexport default CustomRoute;\n","import { useContext, useEffect } from 'react';\nimport { UserContext } from '../contexts';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport { Token } from '../helpers';\nimport { ROUTES } from '../actions/BCM_Constant';\n\nexport const useLogged = (): void => {\n const { push } = useHistory();\n const location = useLocation();\n const { isLogged } = useContext(UserContext);\n\n if (!isLogged) {\n push('/login');\n }\n\n const roles = new Token().getDecoded().roles;\n if (\n location.pathname === '/' &&\n !roles?.some((role) => ['ROLE_SUPPLIER', 'ROLE_CUSTOMER'].includes(role))\n ) {\n if (roles?.some((role) => role === 'ROLE_INTERNAL_OPERATOR')) {\n push(ROUTES.DemandsInternal);\n } else if (roles?.some((role) => role === 'ROLE_EXTERNAL_OPERATOR')) {\n push(ROUTES.DemandsExternal);\n }\n if (\n roles?.some((role) =>\n ['ROLE_MOVEMENT_SUPPLIER', 'ROLE_MOVEMENT_CUSTOMER'].includes(role)\n )\n ) {\n push(ROUTES.Movement);\n }\n }\n};\n","import { useContext, useEffect } from 'react';\nimport { UserContext } from '../contexts';\nimport { useHistory, useLocation } from 'react-router-dom';\n\nexport const useNotLogged = (): void => {\n const { push } = useHistory();\n const { isLogged } = useContext(UserContext);\n if (isLogged) {\n push('/');\n }\n};\n","import React, { SyntheticEvent, useRef, useState } from 'react';\nimport { ClassNameInterface, DropdownInterface } from '../../interfaces';\nimport { useOutsideClick } from '../../hooks';\n\nexport const Dropdown: React.FC = ({\n alignRight,\n children,\n className,\n dropdownToggleClass,\n dropdownTogglerIcon,\n disabled,\n name,\n onClick,\n title,\n withoutChildren,\n}) => {\n const [open, setOpen] = useState(false);\n const ref = useRef(null);\n useOutsideClick(ref, () => setOpen(false));\n\n return (\n {\n event.preventDefault();\n !disabled && setOpen(!open);\n onClick && onClick();\n }}\n >\n \n {title}\n \n \n \n \n {!withoutChildren && (\n \n {children}\n
\n )}\n \n );\n};\n","import { MutableRefObject, useEffect } from 'react';\n\nexport const useOutsideClick = (\n ref: MutableRefObject,\n callback: () => void\n): void => {\n const handleClick = (e: MouseEvent): void => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n callback();\n }\n };\n\n useEffect((): (() => void) => {\n document.addEventListener('click', handleClick);\n return (): void => {\n document.removeEventListener('click', handleClick);\n };\n });\n};\n","import * as React from 'react';\nimport { ClassNameInterface, DropdownInterface } from '../../../../interfaces';\nimport { Dropdown } from '../../../Dropdown';\n\nexport const NavDropdown: React.FC = ({\n className,\n dropdownToggleClass,\n ...rest\n}) => (\n \n);\n","import * as React from 'react';\nimport { LinkInterface } from '../../interfaces';\nimport { Link } from 'react-router-dom';\n\nexport const DropdownItem: React.FC = ({ children, to }) => (\n \n {children}\n \n);\n","import React, { useContext } from 'react';\nimport {\n ClassNameInterface,\n DisabledInterface,\n LinkInterface,\n} from '../../../../interfaces';\nimport { Link, useHistory } from 'react-router-dom';\nimport './navitem.scss';\nimport { LanguageContext } from '../../../../contexts';\n\nexport const NavItem: React.FC<\n ClassNameInterface & DisabledInterface & LinkInterface\n> = ({ children, disabled, to, className }) => {\n const { translate } = useContext(LanguageContext);\n const { location } = useHistory();\n return (\n \n \n {children && translate(`appbar.routes.${children.toString()}`)}\n \n \n );\n};\n","import React, { useContext, useEffect } from 'react';\nimport { Dropdown, Navbar } from 'react-bootstrap';\nimport './filtersBar.scss';\nimport {\n ContractFilter,\n OptionInterface,\n OrganizationFilter,\n PlantFilter,\n ResetFilter,\n} from '../../Filters';\nimport {\n BaseStoreContext,\n objectToOptionInterface,\n SET_FILTERS,\n SET_ITEM_FILTERS_SELECTED,\n} from '../../../contexts';\nimport { Company } from '../../../interfaces/providers';\n\nexport const FiltersBar: React.FC = () => {\n const {\n dispatch,\n itemFiltersSelected: { contract, plant, organization },\n openFilters,\n } = useContext(BaseStoreContext);\n const resetFilters = (): void => {\n dispatch({\n payload: {\n organization: [],\n plant: [],\n contract: [],\n },\n type: SET_ITEM_FILTERS_SELECTED,\n });\n };\n\n useEffect(() => {\n new Company({\n filters: {\n perPage: 1000,\n idOrganizations: ((organization as OptionInterface[]) || []).map(\n (o) => o.value\n ),\n },\n })\n .getList()\n .then(({ data }) =>\n dispatch({\n payload: {\n plants: objectToOptionInterface(\n data.filter(\n (item) => item.companyType && item.companyType.code !== '01'\n )\n ),\n },\n type: SET_FILTERS,\n })\n );\n }, [dispatch, organization]);\n\n return (\n \n
\n \n
\n {\n dispatch({\n payload: {\n organization: value as OptionInterface[],\n },\n type: SET_ITEM_FILTERS_SELECTED,\n });\n },\n value: organization,\n }}\n />\n
\n
\n \n
\n
\n \n dispatch({\n payload: {\n plant: value as OptionInterface[],\n },\n type: SET_ITEM_FILTERS_SELECTED,\n }),\n value: plant,\n }}\n />\n
\n
\n \n
\n
\n \n dispatch({\n payload: {\n contract: value as OptionInterface[],\n },\n type: SET_ITEM_FILTERS_SELECTED,\n }),\n value: contract,\n }}\n />\n
\n
\n \n
\n \n
\n
\n \n );\n};\n","import React, { useContext, useMemo, useState, useEffect } from 'react';\nimport { NavDropdown } from './Items/NavDropdown';\nimport { DropdownItem } from '../../Dropdown/DropdownItem';\nimport { NavItem } from './Items/NavItem';\nimport { Navbar } from 'react-bootstrap';\nimport { LinkInterface } from '../../../interfaces';\nimport { Link } from 'react-router-dom';\nimport {\n BaseStoreContext,\n LanguageContext,\n SET_ITEM_FILTERS_SELECTED,\n SET_OPEN_FILTERS,\n UserContext,\n} from '../../../contexts';\nimport { SzIcon } from 'react-theme-components';\nimport { Dropdown } from 'react-bootstrap';\nimport { User } from '../../../actions';\nimport { Token } from '../../../helpers';\n\nconst AppBarDropdown: React.FC<{ withoutCaret?: boolean }> = ({\n withoutCaret = false,\n}) => {\n const { translate } = useContext(LanguageContext);\n const [count, setCount] = useState(0);\n const {\n itemFiltersSelected: { plant, organization },\n openFilters,\n } = useContext(BaseStoreContext);\n useMemo(() => {\n setCount((plant?.length || 0) + (organization?.length || 0));\n }, [plant, organization]);\n return (\n <>\n \n filter_list\n \n {translate('appbar.filters.label')} {count > 0 && `(${count})`}\n \n \n {!withoutCaret && (\n \n \n \n )}\n \n );\n};\nconst AvatarDropdown: React.FC = () => (\n <>\n \n \"User\n \n \n \n \n \n);\nlet routes: (LinkInterface & { children: string; roles?: string[] })[] = [];\n\nconst navitems: (LinkInterface & { children: string; roles?: string[] })[] = [\n {\n children: 'overview',\n to: '/',\n roles: ['ROLE_SUPPLIER', 'ROLE_CUSTOMER'],\n },\n {\n children: 'analysis',\n to: '/analysis',\n roles: ['ROLE_SUPPLIER', 'ROLE_CUSTOMER'],\n },\n {\n children: 'catalog',\n to: '/catalogs',\n roles: ['ROLE_SUPPLIER', 'ROLE_CUSTOMER'],\n },\n {\n children: 'demandsExternal',\n to: '/demandsExternal',\n roles: ['ROLE_EXTERNAL_OPERATOR'],\n },\n {\n children: 'demandsInternal',\n to: '/demandsInternal',\n roles: ['ROLE_INTERNAL_OPERATOR'],\n },\n {\n children: 'movement',\n to: '/movement',\n roles: ['ROLE_MOVEMENT_CUSTOMER', 'ROLE_MOVEMENT_SUPPLIER'],\n },\n {\n children: 'documents',\n to: '/documents',\n roles: ['ROLE_DOCUMENTS_ACCESS'],\n },\n];\n\nexport const AppBar: React.FC = () => {\n const { translate } = useContext(LanguageContext);\n const [expanded, setExpanded] = useState(false);\n const { dispatch, isLogged } = useContext(UserContext);\n const baseStore = useContext(BaseStoreContext);\n const expand = 'xl';\n useEffect(() => {\n const roles = new Token().getDecoded().roles;\n const isExternalOperator = roles.some(\n (r) => 'ROLE_EXTERNAL_OPERATOR' === r\n );\n const isInternalOperator = roles.some(\n (r) => 'ROLE_INTERNAL_OPERATOR' === r\n );\n const isUserMovement = roles.some((r) =>\n ['ROLE_MOVEMENT_SUPPLIER', 'ROLE_MOVEMENT_CUSTOMER'].includes(r)\n );\n routes = navitems.filter((n) => n.roles?.some((r) => roles.includes(r)));\n if (isUserMovement && !navitems.some((n) => 'movement' === n.children)) {\n navitems.splice(2, 0, {\n children: 'movement',\n to: '/movement',\n });\n }\n if (\n isExternalOperator &&\n !navitems.some((n) => 'demandsExternal' === n.children)\n ) {\n navitems.push({\n children: 'demandsExternal',\n to: '/demandsExternal',\n });\n\n const index = navitems.findIndex((n) => 'demandsInternal' === n.children); // find index demandsInternal\n if (index !== -1) navitems.splice(index, 1); // remove element demandsInternal from navitems\n } else if (\n isInternalOperator &&\n !navitems.some((n) => 'demandsInternal' === n.children)\n ) {\n navitems.push({\n children: 'demandsInternal',\n to: '/demandsInternal',\n });\n\n const index = navitems.findIndex((n) => 'demandsExternal' === n.children); //find index demandsExternal\n if (index !== -1) navitems.splice(index, 1); // remove element demandsExternal from navitems\n }\n }, []);\n\n return (\n \n
\n
\n \n \"BCM\n \n
\n
\n {\n if (!baseStore.openFilters) {\n setExpanded(false);\n }\n baseStore.dispatch({\n type: SET_OPEN_FILTERS,\n payload: !baseStore.openFilters,\n });\n }}\n >\n \n \n
\n {\n if (!expanded) {\n baseStore.dispatch({\n type: SET_OPEN_FILTERS,\n payload: expanded,\n });\n }\n setExpanded(!expanded);\n }}\n >\n \n \n \n
    \n \n baseStore.dispatch({\n type: SET_OPEN_FILTERS,\n payload: !baseStore.openFilters,\n }),\n title: ,\n }}\n />\n {routes.map((navitem: LinkInterface, index: number) => (\n \n ))}\n {\n <>\n
    \n \n account\n {\n baseStore.dispatch({\n type: SET_ITEM_FILTERS_SELECTED,\n payload: {\n organization: [],\n plant: [],\n contract: [],\n },\n });\n baseStore.dispatch({\n type: SET_OPEN_FILTERS,\n payload: false,\n });\n User.logout({\n updateClient: dispatch,\n });\n }}\n >\n {translate('appbar.routes.logout')}\n \n
    \n : <>,\n withoutChildren: !isLogged,\n }}\n >\n {isLogged ? (\n <>\n \n \n {translate('appbar.routes.account')}\n \n \n \n \n {translate('appbar.routes.contact')}\n \n \n \n User.logout({\n updateClient: dispatch,\n })\n }\n >\n {translate('appbar.routes.logout')}\n \n \n ) : null}\n \n \n }\n
\n
\n
\n \n );\n};\n\nexport * from './FiltersBar';\n","import React, { useEffect, useState } from 'react';\nimport { SzIcon } from 'react-theme-components';\nimport './returnToTop.scss';\n\nconst MAX_SCROLL = 120;\n\nexport const ReturnToTop: React.FC = () => {\n const [top, setTop] = useState(window.scrollY < MAX_SCROLL);\n\n const handleScroll = (): void => {\n setTop(window.scrollY < MAX_SCROLL);\n };\n useEffect(() => {\n window.addEventListener('scroll', handleScroll);\n\n return (): void => window.removeEventListener('scroll', handleScroll);\n }, []);\n return (\n window.scrollTo({ top: 0, behavior: 'smooth' })}\n >\n \n \n );\n};\n","import React, { useContext, useEffect } from 'react';\nimport { Nav } from 'react-bootstrap';\nimport { AppBar, FiltersBar } from './AppBar';\nimport { LanguageContext, UserContext } from '../../contexts';\nimport './index.scss';\n\ninterface LayoutBaseInterface {\n withFooter?: boolean;\n}\n\nexport const LayoutBase: React.FC = ({\n children,\n withFooter,\n}) => {\n const { translate } = useContext(LanguageContext);\n\n return (\n <>\n {children}\n {withFooter ? (\n
\n
\n \n
\n
\n ) : null}\n \n );\n};\n\ninterface LayoutInterface {\n noContainer?: boolean;\n withDisclaimer?: boolean;\n withFooter?: boolean;\n}\n\nexport const Layout: React.FC = ({\n children,\n noContainer,\n withDisclaimer,\n withFooter,\n}) => {\n useEffect(() => {\n typeof window !== 'undefined' &&\n [\n '/',\n '/analysis',\n '/catalogs',\n '/account',\n '/movement',\n '/contact',\n '/consent',\n '/demandsExternal',\n '/demandsInternal',\n ].includes(document.location.pathname);\n }, [window]);\n\n const { translate } = useContext(LanguageContext);\n const { isLogged } = useContext(UserContext);\n\n if (!isLogged) {\n return null;\n }\n\n return (\n \n
\n \n \n
\n {noContainer ? (\n children\n ) : (\n
\n
{children}
\n
\n )}\n {withDisclaimer ? (\n
\n
\n {translate('layout.disclaimer')}\n
\n
\n ) : null}\n
\n );\n};\n\nexport * from './ReturnToTop';\n","import React, { useContext } from 'react';\nimport { ButtonInterface, ClassNameInterface } from '../../interfaces';\nimport { SzButton, SzTypographie } from 'react-theme-components';\nimport { LanguageContext } from '../../contexts';\n\ninterface ComponentWithTitleInterface {\n button?: JSX.Element;\n customIcon?: string;\n icon?: string;\n logo?: string;\n title: string;\n withoutTranslation?: boolean;\n}\n\nexport const ComponentWithTitle: React.FC<\n ClassNameInterface & ComponentWithTitleInterface\n> = ({\n button,\n customIcon,\n className,\n children,\n icon,\n title,\n logo,\n withoutTranslation,\n}) => {\n const { translate } = useContext(LanguageContext);\n return (\n <>\n
\n \n {customIcon ? (\n \n ) : (\n {icon}\n )}\n {logo && (\n \n \n \n )}\n \n {!withoutTranslation ? translate(`${title}.title`) : title}\n \n
{button}
\n
\n
\n {children}\n \n );\n};\n","import React, { useContext } from 'react';\nimport { Spinner } from 'react-bootstrap';\nimport { LanguageContext } from '../../contexts';\n\ninterface LoaderInterface {\n text?: string;\n}\n\nexport const Loader: React.FC = ({ text }) => {\n const { translate } = useContext(LanguageContext);\n return (\n
\n
\n \n \n {translate(`${text}.loader`)}\n \n
\n
\n );\n};\n","import React, { useContext, useRef } from 'react';\nimport { Bar as ChartBar } from 'react-chartjs-2';\nimport './bar.scss';\nimport { renderToString } from 'react-dom/server';\nimport { ChartContext } from '../../../contexts';\n\nimport { Loader } from '../../Loader';\nimport { Language } from '../../../helpers';\n\ninterface BarDatasetInterface {\n label: string;\n backgroundColor: string;\n data: number[];\n type?: string;\n borderColor?: string;\n order?: number;\n pointBorderColor?: string;\n pointBackgroundColor?: string;\n pointHoverBackgroundColor?: string;\n pointHoverBorderColor?: string;\n unit?: string;\n}\n\nexport interface BarDataInterface {\n labels: string[];\n datasets: BarDatasetInterface[];\n}\n\nexport interface BarInterface {\n options?: Record;\n type: string;\n unit?: string;\n}\n\nexport interface TooltipInterface {\n body: { lines: string[] }[];\n caretX: number;\n caretY: number;\n dataPoints: { datasetIndex: number };\n labelColors: { backgroundColor: string }[];\n opacity: number;\n style: {\n opacity: number;\n };\n title: string[];\n yAlign: string;\n}\n\nconst CustomTooltip = (\n title: string,\n value: string,\n unit: string,\n color: string\n): string => {\n const formated = value\n .split(': ')[1]\n .replaceAll(' ', '')\n .replaceAll(' ', '')\n .replace(',', '.');\n const v = parseFloat(formated).toLocaleString(new Language().get());\n return renderToString(\n
\n {title}\n \n {`${v}${unit}`}\n \n
\n );\n};\n\nexport const Bar: React.FC = ({\n children,\n options = {},\n type,\n unit = '',\n}) => {\n const ref = useRef(null);\n const { data } = useContext(ChartContext);\n return (\n
\n
\n {children}\n {!data ? (\n \n ) : (\n
\n
\n {\n let tooltipEl: HTMLElement | null =\n document.getElementById('chartjs-tooltip');\n\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.id = 'chartjs-tooltip';\n tooltipEl.innerHTML = '
';\n document.body.appendChild(tooltipEl);\n }\n\n const tooltipModel = context.tooltip;\n if (tooltipModel.opacity === 0) {\n tooltipEl.innerHTML = `
`;\n tooltipEl.style.opacity = '0';\n return;\n } else {\n tooltipEl.innerHTML = CustomTooltip(\n tooltipModel.title[0],\n tooltipModel.body[0].lines[0],\n unit,\n tooltipModel?.labelColors[0]?.backgroundColor.toString() ||\n '#77B7FC'\n );\n }\n\n tooltipEl.classList.remove(\n 'above',\n 'below',\n 'no-transform'\n );\n if (tooltipModel.yAlign) {\n tooltipEl.classList.add(tooltipModel.yAlign);\n } else {\n tooltipEl.classList.add('no-transform');\n }\n\n const position =\n context.chart.canvas.getBoundingClientRect();\n\n tooltipEl.classList.add(\n 'tooltip',\n 'shadow',\n 'bg-white',\n 'p-0'\n );\n tooltipEl.style.position = 'absolute';\n tooltipEl.style.opacity = '1';\n tooltipEl.style.left = `${\n position.left +\n window.pageXOffset +\n tooltipModel.caretX\n }px`;\n tooltipEl.style.top = `${\n position.top +\n window.pageYOffset +\n tooltipModel.caretY\n }px`;\n },\n },\n },\n elements: {\n line: {\n tension: 0.5,\n },\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n x: {\n grid: {\n display: false,\n },\n position: 'top',\n },\n y: {\n grid: {\n display: true,\n },\n beginAtZero: true,\n },\n },\n ...options,\n },\n ref,\n }}\n />\n
\n
\n )}\n
\n
\n );\n};\n","import React, {\n Dispatch,\n SetStateAction,\n useContext,\n useState,\n useEffect,\n useMemo,\n} from 'react';\nimport './bar.scss';\nimport { SzCheckbox, SzModal } from 'react-theme-components';\nimport { LanguageContext, BaseStoreContext } from '../../../contexts';\nimport {\n MaterialFamilyFilter,\n MaterialSubFamilyFilter,\n OptionInterface,\n SearchFilter,\n} from '../../Filters';\n\ntype OptionWithArrayInterface = OptionInterface | OptionInterface[];\n\nexport const FilterMaterials: React.FC<{ page: string }> = ({ page }) => {\n const [show, setShow] = useState(false);\n const [search, setSearch] = useState('');\n\n const { setSelectedMaterials, analysis, movement } =\n useContext(BaseStoreContext);\n const [family, setFamily] = useState([]);\n const [subFamily, setSubFamily] = useState([]);\n const [selection, setSelection] = useState([]);\n\n const selectedMaterials: string[] = useMemo(() => {\n switch (page) {\n case 'analysis':\n return analysis.selectedMaterials;\n case 'movement':\n return movement.selectedMaterials;\n default:\n return analysis.selectedMaterials;\n }\n }, [analysis, movement]);\n const materials = useMemo(() => {\n switch (page) {\n case 'analysis':\n return analysis.materials;\n case 'movement':\n return movement.materials;\n default:\n return analysis.materials;\n }\n }, [analysis, movement]);\n\n useEffect(() => {\n setSelection(selectedMaterials);\n }, [JSON.stringify(selectedMaterials)]);\n\n const update = (\n payload: SetStateAction,\n updater: Dispatch>\n ): void =>\n updater(\n !Array.isArray(payload) && (payload as OptionInterface).value\n ? (payload as OptionInterface)\n : []\n );\n\n const isNoMaterials = () => {\n return (\n materials.filter((m) =>\n `${m.code} - ${m.name}`.toLowerCase().includes(search.toLowerCase())\n ).length === 0\n );\n };\n const updateSelection = (family, subFamily) => {\n const newMaterials = materials.filter(\n (m) =>\n `${m.code} - ${m.name}`.toLowerCase().includes(search.toLowerCase()) &&\n ((family as OptionInterface).value\n ? m.materialFamily?.id === (family as OptionInterface).value\n : true) &&\n ((subFamily as OptionInterface).value\n ? m.materialSubFamily?.id === (subFamily as OptionInterface).value\n : true)\n );\n\n setSelection(newMaterials.map((m) => m.id));\n };\n\n const updateFamily = (\n payload: SetStateAction\n ): void => {\n update(payload, setFamily);\n updateSelection(payload, subFamily);\n };\n const updateSubFamily = (\n payload: SetStateAction\n ): void => {\n update(payload, setSubFamily);\n updateSelection(family, payload);\n };\n\n const { translate } = useContext(LanguageContext);\n\n const subFamilies = materials\n .filter((m) => {\n const f = family as any;\n if (!f || f.length === 0) return true;\n if (f && m.materialFamily && m.materialFamily.id === f.value) {\n return true;\n }\n\n return false;\n })\n .map((m) => ({\n label: m.materialSubFamily?.name || '',\n value: m.materialSubFamily?.id || '',\n }))\n .filter((m) => m && m.label)\n .filter(\n (m, index, self) => index === self.findIndex((t) => t.value === m.value)\n )\n .sort((a, b) => a.label.localeCompare(b.label));\n\n useEffect(() => {\n if (!subFamilies.length || !(subFamily as any).value) return;\n if (subFamilies.find((e) => e.value === (subFamily as any).value)) return;\n setSubFamily([]);\n }, [subFamilies]);\n\n useEffect(() => {\n updateSelection(family, subFamily);\n }, [search]);\n\n return (\n <>\n {\n setShow(false);\n if (\n !selection.every((m) => selectedMaterials.find((s) => s === m)) ||\n selectedMaterials.length !== selection.length\n ) {\n setSelectedMaterials(selection as any, page);\n }\n }}\n size={'xl'}\n >\n
\n
\n ({\n label: m.materialFamily?.name || '',\n value: m.materialFamily?.id || '',\n }))\n .filter((m) => m && m.label)\n .filter(\n (m, index, self) =>\n index === self.findIndex((t) => t.value === m.value)\n )\n .sort((a, b) => a.label.localeCompare(b.label)),\n ]}\n onChange={(v): void => updateFamily(v as OptionInterface[])}\n value={family as OptionInterface}\n />\n updateSubFamily(v as OptionInterface[])}\n value={subFamily as OptionInterface}\n />\n \n
\n
\n 0}\n onChange={(e: React.ChangeEvent): void =>\n selection.length === 0\n ? updateSelection(family, subFamily)\n : setSelection([])\n }\n type=\"checkbox\"\n label={\n 'Tout ' + (selection.length !== 0 ? 'dé-' : '') + 'sélectionner'\n }\n />\n\n {materials\n .filter(\n (m) =>\n `${m.code} - ${m.name}`\n .toLowerCase()\n .includes(search.toLowerCase()) &&\n ((family as OptionInterface).value\n ? m.materialFamily?.id === (family as OptionInterface).value\n : true) &&\n ((subFamily as OptionInterface).value\n ? m.materialSubFamily?.id ===\n (subFamily as OptionInterface).value\n : true)\n )\n .map((material, key) => (\n ): void => {\n if (e.target.checked) {\n setSelection((selection) => [\n ...(new Set([...selection, material.id]) as any),\n ]);\n } else {\n setSelection((selection) =>\n selection.filter((m) => m !== material.id)\n );\n }\n }}\n type=\"checkbox\"\n label={material.code + ' - ' + material.name}\n />\n ))}\n
\n
\n \n
\n {materials.length ? (\n setShow(true)}\n >\n {translate(`pages.analysis.materialfilter.name`)} (\n {selection.length || 0})\n \n ) : null}\n
\n \n );\n};\n","import React, { useContext, useRef } from 'react';\nimport { Bar as ChartBar } from 'react-chartjs-2';\nimport './bar.scss';\nimport { renderToString } from 'react-dom/server';\nimport { Loader } from '../../Loader';\nimport { BarInterface } from './Bar';\nimport { MixedChartContext } from '../../../contexts/MixedChartContext';\nimport { BottomFilters } from '../Analysis/Filters';\nimport { Language } from '../../../helpers';\n\nconst Tooltip = (\n title: string,\n month: string,\n value: string,\n unit: string,\n color: string\n): string => {\n\n const formated = value\n .split(': ')[1]\n .replaceAll(' ', '')\n .replaceAll(' ', '')\n .replace(',', '.');\n const v = parseFloat(formated).toLocaleString(new Language().get());\n\n return renderToString(\n
\n {title}\n {month}\n \n {`${v}${unit}`}\n \n
\n );\n};\n\nexport const Mixed: React.FC = ({\n children,\n options = {},\n type = '',\n unit = '',\n}) => {\n const ref = useRef(null);\n const { data } = useContext(MixedChartContext);\n\n return (\n
\n
\n {children}\n {!data ? (\n \n ) : (\n
\n
\n {\n let tooltipEl: HTMLElement | null =\n document.getElementById('chartjs-tooltip');\n\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.id = 'chartjs-tooltip';\n tooltipEl.innerHTML = '
';\n document.body.appendChild(tooltipEl);\n }\n\n const tooltipModel = context.tooltip;\n if (tooltipModel.opacity === 0) {\n tooltipEl.innerHTML = `
`;\n tooltipEl.style.opacity = '0';\n return;\n } else {\n tooltipEl.innerHTML = Tooltip(\n data.datasets.filter(\n (d) =>\n d.borderColor ===\n tooltipModel.labelColors[0].backgroundColor\n )[0].label,\n tooltipModel.title[0],\n tooltipModel.body[0].lines[0],\n unit,\n tooltipModel?.labelColors[0]?.backgroundColor.toString() ||\n '#77B7FC'\n );\n }\n\n tooltipEl.classList.remove(\n 'above',\n 'below',\n 'no-transform'\n );\n if (tooltipModel.yAlign) {\n tooltipEl.classList.add(tooltipModel.yAlign);\n } else {\n tooltipEl.classList.add('no-transform');\n }\n\n const position =\n context.chart.canvas.getBoundingClientRect();\n\n tooltipEl.classList.add(\n 'tooltip',\n 'shadow',\n 'bg-white',\n 'p-0'\n );\n tooltipEl.style.position = 'absolute';\n tooltipEl.style.opacity = '1';\n tooltipEl.style.left = `${\n position.left +\n window.pageXOffset +\n tooltipModel.caretX\n }px`;\n tooltipEl.style.top = `${\n position.top +\n window.pageYOffset +\n tooltipModel.caretY\n }px`;\n },\n },\n },\n responsive: true,\n maintainAspectRatio: false,\n elements: {\n line: {\n tension: 0.5,\n },\n },\n scales: {\n x: {\n grid: {\n display: false,\n },\n position: 'top',\n },\n 'y-axis-1': {\n type: 'linear',\n display: true,\n beginAtZero: true,\n position: 'left',\n },\n },\n\n ...options,\n },\n ref,\n }}\n />\n
\n
\n )}\n
\n
\n \n
\n
\n );\n};\n","import React, { useContext } from 'react';\nimport { Bar } from '../Abstract';\nimport { ChartContext } from '../../../contexts';\nimport { formatTitleToK, TopFilters } from './Filters';\n\nexport const Co2: React.FC = () => {\n const { total } = useContext(ChartContext);\n\n return (\n \n formatTitleToK(value, 'teqCO2'),\n total,\n }}\n />\n \n );\n};\n","import React, { useContext } from 'react';\nimport { Mixed } from '../Abstract';\nimport { MixedChartContext } from '../../../contexts/MixedChartContext';\nimport { formatTitleToK, TopFilters } from './Filters';\nimport { OptionInterface } from '../../Filters';\n\nexport const IndexValue: React.FC = () => {\n const { selectedIndex, selectedMaterial, total } =\n useContext(MixedChartContext);\n\n return (\n \n formatTitleToK(value, ''),\n total,\n }}\n >\n
\n {(selectedIndex as OptionInterface)?.label ||\n (selectedMaterial as OptionInterface)?.label ||\n ''}\n
\n \n
\n );\n};\n","import React, { useContext } from 'react';\nimport { ClassNameInterface } from '../../../interfaces';\nimport './custombar.scss';\nimport { LanguageContext } from '../../../contexts';\nimport { sprintf } from '../../../helpers';\nimport { OverlayTrigger } from 'react-bootstrap';\n\ninterface CustomBarInterface {\n label?: string;\n placement?: 'left' | 'right' | 'top' | 'bottom';\n subtype?: string;\n title?: JSX.Element;\n tooltip?: JSX.Element;\n total?: number;\n trigger?: 'hover' | 'click';\n type?: string;\n value: number;\n}\n\nconst roundToUpperInt = (value: number): number => {\n const v = value.toFixed(0);\n return parseInt(`${parseInt(v[0]) + 1}${'0'.repeat(v.length - 1)}`);\n};\n\nconst Bar: React.FC = ({ subtype, total, type, value }) => (\n
\n
\n \n
\n
\n);\n\nexport const CustomBar: React.FC = ({\n className,\n label,\n placement = 'left',\n subtype,\n title,\n tooltip,\n total,\n trigger = 'hover',\n type = 'primary',\n value,\n}) => {\n if (!subtype) subtype = type + '-light';\n\n const { translate } = useContext(LanguageContext);\n const date = new Date();\n date.setDate(0);\n return (\n \n \n {sprintf(translate(`charts.${label}.label`), [''])}\n \n \n {title}\n \n {tooltip ? (\n \n \n \n ) : (\n \n )}\n \n );\n};\n","import React from 'react';\nimport { ClassNameInterface } from '../../interfaces';\n\nexport const Tile: React.FC = ({ children, className }) => (\n
{children}
\n);\n","import React, { useContext, useEffect, useState } from 'react';\nimport { CustomBar } from '../Abstract/CutsomBar';\nimport { Loader } from '../../Loader';\nimport { formatTitleToK, formatTitleToKg } from './Filters';\nimport { BaseStoreContext, LanguageContext } from '../../../contexts';\nimport { KPI as KPIProvider } from '../../../interfaces/providers';\nimport { Currency, getDate } from '../../../helpers';\nimport { OptionInterface } from '../../Filters';\nimport { Tooltip } from 'react-bootstrap';\nimport { Tile } from '../../Tile';\nimport './kpi.scss';\nimport { useWindowSize } from '../../../hooks';\nimport { TypeSelector, TypeSelectorContext } from '../../TypeSelector';\n\ninterface KPIStateInterface {\n [key: string]: number;\n}\n\nexport const KPI: React.FC = () => {\n const { itemFiltersSelected } = useContext(BaseStoreContext);\n const { selectedLanguage, translate } = useContext(LanguageContext);\n const date = new Date();\n date.setDate(0);\n const { width } = useWindowSize();\n const [values, setValues] = useState(null);\n const { selected } = useContext(TypeSelectorContext);\n const currency = new Currency().getDecoded().label;\n\n const contract = (\n itemFiltersSelected.contract.length\n ? itemFiltersSelected.contract[0]\n : itemFiltersSelected.contract\n ) as OptionInterface;\n const isServices = contract && contract.value === true;\n\n useEffect(() => {\n const filters: {\n endDeliveryDate?: string;\n startDeliveryDate?: string;\n } = {};\n const filterDate = new Date();\n filterDate.setDate(0);\n filters.endDeliveryDate = getDate(filterDate);\n filterDate.setDate(1);\n filters.startDeliveryDate = getDate(filterDate);\n new KPIProvider({\n filters: {\n idOrganizations: itemFiltersSelected.organization,\n currencyCode: new Currency().getDecoded()?.value,\n idCompanies: itemFiltersSelected.plant,\n isService: isServices,\n role: selected,\n ...filters,\n },\n })\n .get()\n .then(setValues);\n }, [itemFiltersSelected, selected]);\n\n if (!values) {\n return ;\n }\n\n return (\n
\n \n \n {formatTitleToK(values.revenueTotal, currency)}\n
\n }\n tooltip={\n \n
\n
\n {`${translate(\n 'charts.kpi.services'\n )}`}\n \n {formatTitleToK(\n values.revenueTotal - values.revenue,\n currency\n )}\n \n
\n
\n {`${translate(\n 'charts.kpi.valorisations'\n )}`}\n \n {formatTitleToK(values.revenue, currency)}\n \n
\n
\n
\n }\n total={values.revenueTotal}\n type=\"secondary-light\"\n subtype=\"secondary\"\n label=\"kpi.revenue\"\n />\n {!isServices && (\n {formatTitleToKg(values.volume)}\n }\n label=\"kpi.volume\"\n subtype=\"blue-clear-light\"\n />\n )}\n \n
\n \n {translate('charts.kpi.services')}\n \n \n {translate('charts.kpi.valorisations')}\n \n
\n
\n \n {date.toLocaleDateString(selectedLanguage.value?.toString(), {\n month: 'long',\n year: 'numeric',\n })}\n \n
\n
\n \n );\n};\n","import { useEffect, useState } from 'react';\n\ninterface UseWindowSizeInterface {\n width: number;\n height: number;\n}\n\nexport const useWindowSize = (): UseWindowSizeInterface => {\n const [windowSize, setWindowSize] = useState({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n\n useEffect(() => {\n const handleResize = (): void => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n window.addEventListener('resize', handleResize);\n return (): void => window.removeEventListener('resize', handleResize);\n }, []); // Empty array ensures that effect is only run on mount and unmount\n\n return windowSize;\n};\n","import React, { useContext, useRef } from 'react';\nimport { Bar as ChartBar } from 'react-chartjs-2';\nimport './bar.scss';\nimport { renderToString } from 'react-dom/server';\nimport { ChartContext } from '../../../contexts';\nimport { Loader } from '../../Loader';\nimport { BarInterface } from './Bar';\nimport { Language } from '../../../helpers';\n\nconst Tooltip = (\n graph: string,\n title: string,\n value: string,\n unit: string,\n color: string\n): string => {\n const formated = value\n .split(': ')[1]\n .replaceAll(' ', '')\n .replaceAll(' ', '')\n .replace(',', '.');\n const v = parseFloat(formated).toLocaleString(new Language().get());\n return renderToString(\n
\n {graph}\n {title}\n \n {`${v}${unit}`}\n \n
\n );\n};\n\nexport const Bars: React.FC = ({\n children,\n options = {},\n type,\n}) => {\n const ref = useRef(null);\n const { data } = useContext(ChartContext);\n\n return (\n
\n
\n {children}\n {!data ? (\n \n ) : (\n
\n
\n 1,\n position: 'bottom',\n align: 'start',\n },\n tooltip: {\n enabled: false,\n external: (context): void => {\n let tooltipEl: HTMLElement | null =\n document.getElementById('chartjs-tooltip');\n\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.id = 'chartjs-tooltip';\n tooltipEl.innerHTML = '
';\n document.body.appendChild(tooltipEl);\n }\n const tooltipModel = context.tooltip;\n if (tooltipModel.opacity === 0) {\n tooltipEl.innerHTML = `
`;\n tooltipEl.style.opacity = '0';\n return;\n } else {\n const dataset =\n data.datasets[\n tooltipModel.dataPoints[0].datasetIndex\n ];\n tooltipEl.innerHTML = Tooltip(\n dataset.label,\n tooltipModel.title[0],\n tooltipModel.body[0].lines[0],\n dataset.unit ?? '',\n tooltipModel?.labelColors[0]?.backgroundColor.toString() ||\n '#77B7FC'\n );\n }\n\n tooltipEl.classList.remove(\n 'above',\n 'below',\n 'no-transform'\n );\n if (tooltipModel.yAlign) {\n tooltipEl.classList.add(tooltipModel.yAlign);\n } else {\n tooltipEl.classList.add('no-transform');\n }\n\n const position =\n context.chart.canvas.getBoundingClientRect();\n\n tooltipEl.classList.add(\n 'tooltip',\n 'shadow',\n 'bg-white',\n 'p-0'\n );\n tooltipEl.style.position = 'absolute';\n tooltipEl.style.opacity = '1';\n tooltipEl.style.left = `${\n position.left +\n window.pageXOffset +\n tooltipModel.caretX\n }px`;\n tooltipEl.style.top = `${\n position.top +\n window.pageYOffset +\n tooltipModel.caretY\n }px`;\n },\n },\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n x: {\n display: true,\n grid: {\n display: false,\n },\n position: 'top',\n },\n y: {\n beginAtZero: true,\n position: 'left',\n },\n 'y-axis-1': {\n type: 'linear',\n display: true,\n grid: {\n display: false,\n },\n beginAtZero: false,\n position: 'right',\n },\n },\n ...options,\n },\n ref,\n }}\n />\n
\n
\n )}\n
\n
\n );\n};\n","import React, { useContext } from 'react';\nimport './datepicker.scss';\nimport { formatTitleToK, TopFilters } from './Filters';\nimport { Currency } from '../../../helpers';\nimport { ChartContext } from '../../../contexts';\nimport { Bars } from '../Abstract/Bars';\n\nexport const Revenue: React.FC = () => {\n const currency = new Currency().getDecoded()?.label || '€';\n const { total } = useContext(ChartContext);\n return (\n \n formatTitleToK(value, currency),\n total,\n }}\n />\n \n );\n};\n","import React, { useContext } from 'react';\nimport { Bars } from '../Abstract/Bars';\nimport { ChartContext } from '../../../contexts';\nimport { formatTitleToKg, TopFilters } from './Filters';\n\nexport const Volume: React.FC = () => {\n const { total } = useContext(ChartContext);\n\n return (\n \n formatTitleToKg(value),\n total,\n }}\n />\n \n );\n};\n","import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { Co2Chart } from '../interfaces/providers';\nimport { Currency, getDate } from '../helpers';\nimport {\n BaseStoreContext,\n} from './BaseStoreContext';\nimport { ChartContext, DataInterface, defaultContext } from './ChartContext';\nimport { LanguageContext } from './LanguageContext';\nimport { Co2ChartInstance } from '../interfaces/model';\nimport { OptionInterface } from '../components/Filters';\nimport { TypeSelectorContext } from '../components/TypeSelector';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\n\ninterface ChartProviderInterface {\n color?: string;\n label: string;\n startDate: Date;\n endDate: Date;\n}\n\nexport const Co2ChartProvider: React.FC = ({\n children,\n color = '#aadc14',\n label,\n startDate,\n endDate,\n}) => {\n const { translate } = useContext(LanguageContext);\n const {\n itemFiltersSelected: { organization, plant, contract },\n analysis: { materials, selectedMaterials },\n dispatch,\n } = useContext(BaseStoreContext);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [total, setTotal] = useState(defaultContext.total);\n const { selected } = useContext(TypeSelectorContext);\n const finalSelectedMaterials = useMemo(\n () =>\n !materials.length || materials.length === selectedMaterials.length\n ? []\n : selectedMaterials.length\n ? selectedMaterials\n : [],\n [materials.length, selectedMaterials]\n );\n\n const filters = {\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idMaterials: finalSelectedMaterials,\n idOrganizations: organization,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n role: selected,\n startDeliveryDate,\n };\n\n const compute = (filters: any, { reset = true }) => {\n new Co2Chart({ filters }).getChart().then(({ data }) => {\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n\n const currentMonth: Co2ChartInstance = {\n label: formatLabelYearMonthUTC(year, month),\n value: 0,\n };\n\n const labels: string[] = [];\n const d: number[] = [];\n let t = 0;\n data\n .filter((item) => JSON.stringify(item) !== JSON.stringify(currentMonth))\n .forEach((item) => {\n const dateString = item.label.toLocaleDateString(navigator.language, {\n month: 'short',\n year: 'numeric',\n });\n labels.push(dateString.replace(/^./, dateString[0].toUpperCase()));\n d.push(item.value);\n t += item.value;\n });\n setTotal(t);\n setData({\n labels,\n datasets: [\n {\n label: translate(label),\n data: d,\n type: 'line',\n borderColor: color,\n backgroundColor: 'transparent',\n pointBorderColor: color,\n pointBackgroundColor: color,\n pointHoverBackgroundColor: color,\n pointHoverBorderColor: color,\n },\n ],\n });\n });\n };\n\n useEffect(() => {\n setData(undefined);\n compute({ ...filters }, { reset: true });\n }, [\n color,\n label,\n filters.currencyCode,\n filters.endDeliveryDate,\n JSON.stringify(filters.idMaterials),\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.isService,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n return (\n \n {children}\n \n );\n};\n","import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { VolumeChart } from '../interfaces/providers';\nimport { Currency, getDate } from '../helpers';\nimport {\n BaseStoreContext,\n} from './BaseStoreContext';\nimport { ChartContext, DataInterface, defaultContext } from './ChartContext';\nimport { LanguageContext } from './LanguageContext';\nimport { OptionInterface } from '../components/Filters';\nimport { TypeSelectorContext } from '../components/TypeSelector';\nimport { Co2ChartInstance } from '../interfaces';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\n\nexport interface ChartProviderInterface {\n options: { [key: string]: GraphInterface };\n}\ninterface InternalChartProviderInterface extends ChartProviderInterface {\n startDate: Date;\n endDate: Date;\n}\ninterface GraphInterface {\n color: string;\n label: string;\n sum?: boolean;\n type?: string;\n unit?: string;\n}\n\nexport const VolumeChartProvider: React.FC = ({\n children,\n options,\n startDate,\n endDate,\n}) => {\n const { translate } = useContext(LanguageContext);\n const {\n itemFiltersSelected: { organization, plant, contract },\n analysis: { materials, selectedMaterials },\n dispatch,\n } = useContext(BaseStoreContext);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [total, setTotal] = useState(defaultContext.total);\n const { selected } = useContext(TypeSelectorContext);\n const finalSelectedMaterials = useMemo(\n () =>\n !materials.length || materials.length === selectedMaterials.length\n ? []\n : selectedMaterials.length\n ? selectedMaterials\n : [],\n [materials.length, selectedMaterials]\n );\n\n const filters = {\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idMaterials: finalSelectedMaterials,\n idOrganizations: organization,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n role: selected,\n startDeliveryDate,\n };\n\n const compute = (filters: any, { reset = true }) => {\n new VolumeChart({ filters }).getChart().then(({ data }) => {\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n const currentMonth: Co2ChartInstance = {\n label: formatLabelYearMonthUTC(year, month),\n value: 0,\n };\n const labels: string[] = [];\n const datasets: any[] = [];\n let t = 0;\n data.forEach((graph) => {\n const graphOptions: GraphInterface = options[graph.type];\n if (!graphOptions) return;\n\n const d: number[] = [];\n graph.data\n .filter(\n (item) => JSON.stringify(item) !== JSON.stringify(currentMonth)\n )\n .forEach((item) => {\n let dateString = item.label.toLocaleDateString(navigator.language, {\n month: 'short',\n year: 'numeric',\n });\n dateString = dateString.replace(/^./, dateString[0].toUpperCase());\n if (!labels.includes(dateString)) {\n // Based on the fact that the api \"fill\" empty dates before returning data\n // So only first graph will add labels\n labels.push(dateString);\n }\n d.push(item.value);\n if (graphOptions.sum) t += item.value;\n });\n\n if (graphOptions.type === 'line') {\n datasets.push({\n label: translate(graphOptions.label),\n data: d,\n type: 'line',\n unit: graphOptions.unit,\n borderColor: graphOptions.color,\n backgroundColor: 'transparent',\n pointBorderColor: graphOptions.color,\n pointBackgroundColor: graphOptions.color,\n pointHoverBackgroundColor: graphOptions.color,\n pointHoverBorderColor: graphOptions.color,\n yAxisID: 'y-axis-1',\n order: 1,\n });\n } else {\n datasets.push({\n label: translate(graphOptions.label),\n backgroundColor: graphOptions.color,\n data: d,\n unit: graphOptions.unit,\n order: 2,\n });\n }\n });\n\n //datasets.reverse(); // Pour que la courbe soit devant les barres...\n\n setTotal(t);\n setData({\n labels,\n datasets,\n });\n });\n };\n\n useEffect(() => {\n setData(undefined);\n compute({ ...filters }, { reset: true });\n }, [\n options,\n filters.currencyCode,\n filters.endDeliveryDate,\n JSON.stringify(filters.idMaterials),\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.isService,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n return (\n \n {children}\n \n );\n};\n","import { Token } from '../../../helpers';\n\ntype InvoiceTypeNameType = 'AP' | 'AR';\n\nexport interface ExportAllDataInterface {\n detailsData: ExportDataInterface[];\n monthlyData: ExportDataInterface[];\n}\n\nexport interface ExportDataInterface {\n countryCode: string;\n companyLocalName: string;\n startDatePeriod: string;\n endDatePeriod: string;\n invoiceTypeName: InvoiceTypeNameType;\n materialCode: string;\n materialName: string;\n materialUnitName: string;\n isService: boolean;\n quantity?: number | null;\n volumeTeqCO2?: number | null;\n priceExcludingTax?: number | null;\n pricePerQuantity?: number | null;\n quantityPrevYear?: number | null;\n volumeTeqCO2PrevYear?: number | null;\n priceExcludingTaxPrevYear?: number | null;\n quantityEvolution?: number | null;\n volumeTeqCO2Evolution?: number | null;\n priceExcludingTaxEvolution?: number | null;\n}\n\nexport interface ExportSerializationResultInterface {\n headers: ExportHeadersInterface;\n data: ExportSerializedDataInterface[];\n detailsData: ExportSerializedDataInterface[];\n}\n\ninterface ExportHeadersInterface {\n countryCode: string;\n companyLocalName: string;\n startDatePeriod: string;\n endDatePeriod: string;\n invoiceTypeName: string;\n materialCode: string;\n materialName: string;\n materialUnitName: string;\n isService: string;\n quantity: string;\n volumeTeqCO2: string;\n priceExcludingTax: string;\n pricePerQuantity: string;\n quantityPrevYear: string;\n volumeTeqCO2PrevYear: string;\n priceExcludingTaxPrevYear: string;\n quantityEvolution: string;\n volumeTeqCO2Evolution: string;\n priceExcludingTaxEvolution: string;\n}\n\ninterface ExportSerializedDataInterface {\n countryCode: string;\n companyLocalName: string;\n startDatePeriod: string;\n endDatePeriod: string | null;\n invoiceTypeName: string;\n materialCode: string;\n materialName: string;\n materialUnitName: string;\n isService: string;\n quantity?: number | null;\n volumeTeqCO2?: number | null;\n priceExcludingTax?: number | null;\n pricePerQuantity?: number | null;\n quantityPrevYear?: number | null;\n volumeTeqCO2PrevYear?: number | null;\n priceExcludingTaxPrevYear?: number | null;\n quantityEvolution?: number | null;\n volumeTeqCO2Evolution?: number | null;\n priceExcludingTaxEvolution?: number | null;\n}\n\nexport interface ExportSerializerConstructorInterface {\n translate: (v: string) => string;\n}\n\nexport class AllSerializer {\n translate: (v: string) => string;\n\n constructor({ translate }: ExportSerializerConstructorInterface) {\n this.translate = (v: string): string => translate(`export.${v}`);\n }\n\n public serialize(\n data: ExportAllDataInterface\n ): ExportSerializationResultInterface {\n const monthlyData: ExportDataInterface[] = data.monthlyData;\n const detailsData: ExportDataInterface[] = data.detailsData;\n const monthlyColumns = Object.keys(data.monthlyData[0]) as string[];\n const detailsColumns = Object.keys(data.detailsData[0]) as string[];\n detailsColumns[2] = 'executionDate';\n const columns = [...monthlyColumns, ...detailsColumns].filter(\n (v, i, a) => a.indexOf(v) === i\n );\n\n const headers = columns.reduce((acc, column) => {\n acc[column] = this.translate('labels.' + column);\n return acc;\n }, {}) as ExportHeadersInterface;\n\n const serializedDetailsData: ExportSerializedDataInterface[] = [];\n const serializedMonthlyData: ExportSerializedDataInterface[] = [];\n\n for (let i = 0; i < monthlyData.length; i++) {\n serializedMonthlyData.push(\n columns.reduce((acc, column) => {\n const value = monthlyData[i][column];\n acc[column] = this.mapColumnValue(column, value);\n return acc;\n }, {}) as ExportSerializedDataInterface\n );\n }\n for (let i = 0; i < detailsData.length; i++) {\n serializedDetailsData.push(\n columns.reduce((acc, column) => {\n const value = detailsData[i][column];\n acc[column] = this.mapColumnValue(column, value);\n return acc;\n }, {}) as ExportSerializedDataInterface\n );\n }\n return {\n headers,\n detailsData: serializedDetailsData,\n data: serializedMonthlyData,\n };\n }\n\n private mapColumnValue(column: string, value: any): any {\n switch (column) {\n case 'startDatePeriod': {\n return new Date(value);\n }\n case 'endDatePeriod': {\n const d = new Date(value);\n d.setHours(d.getHours() - 2);\n return d;\n }\n case 'countryCode':\n return this.translate('countries.' + value);\n\n case 'invoiceTypeName':\n return this.translate('labels.' + value);\n\n case 'materialName':\n return value === 'export.labels.others'\n ? this.translate('labels.others')\n : value;\n\n case 'isService': {\n const name = value ? 'services' : 'valuations';\n return this.translate('contracts.' + name);\n }\n\n case 'priceExcludingTax':\n case 'priceExcludingTaxPrevYear':\n case 'quantity':\n case 'quantityPrevYear':\n case 'volumeTeqCO2':\n case 'volumeTeqCO2PrevYear':\n case 'pricePerQuantity':\n return Math.round((value + Number.EPSILON) * 100) / 100;\n case 'quantityEvolution':\n case 'volumeTeqCO2Evolution':\n case 'priceExcludingTaxEvolution':\n return value !== null ? value / 100 : '';\n\n default:\n return value as string;\n }\n }\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\nimport React, { useContext, useMemo, useState } from 'react';\nimport { SzButton, SzIcon } from 'react-theme-components';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport {\n AllSerializer,\n ExportSerializationResultInterface,\n} from './Export/AllSerializer';\nimport { Currency, getDate } from '../../helpers';\nimport { OptionInterface } from '../Filters';\nimport { ExportChart as ExportChartProvider } from '../../interfaces/providers';\nimport { TypeSelectorContext } from '../TypeSelector';\n\nconst XlsxTemplate = require('xlsx-template');\n\ninterface ExportOptionsInterface {\n endDate: Date;\n startDate: Date;\n}\n\ninterface PlaceholderInterface {\n placeholder: string;\n type: string;\n name: string;\n key: string;\n subType: string;\n full: boolean;\n}\n\n// https://github.com/optilude/xlsx-template/blob/752568a81d7a635ba7f9a8a7347f5e8a2c7889b3/lib/index.js#L811\n// Regex customized to skip character \" in first group\n//\n// Return a list of tokens that may exist in the string.\n// Keys are: `placeholder` (the full placeholder, including the `${}`\n// delineators), `name` (the name part of the token), `key` (the object key\n// for `table` tokens), `full` (boolean indicating whether this placeholder\n// is the entirety of the string) and `type` (one of `table` or `cell`)\nfunction extractPlaceholders(string): PlaceholderInterface[] {\n // Yes, that's right. It's a bunch of brackets and question marks and stuff.\n const re = /\\${(?:([^\"]+?):)?(.+?)(?:\\.(.+?))?(?::(.+?))??}/g;\n\n const matches: PlaceholderInterface[] = [];\n let match: RegExpExecArray | null = null;\n while ((match = re.exec(string)) !== null) {\n matches.push({\n placeholder: match[0],\n type: match[1] || 'normal',\n name: match[2],\n key: match[3],\n subType: match[4],\n full: match[0].length === string.length,\n });\n }\n\n return matches;\n}\n\nexport const ExportAllChart: React.FC = ({\n startDate,\n endDate,\n}) => {\n const {\n itemFiltersSelected: { organization, plant, contract },\n } = useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n const { selected } = useContext(TypeSelectorContext);\n const [isLoading, setIsLoading] = useState(false);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n const memoizedFilters = useMemo(\n () => ({\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idOrganizations: organization,\n role: selected,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n startDeliveryDate,\n }),\n [contract, endDeliveryDate, organization, plant, startDeliveryDate, selected]\n );\n\n const serializer = new AllSerializer({ translate });\n const today = new Date();\n\n const handleClick = () => {\n setIsLoading(true);\n window.dataLayer.push({\n event: 'sz_conversion',\n sz_conversion_type: `Export Analyse et Rapports`,\n });\n\n new ExportChartProvider({ filters: memoizedFilters })\n .getChart()\n .then((data) => {\n return serializer.serialize(data);\n })\n .then(\n (\n result: ExportSerializationResultInterface\n ): Promise<{\n result: ExportSerializationResultInterface;\n buffer: ArrayBuffer;\n }> => {\n // fetch right template : customer has saved Co2 column\n return fetch(\n '/templates/export_global_analyses.xlsx'\n )\n .then((response) => response.arrayBuffer())\n .then((buffer) => {\n return {\n result,\n buffer,\n };\n });\n }\n )\n .then(({ result, buffer }): void => {\n const template = new XlsxTemplate(buffer);\n let templateData = {\n data: result.data,\n detailsData: result.detailsData,\n };\n // template-xlsx don't support table headers of type headers.column... So map to headers_column\n templateData = (Object.keys(result.headers) as string[]).reduce(\n (acc, key) => {\n acc['headers_' + key] = result.headers[key];\n return acc;\n },\n templateData\n );\n template.substitute('Export', templateData);\n template.substitute('Export détaillé', templateData);\n\n // Update files for pivot table\n for (const file of [\n 'xl/pivotCache/pivotCacheDefinition1.xml',\n 'xl/pivotCache/pivotCacheRecords1.xml',\n 'xl/pivotTables/pivotTable1.xml',\n ]) {\n let content = template.archive.file(file).asText();\n // D'ont use builtin extractPlaceholders because of bad regex with character \" (xml files)\n extractPlaceholders(content).forEach((placeholder) => {\n const substitution = templateData[placeholder.name];\n content = content.replace(\n placeholder.placeholder,\n template.stringify(substitution)\n );\n });\n template.archive.file(file, content);\n }\n\n const xlsx = template.generate({ type: 'arraybuffer' });\n\n // Download generated xlsx file\n const link = document.createElement('a');\n link.href = window.URL.createObjectURL(new Blob([xlsx]));\n const filename = `all-${today\n .toLocaleDateString()\n .replace('/', '_')}-${today.toLocaleTimeString()}.xlsx`;\n link.setAttribute('download', filename);\n document.body.appendChild(link);\n link.click();\n setIsLoading(false);\n })\n .catch((err) => {\n setIsLoading(false);\n console.error('Error building xls file', err);\n });\n };\n\n return (\n
\n \n \n \n {translate('charts.export-all')}\n \n \n
\n );\n};\n","export interface ExportMovementDataInterface {\n detailsData: ExportDataInterface[];\n monthlyData: ExportDataInterface[];\n}\n\nexport interface ExportDataInterface {\n countryCode: string;\n companyLocalName: string;\n startDatePeriod: string;\n endDatePeriod: string;\n materialCode: string;\n materialName: string;\n materialUnitName: string;\n quantity?: number | null;\n volumeTeqCO2?: number | null;\n quantityPrevYear?: number | null;\n volumeTeqCO2PrevYear?: number | null;\n quantityEvolution?: number | null;\n volumeTeqCO2Evolution?: number | null;\n weightNoteRef?: string | null;\n}\n\nexport interface ExportSerializationResultInterface {\n headers: ExportHeadersInterface;\n data: ExportSerializedDataInterface[];\n detailsData: ExportSerializedDataInterface[];\n}\n\ninterface ExportHeadersInterface {\n countryCode: string;\n companyLocalName: string;\n startDatePeriod: string;\n endDatePeriod: string;\n materialCode: string;\n materialName: string;\n materialUnitName: string;\n quantity: string;\n volumeTeqCO2: string;\n quantityPrevYear: string;\n volumeTeqCO2PrevYear: string;\n quantityEvolution: string;\n volumeTeqCO2Evolution: string;\n weightNoteRef: string | null;\n}\n\ninterface ExportSerializedDataInterface {\n countryCode: string;\n companyLocalName: string;\n startDatePeriod: string;\n endDatePeriod?: string | null;\n materialCode: string;\n materialName: string;\n materialUnitName: string;\n quantity?: number | null;\n volumeTeqCO2?: number | null;\n quantityPrevYear?: number | null;\n volumeTeqCO2PrevYear?: number | null;\n quantityEvolution?: number | null;\n volumeTeqCO2Evolution?: number | null;\n weightNoteRef?: string | null;\n}\n\nexport interface ExportSerializerConstructorInterface {\n translate: (v: string) => string;\n}\n\nexport class MovementSerializer {\n translate: (v: string) => string;\n\n constructor({ translate }: ExportSerializerConstructorInterface) {\n this.translate = (v: string): string => translate(`export.${v}`);\n }\n\n public serialize(\n data: ExportMovementDataInterface\n ): ExportSerializationResultInterface {\n const monthlyData: ExportDataInterface[] = data.monthlyData;\n const detailsData: ExportDataInterface[] = data.detailsData;\n const monthlyColumns = Object.keys(data.monthlyData[0]) as string[];\n const detailsColumns = Object.keys(data.detailsData[0]) as string[];\n detailsColumns[2] = 'executionDate';\n const columns = [...monthlyColumns, ...detailsColumns].filter(\n (v, i, a) => a.indexOf(v) === i\n );\n\n const headers = columns.reduce((acc, column) => {\n acc[column] = this.translate('labels.' + column);\n return acc;\n }, {}) as ExportHeadersInterface;\n\n const serializedDetailsData: ExportSerializedDataInterface[] = [];\n const serializedMonthlyData: ExportSerializedDataInterface[] = [];\n\n for (let i = 0; i < monthlyData.length; i++) {\n serializedMonthlyData.push(\n columns.reduce((acc, column) => {\n const value = monthlyData[i][column];\n acc[column] = this.mapColumnValue(column, value);\n return acc;\n }, {}) as ExportSerializedDataInterface\n );\n }\n for (let i = 0; i < detailsData.length; i++) {\n serializedDetailsData.push(\n columns.reduce((acc, column) => {\n const value = detailsData[i][column];\n acc[column] = this.mapColumnValue(column, value);\n return acc;\n }, {}) as ExportSerializedDataInterface\n );\n }\n return {\n headers,\n detailsData: serializedDetailsData,\n data: serializedMonthlyData,\n };\n }\n\n private mapColumnValue(column: string, value: any): any {\n switch (column) {\n case 'startDatePeriod': {\n return new Date(value);\n }\n case 'endDatePeriod': {\n const d = new Date(value);\n d.setHours(d.getHours() - 2);\n return d;\n }\n case 'countryCode':\n return this.translate('countries.' + value);\n\n case 'materialName':\n return value === 'export.labels.others'\n ? this.translate('labels.others')\n : value;\n\n case 'quantity':\n case 'quantityPrevYear':\n case 'volumeTeqCO2':\n case 'volumeTeqCO2PrevYear':\n return Math.round((value + Number.EPSILON) * 100) / 100;\n case 'quantityEvolution':\n case 'volumeTeqCO2Evolution':\n return value !== null ? value / 100 : '';\n\n default:\n return value as string;\n }\n }\n}\n","import React, {\n createContext,\n useState,\n} from 'react';\nimport { Token } from '../../../helpers';\nimport { TypeSelectorContextInterface } from './TypeSelectorContext';\n\n\nexport const MovementTypeSelectorContext = createContext({\n selected: '',\n setSelected: () => null,\n});\n\nexport const MovementTypeSelectorProvider: React.FC = ({ children }) => {\n const roles = new Token()\n .getDecoded()\n .roles.filter((r) =>\n [ 'ROLE_MOVEMENT_CUSTOMER','ROLE_MOVEMENT_SUPPLIER'].includes(r)\n );\n const [selected, setSelected] = useState(roles[1] || '');\n\n return (\n \n {children}\n \n );\n};\n","/* eslint-disable @typescript-eslint/no-var-requires */\nimport React, { useContext, useMemo, useState } from 'react';\nimport { SzButton, SzIcon } from 'react-theme-components';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport {\n MovementSerializer,\n ExportSerializationResultInterface,\n} from './Export/MovementSerializer';\nimport { Currency, getDate } from '../../helpers';\nimport { OptionInterface } from '../Filters';\nimport { MovementExportChart as MovementExportChartProvider } from '../../interfaces/providers';\nimport { MovementTypeSelectorContext } from '../TypeSelector/context/MovementTypeSelectorContext';\n\nconst XlsxTemplate = require('xlsx-template');\n\ninterface ExportOptionsInterface {\n endDate: Date;\n startDate: Date;\n}\n\ninterface PlaceholderInterface {\n placeholder: string;\n type: string;\n name: string;\n key: string;\n subType: string;\n full: boolean;\n}\n\n// https://github.com/optilude/xlsx-template/blob/752568a81d7a635ba7f9a8a7347f5e8a2c7889b3/lib/index.js#L811\n// Regex customized to skip character \" in first group\n//\n// Return a list of tokens that may exist in the string.\n// Keys are: `placeholder` (the full placeholder, including the `${}`\n// delineators), `name` (the name part of the token), `key` (the object key\n// for `table` tokens), `full` (boolean indicating whether this placeholder\n// is the entirety of the string) and `type` (one of `table` or `cell`)\nfunction extractPlaceholders(string): PlaceholderInterface[] {\n // Yes, that's right. It's a bunch of brackets and question marks and stuff.\n const re = /\\${(?:([^\"]+?):)?(.+?)(?:\\.(.+?))?(?::(.+?))??}/g;\n\n const matches: PlaceholderInterface[] = [];\n let match: RegExpExecArray | null = null;\n while ((match = re.exec(string)) !== null) {\n matches.push({\n placeholder: match[0],\n type: match[1] || 'normal',\n name: match[2],\n key: match[3],\n subType: match[4],\n full: match[0].length === string.length,\n });\n }\n\n return matches;\n}\n\nexport const MovementExportAllChart: React.FC = ({\n startDate,\n endDate,\n}) => {\n const {\n itemFiltersSelected: { organization, plant, contract },\n } = useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n const { selected } = useContext(MovementTypeSelectorContext);\n const [isLoading, setIsLoading] = useState(false);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n const memoizedFilters = useMemo(\n () => ({\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idOrganizations: organization,\n role: selected,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n startDeliveryDate,\n }),\n [contract, endDeliveryDate, organization, plant, startDeliveryDate, selected]\n );\n\n const serializer = new MovementSerializer({ translate });\n const today = new Date();\n\n const handleClick = () => {\n setIsLoading(true);\n window.dataLayer.push({\n event: 'sz_conversion',\n sz_conversion_type: `Export Mouvements`,\n });\n\n new MovementExportChartProvider({ filters: memoizedFilters })\n .getChart()\n .then((data) => {\n return serializer.serialize(data);\n })\n .then(\n (\n result: ExportSerializationResultInterface\n ): Promise<{\n result: ExportSerializationResultInterface;\n buffer: ArrayBuffer;\n }> => {\n // fetch right template : movement has saved Co2 column\n return fetch('/templates/export_all_movement.xlsx')\n .then((response) => response.arrayBuffer())\n .then((buffer) => {\n return {\n result,\n buffer,\n };\n });\n }\n )\n .then(({ result, buffer }): void => {\n const template = new XlsxTemplate(buffer);\n let templateData = {\n data: result.data,\n detailsData: result.detailsData,\n };\n // template-xlsx don't support table headers of type headers.column... So map to headers_column\n templateData = (Object.keys(result.headers) as string[]).reduce(\n (acc, key) => {\n acc['headers_' + key] = result.headers[key];\n return acc;\n },\n templateData\n );\n template.substitute('Export', templateData);\n template.substitute('Export détaillé', templateData);\n\n // Update files for pivot table\n for (const file of [\n 'xl/pivotCache/pivotCacheDefinition1.xml',\n 'xl/pivotCache/pivotCacheRecords1.xml',\n 'xl/pivotTables/pivotTable1.xml',\n ]) {\n let content = template.archive.file(file).asText();\n // D'ont use builtin extractPlaceholders because of bad regex with character \" (xml files)\n extractPlaceholders(content).forEach((placeholder) => {\n const substitution = templateData[placeholder.name];\n content = content.replace(\n placeholder.placeholder,\n template.stringify(substitution)\n );\n });\n template.archive.file(file, content);\n }\n\n const xlsx = template.generate({ type: 'arraybuffer' });\n\n // Download generated xlsx file\n const link = document.createElement('a');\n link.href = window.URL.createObjectURL(new Blob([xlsx]));\n const filename = `all-movements-${today\n .toLocaleDateString()\n .replace('/', '_')}-${today.toLocaleTimeString()}.xlsx`;\n link.setAttribute('download', filename);\n document.body.appendChild(link);\n link.click();\n setIsLoading(false);\n })\n .catch((err) => {\n setIsLoading(false);\n console.error('Error building xls file', err);\n });\n };\n\n return (\n
\n \n \n \n {translate('charts.export-all')}\n \n \n
\n );\n};\n","import React, { useContext, useRef } from 'react';\nimport { Bar as ChartBar } from 'react-chartjs-2';\nimport './bar.scss';\nimport { ChartContext } from '../../../contexts';\nimport { Loader } from '../../Loader';\nimport { BarInterface } from './Bar';\nimport { FilterMaterials } from './FilterMaterials';\n\nexport function formatNumber(number: number) {\n if (number % 1 !== 0) {\n return new Intl.NumberFormat('fr-FR', {\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n }).format(number);\n }\n return new Intl.NumberFormat('fr-FR', {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(number);\n}\n\nexport const StackedBars: React.FC = ({\n children,\n options = {},\n type,\n}) => {\n const ref = useRef(null);\n const { data } = useContext(ChartContext);\n\n const total = (index: number) => {\n const totals = data?.datasets.map((item) => {\n return item.data[index];\n });\n return totals?.reduce(function (a, b) {\n return a + b;\n }, 0);\n };\n\n return (\n
\n
\n {children}\n {!data ? (\n \n ) : (\n
\n
\n dataset.label != 'NA'\n ).length > 0,\n position: 'bottom',\n align: 'start',\n },\n tooltip: {\n mode: 'x',\n position: 'nearest',\n callbacks: {\n title(tooltipItem: any) {\n const title = [tooltipItem[0].label];\n title.push(\n `${formatNumber(\n total(tooltipItem[0].dataIndex) ?? 0\n )} t`\n );\n return title;\n },\n label(tooltipItem: any) {\n const label = tooltipItem.dataset.label || '';\n return `${label} : ${formatNumber(\n tooltipItem.raw\n )} t`;\n },\n },\n // Title Style\n titleColor: '#030F40',\n titleFont: { size: 16, family: 'DINPro' },\n titleSpacing: 10,\n titleMarginBottom: 12,\n padding: 10,\n // Body Style\n bodyColor: '#030F40',\n bodyFont: { size: 12 },\n bodySpacing: 5,\n\n // Global Style\n backgroundColor: '#fff',\n },\n },\n scales: {\n x: {\n grid: {\n display: false,\n },\n stacked: true,\n },\n y: {\n beginAtZero: true,\n display: true,\n stacked: true,\n },\n },\n },\n ref,\n }}\n />\n
\n
\n )}\n
\n
\n );\n};\n","import React, { useContext } from 'react';\nimport { ChartContext } from '../../../contexts';\nimport { formatTitleToK, TopFilters } from './Filters';\nimport { StackedBars } from '../Abstract/StackedBars';\n\nexport const CircularEconomy: React.FC = () => {\n const { total } = useContext(ChartContext);\n\n return (\n \n formatTitleToK(value, 't'),\n total,\n }}\n />\n \n );\n};\n","import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { CircularEconomyChart } from '../interfaces/providers';\nimport { getDate } from '../helpers';\nimport {\n BaseStoreContext,\n} from './BaseStoreContext';\nimport { ChartContext, DataInterface, defaultContext } from './ChartContext';\nimport { LanguageContext } from './LanguageContext';\nimport { TypeSelectorContext } from '../components/TypeSelector';\nimport { Co2ChartInstance } from '../interfaces';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\n\nexport interface ChartProviderInterface {\n options: { [key: string]: GraphInterface };\n}\ninterface InternalChartProviderInterface extends ChartProviderInterface {\n startDate: Date;\n endDate: Date;\n}\ninterface GraphInterface {\n color: string;\n label: string;\n sum?: boolean;\n type?: string;\n unit?: string;\n}\n\nexport const CircularEconomyChartProvider: React.FC<\n InternalChartProviderInterface\n> = ({ children, options, startDate, endDate }) => {\n const { translate } = useContext(LanguageContext);\n const {\n itemFiltersSelected: { organization, plant },\n analysis: { materials, selectedMaterials },\n dispatch,\n } = useContext(BaseStoreContext);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [total, setTotal] = useState(defaultContext.total);\n const { selected } = useContext(TypeSelectorContext);\n const finalSelectedMaterials = useMemo(\n () =>\n !materials.length || materials.length === selectedMaterials.length\n ? []\n : selectedMaterials.length\n ? selectedMaterials\n : [],\n [materials.length, selectedMaterials]\n );\n\n const filters = {\n endDeliveryDate,\n idCompanies: plant,\n idMaterials: finalSelectedMaterials,\n idOrganizations: organization,\n mvtTypeCode: selected == 'ROLE_CUSTOMER' ? '02' : '01',\n role: selected,\n startDeliveryDate,\n };\n\n const compute = (filters: any, { reset = true }) => {\n new CircularEconomyChart({ filters })\n .getChart()\n .then(({ data, materials: m }) => {\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n const currentMonth: Co2ChartInstance = {\n label: formatLabelYearMonthUTC(year, month),\n value: 0,\n };\n let labels: any[] = [];\n let datasets: any[] = [];\n let t = 0;\n\n data.forEach((graph) => {\n const graphOptions: GraphInterface = options[graph.type];\n if (!graphOptions) return;\n\n const d: number[] = [];\n graph.data\n .filter(\n (item) => JSON.stringify(item) !== JSON.stringify(currentMonth)\n )\n .forEach((item) => {\n labels.push(item.label);\n d.push(item.value);\n\n if (graphOptions.sum) t += item.value;\n });\n datasets.push({\n label: translate(graphOptions.label),\n data: d,\n unit: 't',\n backgroundColor: graphOptions.color,\n });\n });\n\n labels = labels\n .map((date) => date.getTime()) //Convert Date() to be able to compare\n .filter((date, i, array) => array.indexOf(date) === i) //Remove duplicates\n .sort((a: any, b: any) => a - b) //Sort date\n .map((item) => {\n //Convert To MM. YYYY => Ex: Jan. 2023\n const dateString = new Date(item).toLocaleDateString(\n navigator.language,\n {\n month: 'short',\n year: 'numeric',\n }\n );\n return dateString.replace(/^./, dateString[0].toUpperCase());\n });\n\n if (datasets.length > 1) {\n datasets = datasets.filter((dataset) => dataset.label != 'NA');\n }\n\n // datasets.reverse(); // Pour que la courbe soit devant les barres...\n setTotal(t);\n setData({\n labels,\n datasets,\n });\n });\n };\n\n useEffect(() => {\n setData(undefined);\n compute({ ...filters }, { reset: true });\n }, [\n options,\n filters.endDeliveryDate,\n JSON.stringify(filters.idMaterials),\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.mvtTypeCode,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n return (\n \n {children}\n \n );\n};\n","/* eslint-disable @typescript-eslint/no-var-requires */\nimport React, { useContext } from 'react';\nimport { SzButton, SzIcon } from 'react-theme-components';\nimport { LanguageContext } from '../../contexts';\nimport { MixedChartContext } from '../../contexts/MixedChartContext';\nimport moment from 'moment';\n\nconst XlsxTemplate = require('xlsx-template');\n\ninterface ExportItem {\n month: string;\n material: string;\n value: number;\n}\n\nexport const ExportIndexButton: React.FC = () => {\n const { data, selectedIndex } = useContext(MixedChartContext);\n const { translate } = useContext(LanguageContext);\n\n const handleClick = () => {\n window.dataLayer.push({\n event: 'sz_conversion',\n sz_conversion_type: `Export Index`,\n });\n\n const serializeData: ExportItem[] = [];\n\n data?.datasets?.map((dataset) => {\n data?.labels?.map((month, i) => {\n serializeData.push({\n month: month,\n material: dataset.label,\n value: dataset.data[i],\n });\n });\n });\n return fetch('/templates/export_index.xlsx').then((response) => {\n response.arrayBuffer().then((buffer) => {\n const template = new XlsxTemplate(buffer);\n const values = {\n headersMonth: translate('export.index.month'),\n headersMaterials: translate('export.index.material'),\n headersValue: `${translate('export.index.value')} ${\n selectedIndex?.label\n }`,\n data: serializeData,\n };\n template.substitute(1, values);\n\n const result = template.generate({ type: 'arraybuffer' });\n const link = document.createElement('a');\n link.href = window.URL.createObjectURL(new Blob([result]));\n const day = moment(new Date()).format('YYYY-MM-DD');\n const filename = `Export_Index_${selectedIndex?.label}_${day}.xlsx`;\n link.setAttribute('download', filename);\n document.body.appendChild(link);\n link.click();\n });\n });\n };\n\n return (\n
\n \n \n \n {translate('charts.export')}\n \n \n
\n );\n};\n","import React, {\n Dispatch,\n SetStateAction,\n useContext,\n useReducer,\n useState,\n useEffect,\n useMemo,\n} from 'react';\nimport { SzDatePicker, SzAccordion } from 'react-theme-components';\nimport { Layout } from '../components/Layout';\nimport { ComponentWithTitle } from '../components/Common';\nimport { Co2, IndexValue, Revenue, Volume } from '../components/Chart/Analysis';\nimport { Currency, Token } from '../helpers';\nimport { useLogged } from '../hooks';\nimport { BaseStoreContext, ChartProvider, LanguageContext } from '../contexts';\nimport { OptionInterface } from '../components/Filters';\nimport { Co2ChartProvider } from '../contexts/Co2ChartContext';\n\nimport {\n MixedChartContext,\n MixedChartProvider,\n} from '../contexts/MixedChartContext';\nimport {\n VolumeChartProvider,\n} from '../contexts/VolumeChartContext';\nimport { TypeSelector, TypeSelectorProvider } from '../components/TypeSelector';\nimport { ExportAllChart } from '../components/Button';\nimport { FilterMaterials } from '../components/Chart';\nimport { CircularEconomy } from '../components/Chart/Analysis/CircularEconomy';\nimport { CircularEconomyChartProvider } from '../contexts/CircularEconomyChartContext';\nimport { ExportIndexButton } from '../components/Button/ExportIndexButton';\nimport { BaseChartsInterface, ChartInterface, ChartsInterface, MultiChartProviderInterface, PeriodeInterface, VolumeChartInterface } from '../interfaces/ChartInterface';\n\n\nconst volumeCharts: (MultiChartProviderInterface & BaseChartsInterface)[] = [\n {\n component: ,\n title: 'pages.analysis.volume',\n icon: 'poll',\n options: {\n Tonnages: {\n label: 'charts.volume.label',\n color: '#030f40',\n sum: true,\n unit: 't',\n },\n Unites: {\n label: 'charts.volume_units.label',\n color: '#77B7FC',\n type: 'line',\n },\n },\n },\n];\n\nconst co2Charts: ChartsInterface[] = [\n {\n component: ,\n label: 'charts.co2.label',\n title: 'pages.analysis.co2',\n icon: 'trending_up',\n },\n];\n\nconst mixedCharts: ChartsInterface[] = [\n {\n component: ,\n label: 'charts.index.label',\n title: 'pages.analysis.indexes',\n icon: 'trending_up',\n },\n];\n\nconst circularEconomyCharts: (MultiChartProviderInterface &\n BaseChartsInterface)[] = [\n {\n component: ,\n title: 'pages.analysis.circularEconomy',\n icon: 'sync',\n options: {\n Automotive: {\n label: 'charts.circularEconomy.automotive',\n color: '#FFD469',\n sum: true,\n },\n Construction: {\n label: 'charts.circularEconomy.construction',\n color: '#F89E73',\n sum: true,\n },\n Railway: {\n label: 'charts.circularEconomy.railway',\n color: '#8187A0',\n sum: true,\n },\n Recycling: {\n label: 'charts.circularEconomy.recycling',\n color: '#C4E769',\n sum: true,\n },\n Aeronotic: {\n label: 'charts.circularEconomy.aeronotic',\n color: '#77B7FC',\n sum: true,\n },\n scrapRetail: {\n label: 'charts.circularEconomy.scrapRetail',\n color: '#B4B7C6',\n sum: true,\n },\n transport: {\n label: 'charts.circularEconomy.transport',\n color: '#BBDCFD',\n sum: true,\n },\n oilAndGas: {\n label: 'charts.circularEconomy.oilAndGas',\n color: '#030F40',\n sum: true,\n },\n energy: {\n label: 'charts.circularEconomy.energy',\n color: '#AADC14',\n sum: true,\n },\n varnishesPowderPaint: {\n label: 'charts.circularEconomy.varnishesPowderPaint',\n color: '#4F5779',\n sum: true,\n },\n tractorVehicle: {\n label: 'charts.circularEconomy.tractorVehicle',\n color: '#FFC229',\n sum: true,\n },\n Other: {\n label: 'charts.circularEconomy.other',\n color: '#666666',\n sum: true,\n },\n NA: {\n label: 'NA',\n color: '#666666',\n sum: true,\n },\n },\n },\n];\n\nconst Chart: React.FC = ({\n chart,\n startDate,\n endDate,\n children,\n}) => (\n \n \n
{children}
\n
\n
\n \n);\n\nconst VolumeChart: React.FC = ({\n chart,\n startDate,\n endDate,\n children,\n}) => (\n \n \n
{children}
\n
\n
\n \n);\n\nconst Co2Chart: React.FC = ({\n chart,\n startDate,\n endDate,\n children,\n}) => {\n const { translate } = useContext(LanguageContext);\n\n const labelsLegendCO2 = [\n 'aluminiumTeqCO2',\n 'brassTeqCO2',\n 'bronzeTeqCO2',\n 'cardboardTeqCO2',\n 'castIronTeqCO2',\n 'copperTeqCO2',\n 'E1TeqCO2',\n 'E2TeqCO2',\n 'E3TeqCO2',\n 'E5TeqCO2',\n 'E6TeqCO2',\n 'E8TeqCO2',\n 'EHRTeqCO2',\n 'ferrousTeqCO2',\n 'nonferrousTeqCO2',\n 'paperTeqCO2',\n 'plasticsTeqCO2',\n 'titaniumTeqCO2',\n 'VFTeqCO2',\n ];\n\n const [activeKey, setActiveKey] = useState('1');\n const onClick = (key) => setActiveKey(key !== activeKey ? key : -1);\n\n const finalLegendCO2 = useMemo(\n () =>\n labelsLegendCO2.filter(\n (item) =>\n translate(`pages.analysis.co2.legendCO2.${item}`) !==\n `pages.analysis.co2.legendCO2.${item}`\n ),\n [labelsLegendCO2]\n );\n const indexLegend =\n Math.floor(finalLegendCO2.length / 2) + (finalLegendCO2.length % 2);\n\n return (\n \n \n
\n {children}\n
\n
\n \n {translate('pages.analysis.co2.disclaimer')}\n \n
\n
\n \n \n {[0, 1].map((i, k) => (\n
\n
    \n {finalLegendCO2.map(\n (item, key) =>\n ((i === 0 && key < indexLegend) ||\n (i === 1 && key > indexLegend - 1)) && (\n
  • \n {translate(\n `pages.analysis.co2.legendCO2.${item}`\n )}\n
  • \n )\n )}\n
\n
\n ))}\n
\n }\n eventKey=\"0\"\n onClick={onClick}\n />\n \n
\n
\n
\n \n
\n \n );\n};\n\nconst MixedChart: React.FC = ({ chart, children }) => {\n const { selectedIndex } = useContext(MixedChartContext);\n const { translate } = useContext(LanguageContext);\n\n return (\n }>\n
\n {children}\n {selectedIndex?.label === 'MMR-SteelMint-SIAM' && (\n
\n
\n \n {translate(\"pages.analysis.indexes.MMR\")}\n \n
\n
\n )}\n
\n
\n );\n};\nconst CircularEconomyChart: React.FC<\n VolumeChartInterface & PeriodeInterface\n> = ({ chart, startDate, endDate, children }) => (\n \n \n
{children}
\n
\n
\n \n);\n\nconst SET_END_DATE = \"SET_END_DATE\";\nconst SET_START_DATE = \"SET_START_DATE\";\n\ninterface ActionInterface {\n payload: SetStateAction;\n type: string;\n}\n\ninterface PeriodeStoreInterface extends PeriodeInterface {\n dispatch: Dispatch;\n}\n\nconst getLastYear = (): Date => {\n const startDate = new Date();\n startDate.setFullYear(new Date().getFullYear() - 1);\n return startDate;\n};\n\nconst defaultStore: PeriodeStoreInterface = {\n dispatch: () => {\n return;\n },\n endDate: new Date(),\n startDate: getLastYear(),\n};\n\nconst reducer = (\n state: PeriodeStoreInterface = defaultStore,\n { payload, type }: ActionInterface\n): PeriodeStoreInterface => {\n switch (type) {\n case SET_END_DATE: {\n return {\n ...state,\n endDate: payload as Date,\n };\n }\n case SET_START_DATE: {\n return {\n ...state,\n startDate: payload as Date,\n };\n }\n default:\n return state;\n }\n};\n\nexport const Analysis: React.FC = () => {\n useLogged();\n const { itemFiltersSelected } = useContext(BaseStoreContext);\n const contract = (\n itemFiltersSelected.contract.length\n ? itemFiltersSelected.contract[0]\n : itemFiltersSelected.contract\n ) as OptionInterface;\n\n const [state, dispatch] = useReducer(reducer, defaultStore);\n const { startDate, endDate } = state;\n const [showCircularChart, setShowCircularChart] = useState(false);\n const [charts, setCharts] = useState<(MultiChartProviderInterface & BaseChartsInterface)[]>([]);\n\n useEffect(() => {\n const roles = new Token().getDecoded().roles || [];\n setShowCircularChart(roles.includes(\"ROLE_CIRCULAR_ECONOMY\"));\n const options: (MultiChartProviderInterface & BaseChartsInterface)[] = [\n {\n component: ,\n title: 'pages.analysis.revenue',\n icon: 'poll',\n options: {\n Revenues: {\n label: 'charts.revenue.label',\n color: '#77B7FC',\n sum: true,\n unit: `${new Currency().getDecoded()?.label || '€'}`,\n },\n Unites: {\n label: `charts.revenue_units.${new Currency().getDecoded()?.value || 'eur'}`,\n color: '#030f40',\n type: 'line',\n unit: `${new Currency().getDecoded()?.label || '€'}/t`,\n },\n },\n },\n ];\n setCharts(options);\n }, []);\n\n return (\n \n \n
\n
\n \n dispatch({ type: SET_END_DATE, payload: v as Date }),\n onChangeStartDate: (v): void =>\n dispatch({ type: SET_START_DATE, payload: v as Date }),\n startDate,\n }}\n />\n
\n \n \n \n
\n {charts.map((chart, key) => (\n \n {chart.component}\n \n ))}\n {volumeCharts\n .filter(() => !(contract && contract.value === true))\n .map((chart, key) => (\n \n {chart.component}\n \n ))}\n {co2Charts\n .filter(() => !(contract && contract.value === true))\n .map((chart, key) => (\n \n {chart.component}\n \n ))}\n {showCircularChart &&\n circularEconomyCharts\n .filter(() => !(contract && contract.value === true))\n .map((chart, key) => (\n \n {chart.component}\n \n ))}\n {mixedCharts.map((chart, key) => (\n \n {chart.component}\n \n ))}\n
\n
\n );\n};\n","import React, {\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { MovementCo2Chart } from '../interfaces/providers';\nimport { Currency, getDate } from '../helpers';\nimport {\n BaseStoreContext,\n INIT_MOVEMENT_MATERIALS,\n SET_MOVEMENT_MATERIALS,\n} from './BaseStoreContext';\nimport { ChartContext, DataInterface, defaultContext } from './ChartContext';\nimport { LanguageContext } from './LanguageContext';\nimport { Co2ChartInstance } from '../interfaces/model';\nimport { OptionInterface } from '../components/Filters';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\nimport { MovementTypeSelectorContext } from '../components/TypeSelector/context/MovementTypeSelectorContext';\n\ninterface ChartProviderInterface {\n color?: string;\n label: string;\n startDate: Date;\n endDate: Date;\n}\n\nexport const MovementCo2ChartProvider: React.FC = ({\n children,\n color = '#aadc14',\n label,\n startDate,\n endDate,\n}) => {\n const { translate } = useContext(LanguageContext);\n const {\n itemFiltersSelected: { organization, plant, contract },\n movement: { materials, selectedMaterials },\n dispatch,\n } = useContext(BaseStoreContext);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [total, setTotal] = useState(defaultContext.total);\n const { selected } = useContext(MovementTypeSelectorContext);\n const finalSelectedMaterials = useMemo(\n () =>\n !materials.length || materials.length === selectedMaterials.length\n ? []\n : selectedMaterials.length\n ? selectedMaterials\n : [],\n [materials.length, selectedMaterials]\n );\n\n const filters = {\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idMaterials: finalSelectedMaterials,\n idOrganizations: organization,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n role: selected,\n startDeliveryDate,\n };\n\n const compute = (filters: any, { reset = true }) => {\n new MovementCo2Chart({ filters })\n .getChart()\n .then(({ data, materials: m }) => {\n if (JSON.stringify(finalSelectedMaterials) === JSON.stringify([])) {\n dispatch({\n payload: m,\n type: reset ? INIT_MOVEMENT_MATERIALS : SET_MOVEMENT_MATERIALS,\n });\n }\n\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n\n const currentMonth: Co2ChartInstance = {\n label: formatLabelYearMonthUTC(year, month),\n value: 0,\n };\n\n const labels: string[] = [];\n const d: number[] = [];\n let t = 0;\n data\n .filter(\n (item) => JSON.stringify(item) !== JSON.stringify(currentMonth)\n )\n .forEach((item) => {\n const dateString = item.label.toLocaleDateString(\n navigator.language,\n {\n month: 'short',\n year: 'numeric',\n }\n );\n labels.push(dateString.replace(/^./, dateString[0].toUpperCase()));\n d.push(item.value);\n t += item.value;\n });\n setTotal(t);\n setData({\n labels,\n datasets: [\n {\n label: translate(label),\n data: d,\n type: 'line',\n borderColor: color,\n backgroundColor: 'transparent',\n pointBorderColor: color,\n pointBackgroundColor: color,\n pointHoverBackgroundColor: color,\n pointHoverBorderColor: color,\n },\n ],\n });\n });\n };\n\n useEffect(() => {\n setData(undefined);\n compute({ ...filters }, { reset: true });\n }, [\n filters.currencyCode,\n filters.endDeliveryDate,\n JSON.stringify(filters.idMaterials),\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.isService,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n return (\n \n {children}\n \n );\n};\n","import React, {\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { MovementVolumeChart } from '../interfaces/providers';\nimport { Currency, getDate } from '../helpers';\nimport {\n BaseStoreContext,\n INIT_MOVEMENT_MATERIALS,\n SET_MOVEMENT_MATERIALS,\n} from './BaseStoreContext';\nimport { ChartContext, DataInterface, defaultContext } from './ChartContext';\nimport { LanguageContext } from './LanguageContext';\nimport { OptionInterface } from '../components/Filters';\nimport { Co2ChartInstance } from '../interfaces';\nimport { formatLabelYearMonthUTC } from '../components/Chart/Analysis/Filters';\nimport { MovementTypeSelectorContext } from '../components/TypeSelector/context/MovementTypeSelectorContext';\n\nexport interface ChartProviderInterface {\n options: { [key: string]: GraphInterface };\n}\ninterface InternalChartProviderInterface extends ChartProviderInterface {\n startDate: Date;\n endDate: Date;\n}\ninterface GraphInterface {\n color: string;\n label: string;\n sum?: boolean;\n type?: string;\n unit?: string;\n}\n\nexport const MovementVolumeChartProvider: React.FC<\n InternalChartProviderInterface\n> = ({ children, options, startDate, endDate }) => {\n const { translate } = useContext(LanguageContext);\n\n const {\n itemFiltersSelected: { organization, plant, contract },\n movement: { materials, selectedMaterials },\n dispatch,\n } = useContext(BaseStoreContext);\n const endDeliveryDate = getDate(endDate);\n const startDeliveryDate = getDate(startDate);\n\n const [data, setData] = useState(defaultContext.data);\n const [total, setTotal] = useState(defaultContext.total);\n const { selected } = useContext(MovementTypeSelectorContext);\n const finalSelectedMaterials = useMemo(\n () =>\n !materials.length || materials.length === selectedMaterials.length\n ? []\n : selectedMaterials.length\n ? selectedMaterials\n : [],\n [materials.length, selectedMaterials]\n );\n\n const filters = {\n currencyCode: new Currency().getDecoded()?.value,\n endDeliveryDate,\n idCompanies: plant,\n idMaterials: finalSelectedMaterials,\n idOrganizations: organization,\n isService: Array.isArray(contract)\n ? contract[0]\n : (contract as OptionInterface).value,\n role: selected,\n startDeliveryDate,\n };\n\n const compute = (filters: any, { reset = true }) => {\n new MovementVolumeChart({ filters })\n .getChart()\n .then(({ data, materials: m }) => {\n if (JSON.stringify(finalSelectedMaterials) === JSON.stringify([])) {\n dispatch({\n payload: m,\n type: reset ? INIT_MOVEMENT_MATERIALS : SET_MOVEMENT_MATERIALS,\n });\n }\n\n const year = new Date().getFullYear();\n const month = new Date().getMonth() + 1;\n const currentMonth: Co2ChartInstance = {\n label: formatLabelYearMonthUTC(year, month),\n value: 0,\n };\n const labels: string[] = [];\n const datasets: any[] = [];\n let t = 0;\n data.forEach((graph) => {\n const graphOptions: GraphInterface = options[graph.type];\n if (!graphOptions) return;\n\n const d: number[] = [];\n graph.data\n .filter(\n (item) => JSON.stringify(item) !== JSON.stringify(currentMonth)\n )\n .forEach((item) => {\n let dateString = item.label.toLocaleDateString(\n navigator.language,\n {\n month: 'short',\n year: 'numeric',\n }\n );\n dateString = dateString.replace(\n /^./,\n dateString[0].toUpperCase()\n );\n if (!labels.includes(dateString)) {\n // Based on the fact that the api \"fill\" empty dates before returning data\n // So only first graph will add labels\n labels.push(dateString);\n }\n d.push(item.value);\n if (graphOptions.sum) t += item.value;\n });\n\n if (graphOptions.type === 'line') {\n datasets.push({\n label: translate(graphOptions.label),\n data: d,\n type: 'line',\n unit: graphOptions.unit,\n borderColor: graphOptions.color,\n backgroundColor: 'transparent',\n pointBorderColor: graphOptions.color,\n pointBackgroundColor: graphOptions.color,\n pointHoverBackgroundColor: graphOptions.color,\n pointHoverBorderColor: graphOptions.color,\n yAxisID: 'y-axis-1',\n order: 1,\n });\n } else {\n datasets.push({\n label: translate(graphOptions.label),\n backgroundColor: graphOptions.color,\n data: d,\n unit: graphOptions.unit,\n order: 2,\n });\n }\n });\n\n //datasets.reverse(); // Pour que la courbe soit devant les barres...\n\n setTotal(t);\n setData({\n labels,\n datasets,\n });\n });\n };\n\n useEffect(() => {\n setData(undefined);\n compute({ ...filters }, { reset: true });\n }, [\n filters.currencyCode,\n filters.endDeliveryDate,\n JSON.stringify(filters.idMaterials),\n JSON.stringify(filters.idCompanies),\n JSON.stringify(filters.idOrganizations),\n filters.isService,\n filters.role,\n filters.startDeliveryDate,\n ]);\n\n return (\n \n {children}\n \n );\n};\n","import React, { useContext } from 'react';\nimport { Token } from '../../helpers';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport { ClassNameInterface } from '../../interfaces';\nimport './typeSelector.scss';\nimport { SzButton } from 'react-theme-components';\nimport { MovementTypeSelectorContext } from './context/MovementTypeSelectorContext';\n\nexport const MovementTypeSelector: React.FC = ({\n className,\n}) => {\n const t = new Token().getDecoded().roles || [];\n if (\n !(\n t.includes('ROLE_MOVEMENT_CUSTOMER') &&\n t.includes('ROLE_MOVEMENT_SUPPLIER')\n )\n ) {\n return null;\n }\n\n const { translate } = useContext(LanguageContext);\n const { selected, setSelected } = useContext(MovementTypeSelectorContext);\n const {setSelectedMaterials} = useContext(BaseStoreContext);\n\n const handleTypeSelected = (type) => {\n setSelected(type);\n setSelectedMaterials([], 'analysis');\n setSelectedMaterials([], 'movement');\n setSelectedMaterials([], 'circularEconomy');\n };\n\n return (\n
\n
\n
\n {[\n {\n label: 'customer',\n value: 'ROLE_MOVEMENT_CUSTOMER',\n },\n {\n label: 'supplier',\n value: 'ROLE_MOVEMENT_SUPPLIER',\n },\n ].map(({ label, value }, key) => (\n handleTypeSelected(value)}\n variant={selected === value ? 'primary' : 'secondary'}\n >\n {translate(`charts.typeSelector.${label}`)}\n \n ))}\n
\n
\n
\n );\n};\n","import React, { Dispatch, SetStateAction, useContext, useReducer } from 'react';\nimport { SzDatePicker } from 'react-theme-components';\nimport { Layout } from '../components/Layout';\nimport { ComponentWithTitle } from '../components/Common';\nimport { Co2, Volume } from '../components/Chart/Analysis';\nimport { getTimeOffset } from '../helpers';\nimport { useLogged } from '../hooks';\nimport { BaseStoreContext, LanguageContext } from '../contexts';\nimport { OptionInterface } from '../components/Filters';\nimport { MovementCo2ChartProvider } from '../contexts/MovementCo2ChartContext';\nimport {\n MovementVolumeChartProvider,\n} from '../contexts/MovementVolumeChartContext';\nimport { MovementExportAllChart } from '../components/Button';\nimport { FilterMaterials } from '../components/Chart';\nimport { MovementTypeSelector } from '../components/TypeSelector/MovementTypeSelector';\nimport { MovementTypeSelectorProvider } from '../components/TypeSelector/context/MovementTypeSelectorContext';\nimport { BaseChartsInterface, ChartInterface, ChartsInterface, MultiChartProviderInterface, PeriodeInterface, VolumeChartInterface } from '../interfaces/ChartInterface';\n\nconst volumeCharts: (MultiChartProviderInterface & BaseChartsInterface)[] = [\n {\n component: ,\n title: 'pages.movement.volume',\n icon: 'poll',\n options: {\n Tonnages: {\n label: 'charts.volume.label',\n color: '#030f40',\n sum: true,\n unit: 't',\n },\n Unites: {\n label: 'charts.volume_units.label',\n color: '#77B7FC',\n type: 'line',\n },\n },\n },\n];\n\nconst co2Charts: ChartsInterface[] = [\n {\n component: ,\n label: 'charts.co2.label',\n title: 'pages.movement.co2',\n icon: 'trending_up',\n },\n];\n\nconst MovementVolumeChart: React.FC<\n VolumeChartInterface & PeriodeInterface\n> = ({ chart, startDate, endDate, children }) => (\n \n \n
{children}
\n
\n
\n \n);\n\nconst MovementCo2Chart: React.FC = ({\n chart,\n startDate,\n endDate,\n children,\n}) => {\n const { translate } = useContext(LanguageContext);\n\n return (\n \n \n
\n {children}\n
\n
\n \n {translate('pages.movement.co2.disclaimer')}\n \n
\n
\n
\n
\n
\n \n );\n};\n\nconst SET_END_DATE = 'SET_END_DATE';\nconst SET_START_DATE = 'SET_START_DATE';\n\ninterface ActionInterface {\n payload: SetStateAction;\n type: string;\n}\n\ninterface PeriodeStoreInterface extends PeriodeInterface {\n dispatch: Dispatch;\n}\n\nconst getLastYear = (): Date => {\n const startDate = new Date();\n startDate.setFullYear(new Date().getFullYear() - 1);\n return startDate;\n};\n\nconst defaultStore: PeriodeStoreInterface = {\n dispatch: () => {\n return;\n },\n endDate: new Date(),\n startDate: getLastYear(),\n};\n\nconst reducer = (\n state: PeriodeStoreInterface = defaultStore,\n { payload, type }: ActionInterface\n): PeriodeStoreInterface => {\n switch (type) {\n case SET_END_DATE: {\n return {\n ...state,\n endDate: payload as Date,\n };\n }\n case SET_START_DATE: {\n return {\n ...state,\n startDate: payload as Date,\n };\n }\n default:\n return state;\n }\n};\n\nexport const Movement: React.FC = () => {\n useLogged();\n const { itemFiltersSelected } = useContext(BaseStoreContext);\n const contract = (\n itemFiltersSelected.contract.length\n ? itemFiltersSelected.contract[0]\n : itemFiltersSelected.contract\n ) as OptionInterface;\n\n const [state, dispatch] = useReducer(reducer, defaultStore);\n const { startDate, endDate } = state;\n\n return (\n \n \n
\n
\n \n dispatch({ type: SET_END_DATE, payload: v as Date }),\n onChangeStartDate: (v): void =>\n dispatch({ type: SET_START_DATE, payload: v as Date }),\n startDate,\n }}\n />\n
\n \n \n \n
\n {volumeCharts\n .filter(() => !(contract && contract.value === true))\n .map((chart, key) => (\n \n {chart.component}\n \n ))}\n {co2Charts\n .filter(() => !(contract && contract.value === true))\n .map((chart, key) => (\n \n {chart.component}\n \n ))}\n
\n
\n );\n};\n","import React from 'react';\nimport { ClassNameInterface } from '../../interfaces';\n\nexport const Card: React.FC = ({ children, className }) => (\n
{children}
\n);\n","import React, { SyntheticEvent, useContext } from 'react';\nimport { Card } from './Card';\nimport { SzIcon } from 'react-theme-components';\nimport { ClassNameInterface } from '../../interfaces';\nimport { LanguageContext } from '../../contexts';\n\ninterface EmbedCardInterface {\n image: {\n alt: string;\n src?: string;\n };\n link: string;\n onClick: (event: SyntheticEvent) => void;\n title: string;\n}\n\nexport const EmbedCard: React.FC = ({\n className,\n image,\n link,\n onClick,\n title,\n}) => {\n const { translate } = useContext(LanguageContext);\n return (\n \n
\n \n

{title}

\n
\n \n \n \n {translate('pages.catalog.item.more')}\n \n \n
\n
\n
\n );\n};\n","import React, { useContext, useState } from 'react';\nimport { MaterialInstance } from '../../interfaces/model';\nimport {\n ADD_ITEM_CATALOG,\n BaseStoreContext,\n LanguageContext,\n SET_SELECTED_ITEM,\n} from '../../contexts';\nimport { EmbedCard } from '../Card';\nimport { useHistory } from 'react-router';\nimport InfiniteScroll from 'react-infinite-scroller';\nimport { Material } from '../../interfaces/providers';\nimport { Spinner } from 'react-bootstrap';\nimport { OptionInterface } from '../Filters';\n\ninterface CatalogItemsInterface {\n materialFamilyFilterValues: OptionInterface[];\n materialSubFamilyFilterValues: OptionInterface[];\n perPage: number;\n searchMaterialFilter: string;\n}\n\nexport const CatalogItems: React.FC = ({\n materialFamilyFilterValues,\n materialSubFamilyFilterValues,\n perPage,\n searchMaterialFilter,\n}) => {\n const { push } = useHistory();\n const { catalog, loading, dispatch, itemFiltersSelected } =\n useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n const [hasMore, setHasMore] = useState(true);\n\n const loader = (\n
\n \n \n {translate(`pages.catalog.loader`)}\n \n
\n );\n\n if (loading) {\n return loader;\n }\n\n if (!catalog.length) {\n return (\n
\n \n \n {translate(`pages.catalog.no_results`)}\n \n \n
\n );\n }\n\n return (\n
\n {\n new Material({\n filters: {\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n materialFamilyFilterValues,\n materialSubFamilyFilterValues,\n searchMaterialFilter,\n page,\n perPage,\n },\n })\n .getList()\n .then(({ data }) => {\n setHasMore(data.length === perPage);\n dispatch({\n payload: data,\n type: ADD_ITEM_CATALOG,\n });\n if (data.length < perPage) {\n setHasMore(false);\n }\n });\n }}\n hasMore={hasMore}\n loader={loader}\n >\n
\n {catalog.map((item: MaterialInstance, key: number) => (\n
\n {\n event.preventDefault();\n dispatch({\n type: SET_SELECTED_ITEM,\n payload: item,\n });\n push(`/catalogs/${item.id}`);\n }}\n title={`${item.code} - ${item.name}`}\n />\n
\n ))}\n
\n \n
\n );\n};\n","import React, {\n Dispatch,\n SetStateAction,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport {\n Material,\n MaterialFamily,\n MaterialSubFamily,\n} from '../../interfaces/providers';\nimport { BaseStoreContext, SET_CATALOG } from '../../contexts';\nimport { MaterialInstance, ModelInstance } from '../../interfaces';\nimport {\n MaterialFamilyFilter,\n MaterialSubFamilyFilter,\n OptionInterface,\n ResetFilter,\n SearchFilter,\n} from '../Filters';\nimport { CatalogItems } from './CatalogItems';\nimport { AbstractProvider } from '../../interfaces/providers/abstract';\nimport { useDebounce } from '../../hooks';\nimport { Tile } from '../Tile';\n\ninterface ProviderInterface {\n provider: AbstractProvider;\n setter: Dispatch>;\n}\n\nexport const Catalog: React.FC = () => {\n const perPage = 20;\n const { dispatch, itemFiltersSelected } = useContext(BaseStoreContext);\n const [isFirstCall, setIsFirstCall] = useState(true);\n const [materialFamilyFilterValues, setMaterialFamilyFilterValues] = useState<\n OptionInterface[]\n >([]);\n const [materialSubFamilyFilterValues, setMaterialSubFamilyFilterValues] =\n useState([]);\n const [searchMaterialFilter, setSearchMaterialFilter] = useState('');\n const [materialFamily, setMaterialFamily] = useState([]);\n const [materialSubFamily, setMaterialSubFamily] = useState(\n []\n );\n const debounced = useDebounce(searchMaterialFilter, 500);\n const [providers] = useState([\n {\n provider: new MaterialFamily(),\n setter: setMaterialFamily,\n },\n ]);\n\n useEffect(() => {\n setMaterialSubFamily([]);\n setMaterialSubFamilyFilterValues([]);\n\n const options: any = {};\n\n // TODO: this should not be an OptionInterface[] but an OptionInterface\n // there is although lot of code to change to fix this properly\n if (\n materialFamilyFilterValues &&\n !Array.isArray(materialFamilyFilterValues)\n ) {\n options.filters = {\n idMaterialFamily: (materialFamilyFilterValues as OptionInterface).value,\n };\n }\n\n new MaterialSubFamily(options)\n .getList()\n .then(({ data }: { data: ModelInstance[] }) => {\n setMaterialSubFamily(\n data.map((item) => ({\n label: item.name,\n value: item.id,\n }))\n );\n });\n }, [materialFamilyFilterValues]);\n\n const resetFilters = (): void => {\n setMaterialFamilyFilterValues([]);\n setMaterialSubFamilyFilterValues([]);\n setSearchMaterialFilter('');\n };\n const callMaterialAPI = useCallback(() => {\n new Material({\n filters: {\n perPage,\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n materialFamilyFilterValues,\n materialSubFamilyFilterValues,\n searchMaterialFilter,\n },\n })\n .getList()\n .then(({ data }: { data: MaterialInstance[] }) => {\n dispatch({\n payload: { data, loading: false },\n type: SET_CATALOG,\n });\n });\n }, [\n dispatch,\n itemFiltersSelected,\n materialFamilyFilterValues,\n materialSubFamilyFilterValues,\n searchMaterialFilter,\n ]);\n\n useEffect(() => {\n providers.map((provider) =>\n provider.provider.getList().then(({ data }: { data: ModelInstance[] }) =>\n provider.setter(\n data.map((item) => ({\n label: item.name,\n value: item.id,\n }))\n )\n )\n );\n }, [providers]);\n\n useEffect(() => {\n dispatch({\n payload: { data: [], loading: true },\n type: SET_CATALOG,\n });\n callMaterialAPI();\n }, [\n callMaterialAPI,\n dispatch,\n materialFamilyFilterValues,\n materialSubFamilyFilterValues,\n ]);\n\n useMemo(() => {\n if (debounced || isFirstCall) {\n setIsFirstCall(false);\n dispatch({\n payload: { data: [], loading: true },\n type: SET_CATALOG,\n });\n callMaterialAPI();\n }\n }, [callMaterialAPI, dispatch, debounced, isFirstCall]);\n\n return (\n
\n \n
\n
\n \n
\n
\n \n
\n \n \n
\n \n
\n
\n );\n};\n","import { useEffect, useState } from 'react';\nimport { OptionInterface } from '../components/Filters';\n\nexport const useDebounce = (\n value: string | OptionInterface[],\n delay: number\n): string | OptionInterface[] => {\n const [debouncedValue, setDebouncedValue] = useState<\n string | OptionInterface[]\n >(value);\n\n useEffect((): (() => void) => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return (): void => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n};\n","import React from 'react';\nimport { Layout, ReturnToTop } from '../components/Layout';\nimport { ComponentWithTitle } from '../components/Common';\nimport { Catalog as CatalogComponent } from '../components/Catalog';\nimport { useLogged } from '../hooks';\n\nexport const Catalog: React.FC = () => {\n useLogged();\n return (\n \n \n \n \n \n \n );\n};\n","import React, { useContext, useEffect } from 'react';\nimport { Layout } from '../components/Layout';\nimport { useHistory, useRouteMatch } from 'react-router';\nimport './catalogItem.scss';\nimport { SzIcon, SzTypographie } from 'react-theme-components';\nimport {\n BaseStoreContext,\n LanguageContext,\n SET_SELECTED_ITEM,\n} from '../contexts';\nimport { Material } from '../interfaces/providers';\nimport { MaterialInstance } from '../interfaces/model';\nimport { useLogged } from '../hooks';\nimport { ComponentWithTitle } from '../components/Common';\nimport { Tile } from '../components/Tile';\nimport { Loader } from '../components/Loader';\n\nexport const CatalogItem: React.FC = () => {\n useLogged();\n const { translate } = useContext(LanguageContext);\n const { goBack } = useHistory();\n const {\n params: { id },\n } = useRouteMatch>();\n const { itemSelected, dispatch } = useContext(BaseStoreContext);\n\n useEffect(() => {\n if (!(itemSelected && id === itemSelected.id)) {\n new Material()\n .getOne({ id })\n .then(({ data }: { data: MaterialInstance }) =>\n dispatch({\n payload: data,\n type: SET_SELECTED_ITEM,\n })\n );\n }\n }, [dispatch, id, itemSelected]);\n\n return (\n \n \n
\n \n
\n \n \n goBack()}\n >\n {' '}\n \n {translate('pages.catalogItem.back')}\n \n \n \n \n
\n {!itemSelected ? (\n
\n \n
\n ) : (\n <>\n
\n \n {itemSelected.name}\n \n \n {itemSelected.code}\n \n
\n
\n \n {(\n itemSelected?.materialFamily?.name || ''\n ).toUpperCase()}\n |\n {(\n itemSelected?.materialSubFamily?.name || ''\n ).toUpperCase()}\n \n \n {itemSelected.description}\n \n
\n
\n {itemSelected?.photos?.map((p, k) => (\n \n )) || (\n \n )}\n
\n \n )}\n
\n
\n
\n
\n \n
\n );\n};\n","import React, {\n Dispatch,\n MutableRefObject,\n ReactElement,\n SyntheticEvent,\n useContext,\n useState,\n useRef,\n} from 'react';\nimport { FieldInterface } from './Field';\nimport { Link, useHistory } from 'react-router-dom';\nimport {\n FormContext,\n FormProvider,\n LanguageContext,\n SET_ERROR,\n SET_LOADING,\n SET_SUCCESS,\n SET_VALUE,\n} from '../../contexts';\nimport { SzAlert, SzButton, SzInput, SzTextArea } from 'react-theme-components';\nimport './form.scss';\nimport Recaptcha from 'react-recaptcha';\n\nexport interface LinkInterface {\n label: string;\n path: string;\n}\n\nexport interface BaseFormInterface {\n additionalLinks?: LinkInterface[];\n alertsTop?: boolean;\n back?: boolean;\n buttonContent?: ReactElement;\n buttonText?: string;\n keepButton?: boolean;\n submitForm?: (\n e: any, // eslint-disable-line\n ref: MutableRefObject\n ) => Promise;\n successMessage?: string;\n validate?: (ref: MutableRefObject) => boolean;\n withRecaptcha?: boolean;\n}\n\nexport interface FormInterface extends BaseFormInterface {\n fields: FieldInterface[];\n}\n\nexport const jsonToFormData = (\n element: any /*eslint-disable-line*/\n): FormData => {\n const fd = new FormData();\n Object.keys(element).forEach((e) => fd.append(e, element[e])); // eslint-disable-line\n return fd;\n};\n// eslint-disable-line\nexport const formatformToJson = (\n elements: any /*eslint-disable-line*/\n): any /*eslint-disable-line*/ => {\n const formData = new FormData(elements);\n return Object.fromEntries(formData);\n};\n\nexport interface BaseInputInterface {\n field: FieldInterface;\n}\n\nconst Field: React.FC = ({ field }) => {\n const { translate } = useContext(LanguageContext);\n const { dispatch, isLoading, values } = useContext(FormContext);\n return (\n
\n
\n {'textarea' === field.type ? (\n ): void => {\n dispatch({\n payload: {\n name: field.name,\n value: event.currentTarget.value,\n },\n type: SET_VALUE,\n });\n return;\n }}\n />\n ) : (\n {\n dispatch({\n payload: {\n name: field.name,\n value: target.value,\n },\n type: SET_VALUE,\n });\n return;\n }}\n label={\n field.label && translate(`forms.fields.${field.label}.label`)\n }\n labelClassName=\"d-block position-relative required\"\n required\n disabled={isLoading}\n icon={field.icon}\n placeholder={translate(\n `forms.fields.${field.placeholder}.placeholder`\n )}\n />\n )}\n
\n
\n );\n};\n\ninterface FormPropertiesInterface {\n onSubmit: (event: SyntheticEvent) => void;\n ref: MutableRefObject;\n}\n\ninterface InnerFormPropertiesInterface extends BaseFormInterface {\n dispatch: Dispatch; // eslint-disable-line\n recaptchaRef: Recaptcha | null;\n ref: MutableRefObject;\n withRecaptcha?: boolean;\n setCaptchaOk?: any;\n}\n\nfunction noop() {} // eslint-disable-line\n\nfunction resetRecaptchaIfNeeded({ recaptchaRef, values }: any): Promise {\n if (recaptchaRef && !values['g-recaptcha-response']) {\n return Promise.reject(new Error('No captcha.'));\n }\n\n return Promise.resolve(values);\n}\n\nconst formProperties = ({\n dispatch,\n recaptchaRef,\n ref,\n submitForm,\n validate,\n setCaptchaOk,\n}: InnerFormPropertiesInterface): FormPropertiesInterface => {\n return {\n onSubmit: (event: SyntheticEvent): void => {\n event.preventDefault();\n dispatch({\n type: 'SET_LOADING',\n payload: true,\n });\n const values = formatformToJson(event.target);\n\n if (validate && !validate(ref)) {\n dispatch({\n type: SET_LOADING,\n payload: false,\n });\n return;\n }\n\n resetRecaptchaIfNeeded({ recaptchaRef, values })\n .then((values: any) => {\n if (!submitForm) {\n return Promise.resolve();\n }\n\n return submitForm(values, ref);\n })\n .then(() => {\n dispatch({ type: SET_SUCCESS });\n Object.keys(values).forEach((name: string) =>\n dispatch({\n payload: {\n name,\n value: '',\n },\n type: SET_VALUE,\n })\n );\n })\n .catch((err: Error) => {\n console.error('An error occured while submitting the form', err);\n dispatch({ type: SET_ERROR });\n })\n .finally(() => {\n recaptchaRef?.reset();\n setCaptchaOk(false);\n dispatch({\n type: SET_LOADING,\n payload: false,\n });\n });\n },\n ref,\n };\n};\n\ninterface AlertsInterface {\n error: boolean;\n isLoading: boolean;\n success: boolean;\n successMessage?: string;\n}\n\nconst Alerts: React.FC = ({\n error,\n isLoading,\n success,\n successMessage,\n}) => {\n const { translate } = useContext(LanguageContext);\n\n return !isLoading && error ? (\n
\n {translate(`forms.errorMessage`)}\n
\n ) : successMessage && !isLoading && success ? (\n
\n \n {translate(`forms.${successMessage}.successMessage`)}\n \n
\n ) : null;\n};\n\nlet hasCaptcha = false;\n\nconst BaseForm: React.FC = ({\n additionalLinks,\n alertsTop = true,\n back = false,\n buttonContent,\n buttonText,\n children,\n keepButton = false,\n successMessage,\n withRecaptcha,\n ...rest\n}) => {\n const { selectedLanguage, translate } = useContext(LanguageContext);\n const { dispatch, error, isLoading, success } = useContext(FormContext);\n const [recaptchaRef, setRecaptchaRef] = useState(null);\n const [captchaOk, setCaptchaOk] = useState(false);\n const { goBack, push } = useHistory();\n const ref = useRef();\n const formProps = formProperties({\n dispatch,\n ref: ref as MutableRefObject,\n recaptchaRef,\n withRecaptcha,\n setCaptchaOk,\n ...rest,\n });\n\n setTimeout(() => {\n if (withRecaptcha && !hasCaptcha && recaptchaRef) {\n (recaptchaRef as any)._renderGrecaptcha();\n }\n }, 1000);\n\n return (\n
\n {alertsTop ? (\n \n ) : null}\n {!success && children}\n
\n {!keepButton && success ? (\n push('/')}\n variant=\"secondary\"\n >\n arrow_back{' '}\n {translate('forms.returnToHome')}\n \n ) : (\n <>\n {back && (\n
\n goBack()}\n variant=\"secondary\"\n >\n \n arrow_back\n \n \n
\n )}\n {\n if (withRecaptcha && recaptchaRef && !captchaOk) {\n event.preventDefault();\n recaptchaRef.execute();\n return false;\n }\n\n return;\n },\n }}\n >\n {buttonContent\n ? buttonContent\n : translate(`forms.submit.${buttonText || 'classic'}`)}\n \n \n )}\n
\n {additionalLinks ? (\n
\n {additionalLinks.map(\n (additionalLink: LinkInterface, index: number) => (\n \n {translate(`forms.${additionalLink.label}.additionalLink`)}\n \n )\n )}\n
\n ) : (\n ''\n )}\n {!alertsTop ? (\n \n ) : null}\n {withRecaptcha ? (\n
\n {\n setCaptchaOk(true);\n if (ref && ref.current) {\n const button = ref.current.querySelector(\n 'button[type=\"submit\"]'\n ) as unknown as any;\n if (button) {\n button.click();\n }\n }\n }}\n sitekey={process.env.REACT_APP_RECAPTCHA_KEY}\n onloadCallback={() => {\n hasCaptcha = true;\n }}\n />\n
\n ) : null}\n \n );\n};\n\nexport const Form: React.FC = ({ fields, ...rest }) => (\n \n \n {fields.map((field: FieldInterface, key: number) => (\n \n ))}\n \n \n);\n","import { ClassNameInterface } from '../../interfaces';\n\nexport interface FieldInterface extends ClassNameInterface {\n icon?: string;\n label?: string;\n name: string;\n placeholder?: string;\n type?: 'textarea' | 'number' | 'text' | 'email' | 'password';\n}\n\nexport const email = (className?: string): FieldInterface => ({\n className,\n name: 'email',\n label: 'email',\n placeholder: 'email',\n type: 'email',\n});\n\nexport const firstname = (className?: string): FieldInterface => ({\n className,\n name: 'firstname',\n placeholder: 'firstname',\n});\n\nexport const lastname = (className?: string): FieldInterface => ({\n className,\n name: 'lastname',\n placeholder: 'lastname',\n});\n\nexport const password = (className?: string): FieldInterface => ({\n className,\n name: 'password',\n label: 'password',\n placeholder: 'password',\n type: 'password',\n icon: 'login-keys',\n});\n\nexport const newPassword = (className?: string): FieldInterface => ({\n ...password(className),\n name: 'password',\n label: 'newPassword',\n placeholder: 'newPassword',\n});\n\nexport const confirmPassword = (className?: string): FieldInterface => ({\n ...password(className),\n name: 'confirmPassword',\n label: 'confirmPassword',\n placeholder: 'confirmPassword',\n});\n\nexport const username = (className?: string): FieldInterface => ({\n className,\n name: 'username',\n label: 'email',\n placeholder: 'email',\n type: 'email',\n});\n\nexport const messageHeader = (className?: string): FieldInterface => ({\n className,\n name: 'messageHeader',\n label: 'messageHeader',\n placeholder: 'messageHeader',\n});\n\nexport const messageBody = (className?: string): FieldInterface => ({\n className,\n name: 'messageBody',\n label: 'messageBody',\n placeholder: 'messageBody',\n type: 'textarea',\n});\n","import React from 'react';\nimport { Form } from './Form';\nimport { messageBody, messageHeader } from './Field';\nimport { Contact as ContactAction } from '../../actions';\nimport { Username } from '../../helpers';\n\nexport const Contact: React.FC = () => {\n return (\n => {\n return new ContactAction().send({\n data: { ...data, email: new Username().get() },\n });\n }}\n successMessage=\"contact\"\n />\n );\n};\n","import React, { useEffect, useState } from 'react';\nimport {\n Currency as CurrencyProvider,\n Preference as PreferenceProvider,\n} from '../../actions';\nimport { OptionInterface, SelectFilter } from '../Filters';\nimport { Currency as CurrencyHelper, Preference } from '../../helpers';\nimport { CurrencyInterface, PreferenceInterface } from '../../interfaces';\n\nexport const Currency: React.FC = () => {\n const currencyHelper = new CurrencyHelper();\n const [currencies, setCurrencies] =\n useState<(OptionInterface & CurrencyInterface)[]>();\n const [currency, setCurrency] = useState(\n currencyHelper.getDecoded()\n ? currencyHelper.getDecoded()\n : { label: 'EUR €', value: 'eur' }\n );\n const updateCurrency = (currency: OptionInterface): void => {\n const label = currency.label.split(' ');\n currency = {\n ...currency,\n label: label.length > 1 ? label[1] : label[0],\n };\n setCurrency(currency);\n currencyHelper.setDecoded(currency as CurrencyInterface);\n new PreferenceProvider().update({\n data: {\n currency: (currency as CurrencyInterface)['@id'],\n },\n id: (new Preference().getDecoded() as PreferenceInterface)['@id'],\n });\n };\n useEffect(() => {\n new CurrencyProvider().get().then((values) =>\n setCurrencies(\n values.map(\n (value) =>\n ({\n ...(value as CurrencyInterface),\n label: `${(value.value as string).toUpperCase()} ${value.label}`,\n value: value.value,\n } as OptionInterface & CurrencyInterface)\n )\n )\n );\n }, []);\n\n return (\n \n );\n};\n","import React, { useContext } from 'react';\nimport { OptionInterface, SelectFilter } from '../Filters';\nimport { Language as LanguageLS, Preference } from '../../helpers';\nimport { LanguageContext } from '../../contexts';\nimport { Preference as PreferenceProvider } from '../../actions';\nimport { PreferenceInterface } from '../../interfaces';\n\nexport const Language: React.FC = () => {\n const { languages, selectedLanguage, setSelectedLanguage } =\n useContext(LanguageContext);\n const updateLanguage = (option: OptionInterface): void => {\n setSelectedLanguage(option);\n new LanguageLS().set(option.value as string);\n new PreferenceProvider().update({\n data: {\n language: option.value,\n },\n id: (new Preference().getDecoded() as PreferenceInterface)['@id'],\n });\n };\n\n return (\n \n );\n};\n","import React, { MutableRefObject, SyntheticEvent, useContext } from 'react';\nimport { Form, jsonToFormData } from './Form';\nimport { password, username } from './Field';\nimport { User } from '../../actions';\nimport {\n BaseStoreContext,\n SET_ITEM_FILTERS_SELECTED,\n SET_OPEN_FILTERS,\n UserContext,\n LanguageContext,\n INIT_ANALYSIS_MATERIALS,\n INIT_MOVEMENT_MATERIALS,\n} from '../../contexts';\nimport { useHistory } from 'react-router';\nimport { Language } from '../../helpers';\n\nexport const Login: React.FC = () => {\n const { goBack } = useHistory();\n const { dispatch } = useContext(UserContext);\n const { languages, selectedLanguage, setSelectedLanguage } =\n useContext(LanguageContext);\n const baseStore = useContext(BaseStoreContext);\n\n return (\n ,\n ref: MutableRefObject<{ reset: () => void }>\n ): Promise => {\n baseStore.dispatch({\n payload: {\n organization: [],\n plant: [],\n contract: [],\n },\n type: SET_ITEM_FILTERS_SELECTED,\n });\n baseStore.dispatch({\n payload: [],\n type: INIT_ANALYSIS_MATERIALS,\n });\n baseStore.dispatch({\n payload: [],\n type: INIT_MOVEMENT_MATERIALS,\n });\n baseStore.dispatch({\n type: SET_OPEN_FILTERS,\n payload: false,\n });\n\n return new User()\n .login({\n data: jsonToFormData(data),\n ref,\n updateClient: dispatch,\n })\n .then(() => {\n const userLanguage = new Language().get();\n const lang = languages.find(({ value }) => value === userLanguage);\n if (selectedLanguage.value !== userLanguage && lang) {\n setSelectedLanguage(lang);\n }\n goBack();\n });\n }}\n withRecaptcha\n />\n );\n};\n","import React, { useContext } from 'react';\nimport { SzTypographie } from 'react-theme-components';\nimport './passwordValidationBlock.scss';\nimport { LanguageContext } from '../../../contexts';\n\nconst requirements: string[] = ['length', 'upper', 'lower', 'digit', 'special'];\n\nexport const PasswordValidationBlock: React.FC = () => {\n const { translate } = useContext(LanguageContext);\n const t = (value: string): string =>\n translate(`forms.password.conditions.${value}`);\n return (\n
\n
\n \n {t('title')}\n \n \n {requirements.map((requirement, index) => (\n

\n {t(`contains.${requirement}`)}\n

\n ))}\n
\n
\n
\n );\n};\n","import React, { MutableRefObject, useContext, useState } from 'react';\nimport { User } from '../../../actions';\nimport { confirmPassword, newPassword } from '../Field';\nimport { Form } from '../Form';\nimport { useRouteMatch, useLocation } from 'react-router';\nimport { LanguageContext } from '../../../contexts';\nimport { validatePassword } from './PasswordValidator';\nimport { PasswordValidationBlock } from './PasswordValidationBlock';\n\nexport const ResetPasswordApplyForm: React.FC = () => {\n const { translate } = useContext(LanguageContext);\n const { search } = useLocation();\n const { params } = useRouteMatch<{ token: string }>();\n const fields = [newPassword(), confirmPassword()];\n const [hasError, setHasError] = useState(false);\n return (\n <>\n {hasError && (\n
\n {translate(`forms.changePassword.invalid`)}\n
\n )}\n {\n const isValidated = validatePassword(ref, fields);\n setHasError(!isValidated);\n return isValidated;\n }}\n submitForm={(\n data: any, // eslint-disable-line\n ref: MutableRefObject<{ reset: () => void }>\n ): Promise => {\n return new User().resetPasswordApply({\n data: {\n ...data,\n email: new URLSearchParams(search).get('username'),\n token: params.token,\n },\n ref,\n });\n }}\n successMessage=\"resetPasswordApply\"\n />\n \n \n );\n};\n","import { MutableRefObject } from 'react';\nimport { FieldInterface } from '../Field';\n\nexport const validatePassword = (\n ref: MutableRefObject,\n fields: FieldInterface[]\n): boolean => {\n if (ref.current[fields[0].name].value !== ref.current[fields[1].name].value) {\n return false;\n }\n\n const strongRegex = new RegExp(\n '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})'\n );\n if (!ref.current[fields[0].name].value.match(strongRegex)) {\n return false;\n }\n\n return true;\n};\n","import React, { MutableRefObject, useContext } from 'react';\nimport { SzIcon, SzTypographie } from 'react-theme-components';\nimport { Form } from '../Form';\nimport { User } from '../../../actions';\nimport { email } from '../Field';\nimport { LanguageContext, UserContext } from '../../../contexts';\n\nexport const ResetPasswordRequestForm: React.FC = () => (\n void }>\n ): Promise => {\n return new User().resetPasswordRequest({ data, ref });\n }}\n successMessage=\"resetPasswordRequest\"\n withRecaptcha\n />\n);\n\nexport const ResetPasswordForCurrentUserRequestForm: React.FC = () => {\n const { username } = useContext(UserContext);\n const { translate } = useContext(LanguageContext);\n\n return (\n \n \n \n {translate('forms.password.reset.label')}\n \n \n }\n fields={[]}\n keepButton={true}\n submitForm={(\n data: FormData,\n ref: MutableRefObject<{ reset: () => void }>\n ): Promise => {\n data['email'] = username ?? '';\n return new User().resetPasswordRequest({ data, ref });\n }}\n successMessage=\"password.reset\"\n withRecaptcha\n />\n );\n};\n","import React, { useContext } from 'react';\nimport { Layout } from '../components/Layout';\nimport { Contact as ContactForm } from '../components/Form';\nimport { SzTypographie } from 'react-theme-components';\nimport { LanguageContext } from '../contexts';\nimport { useLogged } from '../hooks';\nimport { ComponentWithTitle } from '../components/Common';\n\nexport const Contact: React.FC = () => {\n useLogged();\n const { translate } = useContext(LanguageContext);\n return (\n \n \n
\n \n {translate('pages.contact.description')}\n \n \n
\n
\n
\n );\n};\n","import React, { useContext } from 'react';\nimport { ComponentWithTitle } from '../../components/Common';\nimport { SzTypographie } from 'react-theme-components';\nimport { useNotLogged } from '../../hooks';\nimport { LanguageContext } from '../../contexts';\nimport { LayoutBase } from '../../components/Layout';\n\ninterface CommonResetPasswordInterface {\n title: string;\n}\n\nexport const CommonResetPassword: React.FC = ({\n children,\n title,\n}) => {\n useNotLogged();\n const { translate } = useContext(LanguageContext);\n return (\n \n
\n
\n \n
\n \n {translate(`pages.${title}.description`)}\n \n {children}\n
\n
\n
\n
\n
\n );\n};\n","import React, { useContext } from 'react';\nimport { Layout } from '../../components/Layout';\nimport { ComponentWithTitle } from '../../components/Common';\nimport { Tile } from '../../components/Tile';\nimport {\n Currency,\n Language,\n ResetPasswordForCurrentUserRequestForm,\n} from '../../components/Form';\nimport { Company, Organization, sprintf, Username } from '../../helpers';\nimport { LanguageContext } from '../../contexts';\nimport { CompanyInstance, OrganizationInstance } from '../../interfaces/model';\nimport { ClassNameInterface } from '../../interfaces';\nimport { useLogged } from '../../hooks';\n\ninterface AccountItemsInnerInterface {\n company: CompanyInstance;\n organization: OrganizationInstance;\n translate: (value: string) => string;\n}\n\ninterface AccountItemsOuterInterface {\n children: JSX.Element;\n title: string;\n}\n\nconst accountItems = ({\n company,\n organization,\n translate,\n}: AccountItemsInnerInterface): AccountItemsOuterInterface[] => [\n {\n children: (\n <>\n
    \n
  • \n mail\n \n {' '}\n {translate('pages.account.email')}: {new Username().get()}\n \n
  • \n {company && (\n
  • \n business\n \n {' '}\n {sprintf(translate(`filters.bar.plant`), [company.name])}\n \n
  • \n )}\n {organization && (\n
  • \n business\n \n {' '}\n {sprintf(translate(`filters.bar.organization`), [\n organization.name,\n ])}\n \n
  • \n )}\n
\n \n \n ),\n title: 'pages.account.informations',\n },\n {\n children: ,\n title: 'pages.account.language',\n },\n {\n children: ,\n title: 'pages.account.currency',\n },\n];\n\nconst AccountItem: React.FC = ({\n children,\n className,\n title,\n}) => {\n const { translate } = useContext(LanguageContext);\n return (\n \n

{translate(title)}

\n {children}\n
\n );\n};\n\nexport const Account: React.FC = () => {\n const { translate } = useContext(LanguageContext);\n const company = new Company().getDecoded();\n const organization = new Organization().getDecoded();\n useLogged();\n return (\n \n \n
\n {accountItems({ company, organization, translate }).map(\n (item, index) => (\n 0 && 'mt-3'}`}\n {...item}\n key={index}\n />\n )\n )}\n
\n \n
\n );\n};\n","import React, { useContext } from 'react';\nimport { Layout } from '../components/Layout';\nimport { ComponentWithTitle } from '../components/Common';\nimport { KPI } from '../components/Chart/Analysis';\nimport { useLogged } from '../hooks';\nimport { LanguageContext, UserContext } from '../contexts';\nimport { Tile } from '../components/Tile';\nimport { TypeSelectorProvider } from '../components/TypeSelector';\n\nexport const Welcome: React.FC = () => {\n useLogged();\n const { translate } = useContext(LanguageContext);\n const { isLogged } = useContext(UserContext);\n return (\n \n \n
\n
\n \n \n {translate('pages.welcome.overview.description')}\n \n \n
\n {isLogged ? (\n
\n \n \n \n
\n ) : null}\n
\n
\n
\n );\n};\n","import React, { useState, useEffect, useContext } from 'react';\nimport { LanguageContext } from '../../contexts';\n\n/**\n * We use react-table lib because the native Suez Design System\n * Component (SDS) does not provide the functionalities we want\n * The react-table lib is cool, but with TYPESCRIPT, we have\n * a lot of problem, so we use JS files\n */\nfunction TableColumnFilter({\n // eslint-disable-next-line react/prop-types\n column: { setFilter },\n}) {\n const { translate } = useContext(LanguageContext);\n const [value, setValue] = useState('');\n\n useEffect(() => {\n const timer = setTimeout(() => setFilter(value), 1000);\n return () => clearTimeout(timer);\n }, [value]);\n\n return (\n <>\n {\n setValue(e.target.value || undefined);\n }}\n />\n \n );\n}\n\nexport default TableColumnFilter;\n","import React, { useContext } from 'react';\n// import { useTranslation } from 'react-i18next'\nimport { LanguageContext } from '../../contexts';\n\n/* eslint-disable react/prop-types */\n/* eslint-disable no-shadow */\n/**\n * We use react-table lib because the native Suez Design System\n * Component (SDS) does not provide the functionalities we want\n * The react-table lib is cool, but with TYPESCRIPT, we have\n * a lot of problem, so we use JS files\n */\nfunction TablePagination({\n pageIndex,\n pageCount,\n pageSize,\n pageOptions,\n canPreviousPage,\n canNextPage,\n gotoPage,\n nextPage,\n previousPage,\n setPageSize,\n}) {\n const { translate } = useContext(LanguageContext);\n return (\n
\n
\n gotoPage(0)}\n disabled={!canPreviousPage}\n >\n {'<<'}\n {' '}\n previousPage()}\n disabled={!canPreviousPage}\n >\n {'<'}\n {' '}\n \n {pageIndex + 1} {pageCount ? `/ ${pageCount}` : ''}\n \n nextPage()}\n disabled={!canNextPage}\n >\n {'>'}\n {' '}\n gotoPage(pageCount - 1)}\n disabled={!canNextPage}\n >\n {'>>'}\n {' '}\n
\n
\n

{translate('table.label.linesPerPage')}

\n
\n
\n {\n setPageSize(Number(e.target.value));\n }}\n >\n {[10, 20, 30, 40, 50].map((pageSize) => (\n \n ))}\n \n
\n
\n );\n}\n\nexport default TablePagination;\n","/* eslint-disable no-param-reassign */\n/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable no-return-assign */\n/* eslint-disable react/jsx-key */\n/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable no-nested-ternary */\n/* eslint-disable no-use-before-define */\n/* eslint-disable react/display-name */\n/* eslint-disable react/prop-types */\n/* eslint-disable no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React, { useMemo, useEffect, useCallback, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n useTable,\n useSortBy,\n useFilters,\n useRowSelect,\n usePagination,\n actions,\n} from 'react-table';\nimport { Spinner } from 'react-bootstrap';\n\nimport TableColumnFilter from './TableColumnFilter';\nimport TablePagination from './TablePagination';\nimport { SzIcon } from 'react-theme-components';\nimport './_table.scss';\nimport './_table-pagination.scss';\n\n/**\n * We use react-table lib because the native Suez Design System\n * Component (SDS) does not provide the functionalities we want\n * The react-table lib is cool, but with TYPESCRIPT, we have\n * a lot of problem, so we use JS files\n */\nfunction Table({\n type,\n columns,\n data,\n disabledList = [],\n disabledColumnActionsList = [],\n paginationDisplayed = true,\n // These are wrong\n checkedList = [],\n onSelectedItemChanged = (id) => {},\n onCheckAll = (itemIds) => {},\n // Use this instead:\n onSelectionChange = null,\n onPageChange = (page) => {},\n pageCount = 0,\n headerVisible = true,\n resultPerPage = `${process.env.REACT_APP_TABLE_DEFAULT_RESULT_PER_PAGE}`,\n onSortTableChange = (order) => {},\n initialFilters = [],\n onFiltersChange = (filters) => {},\n nbPerPage = 10,\n onNbPerPageChange = (pageSize) => {},\n isLoading = true,\n isInternalPagination = false,\n initialSortBy = [],\n resetOrgaInsti = false,\n forceReset = false,\n currentPage = 0,\n manualPagination = true,\n autoResetPage = true,\n embeddedFilter = false,\n autoResetSort = true,\n withFilters = true,\n}) {\n const defaultColumn = useMemo(\n () => ({\n Filter: TableColumnFilter,\n }),\n []\n );\n\n function checkedArrayToObject(checkedArray) {\n return checkedArray.reduce((acc, curr) => {\n acc[curr] = true;\n return acc;\n }, {});\n }\n\n let useSwitchStateManagement = (state) => ({ ...state });\n if (!onSelectionChange) {\n // TODO remove this and improve checkbox selection everywhere using the state selectedRowIds instead...\n const useStateMemo = (state) => {\n return useMemo(\n () => ({\n ...state,\n selectedRowIds: { ...checkedArrayToObject(checkedList) },\n }),\n [checkedList]\n );\n };\n // TODO remove this and improve checkbox selection everywhere using the state selectedRowIds instead...\n useSwitchStateManagement = (state) => {\n const memoValue = useStateMemo(state);\n return paginationDisplayed\n ? {\n ...state,\n selectedRowIds: { ...checkedArrayToObject(checkedList) },\n }\n : memoValue;\n };\n }\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n prepareRow,\n page,\n canPreviousPage,\n canNextPage,\n pageOptions,\n gotoPage,\n nextPage,\n previousPage,\n setPageSize,\n allColumns,\n setAllFilters,\n dispatch,\n rows,\n state: { pageIndex, pageSize, sortBy, filters, selectedRowIds },\n } = useTable(\n {\n columns,\n defaultColumn,\n data,\n autoResetSelectedRows: forceReset,\n manualPagination,\n manualSortBy: !embeddedFilter,\n pageCount,\n autoResetPage,\n autoResetFilters: false,\n autoResetSortBy: autoResetSort,\n defaultFilters: embeddedFilter,\n manualFilters: !embeddedFilter,\n getRowId: useCallback((row) => row.id, []),\n useControlledState: (state) => useSwitchStateManagement(state),\n initialState: {\n filters: initialFilters,\n pageSize: nbPerPage,\n sortBy: initialSortBy,\n pageIndex: currentPage,\n },\n },\n useFilters,\n useSortBy,\n usePagination,\n useRowSelect,\n (hooks) => {\n hooks.visibleColumns.push((columnsData) => [\n {\n id: 'selection',\n Header: ({ getToggleAllRowsSelectedProps }) => (\n
\n {onSelectionChange ? (\n \n ) : (\n onCheckAll(page.map(({ id }) => id))}\n />\n )}\n
\n ),\n Cell: ({ row }) => (\n
\n {onSelectionChange ? (\n \n ) : (\n onSelectedItemChanged(row.id)}\n />\n )}\n
\n ),\n },\n ...columnsData,\n ]);\n }\n );\n\n useEffect(() => {\n if (!isInternalPagination) {\n dispatch({ type: 'resetSelectedRows' });\n dispatch({ type: 'resetSortBy' });\n setAllFilters(initialFilters);\n onPageChange(1);\n }\n }, [columns]);\n\n useEffect(() => {\n dispatch({ type: actions.resetPage });\n }, [resetOrgaInsti]);\n\n useEffect(() => {\n if (manualPagination) onPageChange(pageIndex + 1);\n else onPageChange(pageIndex);\n }, [pageIndex]);\n\n useEffect(() => {\n onNbPerPageChange(pageSize);\n }, [pageSize]);\n\n useEffect(() => {\n if (embeddedFilter) onPageChange(0);\n onFiltersChange(filters);\n }, [filters]);\n\n useEffect(() => {\n if (onSelectionChange) onSelectionChange(selectedRowIds);\n }, [selectedRowIds]);\n\n useEffect(() => {\n if (sortBy.length === 0) {\n return;\n }\n\n const sorted = {};\n\n allColumns.forEach((column) => {\n const index = sortBy.findIndex((sorted) => sorted.id === column.id);\n if (index !== -1) {\n sorted[column.Header] = sortBy[index].desc ? 'desc' : 'asc';\n }\n });\n onSortTableChange(sorted);\n if (embeddedFilter) onPageChange(0);\n }, [sortBy]);\n\n return (\n
\n \n \n\n \n {page.map((row) => {\n prepareRow(row);\n return (\n \n {row.cells.map((cell) => {\n return (\n \n );\n })}\n \n );\n })}\n \n
{cell.render('Cell')}
\n {paginationDisplayed ? (\n \n ) : null}\n
\n );\n}\n\nfunction TableHeader({\n toDisplay,\n headerGroups,\n disabledColumnActionsList,\n isLoading,\n withFilters\n}) {\n if (toDisplay === false) {\n return null;\n }\n\n const foundDisabled = (index) => {\n const colName = headerGroups?.[0]?.headers?.[index]?.Header;\n return disabledColumnActionsList.includes(colName);\n };\n\n return (\n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column, index) => (\n \n \n \n {index === 0 && isLoading ? (\n \n ) : (\n column.render('Header')\n )}\n\n {!foundDisabled(index) ? (\n <>\n {/* SORT UI */}\n \n {column.isSorted ? (\n column.isSortedDesc ? (\n \n ) : (\n \n )\n ) : (\n \n )}\n \n \n ) : null}\n\n {index < headerGroup.headers.length - 1 &&\n column.Header !== '' ? (\n  \n ) : (\n ''\n )}\n
\n {withFilters && (\n
\n {!foundDisabled(index) && column.canFilter ? (\n <>\n {/* FILTER UI */}\n {column.render('Filter')}\n \n ) : null}\n
\n )}\n
{' '}\n {/* end table header container */}\n \n ))}\n \n ))}\n \n );\n}\n\nconst IndeterminateCheckbox = React.forwardRef(\n ({ indeterminate, type, isHeader, ...rest }, ref) => {\n const defaultRef = useRef();\n const resolvedRef = ref || defaultRef;\n\n useEffect(() => {\n resolvedRef.current.indeterminate = indeterminate;\n }, [resolvedRef, indeterminate]);\n\n if (type === 'radio')\n return (\n
\n \n
\n \n
\n
\n );\n if (type === 'hidden')\n return (\n \n );\n if (type === 'checkbox' && isHeader)\n return (\n \n );\n return (\n
\n \n
\n \n \n
\n
\n );\n }\n);\n\nTable.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.object),\n data: PropTypes.arrayOf(PropTypes.object),\n type: PropTypes.string,\n onSelectedItemChanged: PropTypes.func,\n initialFilters: PropTypes.arrayOf(PropTypes.object),\n pageCount: PropTypes.number,\n};\n\nTable.defaultProps = {\n columns: [],\n data: [],\n type: 'checkbox',\n onSelectedItemChanged: () => {\n // empty just for the compilation\n },\n pageCount: 0,\n initialFilters: [],\n};\n\nexport default Table;\n","import React from 'react';\nimport './chip.scss';\n\nexport const Chip: React.FC = ({ key, label }) => (\n
\n
{label}
\n
\n);\n","import React from 'react';\nimport { Chip } from '../../components/Chip/Chip';\n\nexport const Materials: React.FC = ({ demand }) => (\n
\n {demand.materials?.map((m, i) => {\n return ;\n })}\n
\n);\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport React, { useContext, useState, useEffect } from 'react';\nimport { Layout } from '../../components/Layout';\nimport { ComponentWithTitle } from '../../components/Common';\nimport { useLogged } from '../../hooks';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport Table from '../../components/TableContainer/Table';\nimport {\n SzAlert,\n SzButton,\n SzDatePicker,\n SzModal,\n SzSelect,\n} from 'react-theme-components';\nimport TimePicker from 'rc-time-picker';\nimport {\n ContainerDemand,\n ContainerDemandStatus,\n} from '../../interfaces/providers';\nimport { UserId } from '../../helpers';\nimport { ContainerDemandStatusInstance } from '../../interfaces';\nimport './Demand.scss';\n\nimport 'rc-time-picker/assets/index.css';\nimport moment from 'moment';\nimport { User } from '../../actions';\nimport { Materials } from './Materials';\n\nexport const STATUS = {\n InProgress: 'In Progress',\n Planned: 'Planned',\n NewDate: 'New Date',\n Closed: 'Closed',\n Canceled: 'Canceled',\n NoReturn: 'No Return',\n};\nexport const INPROGRESS_STATUS = [\n STATUS.InProgress,\n STATUS.Planned,\n STATUS.NewDate,\n];\nexport const CLOSED_STATUS = [STATUS.Closed, STATUS.Canceled, STATUS.NoReturn];\n\nexport const DemandsInternal: React.FC = () => {\n useLogged();\n const { itemFiltersSelected } = useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n\n const [inProgressTableData, setInprogressTableData] = useState([]);\n const [closedTableData, setClosedTableData] = useState([]);\n const [pageInprogress, setPageInprogress] = useState(1);\n const [pageClosed, setPageClosed] = useState(1);\n const [pgCountClosed, setPgCountClosed] = useState(1);\n const [pgCountInprogress, setPgCountInprogress] = useState(1);\n const [perPageClosed, setPerPageClosed] = useState(10);\n const [perPageInprogress, setPerPageInprogress] = useState(10);\n const [inprogressStatusList, setInprogressStatusList] = useState([]);\n const [closedStatusList, setClosedStatusList] = useState([]);\n const [isClosedTableLoading, setIsClosedTableLoading] = useState(false);\n const [isInprogressTableLoading, setIsInprogressTableLoading] =\n useState(false);\n const [StatusList, setStatusList] = useState([]);\n const [bookingDate, setBookingDate] = useState(new Date());\n const [bookingTime, setBookingTime] = useState(new Date());\n const [selectedDemand, setSelectedDemand] = useState();\n const [successUpdate, setSucessUpdate] = useState(false);\n const [failureUpdate, setFailureUpadate] = useState(false);\n const [successMessage, setSuccessMessage] = useState('');\n const [show, setShow] = useState(false);\n const [failureMessage, setFailureMessage] = useState('');\n const [inprogressFilters, setInprogressFilters] = useState([]);\n const [closedFilters, setClosedFilters] = useState([]);\n const [sortInprogressTable, setSortInprogressTable] = useState([]);\n const [sortClosedTable, setSortClosedTable] = useState([]);\n\n function StatutInprogressDemandFilter({ column }: { column: any }) {\n const filterList = [\n { value: '', label: translate(`pages.demands.status.all`) },\n ...inprogressStatusList,\n ];\n const { filterValue = filterList[0], setFilter } = column;\n return (\n {\n setFilter(value);\n }}\n />\n );\n }\n function StatutClosedDemandFilter({ column }: { column: any }) {\n const filterList = [\n { value: '', label: translate(`pages.demands.status.all`) },\n ...closedStatusList,\n ];\n const { filterValue = filterList[0], setFilter } = column;\n return (\n {\n setFilter(value);\n }}\n />\n );\n }\n\n const TABLE_COLUMN = [\n {\n Header: translate('table.header.demands.idDemand'),\n accessor: 'id',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.client'),\n accessor: 'companyName',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.container'),\n accessor: 'containerName',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.materials'),\n accessor: 'materials',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.date'),\n accessor: 'bookingDate',\n disableFilters: true,\n },\n ];\n\n const INPROGRESS_TABLE_CULUMN = [\n ...TABLE_COLUMN,\n {\n Header: translate('table.header.demands.status'),\n accessor: 'status',\n Filter: StatutInprogressDemandFilter,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.common.actions'),\n accessor: 'controlButtons',\n disableFilters: true,\n disableSortBy: true,\n },\n ];\n\n const CLOSED_TABLE_COLUMN = [\n ...TABLE_COLUMN,\n {\n Header: translate('table.header.demands.status'),\n accessor: 'status',\n Filter: StatutClosedDemandFilter,\n disableSortBy: true,\n },\n ];\n\n const initialSortBy = [\n {\n id: 'bookingDate',\n desc: true,\n },\n ];\n\n const formatedTableData = (demands: any[]) => {\n return demands.map((demand: any) => {\n return {\n id: demand.idDemand,\n companyName: (\n
{demand.company?.name}
\n ),\n containerName: (\n
{demand.container.name}
\n ),\n materials: ,\n bookingDate: (\n
\n
\n {demand.bookingDate\n ? `${new Date(demand.bookingDate).toLocaleDateString(\n navigator.language\n )}\n ${new Date(demand.bookingDate)\n .toISOString()\n .substring(11, 19)}`\n : ''}\n {' '}\n {!(\n demand.status.name === STATUS.Closed ||\n demand.status.name === STATUS.Canceled ||\n demand.status.name === STATUS.NoReturn\n ) && (\n {\n setShow(true);\n setBookingDate(new Date(demand.bookingDate));\n setBookingTime(\n moment(demand.bookingDate).utc().format('HH:mm:ss')\n );\n setSelectedDemand(demand);\n }}\n >\n )}\n
\n
\n ),\n status: (\n
\n {demand.status\n ? translate(`pages.demands.status.${demand.status.name}`)\n : ''}\n
\n ),\n controlButtons: getStatus(demand, demand.status),\n };\n });\n };\n\n async function loadDataInprogress() {\n setIsInprogressTableLoading(true);\n const statusFilter = inprogressFilters.find((f) => f.id === 'status');\n const statusFilterValue =\n statusFilter && statusFilter?.value.value !== ''\n ? [statusFilter?.value]\n : inprogressStatusList.map((s) => s.value);\n\n await new ContainerDemand({\n filters: {\n perPage: perPageInprogress,\n page: pageInprogress,\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n internalOperator: new UserId().get(),\n idStatus: statusFilterValue,\n orderByDate: sortInprogressTable['Date'],\n },\n })\n .getList()\n .then(({ data, total }) => {\n setInprogressTableData(data);\n setPgCountInprogress(Math.ceil(total / perPageInprogress));\n setIsInprogressTableLoading(false);\n })\n .catch((e) => {\n console.error(e);\n setIsInprogressTableLoading(false);\n });\n }\n\n async function loadDataClosed() {\n setIsClosedTableLoading(true);\n const statusFilter = closedFilters.find((f) => f.id === 'status');\n const statusFilterValue =\n statusFilter && statusFilter?.value.value != ''\n ? [statusFilter?.value]\n : closedStatusList.map((s) => s.value);\n\n await new ContainerDemand({\n filters: {\n perPage: perPageClosed,\n page: pageClosed,\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n internalOperator: new UserId().get(),\n idStatus: statusFilterValue,\n orderByDate: sortClosedTable['Date'],\n },\n })\n .getList()\n .then(({ data, total }) => {\n setClosedTableData(data);\n setPgCountClosed(Math.ceil(total / perPageClosed));\n setIsClosedTableLoading(false);\n })\n .catch((e) => {\n console.error(e);\n setIsClosedTableLoading(false);\n });\n }\n\n // Handle of change booking date and status\n const handleUpdateDemand = async (\n demand: any,\n statusLabel: string,\n booking?: boolean\n ) => {\n setIsInprogressTableLoading(true);\n const formatedBookingDate = `${moment(bookingDate).format(\n 'YYYY-MM-DD'\n )} ${bookingTime}`;\n if (moment(formatedBookingDate) < moment()) {\n setFailureUpadate(true);\n setFailureMessage(translate(`forms.externalDemand.invalidBookingDate`));\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setFailureUpadate(false);\n });\n setIsInprogressTableLoading(false);\n return;\n }\n const idStatus = StatusList.find((s) => s.name === statusLabel)?.id;\n\n const data = {\n id: demand.id,\n idDemandStatus: idStatus,\n internalOperator: new UserId().get(),\n };\n if (booking) {\n data['bookingDate'] = formatedBookingDate;\n }\n await new ContainerDemand()\n .update({\n data,\n })\n .then(() => {\n new User().sendDemandMail({\n data: {\n demandStatus: statusLabel,\n type: 'external',\n operators: demand.externalOperator,\n demand: demand.idDemand,\n },\n });\n })\n .then(() => {\n loadDataInprogress();\n if (closedStatusList.includes(idStatus)) {\n loadDataClosed();\n }\n setSucessUpdate(true);\n booking\n ? setSuccessMessage(\n translate('forms.internalDemand.successUpdateBookingDate')\n )\n : setSuccessMessage(\n translate('forms.internalDemand.successUpdateStatus')\n );\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setSucessUpdate(false);\n });\n })\n .catch((e) => {\n setFailureUpadate(true);\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setFailureUpadate(false);\n });\n setIsInprogressTableLoading(false);\n console.error(e);\n });\n };\n\n const getStatus = (demand: any, status: ContainerDemandStatusInstance) => {\n if (status.name === STATUS.InProgress) {\n return (\n
\n {\n return handleUpdateDemand(demand, STATUS.Planned);\n }}\n >\n check\n \n {\n return handleUpdateDemand(demand, STATUS.Canceled);\n }}\n >\n close\n \n
\n );\n } else if (\n status.name === STATUS.NewDate ||\n status.name === STATUS.Planned\n ) {\n return (\n
\n \n {\n return handleUpdateDemand(demand, STATUS.Canceled);\n }}\n >\n close\n \n
\n );\n } else {\n return (\n
\n \n \n
\n );\n }\n };\n\n // Handler of table filters\n const handleInprogressFiltersChange = (filter: any[]) => {\n if (JSON.stringify(filter) !== JSON.stringify(inprogressFilters)) {\n setPageInprogress(1);\n setInprogressFilters(filter);\n }\n };\n const handleClosedFiltersChange = (filter: any[]) => {\n if (JSON.stringify(filter) !== JSON.stringify(closedFilters)) {\n setPageClosed(1);\n setClosedFilters(filter);\n }\n };\n\n useEffect(() => {\n async function loadStatus() {\n await new ContainerDemandStatus()\n .getList()\n .then(({ data }) => {\n const inprogressStatus: any[] = [];\n const closedStatus: any[] = [];\n\n data.map((status) => {\n if (INPROGRESS_STATUS.includes(status.name))\n inprogressStatus.push({\n value: status.id,\n label: translate(`pages.demands.status.${status.name}`),\n });\n else if (CLOSED_STATUS.includes(status.name))\n closedStatus.push({\n value: status.id,\n label: translate(`pages.demands.status.${status.name}`),\n });\n });\n setStatusList(data);\n setInprogressStatusList(inprogressStatus);\n setClosedStatusList(closedStatus);\n })\n .catch((e) => {\n console.error(e);\n });\n }\n\n try {\n setIsInprogressTableLoading(true);\n setIsClosedTableLoading(true);\n loadStatus();\n } catch (error) {\n console.error(error);\n }\n }, []);\n\n useEffect(() => {\n if (inprogressStatusList.length > 0) {\n loadDataInprogress();\n }\n }, [\n pageInprogress,\n perPageInprogress,\n inprogressStatusList,\n inprogressFilters,\n sortInprogressTable,\n itemFiltersSelected,\n ]);\n\n useEffect(() => {\n if (closedStatusList.length > 0) {\n loadDataClosed();\n }\n }, [\n pageClosed,\n perPageClosed,\n closedStatusList,\n closedFilters,\n sortClosedTable,\n itemFiltersSelected,\n ]);\n\n return (\n <>\n \n \n
\n {successUpdate && (\n
\n \n {successMessage}\n \n
\n )}\n {failureUpdate && (\n
\n \n {failureMessage}\n \n
\n )}\n \n
\n
\n \n
\n \n
\n
\n
\n {\n setShow(false);\n }}\n size={'lg'}\n >\n
\n {translate(`pages.demands.chooseDate`)}\n
\n
\n
\n setBookingDate(v),\n classNameStartDate: 'col-12',\n startDate: bookingDate,\n }}\n />\n
\n
\n setBookingTime(value.format('HH:mm:ss'))}\n placeholder={translate(`pages.demands.chooseTime`)}\n popupClassName={'rc-time-picker-panel-customer'}\n placement={'bottomLeft'}\n minuteStep={5}\n />\n
\n
\n
\n {\n setShow(false);\n handleUpdateDemand(selectedDemand, STATUS.NewDate, true);\n }}\n >\n {translate(`pages.demands.validate`)}\n \n
\n \n \n );\n};\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport React, { useContext, useState, useEffect } from 'react';\nimport { useHistory, useLocation } from 'react-router';\nimport { Layout } from '../../components/Layout';\nimport { ComponentWithTitle } from '../../components/Common';\nimport { useLogged } from '../../hooks';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport Table from '../../components/TableContainer/Table';\nimport {\n ContainerDemand,\n ContainerDemandStatus,\n} from '../../interfaces/providers';\nimport { UserId } from '../../helpers';\nimport { ContainerDemandStatusInstance } from '../../interfaces';\nimport './Demand.scss';\nimport { SzAlert, SzSelect } from 'react-theme-components';\nimport { CLOSED_STATUS, INPROGRESS_STATUS, STATUS } from './DemandsInternal';\nimport { User } from '../../actions/User';\nimport { Materials } from './Materials';\n\nexport const DemandsExternal: React.FC = () => {\n useLogged();\n const { itemFiltersSelected } = useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n const { state } = useLocation<{ sucessCreate: boolean }>();\n const history = useHistory();\n\n const [inProgressTableData, setInprogressTableData] = useState([]);\n const [closedTableData, setClosedTableData] = useState([]);\n const [pageInprogress, setPageInprogress] = useState(1);\n const [pageClosed, setPageClosed] = useState(1);\n const [pgCountClosed, setPgCountClosed] = useState(1);\n const [pgCountInprogress, setPgCountInprogress] = useState(1);\n const [perPageClosed, setPerPageClosed] = useState(10);\n const [perPageInprogress, setPerPageInprogress] = useState(10);\n const [StatusList, setStatusList] = useState([]);\n const [inprogressStatusList, setInprogressStatusList] = useState([]);\n const [closedStatusList, setClosedStatusList] = useState([]);\n const [isClosedTableLoading, setIsClosedTableLoading] = useState(false);\n const [isInprogressTableLoading, setIsInprogressTableLoading] =\n useState(false);\n const [successUpdate, setSucessUpdate] = useState(false);\n const [failureUpdate, setFailureUpadate] = useState(false);\n const [successMessage, setSuccessMessage] = useState('');\n const [sucessCreate, setSucessCreate] = useState(false);\n const [inprogressFilters, setInprogressFilters] = useState([]);\n const [closedFilters, setClosedFilters] = useState([]);\n const [sortInprogressTable, setSortInprogressTable] = useState([]);\n const [sortClosedTable, setSortClosedTable] = useState([]);\n\n function StatutInprogressDemandFilter({ column }: { column: any }) {\n const filterList = [\n { value: '', label: translate(`pages.demands.status.all`) },\n ...inprogressStatusList,\n ];\n const { filterValue = filterList[0], setFilter } = column;\n return (\n {\n setFilter(value);\n }}\n />\n );\n }\n function StatutClosedDemandFilter({ column }: { column: any }) {\n const filterList = [\n { value: '', label: translate(`pages.demands.status.all`) },\n ...closedStatusList,\n ];\n const { filterValue = filterList[0], setFilter } = column;\n return (\n {\n setFilter(value);\n }}\n />\n );\n }\n\n const TABLE_COLUMN = [\n {\n Header: translate('table.header.demands.idDemand'),\n accessor: 'id',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.container'),\n accessor: 'containerName',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.materials'),\n accessor: 'materials',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.demands.date'),\n accessor: 'bookingDate',\n disableFilters: true,\n },\n ];\n\n const initialSortBy = [\n {\n id: 'bookingDate',\n desc: true,\n },\n ];\n\n const INPROGRESS_TABLE_CULUMN = [\n ...TABLE_COLUMN,\n {\n Header: translate('table.header.demands.status'),\n accessor: 'status',\n Filter: StatutInprogressDemandFilter,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.common.actions'),\n accessor: 'controlButtons',\n disableFilters: true,\n disableSortBy: true,\n },\n ];\n\n const CLOSED_TABLE_COLUMN = [\n ...TABLE_COLUMN,\n {\n Header: translate('table.header.demands.status'),\n accessor: 'status',\n Filter: StatutClosedDemandFilter,\n disableSortBy: true,\n },\n ];\n\n useEffect(() => {\n if (state?.sucessCreate) {\n setSuccessMessage('forms.externalDemand.successCreateStatus');\n setSucessCreate(true);\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setSucessCreate(false);\n });\n history.replace({\n pathname: '/demandsExternal',\n state: {},\n });\n }\n }, []);\n\n async function loadDataInprogress() {\n setIsInprogressTableLoading(true);\n const statusFilter = inprogressFilters.find((f) => f.id === 'status');\n const statusFilterValue =\n statusFilter && statusFilter?.value.value !== ''\n ? [statusFilter?.value]\n : inprogressStatusList.map((s) => s.value);\n\n await new ContainerDemand({\n filters: {\n perPage: perPageInprogress,\n page: pageInprogress,\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n externalOperator: new UserId().get(),\n idStatus: statusFilterValue,\n orderByDate: sortInprogressTable['Date'],\n },\n })\n .getList()\n .then(({ data, total }) => {\n setInprogressTableData(data);\n setPgCountInprogress(Math.ceil(total / perPageInprogress));\n setIsInprogressTableLoading(false);\n })\n .catch((e) => {\n console.error(e);\n setIsInprogressTableLoading(false);\n });\n }\n\n async function loadDataClosed() {\n setIsClosedTableLoading(true);\n const statusFilter = closedFilters.find((f) => f.id === 'status');\n const statusFilterValue =\n statusFilter && statusFilter?.value.value != ''\n ? [statusFilter?.value]\n : closedStatusList.map((s) => s.value);\n\n await new ContainerDemand({\n filters: {\n perPage: perPageClosed,\n page: pageClosed,\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n externalOperator: new UserId().get(),\n idStatus: statusFilterValue,\n orderByDate: sortClosedTable['Date'],\n },\n })\n .getList()\n .then(({ data, total }) => {\n setClosedTableData(data);\n setPgCountClosed(Math.ceil(total / perPageClosed));\n setIsClosedTableLoading(false);\n })\n .catch((e) => {\n console.error(e);\n setIsClosedTableLoading(false);\n });\n }\n\n // Handler of change status\n const handleStatusChange = async (demand: any, statusLabel: string) => {\n const idStatus = StatusList.find((s) => s.name === statusLabel).id;\n setIsInprogressTableLoading(true);\n\n await new ContainerDemand()\n .update({\n data: {\n id: demand.id,\n idDemandStatus: idStatus,\n externalOperator: new UserId().get(),\n },\n })\n .then(({ data }) => {\n new User().sendDemandMail({\n data: {\n demandStatus: statusLabel,\n type: 'internal',\n operators: data.map((operator) => operator.idOperator),\n demand: demand.idDemand,\n },\n });\n })\n .then(() => {\n loadDataInprogress();\n loadDataClosed();\n setSucessUpdate(true);\n setSuccessMessage('forms.internalDemand.successUpdateStatus');\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setSucessUpdate(false);\n });\n })\n .catch((e) => {\n setIsInprogressTableLoading(false);\n setFailureUpadate(true);\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setFailureUpadate(false);\n });\n console.error(e);\n });\n };\n const getStatus = (demand: any, status: ContainerDemandStatusInstance) => {\n if (status.name === STATUS.InProgress || status.name === STATUS.Planned) {\n return (\n
\n {\n return handleStatusChange(demand, STATUS.Canceled);\n }}\n >\n {translate('pages.demands.status.Cancel')}\n \n
\n );\n }\n if (status.name === STATUS.NewDate) {\n return (\n
\n handleStatusChange(demand, STATUS.Planned)}\n >\n {translate('pages.demands.status.Accept')}\n \n handleStatusChange(demand, STATUS.Canceled)}\n >\n {translate('pages.demands.status.Refuse')}\n \n
\n );\n }\n };\n\n // Handler of table filters\n const handleInprogressFiltersChange = (filter: any[]) => {\n if (JSON.stringify(filter) !== JSON.stringify(inprogressFilters)) {\n setPageInprogress(1);\n setInprogressFilters(filter);\n }\n };\n const handleClosedFiltersChange = (filter: any[]) => {\n if (JSON.stringify(filter) !== JSON.stringify(closedFilters)) {\n setPageClosed(1);\n setClosedFilters(filter);\n }\n };\n\n useEffect(() => {\n async function loadStatus() {\n await new ContainerDemandStatus()\n .getList()\n .then(({ data }) => {\n const inprogressStatus: any[] = [];\n const closedStatus: any[] = [];\n data.map((status) => {\n if (INPROGRESS_STATUS.includes(status.name))\n inprogressStatus.push({\n value: status.id,\n label: translate(`pages.demands.status.${status.name}`),\n });\n else if (CLOSED_STATUS.includes(status.name))\n closedStatus.push({\n value: status.id,\n label: translate(`pages.demands.status.${status.name}`),\n });\n });\n setStatusList(data);\n setInprogressStatusList(inprogressStatus);\n setClosedStatusList(closedStatus);\n })\n .catch((e) => {\n console.error(e);\n });\n }\n\n try {\n setIsInprogressTableLoading(true);\n setIsClosedTableLoading(true);\n loadStatus();\n } catch (error) {\n console.error(error);\n }\n }, []);\n\n useEffect(() => {\n if (inprogressStatusList.length > 0) {\n loadDataInprogress();\n }\n }, [\n pageInprogress,\n perPageInprogress,\n inprogressStatusList,\n inprogressFilters,\n sortInprogressTable,\n itemFiltersSelected,\n ]);\n\n useEffect(() => {\n if (closedStatusList.length > 0) {\n loadDataClosed();\n }\n }, [\n pageClosed,\n perPageClosed,\n closedStatusList,\n closedFilters,\n sortClosedTable,\n itemFiltersSelected,\n ]);\n\n const formatedTableData = (demands: any[]) => {\n return demands.map((demand: any) => {\n return {\n id: demand.idDemand,\n idContainerDemand: demand.name,\n containerName: (\n
{demand.container.name}
\n ),\n materials: ,\n bookingDate: (\n
\n {demand.bookingDate\n ? `${new Date(demand.bookingDate).toLocaleDateString(\n navigator.language\n )}\n ${new Date(demand.bookingDate)\n .toISOString()\n .substring(11, 19)}`\n : ''}\n {' '}\n
\n ),\n status: (\n
\n {demand.status\n ? translate(`pages.demands.status.${demand.status.name}`)\n : ''}\n
\n ),\n controlButtons: getStatus(demand, demand.status),\n };\n });\n };\n\n return (\n \n \n
\n {\n history.push(`/demandsExternal/create`);\n }}\n >\n {translate('pages.demands.NewDemand')}\n \n
\n
\n {(successUpdate || sucessCreate) && (\n
\n \n {translate(`${successMessage}`)}\n \n
\n )}\n {failureUpdate && (\n
\n \n {translate(`forms.errorMessage`)}\n \n
\n )}\n \n
\n
\n\n \n
\n \n
\n
\n
\n );\n};\n","import React, { useContext, useState, useEffect } from 'react';\nimport { Layout } from '../../components/Layout';\nimport { SzTypographie, SzButton, SzIcon } from 'react-theme-components';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport { useLogged } from '../../hooks';\nimport { ComponentWithTitle } from '../../components/Common';\nimport Table from '../../components/TableContainer/Table';\nimport { Document } from '../../actions';\nimport './Documents.scss';\n\nexport const Documents: React.FC = () => {\n useLogged();\n const { translate } = useContext(LanguageContext);\n const { itemFiltersSelected: { plant, organization } } = useContext(BaseStoreContext);\n const [page , setPage] = useState(1);\n const [perPage, setPerPage] = useState(10);\n const [pgCount, setPgCount] = useState(0);\n const [sortTable, setSortTable] = useState([]);\n const [isTableLoading, setIsTableLoading] = useState(false);\n const [tableData, setTableData] = useState([]);\n const [currentDownloadId, setCurrentDownloadId] = useState('')\n const initialSortBy = [\n {\n id: 'createdAt',\n desc: true,\n },\n ];\n\n const TABLE_COLUMN = [\n {\n Header: translate('table.header.documents.name'),\n accessor: 'name',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.documents.company'),\n accessor: 'company',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.documents.type'),\n accessor: 'type',\n disableFilters: true,\n disableSortBy: true,\n },\n {\n Header: translate('table.header.documents.createdAt'),\n accessor: 'createdAt',\n isSorted: false,\n disableFilters: true,\n },\n {\n Header: '',\n accessor: 'controlButtons',\n disableFilters: true,\n disableSortBy: true,\n },\n ];\n\n\n const downloadFile = async (documentObject: any) => {\n try {\n setCurrentDownloadId(documentObject.id)\n const extension = documentObject.blobname.split(\".\").pop()\n const data = await new Document()\n .downloadDocument({ id: `${documentObject.id}/download` })\n const link = document.createElement('a')\n link.href = window.URL.createObjectURL(new Blob([data]))\n link.setAttribute('download', `${documentObject.filename}.${extension}`)\n document.body.appendChild(link)\n link.click()\n setCurrentDownloadId(\"\")\n return true\n } catch (error) {\n setCurrentDownloadId(\"\")\n }\n } \n \n const formatedTableData = (documents: any[]) => {\n return documents.map((document: any) => {\n return {\n id: document.id,\n name: document.filename,\n company: (\n
{document.companyName}
\n ),\n type: document.type,\n createdAt: (\n
\n {\n document.createdAt\n ? `${new Date(document.createdAt).toLocaleDateString()} ${new Date(\n document.createdAt\n ).toLocaleTimeString()}`\n : ''\n }\n {' '}\n
\n ),\n controlButtons: (\n
\n {\n downloadFile(document)\n }}\n isDisabled={document.id === currentDownloadId}\n loader={document.id === currentDownloadId}\n >\n \n \n \n \n
\n ),\n };\n });\n };\n\n async function loadData() {\n setIsTableLoading(true);\n await new Document({\n filters: {\n perPage: perPage,\n page: page,\n organizations: organization,\n companies: plant,\n 'order[createdAt]': sortTable[translate('table.header.documents.createdAt')],\n },\n })\n .getList()\n .then(({ data, total }) => {\n setTableData(data);\n setPgCount(Math.ceil(total / perPage));\n setIsTableLoading(false);\n })\n .catch((e) => {\n console.error(e);\n setIsTableLoading(false);\n });\n }\n\n useEffect(() => {\n loadData();\n }, [\n page,\n perPage,\n sortTable,\n plant,\n organization\n ]);\n\n return (\n \n \n
\n \n
\n \n
\n
\n
\n
\n
\n );\n};\n\n","import { RouteProps } from 'react-router';\nimport {\n Consent,\n Login,\n ResetPasswordApply,\n ResetPasswordRequest,\n} from '../pages';\n\nexport const passwordRoutes: RouteProps[] = [\n {\n component: ResetPasswordRequest,\n path: '/reset-password',\n strict: true,\n exact: true,\n },\n {\n component: ResetPasswordApply,\n path: '/reset-password/:token',\n },\n {\n component: Login,\n path: '/login',\n },\n {\n component: Consent,\n path: '/consent',\n },\n];\n","import React from 'react';\nimport { ResetPasswordRequestForm } from '../../components/Form/Password';\nimport { CommonResetPassword } from './CommonResetPassword';\n\nexport const ResetPasswordRequest: React.FC = () => (\n \n \n \n);\n","import React from 'react';\nimport { ResetPasswordApplyForm } from '../../components/Form/Password';\nimport { CommonResetPassword } from './CommonResetPassword';\n\nexport const ResetPasswordApply: React.FC = () => (\n \n \n \n);\n","import React, { useContext } from 'react';\nimport { SzTypographie } from 'react-theme-components';\nimport { Login as LoginForm } from '../components/Form';\nimport './login.scss';\nimport { useNotLogged } from '../hooks';\nimport { LanguageContext } from '../contexts';\nimport { LayoutBase } from '../components/Layout';\n\nexport const Login: React.FC = () => {\n useNotLogged();\n const { translate } = useContext(LanguageContext);\n return (\n \n \n
\n
\n
\n \n {translate('pages.login.form.title')}\n \n \n
\n
\n
\n
\n
\n

\n {translate('pages.login.block.title')}\n

\n
\n

\n {translate('pages.login.block.description')}\n

\n
\n
\n
\n \n );\n};\n","import React, { useContext } from 'react';\nimport { LayoutBase } from '../components/Layout';\nimport { LanguageContext } from '../contexts';\nimport { ComponentWithTitle } from '../components/Common';\n\nexport const Consent: React.FC = () => {\n const { translate } = useContext(LanguageContext);\n return (\n \n \n
\n

{translate('pages.consent.body.p1')}

\n
\n

{translate('pages.consent.body.p2')}

\n
\n

\n {translate('pages.consent.body.p3.t1')}\n \n {translate('pages.consent.body.p3.l1')}\n \n {translate('pages.consent.body.p3.t2')}\n

\n
\n

{translate('pages.consent.body.p4')}

\n
\n

{translate('pages.consent.body.p5')}

\n
\n

{translate('pages.consent.body.p6')}

\n
\n

{translate('pages.consent.body.p7')}

\n
\n

\n {translate('pages.consent.body.p8.t1')}\n \n {translate('pages.consent.body.p3.l1')}\n \n {translate('pages.consent.body.p8.t2')}\n

\n
\n

\n {translate('pages.consent.body.p9.t1')}\n \n {translate('pages.consent.body.p9.l1')}\n \n .\n

\n

{translate('pages.consent.body.p10')}

\n
\n

\n {translate('pages.consent.body.p11.t1')}\n \n {translate('pages.consent.body.p11.l1')}\n \n .\n

\n
\n

{translate('pages.consent.body.p12')}

\n
\n
\n
\n
\n );\n};\n","/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable @typescript-eslint/no-empty-function */\nimport React, { useContext, useState, useEffect } from 'react';\nimport { Layout } from '../../components/Layout';\nimport { ComponentWithTitle } from '../../components/Common';\nimport { useLogged } from '../../hooks';\nimport { BaseStoreContext, LanguageContext } from '../../contexts';\nimport { useHistory } from 'react-router';\nimport {\n SzAlert,\n SzButton,\n SzDatePicker,\n SzSelect,\n} from 'react-theme-components';\nimport TimePicker from 'rc-time-picker';\nimport { Container, ContainerDemand } from '../../interfaces/providers';\nimport { Company, Organization, UserId } from '../../helpers';\nimport './Demand.scss';\n\nimport 'rc-time-picker/assets/index.css';\nimport moment from 'moment';\nimport { User } from '../../actions';\n\nexport const STATUS = {\n InProgress: 'In Progress',\n Planned: 'Planned',\n NewDate: 'New Date',\n Closed: 'Closed',\n Canceled: 'Canceled',\n NoReturn: 'No Return',\n};\n\nexport const CreateDemands: React.FC = () => {\n useLogged();\n const { itemFiltersSelected } = useContext(BaseStoreContext);\n const { translate } = useContext(LanguageContext);\n const { push } = useHistory();\n\n const [containerList, setContainerList] = useState([]);\n const [selectedContainer, setSelectedContainer] = useState({\n value: '',\n label: '',\n });\n const [isLoading, setIsLoading] = useState(false);\n const [isSelectLoading, setIsSelectLoading] = useState(false);\n const [bookingDate, setBookingDate] = useState(new Date());\n const [bookingTime, setBookingTime] = useState(\n moment()\n .add(75 - (moment().minutes() % 5), 'minutes')\n .startOf('minute')\n );\n const [failureUpdate, setFailureUpadate] = useState(false);\n const [failureMessage, setFailureMessage] = useState('');\n\n const handleSelectionChange = (option) => {\n if (option) {\n setSelectedContainer(option);\n }\n };\n\n // Handle create container command\n const handleCreateDemand = async () => {\n setIsLoading(true);\n let formatedBookingDate = `${moment(bookingDate).format(\n 'YYYY-MM-DD'\n )} ${bookingTime}`;\n if (moment(formatedBookingDate) < moment()) {\n setFailureUpadate(true);\n setFailureMessage(translate(`forms.externalDemand.invalidBookingDate`));\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setFailureUpadate(false);\n });\n setIsLoading(false);\n return;\n }\n\n formatedBookingDate = `${moment(bookingDate).format('YYYY-MM-DD')} ${moment(\n bookingTime\n ).format('HH:mm:ss')}`;\n\n const data = {\n idContainer: selectedContainer?.value,\n CreatedBy: new UserId().get(),\n bookingDate: formatedBookingDate,\n };\n\n await new ContainerDemand()\n .create({\n data,\n })\n .then(({ data }) => {\n new User().sendDemandMail({\n data: {\n demandStatus: STATUS.InProgress,\n type: 'internal',\n operators: data.operators.map((operator) => operator.idOperator),\n bookingDate: formatedBookingDate,\n materials: data.materials.map((material) => material.materialName),\n container: data.containerName,\n company: new Company().getDecoded().name,\n organization: new Organization().getDecoded().name,\n demand: 0,\n },\n });\n })\n .then(() => {\n setIsLoading(false);\n push(`/demandsExternal`, { sucessCreate: true });\n })\n .catch((e) => {\n setFailureUpadate(true);\n setFailureMessage(translate(`forms.errorMessage`));\n new Promise((resolve) => setTimeout(resolve, 5000)).then((r) => {\n setFailureUpadate(false);\n });\n setIsLoading(false);\n console.error(e);\n });\n };\n\n useEffect(() => {\n async function loadContainers() {\n await new Container({\n filters: {\n idUser: new UserId().get(),\n idOrganizations: itemFiltersSelected.organization,\n idCompanies: itemFiltersSelected.plant,\n },\n })\n .getList()\n .then(({ data }) => {\n setIsSelectLoading(false);\n const options = data.map((e) => {\n return {\n value: e.id,\n label: e.name,\n };\n });\n setContainerList(options);\n })\n .catch((e) => {\n console.error(e);\n });\n }\n try {\n setIsSelectLoading(true);\n setSelectedContainer({ value: '', label: '' });\n loadContainers();\n } catch (error) {\n console.error(error);\n }\n }, [itemFiltersSelected]);\n\n return (\n \n \n
\n {failureUpdate && (\n
\n \n {failureMessage}\n \n
\n )}\n
\n {translate(`pages.newDemand.chooseContainerAndDate`)}\n
\n
\n \n
\n
\n
\n setBookingDate(v),\n classNameStartDate: 'col-12',\n startDate: bookingDate,\n }}\n />\n
\n
\n setBookingTime(value)}\n placeholder={translate(`pages.demands.chooseTime`)}\n popupClassName={'rc-time-picker-panel-customer'}\n placement={'bottomLeft'}\n minuteStep={5}\n />\n
\n
\n
\n {\n handleCreateDemand();\n }}\n loader={isLoading}\n isDisabled={selectedContainer.value === null}\n >\n {translate(`pages.demands.validate`)}\n \n
\n
\n
\n
\n );\n};\n","import 'core-js/stable';\nimport 'regenerator-runtime/runtime';\nimport React, { useContext, useEffect } from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n BrowserRouter,\n Route,\n RouteProps,\n Router,\n Switch,\n} from 'react-router-dom';\nimport * as serviceWorker from './serviceWorker';\nimport { createBrowserHistory, History } from 'history';\nimport './main.scss';\nimport {\n BaseStoreProvider,\n LanguageProvider,\n UserProvider,\n LanguageContext,\n} from './contexts';\nimport { AppInsightProvider } from './contexts/AppInsightContext';\nimport withTracker from './routes/withTracker.jsx';\nimport { ROLES, ROUTES } from './actions/BCM_Constant';\nimport CustomRoute from './routes/CustomRoute';\nimport {\n Account,\n Analysis,\n Catalog,\n CatalogItem,\n Contact,\n DemandsExternal,\n DemandsInternal,\n Welcome,\n Documents,\n} from './pages';\nimport { passwordRoutes } from './routes/passwordRoutes';\nimport { Movement } from './pages/Movement';\nimport { CreateDemands } from './pages/Demands/CreateDemand';\n\nconst history: History = createBrowserHistory();\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n QSI: any;\n tarteaucitronForceLanguage: any;\n }\n}\n\nconst RoutingComponent: React.FC = () => (\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 \n \n \n \n \n \n \n \n {passwordRoutes.map(\n ({ component, ...route }: RouteProps, index: number) => (\n \n )\n )}\n \n \n);\n\nconst App: React.FC = () => {\n const { selectedLanguage } = useContext(LanguageContext);\n useEffect(() => {\n window.tarteaucitronForceLanguage = (\n selectedLanguage.value as string\n ).split('-')[0];\n }, [window]);\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}