{"version":3,"sources":["constants/status.save.js","libs/locale.js","translations/Translations.js","redux/actions.js","libs/RouterPath.js","constants/DemandValidation.js","redux/reducers/initValues/stepper.values.js","redux/reducers/StepperReducer.js","redux/store.js","redux/reducers/ResourcesReducer.js","redux/reducers/PrivilegeReducer.js","redux/reducers/StoreReducer.js","redux/reducers/FormReducer.js","redux/reducers/AuthorizeReducer.js","redux/reducers/InnerMenuReducer.js","redux/reducers/FormValuesReducer.js","redux/reducers/SignatureReducer.js","pages/NotFound/NotFound.js","components/complex/navigation/ListItem.js","components/complex/navigation/OpenElement.js","images/logo-long-contrast.png","components/complex/navigation/Logo.js","images/logo-long.png","images/logo-icon-contrast.png","images/logo-icon.png","components/Button.js","components/complex/navigation/newProcedureMenu/ListElement.js","components/complex/navigation/newProcedureMenu/NewProcedureMenu.js","constants/ProcedureType.js","components/complex/navigation/newProcedureMenu/ListElements.values.js","components/complex/navigation/ListAddButton.js","libs/isDevMode.js","constants/Endpoints.js","constants/HttpCodes.js","libs/downloadFile.js","libs/RestRequest.js","services/OAuthService.js","components/complex/navigation/LogoutButton.js","components/complex/navigation/Navigation.js","components/complex/appbar/InvertColorsButton.js","components/complex/appbar/TextSizeButton.js","components/complex/appbar/Profile.js","images/Poland.js","images/GreatBritain.js","components/GridBlock.js","components/popup/help/dialog.buttons.js","components/popup/components/CancelButton.js","components/popup/help/HelpDialog.js","components/popup/help/Help.js","components/complex/appbar/ChangeLanguageButtonButtons.js","libs/redirectUsingPOST.js","components/complex/appbar/AppBar.js","components/button/IconButton.js","components/button/IconCloseButton.js","components/Loading.js","components/Dialog.js","components/popup/IEinfo/IEInfo.js","libs/Browser.js","libs/objectExtension.js","services/DemandSectionsService.js","services/PrivilegeService.js","services/DemandService.js","constants/InputLimits.js","libs/moment.js","constants/ValidationShema.js","components/Form.js","components/Title.js","components/Divider.js","libs/getObjectValue.js","constants/INPUT_TYPE.js","libs/toNumberType.js","components/TextInput.js","components/RadioGroupElement.js","components/RadioGroup.js","components/Typography.js","components/Select.js","constants/PrimaryTenderVariant.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/fieldsOptions/primaryTenderVariant.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/fieldsOptions/pzpExclusion.values.js","constants/orderType.values.js","constants/concessionOrderType.values.js","constants/BooleanItems.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/fieldsOptions/jedz.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/fieldsOptions/contractType.values.js","components/Checkbox.js","components/RawHTML.js","components/button/WorkableIconButton.js","components/button/WorkableIconExpandButton.js","components/popup/selectCpv/ListElement.js","components/popup/selectCpv/libs/filterItems.js","components/popup/selectCpv/RadioListInfiniteScroller.js","components/popup/selectCpv/libs/countItems.js","components/popup/selectCpv/RadioList.js","components/button/WorkableButton.js","components/popup/components/DoubleButton.js","hooks/useId.js","libs/createId.js","services/CpvService.js","components/popup/selectCpv/SelectForm.js","components/popup/selectCpv/SelectCPV.js","components/Chip.js","libs/removeFormikListElement.js","components/CPVInput.js","components/HelpTooltip.js","components/HelpComponent.js","constants/ProcedureStatus.js","constants/PZPType.js","libs/getDemandStatus.js","libs/filterItems.js","components/popup/selectOrganization/SelectOrganizationForm.js","components/popup/selectOrganization/SelectOrganization.js","components/OrganizationInput.js","components/GreyBox.js","components/Dropzone.js","services/UploadService.js","components/ProgressBar.js","components/popup/components/SingleButton.js","services/DemandOffersService.js","libs/isResponseValid.js","constants/ContractorPasswordState.js","components/popup/uploadFile/UploadFilePopup.js","components/TitledComponent.js","constants/DateFormats.js","components/icon/TooltipIcon.js","components/FilesList.js","services/SharepointService.js","components/popup/components/MultiButton.js","components/icon/SharepointIcon.js","components/complex/sharepointExplorer/SharepointExplorer.js","components/complex/sharepointExplorer/SharepointDownloadPopup.js","services/EzdrpService.js","components/complex/ezdrpExplorer/EzdrpList.js","components/complex/ezdrpExplorer/EzdrpExplorer.js","components/complex/ezdrpExplorer/EzdrpDownloadPopup.js","services/EzdpuwService.js","components/complex/ezdpuwExplorer/EzdpuwDownloadPopup.js","components/button/WorkableIconFolderButton.js","components/complex/ezdpuwExplorer/EzdpuwList.js","components/complex/ezdpuwExplorer/EzdpuwExplorer.js","components/UploadFile.js","constants/PriceTypes.js","constants/DemandCategoryType.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/fieldsOptions/caseClassificationSymbol.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/RequiredFields.js","components/DatePicker.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/OptionalFields.js","components/CheckboxButton.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/ContactFields.js","hooks/useDebouncedEffect.js","components/SaveFormikValues.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/constants/validationSchema.js","components/ShowErrorOnFailedSubmit.js","libs/supportedNoApiScreens.js","services/HeaderService.js","services/ModificationService.js","hooks/useStepperStateCloseValidator.js","components/AutoSaveFormValues.js","libs/saveFormDraft.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/MainForm.js","constants/VatType.js","constants/VATItems.js","libs/toFloat.js","libs/netGrosCalculations.js","hooks/useDidUpdateEffect.js","components/NetGrossField.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/ExPostFields.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/constants/validationSchemaExPost.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/MainFormExPost.js","components/popup/confirm/Confirm.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/MainFormWrapper.js","pages/purchaser/MyProcedure/scenes/part1/panels/demand/index.js","components/popup/changeHistory/ListElement.js","components/popup/changeHistory/ChangeHistory.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/StartScreen.js","services/DealingsService.js","constants/OfferSourceTypes.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/constants/itemTypes.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/constants/initialValues.js","components/button/AddButton.js","components/complex/loadingScreen/LoadingScreen.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/ImporterForm.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/lib/downloadImportTemplate.js","components/complex/simpleTable/STableContainer.js","components/complex/simpleTable/STableRow.js","components/complex/simpleTable/SimpleTable.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/UploadImportFile.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/AdditionalButtons.js","components/complex/sortable/SortableItem.js","components/complex/sortable/SortableList.js","components/complex/sortable/SortableContainer.js","components/popup/newCondition/constants/condition.values.js","components/popup/newCriteria/constants/criterium.type.js","components/popup/newCriteria/constants/criteria.variants.js","constants/DirectionsItems.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/constants/validationSchema.js","components/button/WorkableIconDeleteButton.js","components/button/WorkableIconEditButton.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/lib/mergeDealing.js","components/button/WorkableIconConfirmButton.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/ElementTitle.js","services/MeasureUnitService.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/positions/Units.js","components/button/WorkableIconPreviewButton.js","components/button/WorkableIconAddButton.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/positions/SingleVariant.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/positions/MultiVariant.js","components/VatField.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/positions/ItemPopup.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/PositionsSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/ConditionElement.js","components/PartsTable.js","components/popup/newCondition/constants/validation.form.js","components/popup/newCondition/ConditionForm.js","components/popup/newCondition/NewCondition.js","libs/setObjectValue.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/constants/stage.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/lib/manipulateElementsOnParts.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/ConfirmDeleteCriterion.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/ConditionsSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/CriteriaElement.js","components/popup/newCriteria/constants/tabs.values.js","components/popup/newCriteria/constants/criteriaElement.variants.js","components/popup/newCriteria/constants/validation.form.js","components/Tabs.js","components/popup/newCriteria/components/FormTabs.js","components/popup/newCriteria/components/OtherCriteriaFields.js","components/popup/newCriteria/constants/measurePeriodUnits.values.js","components/popup/newCriteria/myCriteriaList/mock.elements.js","components/popup/newCriteria/myCriteriaList/ListElement.js","components/popup/newCriteria/myCriteriaList/MyCriteriaList.js","components/ErrorText.js","components/popup/newCriteria/listVariant/CriteriaElement.js","components/popup/newCriteria/components/CriteriaListBase.js","components/popup/newCriteria/listVariant/CriteriaList.js","components/popup/newCriteria/components/RadioButton.js","components/popup/newCriteria/intervalVariant/elementVariants/BaseVariant.js","components/popup/newCriteria/intervalVariant/elementVariants/RangeVariant.js","components/popup/newCriteria/intervalVariant/elementVariants/SmallerVariant.js","components/popup/newCriteria/intervalVariant/elementVariants/BiggerVariant.js","components/popup/newCriteria/intervalVariant/CriteriaElement.js","libs/arrayExtension.js","components/popup/newCriteria/intervalVariant/CriteriaList.js","components/popup/newCriteria/CriteriaFormBody.js","components/popup/newCriteria/CriteriaForm.js","components/popup/newCriteria/NewCriteria.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/CriteriaSection.js","components/popup/addAdditionalPosition/constants/additionalPositionType.values.js","components/popup/addAdditionalPosition/constants/validation.form.js","components/popup/addAdditionalPosition/AddAdditionalPositionForm.js","components/popup/addAdditionalPosition/AddAdditionalPosition.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/AdditionalPositionsSection.js","components/popup/addItemParameter/constants/itemParameterType.values.js","components/popup/addItemParameter/constants/validation.form.js","components/popup/addItemParameter/AddItemParameterForm.js","components/popup/addItemParameter/AddItemParameter.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/PositionsParametersSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/PartForm.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/components/Element.js","components/ExecuteFunction.js","components/DemandValidationMessages.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/PositionAndPartsForm.js","libs/setFormikValuesTouched.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/ImportScreen.js","services/PapersGeneratorService.js","components/button/WorkableIcon.js","components/button/WorkableIconShareButton.js","components/complex/papersGenerator/PaperLink.js","components/BoldTypography.js","hooks/useSnackbar.js","components/complex/papersGenerator/customPopups/PapersGeneratorSelectPopup.js","components/complex/papersGenerator/customPopups/PapersGeneratorRfxInvitedSupplierWithOfferPopup.js","components/complex/papersGenerator/customPopups/PapersGeneratorRfxRequestPosition.js","components/complex/papersGenerator/customPopups/PapersGeneratorRfxInvitedSupplierPosition.js","libs/previewFile.js","libs/downloadFileWithPreloadUrl.js","components/complex/documentsTables/swz/constants/SiwzSourceType.js","libs/getOnlyValidMomentObjectOrDefault.js","constants/RepoFolderTypes.js","services/RepoService.js","services/SiwzService.js","components/complex/papersGenerator/customPopups/swzGenerator/SwzGeneratorQuestionSelect.js","components/complex/papersGenerator/customPopups/swzGenerator/SwzGeneratorQuestionCheckbox.js","components/complex/papersGenerator/customPopups/swzGenerator/SwzGeneratorQuestion.js","components/complex/papersGenerator/customPopups/swzGenerator/SwzGeneratorSection.js","components/complex/papersGenerator/customPopups/swzGenerator/ChooseSwzGeneratorOptions.js","components/complex/papersGenerator/customPopups/PapersGeneratorSelectFilesPopup.js","components/complex/papersGenerator/customPopups/PapersGeneratOfferFilesVerification.js","components/complex/papersGenerator/customPopups/PapersGeneratorMessageFilesVerification.js","libs/applySearchParams.js","libs/applySortParams.js","services/PurchasingGroupSectionService.js","constants/DemandValidationSectionStatus.js","libs/scrollTo.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/basicData/history/propertyTransformer.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/basicData/PurchasingGroupStage1BasicDataForm.js","components/button/HistoryButton.js","components/popup/historyListPopup/HistoryList.js","libs/userNameGetter.js","components/popup/historyListPopup/HistoryElementComparator.js","components/popup/historyListPopup/HistoryListPopup.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/basicData/PurchasingGroupStage1BasicData.js","components/complex/transferList/TransferList.js","components/complex/transferList/Column.js","components/complex/transferList/headers/Header.js","components/complex/transferList/headers/SearchHeader.js","components/complex/transferList/List.js","constants/PositionItems.js","constants/PurchasingGroupPositionItems.js","components/button/IconAddButton.js","constants/CommissionUserType.js","components/button/WorkableIconHighlightOffButton.js","components/complex/commissionForm/transferList/listItems/FullNameItem.js","components/TypographyWithIcon.js","components/popup/addCandidate/PopupForm.js","services/CommissionService.js","components/popup/addCandidate/AddCandidate.js","components/complex/transferList/options/EmptyOptions.js","components/complex/commissionForm/transferList/CandidateColumn.js","components/complex/commissionForm/transferList/listItems/FullNamePositionItem.js","components/complex/commissionForm/transferList/CommissionColumn.js","components/complex/commissionForm/transferList/TransferList.js","components/complex/commissionForm/CommissionForm.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/commission/PurchasingGroupStage1Commission.js","components/DateTimePicker.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/schedule/PurchasingGroupStage1ScheduleForm.js","pages/purchaser/PurchasingGroup/stages/utils/scheduleReloadTimeout.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/schedule/PurchasingGroupStage1Schedule.js","components/BasicSearch.js","libs/iconWorksReducer.js","libs/ConfirmNotification.js","components/button/WorkableIconMailButton.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/MembersElementTitle.js","components/popup/EditDescriptionPopup.js","components/button/WorkableIconSearchButton.js","components/button/WorkableIconDownloadButton.js","components/button/WorkableIconPublishButton.js","components/button/WorkableIconUnpublishButton.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/MembersDocumentsListTableRow.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/constants/PurchasingGroupDocumentStatus.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/SelectMembersDocumentType.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/MembersDocumentsList.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/AddMemberUserPopup.js","services/UserService.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/MembersElementContent.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/MembersElement.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/AddPurchasingGroupMemberPopup.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/components/MembersList.js","pages/purchaser/PurchasingGroup/stages/constants/PurchasingGroupRole.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/members/PurchasingGroupStage1Members.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/papersGenerator/PurchasingGroupStage1PapersGenerator.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/components/AddNewOpinionMemberPopup.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/components/OpinionMessage.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/components/NewOpinionMessage.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/components/OpinionElementContent.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/components/OpinionElementTitle.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/components/OpinionElement.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/opinion/PurchasingGroupStage1Opinion.js","pages/purchaser/PurchasingGroup/stages/stage1/panels/finishPreparing/PurchasingGroupStage1FinishPreparing.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/collectingSchedule/PurchasingGroupStage2ScheduleForm.js","services/PurchasingGroupStage2Service.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/collectingSchedule/PurchasingGroupStage2Schedule.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/components/TemplateMembersElementTitle.js","pages/purchaser/PurchasingGroup/templates/constants/PurchasingGroupTemplateFieldType.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/components/TemplateMemberFormField.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/constants/PurchasingGroupTemplateFormState.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/history/propertyTransformer.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/components/TemplateMemberForm.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/components/TemplateMembersElementContent.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/components/TemplateMembersElement.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/components/TemplateMembersList.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/template/PurchasingGroupStage2Template.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/dealing/PurchasingGroupStage2Dealing.js","components/popup/components/SplitButton.js","pages/purchaser/PurchasingGroup/stages/stage2/panels/finish/PurchasingGroupStage2Finish.js","pages/purchaser/PurchasingGroup/stages/constants/PurchasingGroupStageSections.js","services/PurchasingGroupStage1Service.js","components/complex/papersGenerator/customPopups/gzm/PapersGeneratorGzmManagementResolution.js","components/complex/papersGenerator/customPopups/gzm/PapersGeneratorGzmLeadingDocument.js","components/complex/papersGenerator/customPopups/gzm/PapersGeneratorGzmDraftGroupAgreement.js","components/complex/papersGenerator/customPopups/gzm/PapersGeneratorGzmDocumentToSign.js","hooks/useEzamowieniaOauth.js","components/icon/EZamowieniaIcon.js","services/EzamowieniaService.js","components/complex/papersGenerator/customPopups/xmpUzpPresidentPaper/PapersGeneratorXmpUzpPresidentPaperContent.js","components/complex/papersGenerator/customPopups/xmpUzpPresidentPaper/PapersGeneratorXmpUzpPresidentPaperPopup.js","libs/shareSystems.js","components/popup/ShareSelectPopup.js","components/complex/papersGenerator/PapersGeneratorList.js","pages/purchaser/MyProcedure/scenes/part3/panels/papersGenerator/PapersGenerator.js","pages/purchaser/MyProcedure/scenes/part3/panels/papersGenerator/index.js","hooks/useSearch.js","components/button/MoreButton.js","services/RfxOfferService.js","constants/OfferStatus.js","constants/OfferEncryptionStatus.js","components/complex/offer/components/OfferAdditionalOffersTable.js","services/DemandOffersGeneralInfoService.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoExpansionPanelTitle.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoEntry.js","components/ExpansionPanel.js","libs/formatAmountNumber.js","context/OfferStageTranslationsContext.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoBasicData.js","components/button/WorkableIconForwardButton.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoDocumentsFileTableRow.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoDocumentsFileTable.js","context/PurchaserOfferContext.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoDocuments.js","services/CorrespondenceService.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoPublicAnswersMessage.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoPublicAnswers.js","services/StatisticsService.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/GeneralInfoRealizationAmount.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/GeneralInfoPanel.js","libs/isResponseValidWithStoredPasswordCheck.js","components/ExpansionPanelTitleAvatar.js","pages/contractor/demand/scenes/offer/components/common/constants/OfferMode.js","pages/contractor/demand/scenes/offer/components/common/constants/OfferPositionStatusType.js","constants/SignatureType.js","pages/contractor/demand/scenes/offer/components/common/constants/OfferStatusType.js","services/DemandOffersOfferService.js","constants/ContractorDocumentType.js","constants/RoundType.js","constants/TrueFalseItems.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/files/SelectOfferFilesType.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/files/EditFilePopup.js","services/DemandAdditionalOffersOfferService.js","services/DemandOffersAuctionService.js","context/OfferSectionContext.js","components/icon/SignatureIcon.js","pages/contractor/demand/scenes/offer/components/common/constants/OfferFileSignStatus.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/files/OfferFilesTableSignStatus.js","context/SupportModeContext.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/files/OfferFilesTableRow.js","hooks/useSignature.js","hooks/useLoadingScreen.js","libs/AlertNotification.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/files/OfferFilesTable.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/files/OfferFiles.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/constants/OfferEspdType.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdTypeSwitch.js","components/SimpleSelect.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdInternal.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdExternalUploadFileTypes.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdExternalUploadFile.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdExternal.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdTableRow.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspdTable.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/espd/OfferEspd.js","constants/ContractorOfferEspdType.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/positions/constants/validation.form.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferYesNoInput.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferTextInput.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferNumberInput.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferPriceInput.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferListInput.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferUnits.js","pages/contractor/demand/scenes/offer/components/common/positions/inputs/OfferInput.js","pages/contractor/demand/scenes/offer/components/common/positions/OfferPositionConditions.js","pages/contractor/demand/scenes/offer/components/common/positions/OfferPositionCriteriums.js","pages/contractor/demand/scenes/offer/components/common/positions/OfferPositionItems.js","pages/contractor/demand/scenes/offer/components/common/positions/OfferPositionParameters.js","constants/ContractorConsorciumTypes.js","constants/ContractorCompanySize.js","services/ContractorService.js","components/popup/inviteContactor/components/NipRow.js","components/MaskedTextInput.js","components/popup/inviteContactor/components/PostCodeRow.js","components/popup/inviteContactor/InviteContactorForm.js","components/popup/inviteContactor/InviteContactor.js","pages/contractor/demand/scenes/offer/components/common/commonData/ConsorciumTable.js","components/YesNo.js","pages/contractor/demand/scenes/offer/components/common/positions/OfferPositionConsorciants.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/positions/constants/APIOfferPlacingType.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/SnapshotListPopup.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/VerificationsPopup.js","hooks/useSalesNotification.js","components/popup/salesNotification/constants/salesNotification.keys.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/positions/components/OfferPositionForm.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/positions/OfferMultiPositions.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/positions/OfferSinglePosition.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/positions/OfferPositions.js","components/complex/floatingMenu/ButtonsBar.js","components/complex/floatingMenu/NavigationBar.js","components/complex/floatingMenu/createButton.js","components/PartsRadioTable.js","pages/contractor/demand/scenes/offer/components/common/OfferPositionsSelectPopup.js","pages/contractor/demand/scenes/offer/components/common/commonData/OfferCommonDataForm.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/commonData/OfferCommonData.js","pages/contractor/demand/scenes/offer/components/common/contractorData/OfferContractorData.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/VerificationBeforePlaceOfferPopup.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/ImportOfferFormPopup.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/OfferEditPanel.js","pages/contractor/demand/scenes/offer/components/common/OfferExpansionSectionTitle.js","pages/contractor/demand/scenes/offer/components/panels/offerEdit/components/OfferEditSectionTitle.js","pages/contractor/demand/scenes/offer/components/panels/offerPlaced/OfferPlacedPanel.js","pages/contractor/demand/scenes/offer/components/panels/offerPlaced/components/OfferPlacedSectionTitle.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferEdit/components/commonData/AdditionalOfferCommonData.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferEdit/components/EnvelopeOfferDatePopup.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferEdit/AdditionalOfferEditPanel.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferPlaced/AdditionalOfferPlacedPanel.js","constants/AuctionRule.js","constants/AuctionStatus.js","constants/AuctionType.js","libs/openInNewTab.js","pages/contractor/demand/scenes/offer/components/panels/auctionOfferEdit/components/AuctionRow.js","pages/contractor/demand/scenes/offer/components/panels/auctionOfferEdit/components/AuctionsTable.js","pages/contractor/demand/scenes/offer/components/panels/auctionOfferEdit/AuctionOfferEditPanel.js","pages/contractor/demand/scenes/offer/components/panels/auctionOfferPlaced/AuctionOfferPlacedPanel.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferPlaced/components/AdditionalOfferPlacedSectionTitle.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferEdit/components/AdditionalOfferEditSectionTitle.js","pages/contractor/demand/scenes/offer/components/panels/additionalOfferEditAlt/AdditionalOfferEditAltPanel.js","pages/contractor/demand/scenes/offer/components/panels/generalInfo/components/DeneralInfoSectionTitle.js","pages/contractor/demand/scenes/offer/components/panels/auctionOfferPlaced/components/AuctionOfferPlacedSectionTitle.js","pages/contractor/demand/scenes/offer/constants/StageSections.js","components/complex/offer/components/OfferTableRow.js","components/complex/offer/components/OfferTable.js","libs/contractorImport.js","components/popup/addContactor/AddContactor.js","components/complex/offer/components/envelope/RegisterEnvelopeForm.js","components/complex/offer/components/envelope/RegisterEnvelopePopup.js","components/complex/offer/Offers.js","pages/purchaser/MyProcedure/scenes/part3/panels/offers/OffersPanel.js","pages/purchaser/MyProcedure/scenes/part3/panels/offers/index.js","libs/isBzpAttachmentNoticeType.js","components/complex/documentsTables/swz/AddBzpNoticePopup.js","components/complex/documentsTables/swz/SelectSiwzDocumentType.js","components/popup/DownloadHistoryPopup.js","components/button/WorkableIconDownloadCountButton.js","components/button/WarningRoundedButton.js","context/DemandValidationContext.js","components/complex/documentsTables/swz/SiwzVersionsTableRow.js","components/complex/documentsTables/swz/SiwzVersionsTable.js","components/complex/documentsTables/swz/SiwzFileTableRow.js","components/complex/documentsTables/swz/AddNoticeReferenceNumberPopup.js","components/complex/documentsTables/swz/SiwzFileTable.js","components/complex/documentsTables/swz/SelectSiwzDocument.js","components/complex/documentsTables/swz/SiwzDocuments.js","components/complex/documentsTables/repo/CreateFolderPopup.js","components/complex/documentsTables/repo/SelectFolderPopup.js","components/complex/documentsTables/repo/ChangeRepoVisibilityPopup.js","components/button/WorkableIconEjectButton.js","components/complex/documentsTables/repo/RepoFileTableRow.js","components/complex/documentsTables/repo/RepoFileTable.js","components/complex/documentsTables/repo/RepoFolder.js","components/complex/documentsTables/repo/SelectRepoDocument.js","components/complex/documentsTables/repo/RepoDocuments.js","components/complex/documentsTables/DocumentsTables.js","pages/purchaser/MyProcedure/scenes/part3/panels/documents/DocumentsPanel.js","pages/purchaser/MyProcedure/scenes/part3/panels/documents/index.js","constants/ContractorVerificationProcedureType.js","pages/purchaser/MyProcedure/scenes/part3/panels/contractorVerification/components/VerificationProcedureType.js","constants/ContractorVerificationOfferStatus.js","services/ContractorVerificationService.js","pages/purchaser/MyProcedure/scenes/part3/panels/contractorVerification/components/ContractorVerificationRow.js","pages/purchaser/MyProcedure/scenes/part3/panels/contractorVerification/components/ContractorVerificationTable.js","pages/purchaser/MyProcedure/scenes/part3/panels/contractorVerification/ContractorVerification.js","pages/purchaser/MyProcedure/scenes/part3/panels/contractorVerification/index.js","services/OfferEvaluationService.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/constants/OfferEvaluationViewMode.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/constants/OfferEvaluationPositionStatus.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/components/OffersEvaluationScoreColumn.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/components/OffersEvaluationRow.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/components/OffersEvaluationTable.js","components/DottedPagination.js","components/PaginationButton.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/constants/OfferEvaluationRoundType.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/components/OfferEvaluationSearch.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/OffersEvaluation.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersEvaluation/index.js","services/OfferChoiceService.js","components/Pagination.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/OfferChoiceContractorRowPart.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/AuctionTypeList.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/AuctionHistoryPopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/OfferChoiceSummaryCell.js","constants/AdditionalRoundStatus.js","libs/durations.js","services/AdditionalRoundService.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/additionalRound/OfferChoiceEditAdditionalRoundsDatesPopup.js","constants/ProgressStatus.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/additionalRound/OfferChoiceSummaryCellAdditionalRound.js","services/AuctionService.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/constants/AuctionItemBidType.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/OfferChoiceCreateAuctionTable.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/OfferChoiceCreateAuctionPopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/AuctionTypePart.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/EditDatesAuctionPopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/ConfirmAuction.js","components/popup/save/SaveDialogBase.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/AuctionSaveError.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/auction/OfferChoiceSummaryCellAuction.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/constants/OfferChoiceState.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/OfferChoiceRow.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/OfferChoiceTable.js","components/popup/alert/Alert.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/OfferChoiceCancelWhereNoOffersPopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/OfferChoiceSearch.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/constants/OfferChoiceDecision.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/additionalRound/CreateAdditionalRoundTable.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/additionalRound/OfferChoiceCreateAdditionalRoundPopup.js","components/complex/realizationAmount/RealizationAmountForm.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/components/FinalRealizationValuePopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/OfferChoice.js","pages/purchaser/MyProcedure/scenes/part3/panels/offerChoice/index.js","services/OffersChoiceResultService.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/constants/OfferChoiceResultFileState.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/components/OfferChoiceResultFilesTableRow.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/components/OfferChoiceResultFilesTable.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/components/OfferChoiceResultFiles.js","components/button/WorkableIconPrintButton.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/components/OfferChoiceResultFilePublishPopup.js","components/button/WorkableIconCalendarButton.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/components/OfferChoiceResultRow.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/constants/OfferChoiceResultState.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/components/OfferChoiceResultTable.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/OffersChoiceResult.js","pages/purchaser/MyProcedure/scenes/part3/panels/offersChoiceResult/index.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/constants/AgreementListType.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/components/AgreementsListType.js","services/AgreementsService.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/components/AgreementCreatePopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/components/AgreementsAvailablePanel.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/components/AgreementsCreatedPanel.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/constants/AgreementType.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/constants/AgreementState.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/AgreementsPanel.js","pages/purchaser/MyProcedure/scenes/part3/panels/agreements/index.js","services/EvaluationFinishService.js","services/RfxRoundService.js","components/popup/invalidate/InvalidateDemandPopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/evaluationFinish/EvaluationFinish.js","pages/purchaser/MyProcedure/scenes/part3/panels/evaluationFinish/index.js","services/AdditionalRoundPassiveService.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalRoundPassive/components/AdditionalRoundPassiveStatusCell.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalRoundPassive/components/AdditionalRoundPassiveRow.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalRoundPassive/components/AdditionalRoundPassiveTable.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalRoundPassive/components/AdditionalRoundPassiveCreatePopup.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalRoundPassive/AdditionalRoundPassive.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalRoundPassive/index.js","pages/purchaser/MyProcedure/scenes/part3/panels/stageFinish/StageFinish.js","pages/purchaser/MyProcedure/scenes/part3/panels/stageFinish/index.js","pages/purchaser/MyProcedure/scenes/part3/panels/primaryTenderChoice/PrimaryTenderChoice.js","pages/purchaser/MyProcedure/scenes/part3/panels/primaryTenderChoice/index.js","services/DemandAdditionalInfoService.js","context/FormTranslationContext.js","components/complex/nationalNotice/components/inputs/NoticeYesNoInput.js","components/complex/nationalNotice/components/inputs/NoticeIntegerInput.js","components/SelectTreeView.js","components/complex/nationalNotice/components/inputs/NoticeGlossaryInput.js","components/complex/nationalNotice/components/inputs/NoticeNumericInput.js","pages/purchaser/MyProcedure/scenes/part1/panels/additionalInfo/PreparingAdditionalInfo.js","pages/purchaser/MyProcedure/scenes/part3/panels/additionalInfo/index.js","pages/purchaser/MyProcedure/scenes/part3/part3.panels.components.js","services/ResultNoticeService.js","pages/purchaser/MyProcedure/scenes/part4/panels/resultNotice/components/AttachmentResultNoticeRow.js","pages/purchaser/MyProcedure/scenes/part4/panels/resultNotice/components/AttachmentResultNotice.js","constants/PublicationConst.js","pages/purchaser/MyProcedure/scenes/part4/panels/resultNotice/constants/ResultNoticeType.js","pages/purchaser/MyProcedure/scenes/part4/panels/resultNotice/components/OjsResultNotice.js","components/complex/documentsTables/swz/AddBzpResultNoticePopup.js","pages/purchaser/MyProcedure/scenes/part4/panels/resultNotice/ResultNoticePanel.js","pages/purchaser/MyProcedure/scenes/part4/panels/resultNotice/index.js","services/ArchivingService.js","pages/purchaser/MyProcedure/scenes/part4/panels/archiving/constants/ArchivingStatus.js","pages/purchaser/MyProcedure/scenes/part4/panels/archiving/ArchivingPanel.js","pages/purchaser/MyProcedure/scenes/part4/panels/archiving/index.js","services/FinishDemandService.js","pages/purchaser/MyProcedure/scenes/part4/panels/finish/components/UnpublishNoticePopup.js","pages/purchaser/MyProcedure/scenes/part4/panels/finish/FinishDemandPanel.js","pages/purchaser/MyProcedure/scenes/part4/panels/finish/index.js","pages/purchaser/MyProcedure/scenes/part4/panels/documents/FinishDocumentsPanel.js","pages/purchaser/MyProcedure/scenes/part4/panels/documents/index.js","services/DemandPlanRealizationService.js","components/icon/CalcIcon.js","components/button/WorkableIconCalcButton.js","components/complex/netGrossCalc/NetGrossCalcPopup.js","components/complex/netGrossCalc/NetGrossCalc.js","pages/purchaser/MyProcedure/scenes/part4/panels/plan/components/DemandPlanRealizationRow.js","pages/purchaser/MyProcedure/scenes/part4/panels/plan/components/DemandPlanRealizationTable.js","pages/purchaser/MyProcedure/scenes/part4/panels/plan/DemandPlanRealizationPanel.js","pages/purchaser/MyProcedure/scenes/part4/panels/additionalInfo/index.js","pages/purchaser/MyProcedure/scenes/part4/part4.panels.components.js","pages/purchaser/MyProcedure/scenes/part4/panels/plan/index.js","services/helpers/validateSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/dealings/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/schedule/deadlinesEdit/FormElement.js","pages/purchaser/MyProcedure/scenes/part1/panels/schedule/constants/period.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/schedule/deadlinesEdit/DateBind.js","services/ScheduleService.js","pages/purchaser/MyProcedure/scenes/part1/panels/schedule/deadlinesEdit/DeadlinesEdit.js","pages/purchaser/MyProcedure/scenes/part1/panels/schedule/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/commission/DemandCommissionForm.js","pages/purchaser/MyProcedure/scenes/part1/panels/commission/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/constants/exclusion.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/constants/selection.values.js","services/EspdService.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/constants/procedureType.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/constants/buyerType.values.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/ProcedureSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/components/Section.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/components/Element.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/components/AllElements.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/components/AllSections.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/ExclusionSection.js","constants/EspdBooleanItems.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/SelectionSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/components/ExportJedzButtons.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/components/DealingJedzSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/JEDZFormContent.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/jedz/JEDZ.js","pages/purchaser/MyProcedure/scenes/part1/panels/espd/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/siwz/documents/Documents.js","pages/purchaser/MyProcedure/scenes/part1/panels/siwz/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/guarantee/components/WadiumField.js","pages/purchaser/MyProcedure/scenes/part1/panels/guarantee/components/WadiumTable.js","services/GuaranteeService.js","pages/purchaser/MyProcedure/scenes/part1/panels/guarantee/constants/validation.js","pages/purchaser/MyProcedure/scenes/part1/panels/guarantee/Wadium.js","pages/purchaser/MyProcedure/scenes/part1/panels/guarantee/index.js","components/button/IconExternalSignButton.js","components/complex/contractor/ContractorTable.js","pages/purchaser/MyProcedure/scenes/part1/panels/contractor/ContactorPage.js","pages/purchaser/MyProcedure/scenes/part1/panels/contractor/index.js","services/NoticeService.js","pages/purchaser/MyProcedure/scenes/part1/panels/notice/NoticePage.js","pages/purchaser/MyProcedure/scenes/part1/panels/notice/index.js","services/NationalNoticeService.js","pages/purchaser/MyProcedure/scenes/part1/panels/nationalNotice/NationalNoticeSection.js","pages/purchaser/MyProcedure/scenes/part1/panels/nationalNotice/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/papersGenerator/PreparingPapersGenerator.js","pages/purchaser/MyProcedure/scenes/part1/panels/papersGenerator/index.js","services/PublishService.js","pages/purchaser/MyProcedure/scenes/part1/panels/publication/ConfirmPublish.js","pages/purchaser/MyProcedure/scenes/part1/panels/publication/PublishSection.js","libs/getUncompletedSections.js","components/complex/nationalNotice/constants/NationalNoticeStatus.js","libs/isPublishButtonActive.js","pages/purchaser/MyProcedure/scenes/part1/panels/publication/NoticeButtons.js","pages/purchaser/MyProcedure/scenes/part1/panels/publication/InformationSection.js","libs/isCancelModificationButtonActive.js","libs/isPreviewDemandPublicFormButtonActive.js","constants/EzamowieniaRequiredGroups.js","pages/purchaser/MyProcedure/scenes/part1/panels/publication/BzpNoticeButtons.js","pages/purchaser/MyProcedure/scenes/part1/panels/publication/Publication.js","libs/isPreviewButtonActive.js","libs/isPreviewNoticeButtonActive.js","pages/purchaser/MyProcedure/scenes/part1/panels/exPostGoToFinish/ExPostGoToFinish.js","pages/purchaser/MyProcedure/scenes/part1/panels/questionnaire/Questionnaire.js","pages/purchaser/MyProcedure/scenes/part1/part1.panels.components.js","pages/purchaser/MyProcedure/scenes/part1/panels/exPostGoToFinish/index.js","pages/purchaser/MyProcedure/scenes/part1/panels/additionalInfo/index.js","pages/purchaser/MyProcedure/scenes/components/AccordionPart.js","components/popup/relatedObjects/DemandRelatedObjectsPopup.js","pages/purchaser/MyProcedure/scenes/part1/Part1.js","components/Workspace.js","hooks/useNodeTopPosition.js","pages/purchaser/MyProcedure/scenes/part2/components/Section.js","services/RfxSupplierService.js","pages/purchaser/MyProcedure/scenes/part2/sections/ContractorSection.js","pages/purchaser/MyProcedure/scenes/part2/sections/OfferSection.js","components/complex/countdown/ProgressRing.js","components/complex/countdown/RingCountdown.js","pages/purchaser/MyProcedure/scenes/part2/sections/StatisticSection.js","pages/purchaser/MyProcedure/scenes/part2/components/ExpansionProgressPanel.js","pages/purchaser/MyProcedure/scenes/part2/components/OfferDecryptionProgress.js","pages/purchaser/MyProcedure/scenes/part2/constants/OnlinePlatforms.js","pages/purchaser/MyProcedure/scenes/part2/components/EditSessionOnlinePopup.js","pages/purchaser/MyProcedure/scenes/part2/components/PublicSessionOnlineProgress.js","pages/purchaser/MyProcedure/scenes/part2/components/RealizationAmountProgress.js","pages/purchaser/MyProcedure/scenes/part2/sections/OfferDecryptionSection.js","pages/purchaser/MyProcedure/scenes/part2/sections/DocumentsSection.js","pages/purchaser/MyProcedure/scenes/part2/components/ResendOfferInvitationPopup.js","components/Tile.js","pages/purchaser/MyProcedure/scenes/part2/components/TilesRow.js","services/PollService.js","components/popup/poll/PollNpsSwitch.js","components/popup/poll/Poll.js","pages/purchaser/MyProcedure/scenes/part2/Part2.js","pages/purchaser/MyProcedure/scenes/part3/panels/components/RealizationValuePopup.js","pages/purchaser/MyProcedure/scenes/part3/Part3.js","pages/purchaser/MyProcedure/scenes/part4/Part4.js","components/OrganizationsSelect.js","libs/contractorNameBuilder.js","components/complex/correspondence/CorrespondenceEmailList.js","components/complex/correspondence/AddThreadPopup.js","components/complex/correspondence/AddThreadAsSupplierForm.js","components/complex/correspondence/AddThreadAsSupplierPopup.js","components/complex/correspondence/MessageEmailDeliveryPopup.js","components/complex/correspondence/Message.js","components/complex/correspondence/NewMessageForm.js","components/complex/correspondence/PublishMessageConfirmationPopup.js","components/complex/correspondence/NewMessage.js","components/complex/correspondence/MessagesList.js","components/complex/correspondence/Thread.js","components/complex/correspondence/AddBulkMessagePopup.js","components/complex/correspondence/ThreadsPanel.js","components/complex/correspondence/CorrespondenceSearch.js","components/complex/correspondence/Correspondence.js","pages/purchaser/MyProcedure/scenes/correspondence/sections/CorrespondenceSection.js","pages/purchaser/MyProcedure/scenes/correspondence/CorrespondencePanel.js","services/EmailListService.js","pages/purchaser/MyProcedure/scenes/emailList/components/EmailListSearch.js","pages/purchaser/MyProcedure/scenes/emailList/components/EmailDeliveriesTable.js","pages/purchaser/MyProcedure/scenes/emailList/components/EmailDetailsPopup.js","pages/purchaser/MyProcedure/scenes/emailList/components/EmailListSection.js","pages/purchaser/MyProcedure/scenes/emailList/EmailListPanel.js","components/complex/nationalNotice/components/inputs/NoticeTextInput.js","components/complex/nationalNotice/contractNotice/components/BasicData.js","components/complex/nationalNotice/components/inputs/NoticeTypography.js","components/complex/nationalNotice/contractNotice/components/PurchaserDataTogetherList.js","components/complex/nationalNotice/contractNotice/components/PurchaserDataTogether.js","components/complex/nationalNotice/contractNotice/components/PurchaserDataEntrusted.js","components/complex/nationalNotice/contractNotice/components/PurchaserData.js","components/complex/nationalNotice/components/FormNavigator.js","components/complex/nationalNotice/contractNotice/contractNoticeSteps.js","components/complex/nationalNotice/contractNotice/contractNoticeValidation.js","components/complex/nationalNotice/contractNotice/components/RealizationTypeData.js","components/complex/nationalNotice/contractNotice/components/DocumentsAccessData.js","components/CPVSingleInput.js","components/complex/nationalNotice/components/inputs/NoticeCpvInput.js","components/complex/nationalNotice/components/inputs/NoticeDateInput.js","components/complex/nationalNotice/contractNotice/components/OrderObjectNotDivided.js","components/complex/nationalNotice/components/DealingsNavigator.js","components/complex/nationalNotice/contractNotice/components/OrderObjectDividedList.js","components/complex/nationalNotice/contractNotice/components/OrderObjectDivided.js","components/complex/nationalNotice/contractNotice/components/OrderObjectData.js","components/complex/nationalNotice/contractNotice/components/QualificationData.js","components/complex/nationalNotice/contractNotice/components/ObjectiveEvidenceData.js","components/complex/nationalNotice/contractNotice/components/OrderTermsData.js","components/complex/nationalNotice/contractNotice/components/ContractDraftData.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsFrameworkAgreement.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsLotCriterion.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsPrimaryLot.js","components/complex/nationalNotice/components/inputs/NoticeDateTimeInput.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsPrimary.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsPartnership.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsPartnershipLot.js","components/complex/nationalNotice/contractNotice/components/OrderDetailsData.js","components/complex/nationalNotice/contractNotice/components/AdditionalInfoData.js","components/complex/nationalNotice/contractNotice/ContractNoticeForm.js","components/complex/nationalNotice/xmlUzpPresidentPaper/XmlUzpPresidentPaper.js","components/complex/nationalNotice/NationalNoticePage.js","pages/purchaser/MyProcedure/scenes/nationalNotice/NationalNoticePanel.js","pages/purchaser/MyProcedure/scenes/PartsRouter.js","components/Page.js","components/complex/infobar/InfoDataElement.js","components/complex/infobar/InfoData.js","components/complex/infobar/OpenBarText.js","components/complex/infobar/InfoBarTitleButton.js","components/complex/infobar/InfoBarTitle.js","libs/extendFindSectionEditable.js","components/complex/infobar/InfoBar.js","components/complex/stagebar/components/StageElement.js","components/complex/stagebar/StageBar.js","pages/purchaser/MyProcedure/scenes/StepperPages.js","components/SearchInput.js","pages/purchaser/MyProcedure/scenes/home/started/components/SearchBar.js","services/DemandsService.js","hooks/usePathParams.js","components/button/WorkableIconDuplicateButton.js","pages/purchaser/MyProcedure/scenes/home/started/Started.js","pages/purchaser/MyProcedure/scenes/home/HomeRoute.js","pages/purchaser/MyProcedure/scenes/home/MyProcedureHome.js","pages/purchaser/MyProcedure/MyProcedure.js","pages/purchaser/PurchasingGroup/stages/components/PurchasingGroupStageSection.js","pages/purchaser/PurchasingGroup/stages/components/PurchasingGroupStage.js","pages/purchaser/PurchasingGroup/stages/stage2/PurchasingGroupStage2.js","pages/purchaser/PurchasingGroup/stages/stage1/PurchasingGroupStage1.js","pages/purchaser/PurchasingGroup/stages/PurchasingGroupStageNr.js","pages/purchaser/PurchasingGroup/stages/PurchasingGroupStagesRouter.js","pages/purchaser/PurchasingGroup/stages/components/PurchaserGroupInfoBar.js","components/complex/stagebar/StageBarCommon.js","pages/purchaser/PurchasingGroup/constants/PurchasingGroupStatus.js","pages/purchaser/PurchasingGroup/stages/components/PurchaserGroupStageBar.js","pages/purchaser/PurchasingGroup/stages/PurchasingGroupStages.js","pages/purchaser/PurchasingGroup/list/PurchasingGroupSearch.js","pages/purchaser/PurchasingGroup/list/PurchasingGroupList.js","pages/purchaser/PurchasingGroup/list/PurchasingGroupMemberList.js","services/PurchasingGroupTemplateService.js","components/button/WorkableIconDeactivateButton.js","components/button/WorkableIconActivateButton.js","pages/purchaser/PurchasingGroup/templates/PurchasingGroupTemplatesList.js","components/button/IconDragButton.js","components/complex/sortable/SortableHandle.js","components/RadioGroupYesNo.js","pages/purchaser/PurchasingGroup/templates/components/PurchasingGroupTemplateField.js","pages/purchaser/PurchasingGroup/templates/components/PurchasingGroupTemplateAggregatedFieldsPopup.js","pages/purchaser/PurchasingGroup/templates/components/PurchasingGroupTemplateForm.js","pages/purchaser/PurchasingGroup/templates/PurchasingGroupTemplate.js","pages/purchaser/PurchasingGroup/PurchasingGroup.js","services/RegistrationService.js","pages/purchaser/Admin/registrations/constants/RegistrationStatus.js","pages/purchaser/Admin/registrations/list/RegistrationsSearch.js","pages/purchaser/Admin/registrations/list/RegistrationsList.js","pages/purchaser/Admin/registrations/registration/InfoEntry.js","pages/purchaser/Admin/registrations/registration/UserRegistrationRejectPopup.js","pages/purchaser/Admin/registrations/registration/UserRegistrationAddOrganizationUnit.js","pages/purchaser/Admin/registrations/registration/UserRegistration.js","pages/purchaser/Admin/Admin.js","pages/contractor/demand/scenes/offer/components/common/OfferExpansionSections.js","pages/contractor/demand/scenes/offer/components/common/DefineOfferPasswordPopup.js","pages/contractor/demand/scenes/offer/components/OfferSections.js","pages/purchaser/demand/scenes/offer/PurchaserOfferPanel.js","pages/purchaser/demand/scenes/PurchaserScenesRouter.js","components/complex/stagebar/ContractorStageBar.js","pages/purchaser/demand/scenes/PurchaserStepperPages.js","pages/purchaser/demand/scenes/preview/PurchaserPreviewPanel.js","pages/purchaser/demand/PurchaserDemand.js","pages/purchaser/annualReport/report/constants/AnnualReportStatus.js","services/AnnualReportsService.js","pages/purchaser/annualReport/list/components/AddAnnualReportPopup.js","pages/purchaser/annualReport/list/components/AnnualReportListTableRow.js","pages/purchaser/annualReport/list/AnnualReportsList.js","pages/purchaser/annualReport/report/constants/annualReportSteps.js","pages/purchaser/annualReport/report/constants/annulaReportClasses.js","pages/purchaser/annualReport/report/components/common/AnnualReportNavigator.js","pages/purchaser/annualReport/report/constants/AnnualReportNoticeSource.js","pages/purchaser/annualReport/report/constants/annualReportValidation.js","pages/purchaser/annualReport/report/components/purchaser/AnnualReportPurchaserForm.js","pages/purchaser/annualReport/report/components/common/AnnualReportTableCell.js","pages/purchaser/annualReport/report/components/common/AnnualReportEditPopup.js","libs/scrollToContainer.js","pages/purchaser/annualReport/report/components/aboveEu/AnnualReportAboveEuEditForm.js","libs/formatBoolean.js","libs/formatInteger.js","pages/purchaser/annualReport/report/components/common/AnnualReportSearchBar.js","pages/purchaser/annualReport/report/components/common/AnnualReportTableHeadCell.js","pages/purchaser/annualReport/report/components/common/MoveAnnualReportEntry.js","components/button/WorkableIconErrorButton.js","pages/purchaser/annualReport/report/components/common/AnnualReportTablePart.js","pages/purchaser/annualReport/report/components/aboveEu/AnnualReportAboveEuForm.js","pages/purchaser/annualReport/report/components/belowEu/AnnualReportBelowEuEditForm.js","pages/purchaser/annualReport/report/components/belowEu/AnnualReportBelowEuTablePart.js","pages/purchaser/annualReport/report/components/belowEu/AnnualReportBelowEuForm.js","pages/purchaser/annualReport/report/components/conflict/AnnualReportConflictEditForm.js","pages/purchaser/annualReport/report/constants/annualReportTenderMode.js","pages/purchaser/annualReport/report/components/conflict/AnnualReportConflictForm.js","pages/purchaser/annualReport/report/components/community/AnnualReportCommunityEditForm.js","pages/purchaser/annualReport/report/components/community/AnnualReportCommunityForm.js","pages/purchaser/annualReport/report/components/social/AnnualReportSocialEditForm.js","pages/purchaser/annualReport/report/components/social/AnnualReportSocialForm.js","pages/purchaser/annualReport/report/components/innovative/AnnualReportInnovativeEditForm.js","pages/purchaser/annualReport/report/components/innovative/AnnualReportInnovativeForm.js","pages/purchaser/annualReport/report/components/exception/AnnualReportExceptionEditForm.js","pages/purchaser/annualReport/report/components/exception/AnnualReportExceptionTablePart.js","pages/purchaser/annualReport/report/components/exception/AnnualReportExceptionForm.js","pages/purchaser/annualReport/report/components/notIncluded/AnnualReportNotIncludedEditForm.js","pages/purchaser/annualReport/report/components/notIncluded/AnnualReportNotIncludedTablePart.js","pages/purchaser/annualReport/report/components/notIncluded/AnnualReportNotIncludedForm.js","pages/purchaser/annualReport/report/constants/dictToTranslationMap.js","components/Link.js","pages/purchaser/annualReport/report/components/common/AnnualReportError.js","pages/purchaser/annualReport/report/components/common/ReloadAnnualReportTableFromPrevVersionButton.js","pages/purchaser/annualReport/report/components/common/ReloadAnnualReportTableButton.js","pages/purchaser/annualReport/report/AnnualReportPage.js","pages/purchaser/annualReport/AnnualReport.js","pages/purchaser/PurchaserRouter.js","services/SalesService.js","components/popup/salesNotification/SalesNotificationPopup.js","components/popup/confirm/ConfirmThreeButtons.js","components/popup/confirmCloseStepper/ConfirmCloseStepper.js","components/complex/feedback/FeedbackContentOpen.js","components/complex/feedback/FeedbackContentClosed.js","components/complex/feedback/Feedback.js","components/complex/ezamowienia/EzamowieniaOauth.js","pages/purchaser/PurchaserRoot.js","pages/contractor/demand/scenes/correspondence/sections/CtrCorrespondenceSection.js","pages/contractor/demand/scenes/correspondence/CtrCorrespondencePanel.js","pages/contractor/demand/scenes/offer/components/ContractorClock.js","pages/contractor/demand/scenes/offer/components/OfferTilesRow.js","pages/contractor/demand/scenes/offer/CtrOfferPanel.js","pages/contractor/demand/scenes/CtrScenesRouter.js","components/complex/signature/ChooseSignatureTypePopup.js","libs/loadExternalLibrary.js","components/complex/signature/Szafir.js","components/complex/signature/ExternalSignature.js","components/complex/signature/Signature.js","pages/contractor/demand/scenes/CtrStepperPages.js","pages/contractor/demand/CtrDemand.js","pages/contractor/ContractorRouter.js","pages/contractor/ContractorRoot.js","pages/Router.js","components/complex/tutorial/WelcomeTutorial.js","components/complex/tutorial/TourTooltip.js","components/complex/tutorial/tutorial.steps.js","components/complex/tutorial/Tutorial.js","components/popup/save/SaveDialog.js","components/popup/save/SaveDialogError.js","components/popup/save/SaveDialogInfo.js","components/popup/save/Save.js","hooks/useInterval.js","components/popup/session/Session.js","components/popup/registerPopup/RegisterPopup.js","services/UserNavigationService.js","services/ClientService.js","hooks/useInitialize.js","components/popup/confirm/HookConfirmPopup.js","components/popup/alert/HookAlertPopup.js","components/complex/loadingScreen/HookLoadingScreen.js","pages/Root.js","theme/ThemeProvider.js","App.js","serviceWorker.js","index.js"],"names":["getLocale","cname","name","ca","document","cookie","split","i","length","c","charAt","substring","indexOf","getCookie","Tr","key","obj","translateObj","tr","en","pl","undefined","k","find","replace","RegExp","action","type","payload","setResource","id","value","clearResource","addObjectResource","setPrivileges","setSignature","clearSignature","__setStoreValue","__setStoreMultiValue","setContrastColors","setMenuOpen","setSalesNotification","salesNotification","setEzamowieniaOauth","ezamowieniaOauth","clearEzamowieniaOauth","setConfirmCloseStepper","handleConfirm","sectionName","handleSecondConfirm","setConfirmNotifications","confirmNotification","setAlertNotifications","alertNotification","__setSaveStatus","setSaveStatusLoading","saveStatusValues","setSaveStatusClosed","setSaveStatusDialog","setSaveStatusInfo","message","saveStatus","saveStatusMessage","setSaveStatusError","errorMessage","setOpenTutorial","setInnerMenuOpen","setOpenRegisterPopup","setOpenForm","setOpenImporter","setFormDraftLoaded","draftLoaded","setStepperState","state","setStepperStateCloseValidator","closeValidationFunction","clearStepperStateCloseValidator","setStepperStateDeleteFormDraftFunction","deleteFormDraftFunc","clearStepperStateDeleteFormDraftFunction","setStepperStateSaveFormDraftFunction","clearStepperStateSaveFormDraftFunction","createPath","route","params","compile","purchaserBaseRoute","purchaserBaseRoute2","contractorBaseRoute","root","BASE","buyerPaths","BUYER_INIT","MY_PROCEDURE","FAQ","PURCHASER_INIT","PURCHASING_GROUP","ANNUAL_REPORT","ADMIN","DEMAND","ctrPaths","CTR_INIT","CTR_DEMAND","ctrDemand","old","CTR_DEMAND_CORRESPONDENCE_ID","steps","CTR_DEMAND_ID","CTR_DEMAND_ID_CORRESPONDENCE","CTR_DEMAND_ID_OFFER","CTR_DEMAND_ID_OFFER_STAGE","CTR_DEMAND_ID_OFFER_STAGE_ID","CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION","myProcedureSteps","MP_1","MP_2","MP_3","MP_4","MP_CORRESPONDENCE","MP_EMAIL_LIST","MP_NATIONAL_NOTICE","myProcedureStepsTabsEdit","MP_1_ID","MP_2_ID","MP_3_ID","MP_4_ID","MP_CORRESPONDENCE_ID","MP_EMAIL_LIST_ID","MP_NATIONAL_NOTICE_FORM_TYPE_ID","myProcedure","annualReport","MP_ANNUAL_REPORT","MP_ANNUAL_REPORT_YEAR_LIST","MP_ANNUAL_REPORT_REPORT","MP_ANNUAL_REPORT_REPORT_ID","MP_ANNUAL_REPORT_REPORT_ID_TABLE","purchasingGroup","MP_PURCHASING_GROUP","MP_PURCHASING_GROUP_LIST","MP_PURCHASING_GROUP_MEMBER_LIST","MP_PURCHASING_GROUP_TEMPLATES","MP_PURCHASING_GROUP_TEMPLATES_LIST","MP_PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID","MP_PURCHASING_GROUP_GROUP","MP_PURCHASING_GROUP_GROUP_ID","MP_PURCHASING_GROUP_GROUP_ID_EMAIL_LIST","MP_PURCHASING_GROUP_GROUP_ID_STAGE","MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR","MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR_SECTION","purchaserDemand","PURCHASER_DEMAND_ID","PURCHASER_DEMAND_ID_OFFER","PURCHASER_DEMAND_ID_PREVIEW","PURCHASER_DEMAND_ID_PREVIEW_ID_STAGE_ID_SECTION","PURCHASER_DEMAND_ID_OFFER_CONTRACTOR","PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID","PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE","PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID","PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID_SECTION","admin","ADMIN_REGISTRATIONS","ADMIN_REGISTRATIONS_LIST","ADMIN_REGISTRATION_ID","matchOpenDrawerMenu","matchOpenDrawerMenuNotExact","setMenuOpenOnPath","path","window","location","pathname","store","reduxStore","getState","open","includes","item","startsWith","isMenuOpen","dispatch","redirect","setSearchObj","searchObj","search","querystring","stringify","redirectWithoutHistory","redirectReplace","redirectWithSearch","baseRoute","DemandValidation","DemandValidationKeys","COMMISSION","QUESTIONNAIRE","DEALINGS","SCHEDULE","SIWZ","PUBLICATION","EX_POST_GO_TO_FINISH","ESPD","NOTICE","NATIONAL_NOTICE","CONTRACTOR","GUARANTEE","PREPARING_PAPERS_GENERATOR","PREPARING_ADDITIONAL_INFO","OFFERS","DOCUMENTS","CONTRACTOR_VERIFICATION","OFFERS_EVALUATION","OFFER_CHOICE","PRIMARY_TENDER_CHOICE","ADDITIONAL_ROUND_PASSIVE","OFFERS_CHOICE_RESULT","EVALUATION_FINISH","STAGE_FINISH","PAPERS_GENERATOR","AGREEMENTS","EVALUATION_ADDITIONAL_INFO","RESULT_NOTICE","FINISH_DOCUMENTS","DEMAND_PLAN_REALIZATION","FINISH_DEMAND","ARCHIVING","FINISH_ADDITIONAL_INFO","DemandValidationTr","Object","keys","reduce","prev","createItem","trKey","href","hrefExpand","title","createStep","apiId","confirmClosing","label","rp","RouterPath","initialState","stateCloseValidator","stateCloseFunction","createStore","combineReducers","resources","idObject","keyValuePairObject","forEach","privileges","contrast","largeText","clientColors","openTutorial","form","authorize","counter","innerMenu","stepper","saveFormDraftFunc","formValues","dirty","signature","composeWithDevTools","NotFound","Typography","variant","align","ListItem","Icon","onClick","className","classes","classesObj","iconPosition","openInner","url","innerKey","singleLink","tooltip","renderItem","component","shouldRender","isSelected","iconBase","ListItemIcon","clsx","iconOpen","contrastColor","iconContrast","icon","Tooltip","itemClass","onHover","elementColor","mainPadding","button","x","onArrowClick","Box","epmptySpace","iconInnerOpen","innerArrow","leftMargin","ListItemText","textBox","primary","primaryTypographyProps","noWrap","text","rightIcon","defaultProps","withRouter","withStyles","theme","marginLeft","spacing","minWidth","transform","color","palette","contrastText","components","navigation","paddingLeft","whiteSpace","fill","main","background","light","secondary","width","maxWidth","memo","prevProps","nextProps","JSON","paddingTop","paddingBottom","setOpen","ArrowIcon","Logo","purchaser","isContrast","logoLongMem","useMemo","logoLongContrast","logoIconMem","to","image","imageOpen","imageClose","src","alt","connect","height","objectFit","Button","hideTooltip","placement","children","others","disabled","transparentBorder","Boolean","marginRight","border","ListElement","onMouseEnter","onMouseLeave","NewProcedureMenu","anchorEl","onClose","items","useState","anchorItem","setAnchorItem","useEffect","handleClickElement","e","handleMouseEnter","currentTarget","Popper","relatedTarget","attributes","role","Paper","List","map","zIndex","isNonpublicProcedure","procedureType","ProcedureType","NATIONAL_NONPUBLIC_TYPE","NATIONAL_LOWCOST_TYPE","isNationalProcedure","NATIONAL_PUBLIC","NATIONAL_SOCIAL_SERVICES","isEuropeProcedure","EUROPE_PUBLIC","EUROPE_SOCIAL_SERVICES","COMPETITION","DYNAMICPURCHASINGSYSTEM","FRAMEWORKDEMAND","LOWCOST","PUBLIC","RESEARCH","RESEARCHTECHNICAL","SOCIALSERVICES","STANDARDPURCHASEREQUEST","NONPUBLICEXECUTIVE","NATIONAL_LOWCOST","NATIONAL_RESEARCH_TYPE","CONCESSION","ProcedureTypeTr","ProcedureType_PZP_2021","values","newDeamandFunction","passive","procedures","proc","system","push","ListAddButton","setAnchorEl","buttonLabel","fullWidth","size","buttonTooltipWraper","menuItems","padding","marginBottom","display","devMode","process","redirect_uri","origin","SERVER_URL","EXT_JS_LIBRARIES","jquery","encodeURIComponent","pjson","version","szafir","BASE_MP","oauth","AUTHORIZE","TOKEN","LOGOUT","base","DEMANDS","RFX","CPV_LIST","MEASURE_UNITS","ITEMS","USER","SALES","POLL","UPLOAD","csrf","encryptRoundId","CHANG_LANGUAGE","language","country","backUrl","sales","SALES_NOTIFICATION_SEND","functionalityName","poll","POLL_SAVE_RATING","POLL_GET","pollType","DEMAND_BASE","RFX_BASE","__DEMAND_AUTOSAVE","__DEMAND_EXPOST_AUTOSAVE","demand","DEMAND_SAVE","DEMAND_SAVE_EX_POST","DEMAND_GET_NEW","DEMAND_GET_BY_ID","DEMAND_COMMISION_USER_HISTORY","DEMAND_AUTOSAVE","DEMAND_AUTOSAVE_CHECK","DEMAND_EXPOST_AUTOSAVE","DEMAND_EXPOST_AUTOSAVE_CHECK","DEMAND_PREVIEW","DEMAND_ACTIONS","DEMAND_DELETE","DEMAND_CLONE","DEMAND_REALTED_OBJECTS","DEMAND_PRIVILEGES","DEMAND_RFX_PRIVILEGES","DEMAND_UPDATE_NUMBER","DEALINGS_AUTOSAVE_DEALING","dealingId","dealings","DEALINGS_SINGLE","demandId","DEALINGS_LIST","DEALINGS_SAVE","DEALINGS_VALIDATE","DEALINGS_DELETE","DEALINGS_AUTOSAVE","DEALINGS_AUTOSAVE_CHECK","DEALINGS_AUTOSAVE_BATCH","DEALINGS_IMPORT","DEALINGS_EXPORT","DEALINGS_WITH_CRITERION","critId","DEALINGS_MATCHING_CRITERION","stageId","criteriumType","DEALING","dealing","DEALING_REALIZATION_VALUE","DEALING_FINAL_REALIZATION_VALUE","DEALING_REALIZATION_VALUE_STATUS","DEALING_REALIZATION_VALUE_PUBLISH","DEALING_REALIZATION_VALUE_UNPUBLISH","papersGenerator","RFX_REQUEST_POSITION","SWZ_PARAMS","RFX_INVITED_SUPPLIER_WITH_OFFER","RFX_INVITED_SUPPLIER_POSITION","supplierId","SIWZ_GET_GENERATOR_PARAMS","XMM_UZP_PRESIDENT_PAPER","GET_SUPPLIER_ATTACHMENTS_VERIFICATION","PAPERS_GENERATOR_PRINT","identity","paper","PAPERS_GENERATOR_PRINT_SHARE","shareSystem","PAPERS_GENERATOR_DEMAND_REPORT","report","PAPERS_GENERATOR_DEMAND_ATTACHMENT_VERIFICATION_REPORT","PAPERS_GENERATOR_CORRESPONDENCE_ATTACHMENT_VERIFICATION_REPORT","PAPERS_GENERATOR_DEMAND_PROCESS_HISTORY","EMAIL_LIST","emailList","EMAIL_LIST_ACTIONS","EMAIL_DETAILS","emailId","EMAIL_PRINT","schedule","SCHEDULE_AUTOSAVE","SCHEDULE_AUTOSAVE_CHECK","SCHEDULE_SAVE","SCHEDULE_VALIDATE","commission","COMMISSION_AUTOSAVE","COMMISSION_AUTOSAVE_CHECK","COMMISSION_VALIDATE","COMMISSION_AVAILABLE","COMMISSION_HISTORY","COMMISSION_DELETE_COMMISION_MEMBER","COMMISSION_MARK_HISTORICAL_MEMBER","COMMISSION_EXTERNAL","GUARANTEE_AUTOSAVE","guarantee","GUARANTEE_VALIDATE","GUARANTEE_AUTOSAVE_CHECK","ESPD_AUTOSAVE","espd","ESPD_SAVE","ESPD_VALIDATE","ESPD_AUTOSAVE_CHECK","ESPD_EXPORT_FOR_DEMAND","ESPD_EXPORT_FOR_DEALING","ESPD_PRINT_FOR_DEMAND","ESPD_PRINT_FOR_DEALING","CONTRACTOR_INVITE","contractor","CONTRACTOR_ADD","CONTRACTOR_GET_LIST","CONTRACTOR_GET_DETAILS","contractorDepartmentId","CONTRACTOR_REMOVE","CONTRACTOR_ONEPLACE","CONTRACTOR_VALIDATE","CONTRACTOR_CHECK","CONTRACTOR_GET_NIP_LIST","contractorVerification","CONTRACTOR_VERIFICATION_LIST","CONTRACTOR_VERIFICATION_STATUS","CONTRACTOR_VERIFICATION_PROCEDURE","CONTRACTOR_VERIFICATION_VALIDATE","user","USER_DATA","USER_PROFILE","USER_LOGGED_MENU_LIST","USER_SESSION_TIME","USER_SERVER_TIME","header","HEADER","client","CLIENT_LOGO","CLIENT_COLORS","publish","PUBLISH_DEMAND","IS_PUBLISH_DEMAND","PUBLISH_OJS_NOTICE","ROLLBACK_OJS_NOTICE","CHECK_OJS_NOTICE","CHECK_PUBLICATION_LIMIT","PUBLISH_DEMAND_EX_POST","notice","NOTICE_PREVIEW","NOTICE_DOWNLOAD_PREVIEW","NOTICE_VALIDATE","SIWZ_ID","source","siwz","SIWZ_MOVE_FROM_REPO","SIWZ_VALIDATE","SIWZ_VALIDATE_DOCUMENTS","SIWZ_ID_DOWNLOAD_HISTORY","SIWZ_ID_UPDATE_DESCRIPTION","SIWZ_ID_UPDATE_NOTICE_REFERENCE_NUMBER","SIWZ_ID_UPDATE_SHARE","SIWZ_ID_UPDATE_STATUS","SIWZ_ID_PUBLISH","SIWZ_ID_VERSIONS","SIWZ_ID_UNPUBLISH","SIWZ_ID_GET_DOWNLOAD_URL","openInBrowser","SIWZ_EDITABLE","SIWZ_TYPES","SIWZ_DOWNLOAD_ALL","SIWZ_ADD_BZP_NOTICE","SIWZ_POST_PRINT_SWZ","SIWZ_POST_SHARE_SWZ","statistic","STATISTIC_CURRENT_ROUND","STATISTIC","roundId","SUPPLIERS","supplier","SUPPLIERS_ADD","SUPPLIERS_INVITE","SUPPLIERS_LIST","SUPPLIERS_CHANGE_EXTERNAL_SIGN","rfxRound","RFX_ROUND_CANCEL","RFX_ROUND_PRIVILEGES","RFX_OFFERS_BASE","RFX_DECRYPTION_BASE","offers","RFX_OFFERS_LIST","RFX_OFFERS_SEND_INVITE","RFX_OFFERS_ATTACHMENTS","RFX_OFFERS_VERIFY_ATTACHMENTS","RFX_OFFERS_ENVELOPE","RFX_OFFERS_ENVELOPE_ID","offerEnvelopeId","RFX_OFFERS_ADDITIONAL_ROUND_OFFERS","RFX_OFFERS_ACTIONS","RFX_OFFERS_SUMMARY","RFX_OFFERS_PUBLIC_SESSION_START","RFX_OFFERS_PUBLIC_SESSION_STATUS","RFX_OFFERS_PUBLIC_SESSION_PROGRESS","RFX_OFFERS_DECRYPTION_START","RFX_OFFERS_DECRYPTION_STATUS","RFX_OFFERS_DECRYPTION_STATUS_LIGHT","RFX_OFFERS_DECRYPTION_PROGRESS","RFX_OFFERS_PUBLIC_SESSION_ONLINE_SAVE","RFX_OFFERS_PUBLIC_SESSION_ONLINE_STATUS","REPO","REPO_FOLDER","folderId","REPO_FILE","fileId","repo","REPO_EDITABLE","REPO_PUBLISH_OPENING_OFFER_FOLDER","REPO_VISIBILITY_TYPES","REPO_FILES_VISIBILITY","REPO_FOLDER_SHARE","REPO_DOWNLOAD_ALL","REPO_DELETE_ALL_FOLDER_FILES","REPO_FILE_VISIBILITY","REPO_FILE_SHARE","REPO_FILE_DOWNLOAD_HISTORY","REPO_FILE_UPDATE_DESCRIPTION","REPO_FILE_GET_DOWNLOAD_URL","DEMAND_MODIFICATION","modification","DEMAND_MODIFICATION_PUBLISH","DEMAND_MODIFICATION_CANCEL","DEMAND_MODIFICATION_PUBLISH_OJS","DEMAND_MODIFICATION_ROLLBACK_OJS","DEMAND_MODIFICATION_OJS_STATUS","DEMAND_MODIFICATION_CHANGED","DEMAND_SECTIONS","sections","DEMAND_PREPARING_SECTIONS","DEMAND_EVALUATION_SECTIONS","DEMAND_FINISHING_SECTIONS","OFFER_EVALUATION","offerEvaluation","OFFER_EVALUATION_LIST","viewMode","roundType","OFFER_EVALUATION_LIST_UPDATE_STATUS","OFFER_EVALUATION_LIST_UPDATE_SCORE","OFFER_EVALUATION_VALIDATE","offerChoice","OFFER_CHOICE_CANCEL_WHERE_NO_OFFERS","OFFER_CHOICE_POSITIONS_WITH_NO_OFFER","OFFER_CHOICE_PREPARE_ADDITIONAL_ROUND","toLowerCase","OFFER_CHOICE_PREPARE_AUCTION_INFO","positionId","OFFER_CHOICE_REVOKE","OFFER_CHOICE_CREATE_ADDITIONAL_ROUND","OFFER_CHOICE_GET_POSITION","OFFER_CHOICE_VALIDATE","OFFER_CHOICE_JUSTIFICATIONS","OFFER_CHOICE_PRIMARY_CHECK","OFFER_CHOICE_PRIMARY_DO_NEGOTIATIONS","OFFER_CHOICE_PRIMARY_DO_OFFER_CHOICE","additionalRound","ADDITIONAL_ROUND_CHANGE_DATES","ADDITIONAL_ROUND","DEMAND_ADDITIONAL_INFO","demandAdditionalInfo","DEMAND_ADDITIONAL_INFO_VALIDATE","DEMAND_ADDITIONAL_INFO_AUTOSAVE","DEMAND_ADDITIONAL_INFO_AUTOSAVE_CHECK","AUCTION_RFX","AUCTION","auction","AUCTION_PREPARE","AUCTION_CREATE","AUCTION_EDIT_DATES","AUCTION_PUBLISH","AUCTION_UNPUBLISH","AUCTION_PAUSE","AUCTION_RESUME","AUCTION_CANCEL","AUCTION_DELETE","AUCTION_DOWNLOAD_INVITATION","AUCTION_ACCEPT","auctionId","AUCTION_DETAILS","OFFER_CHOICE_RESULT","OFFER_CHOICE_RESULT_ID","roundResultId","OFFER_CHOICE_RESULT_FILE","OFFER_CHOICE_RESULT_FILE_ID","resultFileId","offerChoiceResult","OFFER_CHOICE_RESULT_GET","OFFER_CHOICE_RESULT_PRINT","OFFER_CHOICE_RESULT_SHARE","OFFER_CHOICE_RESULT_PUBLISH_UNTIL_DATE","OFFER_CHOICE_RESULT_FILE_PUBLISH","OFFER_CHOICE_RESULT_FILE_UNPUBLISH","OFFER_CHOICE_RESULT_FILE_DELETE","OFFER_CHOICE_RESULT_FILE_DOWNLOAD_HISTORY","OFFER_CHOICE_RESULT_FILE_SHARE","OFFER_CHOICE_RESULT_FILE_DOWNLOAD_URL","OFFER_CHOICE_RESULT_VALIDATE","agreements","AGREEMENTS_AVAILABLE","AGREEMENTS_CREATED","AGREEMENTS_CREATE_NO_AGREEMENT","AGREEMENTS_CREATE_AGREEMENT","AGREEMENTS_AVAILABLE_ORGANIZATIONS","AGREEMENTS_DELETE","objId","AGREEMENTS_DELETE_AGR","AGREEMENTS_VALIDATE","RESULT_NOTICE_ID","resultNoticeId","RESULT_NOTICE_ATTACHMENT_ID","resultNoticeAttachmentId","resultNotice","RESULT_NOTICE_BZP","RESULT_NOTICE_PUBLISH_OJS_NOTICE","RESULT_NOTICE_CHECK_OJS_NOTICE","RESULT_NOTICE_ROLLBACK_OJS_NOTICE","RESULT_NOTICE_VALIDATE","RESULT_NOTICE_DELETE","RESULT_NOTICE_PUBLISH","RESULT_NOTICE_UNPUBLISH","RESULT_NOTICE_ATTACHMENT_PUBLISH","RESULT_NOTICE_ATTACHMENT_UNPUBLISH","RESULT_NOTICE_DESCRIPTION","RESULT_NOTICE_REFERENCE_NUMBER","RESULT_NOTICE_DOWNLOAD_FILE_URL","RESULT_NOTICE_DOWNLOAD_FILE_HISTORY","evaluationFinish","demandPlanRealization","DEMAND_PLAN_REALIZATION_VALIDATE","finishDemand","FINISH_DEMAND_BACK_TO_OFFER_EVALUATION","FINISH_DEMAND_BACK_TO_RESULT_NOTICE","FINISH_DEMAND_WITHDRAWAL_NOTICE_DATE","FINISH_DEMAND_CANCEL","FINISH_DEMAND_FINISH","FINISH_DEMAND_VALIDATE","archiving","ARCHIVING_SCHEDULE","ARCHIVING_VALIDATE","ADDITIONAL_ROUNDS_PASSIVE","additionalRoundsPassive","ADDITIONAL_ROUNDS_PASSIVE_ROUND","ADDITIONAL_ROUNDS_PASSIVE_AVAILABLE_CONTRACTORS","ADDITIONAL_ROUNDS_PASSIVE_VALIDATE","CORRESPONDENCE_BASE","CORRESPONDENCE_BUYER_BASE","correspondenceBuyer","CORRESPONDENCE_BUYER_CTR_IN_ROUND","CORRESPONDENCE_BUYER_THREAD_LIST","CORRESPONDENCE_BUYER_NEW_MESSAGES","CORRESPONDENCE_BUYER_SEARCH","CORRESPONDENCE_BUYER_THREAD_ADD","CORRESPONDENCE_BUYER_THREAD_AS_CRT_SEND","CORRESPONDENCE_BUYER_BULK_MESSAGES_SEND","CORRESPONDENCE_BUYER_BULK_MESSAGES_PUBLISH","CORRESPONDENCE_BUYER_PRIVILEGES","CORRESPONDENCE_BUYER_PRINT","before","CORRESPONDENCE_BUYER_SHARE","CORRESPONDENCE_BUYER_MESSAGE_LIST","threadId","CORRESPONDENCE_BUYER_MESSAGE_CREATE","CORRESPONDENCE_BUYER_MESSAGE_MARK_AS_READ","CORRESPONDENCE_BUYER_FLAG","CORRESPONDENCE_BUYER_UNFLAG","CORRESPONDENCE_BUYER_THREAD_EMAIL_LIST","CORRESPONDENCE_BUYER_MESSAGE_SEND","messageId","CORRESPONDENCE_BUYER_MESSAGE_PUBLISH","CORRESPONDENCE_BUYER_MESSAGE_UPDATE","CORRESPONDENCE_BUYER_MESSAGE_DELETE","CORRESPONDENCE_BUYER_ATTACHMENT_URL","attachmentId","CORRESPONDENCE_BUYER_MESSAGE_EMAIL_DELIVERY","CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_ZIP","CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_CHECK_LIMIT","CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_VERIFY","CORRESPONDENCE_BUYER_CONTRACTOR_EMAIL_LIST","departmentId","CORRESPONDENCE_CONTRACTOR_BASE","correspondenceContractor","CORRESPONDENCE_CONTRACTOR_THREAD_LIST","CORRESPONDENCE_CONTRACTOR_NEW_MESSAGES","CORRESPONDENCE_CONTRACTOR_SEARCH","CORRESPONDENCE_CONTRACTOR_THREAD_ADD","CORRESPONDENCE_CONTRACTOR_PRIVILEGES","CORRESPONDENCE_CONTRACTOR_PRINT","CORRESPONDENCE_CONTRACTOR_MESSAGE_LIST","CORRESPONDENCE_CONTRACTOR_MESSAGE_CREATE","CORRESPONDENCE_CONTRACTOR_MESSAGE_MARK_AS_READ","CORRESPONDENCE_CONTRACTOR_FLAG","CORRESPONDENCE_CONTRACTOR_UNFLAG","CORRESPONDENCE_CONTRACTOR_MESSAGE_UPDATE","CORRESPONDENCE_CONTRACTOR_MESSAGE_SEND","CORRESPONDENCE_CONTRACTOR_MESSAGE_DELETE","CORRESPONDENCE_CONTRACTOR_ATTACHMENT_URL","CORRESPONDENCE_CONTRACTOR_MESSAGE_ATTACHMENTS_ZIP","DEMAND_OFFERS_BASE","DEMAND_OFFERS_STAGE_BASE","demandOffers","DEMAND_OFFERS_CONTRACTOR_STAGES_LIST","DEMAND_OFFERS_CONTRACTOR_STAGE_SECTIONS_LIST","DEMAND_OFFERS_CONTRACTOR_STAGE_TRANSLATIONS","DEMAND_OFFERS_CONTRACTOR_STAGE_SECTION","section","DEMAND_OFFERS_STAGE_CURRENT_ROUND","DEMAND_OFFERS_CONTRACTOR_STAGE_PASSWORD","DEMAND_OFFERS_VALIDATE","DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE","demandOffersGeneralInfo","DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_BASIC_DATA","DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS","DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS_DOWNLOAD_URL","documentId","DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS_DOWNLOAD_ZIP","DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_PUBLIC_ANSWERS","DEMAND_OFFERS_STAGE_OFFER_BASE","demandOffersOffer","DEMAND_OFFERS_STAGE_CONTRACTOR_OFFER","DEMAND_OFFERS_OFFER_MODE","stage","mode","DEMAND_OFFERS_OFFER_MODE_POSITIONS","DEMAND_OFFERS_OFFER_MODE_FILES","DEMAND_OFFERS_OFFER_MODE_TEMPLATE","DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL","DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_ZIP","DEMAND_OFFERS_OFFER_FILE","DEMAND_OFFERS_OFFER_FILES","DEMAND_OFFERS_OFFER_FILE_ID","DEMAND_OFFERS_OFFER_FILE_ID_SIGN_FILE","DEMAND_OFFERS_OFFER_ESPD","DEMAND_OFFERS_OFFER_ESPDS","DEMAND_OFFERS_OFFER_ESPD_ID","espdId","DEMAND_OFFERS_OFFER_ESPD_ID_SIGN_FILE","DEMAND_OFFERS_OFFER_ESPD_MP_APP_URL","DEMAND_OFFERS_OFFER_ESPD_EXPORT_FILE_URL","DEMAND_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL","DEMAND_OFFERS_OFFER_PLACE_OFFER","DEMAND_OFFERS_OFFER_WITHDRAW_OFFER","DEMAND_OFFERS_OFFER_SIGN_OFFER","DEMAND_OFFERS_OFFER_SIGN_WITHDRAW","DEMAND_OFFERS_OFFER_DOC_TO_SIGN","DEMAND_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN","DEMAND_OFFERS_OFFER_STOP_SIGNING_OPERATION","DEMAND_OFFERS_OFFER_REQUIRE_WITHDRAW_ENCRYPTION","DEMAND_OFFERS_OFFER_DELETE_OFFER","DEMAND_OFFERS_OFFER_POSITION","DEMAND_OFFERS_OFFER_MODE_POSITION_ID","DEMAND_OFFERS_OFFER_SNAPSHOTS","DEMAND_OFFERS_OFFER_SNAPSHOT_ID","snapshotId","DEMAND_OFFERS_OFFER_VERIFICATIONS","DEMAND_OFFERS_OFFER_VERIFICATION_BEFORE_PLACE","DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE","demandAdditionalOffersOffer","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITIONS","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILES","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_ZIP","DEMAND_ADDITIONAL_OFFERS_OFFER_FILE","DEMAND_ADDITIONAL_OFFERS_OFFER_FILES","DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID","DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID_SIGN_FILE","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL","DEMAND_ADDITIONAL_OFFERS_OFFER_PLACE_OFFER","DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_OFFER","DEMAND_ADDITIONAL_OFFERS_OFFER_SIGN_OFFER","DEMAND_ADDITIONAL_OFFERS_OFFER_SIGN_WITHDRAW","DEMAND_ADDITIONAL_OFFERS_OFFER_DOC_TO_SIGN","DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN","DEMAND_ADDITIONAL_OFFERS_OFFER_STOP_SIGNING_OPERATION","DEMAND_ADDITIONAL_OFFERS_OFFER_REQUIRE_WITHDRAW_ENCRYPTION","DEMAND_ADDITIONAL_OFFERS_OFFER_DELETE_OFFER","DEMAND_ADDITIONAL_OFFERS_OFFER_POSITION","DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITION_ID","DEMAND_ADDITIONAL_OFFERS_OFFER_SNAPSHOTS","DEMAND_ADDITIONAL_OFFERS_OFFER_SNAPSHOT_ID","DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATIONS","DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATION_BEFORE_PLACE","DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE","demandAdditionalAuction","DEMAND_ADDITIONAL_AUCTIONS_OFFER_AUCTIONS","DEMAND_ADDITIONAL_AUCTIONS_OFFER_AUCTIONS_ASSIGN","DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE","DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_ESPD_DOWNLOAD_URL","DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_FILE_DOWNLOAD_URL","DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_FILES","DEMAND_ADDITIONAL_AUCTIONS_OFFER_POSITION","DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_POSITION_ID","DEMAND_ADDITIONAL_AUCTIONS_OFFER_SNAPSHOTS","DEMAND_ADDITIONAL_AUCTIONS_OFFER_SNAPSHOT_ID","DEMAND_PREVIEW_STAGE_OFFER_BASE","demandPublicationPreview","DEMAND_PREVIEW_OFFER_MODE","DEMAND_PREVIEW_OFFER_MODE_SECTION","DEMAND_PREVIEW_OFFER_MODE_POSITION_ID","DEMAND_PREVIEW_OFFER_MODE_POSITION_ID_PRINT","integrations","SHAREPOINT","EZDRP","EZDPUW","EZDPUW_DOCUMENTS","caseId","EZAMOWIENIA_BASE","ezamowienia","EZAMOWIENIA_AUTHORIZATION_STATUS","EZAMOWIENIA_REVOKE_TOKEN","ANNUAL_REPORT_BASE","ANNUAL_REPORT_REPORT_YEAR","year","ANNUAL_REPORT_REPORT_YEAR_AVAILABLE_ORGS","ANNUAL_REPORT_REPORT_ID","reportId","ANNUAL_REPORT_REPORT_ID_ACTION","ANNUAL_REPORT_REPORT_ID_FORM_NAME","formName","ANNUAL_REPORT_REPORT_ID_INITIALIZE_FORM_NAME","ANNUAL_REPORT_REPORT_ID_INITIALIZE_FROM_PREV_FORM_NAME","ANNUAL_REPORT_REPORT_ID_INITIALIZE_FORM_NAME_TABLE_ID","tableIdentity","ANNUAL_REPORT_DICTIONARIES","ANNUAL_REPORT_TRANSLATIONS","CONTRACT_NOTICE","nationalNotice","NATIONAL_NOTICE_VALIDATE","NATIONAL_NOTICE_CONTRACT_NOTICE","NATIONAL_NOTICE_CONTRACT_NOTICE_CREATE_NEW_VERSION","NATIONAL_NOTICE_CONTRACT_NOTICE_DRAFT","NATIONAL_NOTICE_CONTRACT_NOTICE_TRANSLATIONS","NATIONAL_NOTICE_CONTRACT_NOTICE_DICTIONARIES","NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH","NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_UPDATE","NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_ROLLBACK","NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_UPDATE_ROLLBACK","NATIONAL_NOTICE_CONTRACT_NOTICE_STATUS","NATIONAL_NOTICE_CONTRACT_MODIFICATION_NOTICE_STATUS","NATIONAL_NOTICE_CONTRACT_NOTICE_DYNAMIC_DICTIONARIES","PURCHASING_GROUP_ID","groupId","PURCHASING_GROUP_LIST","PURCHASING_GROUP_LIST_ACTIONS","PURCHASING_GROUP_MEMBER_LIST","PURCHASING_GROUP_HEADER","PURCHASING_GROUP_RELATED_OBJECTS","PURCHASING_GROUP_BASIC_DATA","PURCHASING_GROUP_ARCHIVE_LIST","archiveType","PURCHASING_GROUP_ARCHIVE_ID","archiveId","PURCHASING_GROUP_COMMISSION","PURCHASING_GROUP_COMMISSION_HISTORY","PURCHASING_GROUP_SCHEDULE","PURCHASING_GROUP_MEMBERS","PURCHASING_GROUP_MEMBERS_AVAILABLE_CONCERNS","PURCHASING_GROUP_MEMBERS_MEMBER","PURCHASING_GROUP_MEMBERS_MEMBER_ID","memberId","PURCHASING_GROUP_MEMBERS_MEMBER_ID_REJECT","PURCHASING_GROUP_MEMBERS_MEMBER_ID_RESTORE","PURCHASING_GROUP_MEMBERS_MEMBER_ID_CONFIRM_PARTICIPATION","PURCHASING_GROUP_MEMBERS_MEMBER_ID_WITHDRAW_PARTICIPATION","PURCHASING_GROUP_MEMBERS_MEMBER_ID_RESEND_INVITE_NOTIFICATION","PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT","PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID","PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID_URL","PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER","PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER_ID","userId","PURCHASING_GROUP_MEMBERS_DOCUMENTS","apiPath","PURCHASING_GROUP_MEMBERS_DOCUMENTS_GENERATE_GROUP_AGREEMENT","PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID","PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_PUBLISH","PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_UNPUBLISH","PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_URL","PURCHASING_GROUP_SWZ_DOCUMENTS","PURCHASING_GROUP_SWZ_DOCUMENTS_ID","PURCHASING_GROUP_SWZ_DOCUMENTS_ID_PUBLISH","PURCHASING_GROUP_SWZ_DOCUMENTS_ID_UNPUBLISH","PURCHASING_GROUP_SWZ_DOCUMENTS_ID_URL","PURCHASING_GROUP_OPINION","PURCHASING_GROUP_OPINION_ID","opinionId","PURCHASING_GROUP_OPINION_ID_MARK_AS_READ","PURCHASING_GROUP_OPINION_AVAILABLE_MEMBERS","PURCHASING_GROUP_OPINION_MEMBER_ID","PURCHASING_GROUP_OPINION_ID_MESSAGE_NEW","PURCHASING_GROUP_OPINION_ID_MESSAGE_ID","PURCHASING_GROUP_FINISH_PREPARING","PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_TEMPLATE_FORM_EXPORT","PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_LEADING_DOCUMENT","PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_MANAGEMENT_RESOLUTION","PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DRAFT_GROUP_AGREEMENT","PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DOCUMENT_TO_SIGN","PURCHASING_GROUP_COLLECTING_SCHEDULE","PURCHASING_GROUP_COLLECTING_TEMPLATE","PURCHASING_GROUP_COLLECTING_TEMPLATE_AVAILABLE","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_ID","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID","formId","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_DRAFT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_CLEAR_DRAFT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ACCEPT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_REJECT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ASK_FOR_EDIT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ALLOW_EDIT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_REJECT_EDIT","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ARCHIVE_LIST","PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ARCHIVE_ID","PURCHASING_GROUP_FINISH","PURCHASING_GROUP_FINISH_DEALINGS_CHANGED","PURCHASING_GROUP_SECTIONS","purchasingGroupSections","PURCHASING_GROUP_SECTIONS_PREPARING","PURCHASING_GROUP_SECTIONS_COLLECTING_DATA","PURCHASING_GROUP_SECTIONS_SECTION","PURCHASING_GROUP_TEMPLATES","purchasingGroupTemplate","PURCHASING_GROUP_TEMPLATES_LIST","PURCHASING_GROUP_TEMPLATES_LIST_HAS_EDIT","PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID","templateId","PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_ACTIVATE","PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_DEACTIVATE","PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_CLONE","ADMIN_USER_REGISTRATION","adminUserRegistrations","ADMIN_USER_REGISTRATION_LIST","ADMIN_USER_REGISTRATION_AVAILABLE_ORGS","ADMIN_USER_REGISTRATION_ID","regId","ADMIN_USER_REGISTRATION_ID_REJECT","ADMIN_USER_REGISTRATION_ID_ACCEPT","ADMIN_USER_REGISTRATION_ID_ORGANIZATION","extensions","hotJarSettings","hjid","hjsv","a","createElement","target","setAttribute","click","_sem","semaphore","_paramsSerializer","_executeRequest","async","headers","auth","parse","localStorage","getItem","request","Axios","access_token","paramsSerializer","sessionTime","endTime","moment","add","time","_refreshSessionTime","_logout","removeItem","substr","btoa","redUrl","_refresToken","console","info","res","method","Endpoints","client_id","grant_type","refresh_token","setItem","data","error","_restRequest","acquire","args","response","status","HttpCodes","release","RestRequest","RestRequestGET","other","RestRequestDELETE","RestRequestPOST","RestRequestPUT","RestRequestBLOB","responseType","ob","success","contentDisposition","decodeURIComponent","fileUrl","URL","createObjectURL","Blob","downloadFile","revokeObjectURL","RestRequestBLOBBase64Encoded","blob","Promise","resolve","_","reader","FileReader","onloadend","result","readAsDataURL","resp","SoftLogout","code","LogoutButton","LogoutIcon","OAuthService","navElements","userLoggedMenuList","justifyContent","borderRightColor","onlyContrast","drawerOpen","transition","transitions","default","overflowX","drawerClose","close","innerListItem","icons","my_demands","StarIcon","purchasingGroups","GroupWorkIcon","all_demands","ShoppingCartIcon","deputy","PeopleIcon","public_area","PublicIcon","edocument","DescriptionIcon","GavelIcon","intranet","LocalLibraryIcon","InsertDriveFileIcon","administration","HowToRegIcon","contractor_area","MonetizationOnIcon","AssessmentIcon","Drawer","OpenElement","newDemandProcedures","elements","Fragment","menuElementList","pop","innerItem","j","InvertColorsOffIcon","InvertColorsIcon","IconButton","setLargeText","userData","userProfile","linkText","textDecoration","login","Grid","container","direction","alignItems","fontWeight","link","props","xmlns","viewBox","d","useStyle","makeStyles","column","flexGrow","GridBlock","itemClassName","justify","wrap","gridClasses","React","Children","child","CancelButton","HelpDialog","Dialog","PaperProps","DialogTitle","DialogContent","content","dialogButtons","handleClickButton","DialogActions","textAlign","popup","smallContainer","marginTop","common","white","Help","flag","ChangeLanguageButtonButtons","locale","setLocale","csrfInput","append","body","appendChild","submit","margin","left","appBar","borderBottom","backgroundColor","greyBackground","rootBorder","menuMargin","toolbar","rightGrid","beta","buttonLight","logo","maxHeight","demandHeader","goSoStatus","oldPlatformRoundStatusUrl","changeLocale","redirectUsingPOST","AppBar","elevation","position","Toolbar","PolandSvg","GreatBritainSvg","AcUnitIcon","IconCloseButton","CloseIcon","minHeight","top","ref","CircularProgress","centered","closeButtonBox","right","closeButton","loading","contentClassName","titleCentered","transitionDuration","paperClassName","dialogActions","htmlId","buttonContainer","isOpera","opr","addons","opera","navigator","userAgent","isFirefox","InstallTrigger","isSafari","test","HTMLElement","pushNotification","toString","isIE","documentMode","isEdge","StyleMedia","isChrome","chrome","webstore","runtime","isBlink","CSS","object","checkCondition","changes","isEqual","isObject","changesObj","DEMAND_VALIDATION_RESOURCE_ID","getPreparingSections","clear","getSections","getEvaluationSections","getFinishingSections","urlFn","clearDemandValidationResources","getPrivileges","cleanupPrivileges","clearPrivileges","CORRESPONDENCE_PRIVILEGE_STORE_KEY","RFX_PRIVILEGE_STORE_KEY","DEMAND_PRIVILEGE_STORE_KEY","DEMAND_RESOURCE_ID","DEMAND_AVAILABLE_FORM_TYPES_RESOURCE_ID","DEMAND_AVAILABLE_REALIZATIONS_RESOURCE_ID","DEMAND_AVAILABLE_ORGANIZATIONS_RESOURCE_ID","DEMAND_NUMBER_AUTOMATED","DEMAND_CASE_CLASSIFICATION_SYMBOL_REQUIRED","createParams","exPost","queryParams","_save","enableOptional","termOption","termDate","termDescription","orderValueDecisionDate","auctionMade","digitalSign","euFunded","formatDate","format","agreementRealizationDate","date","_formatFormValues","objectExtension","getValidate","DemandSectionsService","required","_handleSaveResponse","msg","prop","errors","prototype","hasOwnProperty","call","Array","isArray","demandAvailableRealizationTypes","demandAvailableOrganizations","demandAvailableFormTypes","numberingAutomated","caseClassificationSymbolRequired","resource","PrivilegeService","basicInformation","NUMBER","NAME","DESCRIPTION","CONTACT_PERSON","CONTACT_PERSON_PHONE","PURCHASER_PHONE","PURCHASER_FAX","PURCHASER_EMAIL","PURCHASER_ADDITIONAL_INFO","EOD","SINGLE_DEALING_JUSTIFICATION","ESTIMATION_BASE","FINANCIAL_SOURCE","TERM_DESCRIPTION","FULL_NAME","EU_PROJECT_NUMBER","POSTCODE_PL","POSTCODE","EMAIL","NIP_MIN","NIP_MAX","PESEL_PL","NIP_PL","CITY","ADDRESS","organization","PLANNED_CONTRACTOR_NUMBER","condition","OTHER_NAME","criteriaSection","parameters","itemParameters","documents","correspondence","SUBJECT","fn","toJSON","this","emailRegexp","contractorlimits","InputLimits","Yup","usedMessage","trim","maxStringFunc","max","minStringFunc","min","number","Math","abs","amountMin","inclusive","val","fVal","parseFloat","isNaN","amountMaxDecimal100","noZero","pValue","positive","matches","stringExactlyBase","nullable","vatinPL","optional","weight","sum","controlNumber","parseInt","weightCount","dateOrDateTimeValid","isMoment","isValid","String","dateMax","dateToCompare","endOf","isBefore","dateMin","startOf","dateTimeMin","dateTimeMax","stringNoRq","string","defTrKey","noOnlyWhitespaces","stringExactly","stringNotOneOf","notOneOf","stringNotOneOfBase","stringExactlyMax","stringMax","stringMin","stringMinAndMax","stringMaxNoRq","typeError","numberMax","numberMin","numberMin0","numberMaxNoZero","numberPositiveOptional","numberPositiveNoZero","numberMaxMin","keyMin","keyMax","fieldName","decimalNumber","bigDecimal","bigDecimalOptional","integerMin","integer","integerMax","integerMinMax","email","emailMax","emailMaxNoRq","amount","amountBasicRequired","amountOptional","amountBasicOptional","amountMax100NoZero","amountMax100","amountMax100Optional","arrayOfShape","shape","arrayOf","shema","of","fields","lazy","arrayRequired","formValue","any","anyRequired","immediatelyError","dateMaxNoRq","dateMinNoRq","dateTimeNoReq","dateTimeValid","dateTimeMinNoRq","dateTimeMaxNoRq","vatinPLOptional","vatinOrPeselPL","vatinValid","peselValid","peselPL","requiredBoolean","mixed","requiredObject","urlOptional","urlMax","urlMaxOptional","phoneOptional","InnerForm","htmlFormId","setForm","formikProps","submitLabel","afterSubmitFunc","submitForm","then","resetForm","style","autoComplete","onSubmit","handleSubmit","Form","onReset","initialValues","initialTouched","validationSchema","ValidationShema","onChange","validateOnMount","validateOnChange","validateOnBlur","enableReinitialize","actions","setSubmitting","Title","Divider","titleClassName","divider","defaultValue","idArray","innerReg","reg","_value","TextInput","placeholder","noError","noErrorSpace","multiline","endAdornment","limit","step","onBlur","showErrorImmediately","skipCheckTouched","errorValue","getObjectValue","touched","editable","isError","lettersLeft","_label","_placeholder","setFieldTouched","inputType","INPUT_TYPE","TextField","withMin","toNumberType","valueSplit","slice","join","valueSplitAmount","valueSplit1","filter","handleChange","setFieldValue","handleBlur","v","formatValue","helperText","InputProps","maxRows","inputProps","bottom","labelClassName","FormControlLabel","control","Radio","RadioGroup","FormControl","FormLabel","event","isStr","FormHelperText","createSelectItem","subLabel","Select","alwaysEditable","showErrorWithoutTouched","findIndex","select","SelectProps","MenuProps","MenuItem","selected","contrastSelectValue","fontStyle","PrimaryTenderVariant","VARIANT_1","VARIANT_2","VARIANT_3","PrimaryTenderVariantTr","entries","jedzTranslations","itemsHidedExecutive","itemsWithExecutive","hideExecutiveDemandVariant","Checkbox","checkboxClassName","checked","checkbox","dangerouslySetInnerHTML","__html","useStyles","fabProgress","WorkableIconButton","working","rotate","WorkableIconExpandButton","expanded","_tooltip","radioGroup","filteredItemRoot","itemValue","searchKeys","multiple","handleSave","publicCode","shouldOpen","otherItemValues","boldLabel","setBoldLabel","checkboxId","openRow","RawHTML","Collapse","in","fastEnd","filteredChildrens","element","findEl","fullName","every","match","curr","el","overflow","paddingRight","scrollSize","maxSize","page","loadMore","containerRef","useRef","hasMore","setHasMore","setTimeout","initialLoad","pageStart","loader","useWindow","threshold","getScrollParent","current","getSize","list","count","typingStopTimeout","countItems","setPage","elementLength","setElementLength","filtered","setFiltered","setSearchKeys","searchChanged","setSearchChanged","itemsCount","setItemsCount","clearTimeout","filterItems","newItems","newSearchKeys","countItemsFunc","random","p","index","progress","contained","WorkableButton","stopPropagation","DoubleButton","labelFirst","labelSecond","onClickFirst","onClickSecond","buttonTypeFirst","buttonTypeSecond","disabledFirst","disabledSecond","workingFirst","workingSecond","after","buttons","get","formSubmit","onCancel","initCPVValues","useId","cpvList","setCpvList","countCpvList","CpvService","onConfirm","initValues","hierarchicalId","Chip","onDelete","customDeleteIcon","getLabelBody","deleteIcon","cloneDeep","splice","newTouched","chipLabel","textOverflow","buttonSelect","openSelectCPV","setOpenSelectCPV","handleClosePoup","errorLabel","removeFormikListElement","prevValue","currValue","iconColor","active","tooltipWidth","dangerouslySetTextHTML","VALUES","ALL","PREPARING","MODIFICATION","OFFER_COLLECTION","OFFER_DECRYPTION","FINISHING","CANCELLED","ANNULLED","FINISHED","LABELS","PZPType","PZP_OLD","PZP_2021","wasEverPublished","demandStatus","isDemandPreparing","isDemandModification","isDemandOfferCollection","isDemandOfferDecryption","isDemandOfferEvaluation","isDemandFinishing","isDemandFinished","getDemandPZPType","isNonpubProc","isNatProc","isEuProc","buttonsWrapper","availableOrganizations","initOrganization","setItems","allItems","setAllItems","addEventListener","escFunction","all","removeEventListener","orgId","changeSearch","debounce","useCallback","keyEvent","charCode","keyCode","preventDefault","org","SelectOrganization","openSelectOrganization","setOpenSelectOrganization","GreyBox","borderRadius","flexDirection","cursor","defaultChildrenGrid","Dropzone","submitOnChange","acceptExtensionList","onDrop","acceptedFiles","files","getRootProps","getInputProps","useDropzone","accept","setTouched","rootProps","VALID_EXTENSIONS_LIST_RESOURCE_ID","file","onUploadChange","formData","FormData","onUploadProgress","ProgressBar","labelItem","progressItem","progressGrid","LinearProgress","flexShrink","SingleButton","buttonType","DEMAND_STAGES_LIST","DEMAND_STAGE_SECTIONS_LIST","DEMAND_CONTRACTOR_PASSWORD_POPUP","successCallback","errorCallback","password","newList","isResponseValid","setError","errorSet","ContractorPasswordState","alignSelf","UploadFilePopup","downloadFiles","onUpload","errorTranslate","setRefresh","filesStatus","uploadedFiles","useParams","dialogClosed","setDialogClosed","DemandOffersService","onError","doUpload","catch","config","loaded","total","uploadStatus","UploadService","handleUploadProgressChange","uploadSuccess","originalIndex","st","fileData","TitledComponent","additionalElement","componentRef","typography","fontWeightBold","pointer","TooltipIcon","fontSize","tooltipClasses","iconClasses","otherProps","blackChipIcon","FilesList","customAction","onDownload","showDownloadDate","inaccessible","firstDownloadDate","DraftsOutlined","MailOutline","DateFormats","showError","getFilesAdnFolders","folderPath","downloadFileFromSharepoint","MultiButton","afterAfter","createButton","SharepointIcon","SvgIcon","breadcrumbText","selDocuments","dialogContent","titleIcon","SharepointExplorer","filesAndFolders","setFilesAndFolders","selectedFileMap","setSelectedFilesMap","Map","setWorking","SharepointService","finally","handleBreadcrumbClick","serverRelativeUrl","getAttribute","handleClick","folders","from","getButtons","Breadcrumbs","separator","maxItems","elem","arr","Link","dense","uniqueId","disableRipple","newMap","has","delete","set","toggleSelectFile","edge","tabIndex","wait","uploading","done","SharepointDownloadPopup","setFiles","next","getSecondaryText","Error","downloadFileFromEzdrp","attachmentIcon","attachmentsCount","line","dark","italic","FileTypes","EzdrpList","toggleExpandFile","expandedFileMap","level","toggleCheckbox","attachments","hasExpand","timeout","unmountOnExit","EzdrpExplorer","setExpandedFilesMap","EzdrpService","EzdrpDownloadPopup","EzdpuwDownloadPopup","EzdpuwService","WorkableIconFolderButton","FolderIcon","CASE","FILE","EzdpuwList","toggleExpandCase","workingCase","EMPTY","EzdpuwExplorer","setWorkingCase","dropzone","dropzoneParent","integrationButton","SupportedTypes","defaultValidExtensionList","demandPrivileges","onUploadPopupClosed","onOpenConfigureFiles","configuredFiles","currentProcess","browserDownloadFiles","setBrowserDownloadFiles","sharepointExplorerOpen","setSharepointExplorerOpen","sharepointDownloadFiles","setSharepointDownloadFiles","ezdrpExplorerOpen","setEzdrpExplorerOpen","ezdDownloadFiles","setEzdDownloadFiles","ezdpuwExplorerOpen","setEzdpuwExplorerOpen","ezdpuwDownloadFiles","setEzdpuwDownloadFiles","handleDownloadedFiles","formikFiles","fileElements","selectedFiles","INTEGRATIONS_DOWNLOAD","sharepoint","applicationClientSettings","sharepointIntegration","ezdrp","ezdrpIntegration","ezdpuw","ezdpuwIntegration","connected","getIntegrationButtons","PriceType","PriceTypeLabel","priceType","PriceTypeItems","UseNetOverGrossForAuctionPopup","PriceTypeItemsForAuction","NET_FIELD_VISIBLE","GROSS_FIELD_VISIBLE","VAT_FIELD_VISIBLE","PriceTypeNetFieldVisible","PriceTypeGrossFieldVisible","PriceTypeVatFieldVisible","NET_SUM_PRICE_TYPES","NetSumPriceVisible","TOTAL_NET_FIELD_VISIBLE","TOTAL_GROSS_FIELD_VISIBLE","TotalPriceTypeNetFieldVisible","TotalPriceTypeGrossFieldVisible","DemandCategoryType","CLASSIC","SECTOR","DEFENSE_AND_SECURITY","DemandCategoryTypeLabel","DemandCategoryTypesForProcedure","procedure","limits","RequiredFields","demandRealizationTypes","numberAutomated","passiveOfferForm","creatingDemand","realizationType","withNotice","europeProcedure","nationalProcedure","nonpublicProcedure","demandRealizationTypesTranslated","prefix","demandCategoryType","caseClassificationSymbols","primaryTenderVariantValues","onDemandRealizationTypeChanged","pzpExclusionValues","concessionOrderTypeValues","orderTypeValues","contractTypeValues","booleanValues","jedzValues","uploadFile","minDate","maxDate","minDateMessage","maxDateMessage","momentVal","validateField","clone","err","setFieldError","cancelLabel","invalidDateMessage","OptionalFields","Date","CheckboxButton","DEFAULT_CONFIG","ignoreInitialCall","useDebouncedEffect","callback","deps","currentConfig","firstTime","clearFunc","handler","SaveFormikValues","setFormValues","clearFormValues","save","debounceTimeout","propTypes","PropTypes","inputLimits","VS","demandRealizationType","baseObj","when","is","otherwise","description","formType","primaryTenderVariant","demandOrderType","categoryItemCpv","contactPerson","contactPersonPhone","contactPersonEmail","purchaserPhone","purchaserFax","purchaserEmail","purchaserAdditionalInfo","euProjectNumber","caseClassificationSymbol","requiredJEDZ","pzpExclusion","demandVariant","externalPurchaseRequestNumber","singleDealingJustification","estimationBase","financialSource","fullNameOrderValueDecisionPerson","managerEntrustedPerson","isErrors","ShowErrorOnFailedSubmit","setCheckError","checkError","log","_get","forceRedirectOldPlatform","supportedNoApiScreens","updateHeader","HeaderService","modify","cancel","publishOjsNotice","rollbackOjsNotice","noticeOjsStatus","isDemandChanged","clearDemandChanged","useStepperStateCloseValidator","customCloseValidatorFunction","defaultCloseValidatorFunction","AutoSaveFormValues","saveFunc","throttleTimeout","customDirtyRef","timeoutSetTime","throttleHandler","debounceHandler","now","saveFormDraft","MainForm","stepperState","demandValidation","FORM_ID","autoSaveFormDraftActive","autoSaveFormDraft","DemandService","getField","getTimeField","_editable","authorUser","plannedContractorNumberForAgreement","fundingInstitutionLogo","purchaserName","demandJustification","planPropositionText","ezdrpId","ezdpuwId","ModificationService","demandNumberAutomated","createItemText","SELECT_VALUE","DEFAULT","NOT_APPLICABLE","VatType","CANCEL","REVERSED","DIFFRENT_VAT","OTHER","calcGrossValue","netValue","vatOptionValue","optionOtherValue","newGrossValue","round","calcNetValue","grossValue","vatMultipler","newNetValue","useDidUpdateEffect","effect","didMountRef","grid","iconButton","otherTextInput","regularTitle","fontWeightRegular","pathPrefix","net","gross","option","optionOther","toFloat","optionValue","curGross","toFixed","doCalcGrossValue","InputAdornment","VATItems","doCalcNetValue","ExPostFields","estimatedValue","s","vatRate","vatRateOther","realizationGrossValue","MainFormExPost","realizatedValue","validationSchemaExPost","Confirm","confirmTitle","confirmText","confirmText2","labelConfirm","labelCancel","translateConfirmTexts","urlParams","draftConfirm","setDraftConfirm","autoSaveFormDraftEnabled","loadDemandDraft","Index","trPrefix","owner","history","operationType","operationDatetime","firstName","lastName","member","boldDouble","bold","t","textVariant","DELETE","ADD","toUpperCase","MODIFY","purchasingGroupHeader","historyTab","newHistoryTab","inner","sortTable","sort","b","reverse","createTab","onFormOpen","onImporterOpen","_prepareIncomingDealing","_formatSinglePartValues","_open","_edit","_touched","_load","otherValues","otherAmount","newVatRate","vatType","curName","iNewVatRate","offerVatRate","iVatType","offerVatRateOther","offerVatType","offerVatValue","_getDeleteElements","dealingsList","RESOURCE_DEALING_REALIZATION_VALUE_STATUS","getList","modRes","dealingsToDelete","dealingsToSave","some","dealingWithErrorId","dealingWithErrorIndex","checkForDraft","loadDraft","saveDraft","deleteDraft","clearResources","getDealingsMatchingCriterion","getDealingsMatchingCriterionName","getFullList","dealingIds","getRealizationValues","getFinalRealizationValues","getRealizationValueStatus","saveRealizationValues","publishMode","saveFinalRealizationValues","publishRealizationAmountValue","unpublishRealizationAmountValue","validate","SOURCE_TYPES","ITEM_TYPES","ItemTypes","netGross","newItem","quantity","uom","offerVatPredefined","offerSourceType","allowQuantityEditInOffer","newElement","realizationBeforeOfferAmount","stages","conditions","conditionsInSiwz","criterions","AddIcon","LoadingScreen","Backdrop","modal","ImporterForm","downloadingInProgress","downloadImportTemplate","table","tableLayout","head","Table","TableHead","TableBody","SortIcon","STableRow","cellClassName","cellClassNames","TableRow","ccn","TableCell","colSpan","TableSortLabel","IconComponent","SimpleTable","columnClasses","rowClasses","rowElements","lpColumn","reasonColumn","buttonRow","setUploadOpened","importErrors","setImportErrors","processingUpload","setProcessingUpload","openSuccessPopup","setOpenSuccessPopup","clearImportErrors","handleCloseSuccessPopup","DealingsService","isPublished","isPublic","confirmExportPopup","setConfirmExportPopup","setDownloadingInProgress","uploadOpened","hideDownloadingTemplate","nextId","newElementsList","SortableItem","SortableElement","SortableList","SortableContainer","onSortEnd","oldIndex","newIndex","arrayMoveMutable","useDragHandle","CONDITION_TYPE_OTHER","CONDITION_TYPE","COMPETENCES","FINANCIAL_SITUATION","TECHNICAL_CAPACITY","EMPLOYMENT","CONDITION_TYPE_PZP_2021","COURSE_OF_TRADE","CONDITIONS_LABEL","CONDITIONS_LABEL_PZP_2021","conditionValues_PZP_2021","CRYTERIUM_TYPE","TIME_LIMIT","PAYMENT","OPERATING_COST","SERVICE","CONTRACT_SECURITY","OWNERSHIP","PRICE","CRYTERIUM_TYPE_LABEL","VARIANT_CODE","criteriaLabels","Directions","ASCENDING","DESCENDING","PriceDirections","DESCENDING_BY_PRICE_ITEMS","CriterionDictionaryItems","PriceCriterionDictionaryItems","repeadedElement","getNameFunc","y","schema","formItem","weightVisible","criteriaSum","planItemIdentity","planRequired","_weightSum","offerValue","offerGrossValue","vsObj","criterion","uiType","CRITERIA_TYPE","maxListPoints","valuesList","o","maxRangePoints","intervalList","stage0","conditionRepeaded","demandPzpType","conditionLabels","getName","otherName","findRepeatedConditionName","_conditionsError","criterionRepeaded","findRepeatedCriterionName","_criterionsError","WorkableIconDeleteButton","DeleteIcon","WorkableIconEditButton","EditIcon","dealingElement","rootId","createId","emptyStage","oldStage","concatNoDuplicates","concat","bElement","aElement","newDealingElement","WorkableIconConfirmButton","DoneIcon","rootEdit","editInput","wordBreak","cursorPointer","onOpen","disableDelete","elementId","_editId","_touchedId","editTitle","setEditTitle","titleId","titleError","titleTouched","demendId","handleEdit","mergeDealing","localeCompare","flexBasis","idPrefix","unitDisabled","quantityId","unitId","measureUnits","setMeasureUnits","MeasureUnitService","WorkableIconPreviewButton","VisibilityIcon","WorkableIconAddButton","rootWeight","handleEditItem","nameId","typeId","allowQuantityEditInOfferId","predefinedVatId","offerSourceTypeId","weightId","optionalItem","BooleanItems","OfferSourceTypes","showConfirmBeforeDelete","objectPath","oneBaseItem","vatRateId","vatOption","OFFER_VAT_ITEMS","itemElement","baseItemId","handleClose","baseItemName","editingItem","setEditingItem","deleteConfirm","setDeleteConfirm","deleteFunctionParams","setDeleteFunctionParams","criteriaSumError","handleShowItem","clonedItem","elId","showDeleteConfirm","idParam","indexParam","oldItem","mindIdFound","x1","x2","newId","onEdit","textBold","samllColumn","orderColumn","ipColumn","checkboxColumn","cells","elementList","orderLabel","isAllChecked","hasOrder","order","newElements","acc","htmlFor","ImputLimits","selectedItems","otherNameRegExp","partId","typeElements","conditionValues","parts","getInitialValues","initValuesName","getNames","onAdd","showParts","setObjectValue","shift","subObj","doElement","critArray","editedCriterion","originalCriterion","stageName","doDelete","_formikCritArrayCopy","_editedCritCopy","oldFieldIndex","stageValues","oldField","priceIndex","cur","priceWeight","hasElement","crit","objectValue","removeElementsfromParts","doElementsManipulation","addElementsToParts","splitId","fieldId","partsIds","currentDealingList","missingArray","newDownloaded","processedDealings","delaingIndex","currentDealing","newDealingList","processed","initCrit","setElementList","critName","setCritName","critDisplayName","getCritDisplayName","dealingsContains","ids","remoteDealingIds","curDeal","findTemporaryDealingIds","found","filterByCurrentLoadedDealings","dirtyListenerSemaphore","openPopup","setOpenPopup","openDeletePopup","setOpenDeletePopup","editElement","setEditElement","thisId","handleDeleteButtonPress","weightInput","curIndex","newSum","priceWeightId","min0MaxWeight","CRYTERIUM_VARIANT","tab","TABS","errorKeys","pointsLessThanWeight","z","validation","curRowValidation","CRITERIA_ELEMENT_TYPE","smallerError","biggerError","rangeSameError","fromInclusive","toInclusive","curFrom","inservalStartToPrevEndError","inservalStartLesThanEndError","elementErrors","fromValue","tabVertical","textTransform","tabVerticalSelected","tabsVertical","borderRight","Tabs","tabs","vertical","newValue","indicatorColor","orientation","Tab","wrapper","FormTabs","tabsValues","edit","setRepeatValue","fieldValue","criteriumVariant","typeValues","MEASURE_UNIT","MEASURE_UNIT_LABEL","unit","criteria","createCriteria2","points","createCriteriaSmaller","createCriteriaBigger","createCriteriaL","units","nameItem","typeItem","descriptionItem","cutLines","setValues","ErrorText","idList","errorText","CriteriaElement","unitLabel","mu","unitsId","pointsId","inputkey","input","criteriaKey","CriteriaListBase","Element","errorWholeTabValue","render","arrayHelpers","isLast","CriteriaList","hideElement","hide","pairId","pairValue","BaseVariant","disableMin","disableMax","criterionId","minId","maxId","minRadioId","maxRadioId","nextMinRadioId","RangeVariant","SmallerVariant","BiggerVariant","variantId","arrayIds","getErrorIds","criteriaElementVariants","getVariant","lastItem","arrayExtension","isEdit","change","TABS_VALUES","apiVersion","validationSheme","NewCriteria","addCheckbox","setAddCheckbox","criteriaSumId","criteriaPopup","setCriteriaPopup","POSITION_TYPE","POSITION_TYPE_LABEL","showCommentField","shapeObj","positionTypes","ITEM_TYPE","ITEM_TYPE_LABEL","itemTypes","grossNetGrid","cpvBox","isDealingElement","setLoaded","planItems","elementsLength","ExecuteFunction","func","shouldExecute","DemandValidationMessages","messages","infoMessages","saveSuccessCallback","saveErrorCallback","afterSave","setAfterSave","realDirty","dealingValuesAndActionsForSave","setDealingValuesAndActionsForSave","getDraftsAndSaveDealingsConfirm","setGetDraftsAndSaveDealingsConfirm","doSaveDealings","draftPromises","promisesValues","_openTouched","formatDealingList","_formikProps","field","newTouchedObject","getTouchedKeys","setFormikValuesTouched","doNotInitializeDraftsThenSaveDealings","dealingDraft","tmpArr","getAndInitializeDraftsThenSaveDealings","downloadImportTemplateClick","DownloadIcon","PAPERS_GENERATOR_LIST_RESOURCE_ID","WorkableIcon","WorkableIconShareButton","ShareIcon","PaperLink","paperWorking","paperClick","showShare","shareClick","available","waiting","salesModule","customPopup","ExitToAppIcon","PrintIcon","paperId","ListItemSecondaryAction","useSnackbar","useSnackbarNotistack","closeSnackbar","enqueueSnackbar","doSnackbar","options","enqueueInfoSnackbar","enqueueSuccessSnackbar","enqueueWarningSnackbar","enqueueErrorSnackbar","PapersGeneratorSelectPopup","onSelect","onBack","selectGeneratesDocument","workingSupplier","setWorkingSupplier","rowClick","PapersGeneratorService","PapersGeneratorRfxInvitedSupplierWithOfferPopup","invitedSuppliers","setInvitedSuppliers","PapersGeneratorRfxRequestPosition","requestPositions","setRequestPositions","PapersGeneratorRfxInvitedSupplierPosition","chosenSupplier","setChosenSupplier","downloadFileWithPreloadUrl","preloadUrl","previewFile","SiwzSourceType","potentiallyValidMomentObject","VISIBILITY_TYPES_RESOURCE_ID","FOLDER_LIST_RESOURCE_ID","REPO_EDITABLE_RESOURCE_ID","updateFileRowInStore","folderList","folderIndex","folder","fileIndex","f","newFolderList","_updateFolderInStore","respFolder","updateTrash","_doUpdateTrash","workingFolderIdentity","trashIndex","RepoFolderTypes","trash","addFolder","insertIndex","temp","resourcesName","__get","addFiles","refreshFolder","deleteItem","deleteAll","deleteFolder","downloadAll","updateFolderName","updateFolderDescription","getDownloadHistory","pagination","getVisibilityTypes","types","changeFileVisibility","visibilityEndDate","getOnlyValidMomentObjectOrDefault","visibility","changeFolderFilesVisibility","updateDescription","getDownloadFile","shareRepo","shareRepoFolder","isRepoEditable","buildIdentity","SIWZ_TYPE_LIST_RESOURCE_ID","SIWZ_LIST_RESOURCE_ID","SIWZ_EDITABLE_RESOURCE_ID","updateAfterAdd","addResp","demandValidationSectionId","validateSection","updateSiwzRowInStore","siwzRow","preserveVersions","rootRowIdentity","rootRowId","versionRowId","siwzList","versions","r","validateSIWZ","validateDocuments","getTypes","send","repositoryId","parentSiwzId","parent","autopublish","moveFromRepo","rootIdentity","curList","itemToRemove","RepoService","unpublish","getVersions","clearVersions","updateNoticeReferenceNumber","noticeReferenceNumber","addBzpNotice","bzpNoticeId","siwzType","generateSWZ","finallyCallback","shareGenerateSWZ","shareSiwz","isSiwzEditable","buildSiwzIdentity","SwzGeneratorQuestionSelect","question","selectValue","SwzGeneratorQuestionCheckbox","changeMain","fPName","qKey","opt","subOptions","sub","changeSub","so","SwzGeneratorQuestion","helpMessage","DOMParser","parseFromString","documentElement","textContent","helpText","textIndent","SwzGeneratorSection","questions","helpTexts","setSections","getActions","inits","q","SiwzService","PapersGeneratorSelectFilesPopup","onGenerate","selectedPos","setSelectedPos","generateClick","added","PapersGeneratOfferFilesVerification","PapersGeneratorMessageFilesVerification","getJavaKey","jsKey","snakeCase","getParamSerializedValue","applySearchParams","curParams","searchIndex","applySortParams","PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID","transformer","__sectionResponseTranformer","getStage1Sections","getStage2Sections","respTransformed","curSections","newSections","resourceId","DemandValidationSectionStatus","querySelector","extraOffset","scrollElement","boundingClientRect","getBoundingClientRect","stageBar","toolBar","offsetTop","scrollY","clientHeight","scrollTo","behavior","PurchasingGroupStage1BasicDataForm","basicData","propertyTransformer","HistoryButton","HistoryIcon","dateColumn","dateTimeColumn","buttonColumn","HistoryListPopup","historyList","selectElem","selectedElem","dateInserted","replacedUser","getUserFullNameWithEmailAndDeputy","apiUser","getUserFullNameWithEmail","getUserFullNameWithDeputy","getUserFullName","noChanges","buttonShow","HistoryElementComparator","selectedElemLoaded","clearSelectedElem","customParamTransformer","showTheSame","setShowTheSame","rows","changesCount","fieldsCount","leftContent","rightContent","leftVal","rightVal","theSame","ArrowBackIosIcon","loadHistoryList","loadHistoryElement","setHistoryList","setSelectedElem","setSelectedElemLoaded","HistoryList","PurchasingGroupStage1BasicData","panelRef","validationSection","setBasicData","setHistory","PurchasingGroupSectionService","PurchasingGroupStage1Service","getBasicData","closeSection","saveBasicData","getArchiveElement","getArchiveList","TransferList","leftColumn","rightColumn","Column","grow","Header","childClassName","childrenItem","transferList","row","SearchHeader","ItemComponent","itemProps","disablePadding","POSITION_VALUE","IconAddButton","WorkableIconHighlightOffButton","HighlightOffIcon","FullNameItem","marked","addedId","markHistorical","elementsCount","externalUser","userType","CommissionUserType","secondaryText","organizationName","pgMode","pgPositionValue","demandPositionValue","otherRole","TypographyWithIcon","userList","validateObj","ErrorOutlineIcon","COMMISSION_USER_LIST_RESOURCE_ID","COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID","COMMISSION_ESTABLISHMENT_RESOURCE_ID","saveUserList","commissionUserList","users","addExternal","getHistory","getUsers","establishmentDate","getAvailableUsers","deleteCommissionMember","CommissionService","EmptyOptions","CandidateColumn","filteredItems","setFilteredItems","searchFilter","setSearchFilter","addPopup","setAddPopup","addedItems","FullNamePositionItem","selectTextId","otherValue","selectId","primaryAction","secondaryAction","pgPositionsItems","positionsItems","CommissionColumn","doLoadHistory","establishmentId","commissionHistoryList","setCommissionHistoryList","helperTextHidden","userListAvailable","CommissionForm","saveDraftFunc","PurchasingGroupStage1Commission","setCommission","getCommission","getCommissionHistory","saveCommission","DateTimePicker","ampm","picker","stageHead","PurchasingGroupStage1ScheduleForm","joiningStartDateEditable","joiningEndDateEditable","opinionStartDateEditable","opinionEndDateEditable","submissionStartDateEditable","submissionEndDateEditable","scheduleReloadTimeout","serverTime","reloadTimeout","nowServerTime","joiningStartDate","joiningEndDate","opinionStartDate","opinionEndDate","submissionStartDate","submissionEndDate","swzOpinionStartDate","swzOpinionEndDate","collectingDataStartDate","collectingDataEndDate","isAfter","diff","PurchasingGroupStage1Schedule","setSchedule","getSchedule","saveSchedule","PurchasingGroupStageSections","STAGE_1_SECTION","EMPTY_SEARCH_OBJECT","BasicSearch","searchInProgress","doSearch","clearSearch","setValue","submitState","setSubmitState","valueFiltered","doClearSearch","onKeyUp","maxLength","SearchIcon","ClearIcon","iconWorksReducer","newState","works","anyWorks","simpleConfirm","confirmComplex","simpleConfirmNoTranslate","WorkableIconMailButton","MailIcon","buttonReject","rejected","coordinatorView","editName","setEditName","rejectionDate","canReject","canRestore","iconWorks","dispatchIconWorks","useReducer","reject","restore","resend","submitName","updateMemberName","deleteMember","MEMBERS","onReject","rejectMember","onRestore","restoreMember","complete","RestoreIcon","activeStage","resendInviteNotification","disabledEmpty","textField","createEditDescriptionFile","isFolder","editDescriptionFile","onUpdated","service","WorkableIconSearchButton","WorkableIconDownloadButton","GetAppIcon","WorkableIconPublishButton","LaunchIcon","WorkableIconUnpublishButton","warnIcon","descriptionTooltip","versionsCell","MembersDocumentsListTableRow","mainDocs","onEditDescriptionFile","allMemberDocumentsApiPath","memberMode","download","deleteMemberDocument","deleteAllMembersDocument","typeTranslated","createDate","publishDate","downloadMemberDocument","downloadAllMembersDocument","unpublishAllMembersDocument","publishAllMembersDocument","gridContainer","fileName","generateItems","generateInitialValues","generateValidationSchema","typeColumn","MembersDocumentsList","membersDocs","availableTypes","setEditDescriptionFile","generateWorking","setGenerateWorking","addFilesWorking","setAddFilesWorking","setSelectedFiles","setConfiguredFiles","hasUpload","openEditDescription","documentsApiPathType","editDescription","afterDocumentAdd","docs","group_agreement","generateGroupAgreementDocument","doc","addMemberDocuments","addAllMembersDocuments","updateMemberDocument","updateAllMembersDocument","membersList","setMembersList","getAvailableMemberUsers","respMapped","selectedUsers","addMemberUser","addButton","memberData","PURCHASING_GROUP_MEMBER_RESOURCE_ID","stage1Sections","deleteWorkingId","setDeleteWorkingId","participationWorking","setParticipationWorking","getMember","mainSection","UserService","deleteMemberUser","canConfirm","confirmationDate","CancelIcon","withdrawParticipationMember","CheckCircleOutlineIcon","confirmParticipationMember","memberDocuments","MembersElement","getMembersAvailableConcerns","concerns","selectedOrgs","addMembers","MembersList","members","addWindowOpen","setAddWindowOpen","setSearch","PurchasingGroupRole","stageSections","PURCHASING_GROUP_MEMBERS_RESOURCE_ID","PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID","PURCHASING_GROUP_HEADER_RESOURCE_ID","userRole","getMembers","getAllMembersDocuments","STAGE_2_SECTION","PurchasingGroupStage1PapersGenerator","apiPathType","sendType","contractorList","setContractorList","getOpinionAvailableMembers","contents","opinion","addOpinionForMember","newOpinion","saveOpinionMessage","rootMine","contentWrapper","contentWrapperUnread","borderWidth","contentWrapperMine","sendDate","newBadge","OpinionMessage","mine","memberMessage","unread","read","Badge","badgeContent","author","remove","sendMode","handleDelete","deleteOpinionMessage","getOpinions","opinionMessages","PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID","addWorking","setAddWorking","getOpinionMessages","addEmptyOpinionMessage","OpinionElementTitle","memberName","unreadCount","OpinionElement","opinions","PURCHASING_GROUP_OPINIONS_RESOURCE_ID","newOpinionPopup","setNewOpinionPopup","PurchasingGroupStage1FinishPreparing","canFinish","setCanFinish","FINISH_PREPARING","canFinishPreparing","finishPreparingStage","getHeader","PurchasingGroupStage2ScheduleForm","swzOpinionStartDateEditable","swzOpinionEndDateEditable","collectingDataStartDateEditable","collectingDataEndDateEditable","PURCHASING_GROUP_TEMPLATE_RESOURCE_ID","PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID","__save","getCollectingSchedule","saveCollectingSchedule","getTemplate","saveTemplate","newRes","getAvailableTemplates","getTemplateMember","getTemplateMemberForm","updateReduxLists","formListElement","formWrapper","memberListElement","curTemplate","newTemplate","memberList","curMember","newMember","formList","saveTemplateMemberForm","saveTemplateMemberFormDraft","saveTemplateMemberFormClearDraft","saveTemplateMemberFormAccept","saveTemplateMemberFormReject","saveTemplateMemberFormAskForEdit","saveTemplateMemberFormAllowEdit","saveTemplateMemberFormRejectEdit","getFinish","saveFinish","createDemand","maxRedirects","sendDealingsChangedNotification","PurchasingGroupStage2Schedule","PurchasingGroupStage2Service","TemplateMembersElementTitle","allFormsAccepted","askForEditPending","PurchasingGroupTemplateFieldType","TEXT","DATE","PERCENTAGE","AGGREGATE","TemplateMemberFormField","enabled","lastArchiveField","getViewField","fieldBox","emptyValue","textValue","decimalValue","replaceAll","getInputType","difference","fieldGrid","gridFieldComparing","getReadonlyField","PurchasingGroupTemplateFormState","fieldValues","decisionType","showOnGrid","warning","uxFormId","onDiscardChanges","newForm","formEditable","submitter","setSubmitter","historyPopup","setHistoryPopup","draftMode","getReadonlyNameField","lastArchive","getViewNameField","allOptional","getFieldVS","hasAskedForEdit","canAskForEdit","hasDraftSaved","flexWrap","groupHeader","selectedFormId","setSelectedFormId","addFormWorking","setAddFormWorking","setFormWrapper","loadForm","checkFormDirty","doDiscardChanges","getIcon","addTplAvailable","formIdPrefix","TemplateMembersList","template","availableTemplates","setAvailableTemplates","endsWith","canChooseTemplate","templateName","canFillForm","FINISH","SplitButton","buttonClassName","hideEmpty","anchorRef","handleToggle","prevOpen","ButtonGroup","zindex","disablePortal","ClickAwayListener","onClickAway","contains","MenuList","finishData","setFinishData","getSectionData","procedureTypes","createSplitButton","hasDemandPrivilege","sectionErrors","hasDemandCreated","buttonPrint","canSendDealingsChangedNotification","BASIC_DATA","OPINION","SWZ","COLLECTING_SCHEDULE","OPINION_SWZ","TEMPLATE","COLLECTING_PAPERS_GENERATOR","StageSectionNameToSectionParam","kebabCase","StageSectionParamToSectionName","StageSectionsComponents","PurchasingGroupStage1Members","PurchasingGroupStage1Opinion","PurchasingGroupStage2Template","PurchasingGroupStage2Dealing","PurchasingGroupStage2Finish","getMembersRow","newMessage","modifiedDate","__print","getRelatedObjects","getPurchasingGroupList","searchData","getPurchasingGroupListActions","getPurchasingGroupMemberList","noErrorsDocs","userIds","getGzmManagementResolution","printGzmManagementResolution","getGzmLeadingDocument","printGzmLeadingDocument","getGzmDocumentToSign","printGzmDocumentToSign","getGzmDraftGroupAgreement","printGzmDraftGroupAgreement","initData","setInitData","resolutionNumber","resolutionDate","projectName","memberIds","documentNumber","documentDeadline","agreementConclusionDate","agreementStartDate","useEzamowieniaOauth","authorizeEzamowienia","requiredGroups","EZamowieniaIcon","getAuthorizationStatus","revokeToken","PapersGeneratorXmpUzpPresidentPaperContent","goto","EzamowieniaService","ezamowieniaOrigin","PapersGeneratorXmpUzpPresidentPaperPopup","shareSystemsActive","sharePopupData","onChoose","activeShareSystems","connectedShareSystems","shareSystemsConnected","SendIcon","DEF_CUSTOM_POPUP","PAPERS_SHARE_SUPPORTED_CUSTOM_POPUPS","REPORT_SHARE_SUPPORTED_CUSTOM_POPUPS","papersGeneratorList","setCustomPopup","setPaperWorking","sharePopupPaper","setSharePopupPaper","shareSystems","share","dictionary","INTEGRATIONS_UPLOAD","showShareReport","modules","papers","reports","doShare","getPaginationConfig","pageSize","setSearchData","totalCount","setTotalCount","contractorTotalCount","setContractorTotalCount","setPaginationConfig","setSearchConfig","preservePagination","setSortConfig","lineHeight","MoreButton","loadedCount","setConfig","captionTrKey","RESOURCE_ID_RFX_OFFER_LIST","RESOURCE_ID_RFX_OFFERS_ACTIONS","RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS","RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS","_doAdditionalRoundsOffers","additionalOffers","res2","emailsTab","emails","envelope","envelopeId","OfferStatusLabel","OfferEncryptionStatuses","OfferEncryptionStatusLabel","cell","statusColumn","OfferAdditionalOffersTable","redirectToOffer","encryptionStatus","offerDate","offerDetailsUrl","encIcon","LockOpenOutlinedIcon","LockOutlinedIcon","InsertDriveFileOutlinedIcon","dateStr","GENERAL_INFO_BASIC_DATA","GENERAL_INFO_DOCUMENTS","GENERAL_INFO_PUBLIC_ANSWERS","resId","subject","unreadElements","GeneralInfoExpansionPanelTitle","toggleThread","toggleThread2","titleRoot","titleCollapsible","GeneralInfoEntry","collapsible","defaultCollapsed","biggerLabel","collapsed","setCollapsed","ExpansionPanel","defaultExpanded","highlighted","square","titleAdornment","Accordion","AccordionSummary","expandedSummary","titleGrid","AccordionDetails","details","AccordionActions","bottomButton","appBarBackground","formatAmountNumber","undefinedValue","fixed","Number","OfferStageTranslationsContext","createContext","OfferStageTranslationsContextProvider","Provider","textarea","GeneralInfoBasicData","panelsClassesObject","generalInfoBasicData","setExpanded","stageTr","useContext","isExpanded","procedureTypeTranslated","realizationTypeTranslated","orderType","canCreateAuction","guaranteeList","dealingsCount","ordinalNumber","procedureStartDate","stageTypeTranslated","stageEndDate","openOfferDate","stageSecondEndDate","demandFinishDate","ProcedureStatus","WorkableIconForwardButton","ForwardIcon","GeneralInfoDocumentsFileTableRow","DemandOffersGeneralInfoService","GeneralInfoDocumentsFileTable","generalInfoDocuments","downloadZipWorking","setDownloadZipWorking","PurchaserOfferContext","PurchaserOfferContextProvider","demandStageSectionsList","purchaserOfferContext","unreadDemandDocuments","StageSections","GENERAL_INFO","CORRESPONDENCE_RES_PREFIX","CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID","CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID","CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID","CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID","CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID","CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID","cleanupThreadList","_processNewMessagesUpdate","checkTime","correspondenceSplitDate","newReadMessageIds","listResourceId","reqResource","threads","threadsObject","th","reqThread","unreadMessagesCount","newMessageList","unshift","_setMessagesInThread","reqMessages","_addThreadToList","thread","_updateMessageInThread","_removeMessagesFromThread","removedLast","messagesFiltered","_updateMessagesInThreads","respTh","mesMap","_addMessagesToThreads","threadList","_sendFlagUnflagThread","hasRedFlag","_modifyFlag","getSearchResult","searchObject","beforeBiddingEndThreads","afterBiddingEndThreads","notSplicedThreads","attachmentDownloadRegistrationStartDate","print","threadIds","getBuyerThreadList","getBuyerNewMessages","dateFrom","unreadIds","getBuyerSearchResult","getBuyerThreadMessageList","contractorUser","publicQuestion","addBuyerThread","sendBuyerMessage","publishBuyerMessage","updateBuyerMessage","saveBuyerThreadAsContractor","createBuyerMessage","deleteBuyerMessage","sendBuyerBulkMessages","bulkMessages","publishBuyerBulkMessages","getBuyerContractorInRoundList","getBuyerMessageDelivery","downloadBuyerMessageAttachmentsZip","downloadBuyerMessageAttachment","checkVerificationLimit","printBuyerMessageAttachmentsVerification","sendBuyerFlagThread","sendBuyerUnflagThread","getBuyerPrivileges","getBuyerPrint","getBuyerThreadEmailList","getBuyerContractorEmailList","shareCorrespondencePrint","clearThreadMessages","getContractorThreadList","getContractorNewMessages","getContractorSearchResult","getContractorThreadMessageList","buyerUser","createContractorMessage","updateContractorMessage","sendContractorMessage","deleteContractorMessage","addContractorThread","downloadContractorMessageAttachmentsZip","downloadContractorMessageAttachment","sendContractorFlagThread","sendContractorUnflagThread","getContractorPrivileges","getContractorPrint","GeneralInfoPublicAnswersMessage","currentRfxRoundId","attachment","CorrespondenceService","messagesDiv","generalInfoPublicAnswers","unreadAnswers","unreadRfxMessages","DEMAND_STATISTICS_RESOURCE_ID","CURRENT_RFX_RESOURCE_ID","getStats","getCurrentRound","clearStats","clearCurrentRound","GeneralInfoRealizationAmount","realizationList","rootExpanded","currentRfxRound","StatisticsService","sectionId","dataLoading","isResponseValidWithStoredPasswordCheck","passwordSetSuccessCallback","passwordSetErrorCallback","setErrors","skipShowError","noValidPassword","offerErrors","Done","Finished","Required","Optional","Pending","Progress","Wait","avatar","icoTab","PriorityHighIcon","PlaylistAddIcon","HourglassFullIcon","CheckCircleIcon","AvatarStatus","ExpansionPanelTitleAvatar","Avatar","OfferMode","OfferPositionStatusType","OfferPositionStatusesReadyToOffering","OfferPositionStatusesReadyToOfferSign","OfferPositionStatusesReadyToWithdraw","OfferPositionStatusesReadyToWithdrawSign","OfferPositionStatusesReadyToDelete","SignatureType","QUALIFIED","PERSONAL_ID","E_PUAP","UNKNOWN","OfferStatusType","OFFER_EDIT","OFFER_POSITIONS_LOADED","postSaveCommonData","defErrorCallback","commonData","postSavePositionData","newLoaded","getLoadedPositionKey","placingType","filesResp","curEdit","positions","offerFiles","postOfferEspdFiles","_processAddNewEspdFiles","touchedPositions","tmpEspdFiles","espdFiles","updatedOf","placeOffer","onePositionMode","missingSignatures","deleteOffer","positionIds","withdrawOffer","signOffer","signWithdraw","stopSigningOperation","getDocumentToSign","signatureType","getDownloadOfferFile","getDownloadEspdFile","postOfferFiles","_processAddNewFiles","Set","tmpOfferFiles","pos","deleteOfferFile","editEspdFile","editEspdFiles","deleteEspdFile","editOfferFile","editOfferFiles","getOfferEdit","preview","endpoint","getOfferPosition","redirectContractorESPDMpAppUrl","resp2","downloadContractorESPDExportFile","downloadSnapshot","getDownloadOfferFileUrl","getDownloadOfferFilesZip","signFile","signEspdFile","getDownloadEspdFileUrl","printOfferPosition","getDocumentBase64EncodedToSignDocument","getDocumentToWithdraw","requireWithdrawEncryption","getSnapshots","getVerifications","downloadVerifications","verifyBeforePlaceOffer","getPreviewSection","getDownloadOfferTemplate","OFFER_PLACED","ContractorDocumentType","SECRET","RODO","ContractorDocumentTypeSelectItems","curVal","ContractorDocumentTypeLabel","RoundType","TRUE_FALSE_VALUE","TrueFalseWithEmpty","rodoSelect","typeSelect","containsRodoId","getPositionItems","onUpdate","documentType","containsRodo","ADDITIONAL_OFFER_EDIT","ADDITIONAL_OFFER_POSITIONS_LOADED","ADDITIONAL_OFFER_EDIT_ALT","DemandOffersOfferService","OFFER_AUCTIONS_LIST_DATA","AUCTIONS_OFFER_EDIT","AUCTIONS_OFFER_POSITIONS_LOADED","AUCTION_OFFER_PLACED","getOfferAuctionsList","assignToAuction","OfferSectionContext","OfferSectionProvider","SignatureIcon","OfferFileSignStatus","signature_file","not_signed","signed","wrong_sign_type","OfferFilesTableSignStatus","signState","SupportModeContext","SupportModeContextProvider","OfferFilesTableRow","positionIdToOrderMap","bulkEdit","signFileAvailable","onSignDocument","editFile","setEditFile","supportMode","contextSection","promise","DemandAdditionalOffersOfferService","insertDate","fileSize","sha256","signatureConfiguration","DemandOffersAuctionService","updateFile","doSignDocContent","signatureTypes","docContentFunc","cancelCallback","getEncryptionRoundId","makeTaskListConfig","breakSigning","setLoadingScreenShow","show","hideLoadingScreen","showLoadingScreen","simpleAlert","translateTexts","alertComplex","buttonText","OfferFilesTable","offerEdit","setBulkEdit","bulkEditWorking","setBulkEditWorking","realOnePositionMode","signFileRef","useSignature","useLoadingScreen","onDownloadZip","doBreakSigning","encryptionEnabled","SaveIcon","OfferFiles","portFilesWorking","setPostFilesWorking","OfferEspdType","OfferEspdTypeLabel","help","helpNotSelected","OfferEspdTypeSwitch","espdType","setEspdType","ToggleButtonGroup","exclusive","newEspdProcedure","ToggleButton","SimpleSelect","menuItemClassName","getItemProps","fieldValueInput","xVal","hidden","flex","OfferEspdInternal","positionItems","visible","setPositionId","espdOnPositions","parentSelect","OfferEspdExternalUploadFile","handleSendFiles","OfferEspdExternal","OfferEspdTableRow","OfferEspdTable","OfferEspd","envelopeOffer","modifyDisabled","ContractorOfferEspdType","criterionValidation","criterium","gVal","vatValue","quantityShape","baseCriterion","optionalItemId","optionCriterion","parameterOffers","showComment","comment","offerValidation","consorciants","consorciumOnPosition","criteriums","itemOffers","YESNO_ITEMS","OfferYesNoInput","OfferTextInput","OfferNumberInput","vat","currency","gridBlock","VAT_TYPE_ITEMS","calculateGrossValue","newGross","calcNetGros","sumNet","sumGross","roundedGross","roundedNet","OfferPriceInput","parsedQuantity","netField","grossField","vatField","copyVat","totalGross","totalNet","quantityDisabled","offer","optionalItemIndex","baseParameterOffer","parameterId","vatError","copyVats","offerValuesPredefined","getSelectValue","selValue","ImportExportIcon","po","OfferListInput","listValues","marginTop1","marginTop2","OfferInput","customQuantity","Input","offerInput","inpDisabled","canEditQuantity","OfferPositionConditions","OfferPositionCriteriums","sumElem","OfferPositionItems","showOptionSumValues","totalValues","positionOfferValue","positionOfferGrossValue","positionOptionOfferValue","positionOptionOfferGrossValue","positionTotalOfferValue","positionTotalOfferGrossValue","newOptionSum","OfferPositionParameters","parameter","ContractorConsorciumTypesOnePosition","NONE","ContractorConsorciumTypes","POSITION","ContractorConsorciumTypesLabel","ContractorCompanySize","MICRO","SMALL","MEDIUM","SELFTRADER","NONBUSINESSINDIVIDUAL","OTHERSIZE","LARGE","IGNORE","ContractorCompanySizeLabel","CONTRACTOR_LIST_ID","CONTRACTOR_ONE_PLACE_ID","NIP_LIST_RESOURCE_ID","reduxId","getContractorDetails","getOnePlace","__appendContractors","__removeContractor","sendTabContractor","contractors","invite","deleteUser","getNipList","check","NipRow","nipList","listSorted","ContractorService","MaskedTextInput","mask","maskChar","prevFormikProps","nextFormikProps","PostCodeRow","postCodeId","postCodeValue","postCode","FirstPart","SecondPart","PL_PREFIX","translationsMap","InviteContactorForm","defaultValues","collectPostCode","collectAddress","addressRequired","collectCity","cityRequired","collectRegon","collectCompanySize","collectIdentity","checkForExistingVatins","ctrMap","setCtrMap","vatin","address","city","regon","companySize","errorList","nipAndPostCodeError","numberLength","valueKey","countryCode","objShape","fixedname","PESEL","onBlurNip","nameExist","handleInvite","submitButtonLabel","setLoading","emailColumn","commonColumn","ConsorciumTable","invitePopup","setInvitePopup","TableContainer","removeContractor","lastId","toggle","YesNo","newProcedure","OfferPositionConsorciants","consorciumType","consorciumEnabled","APIOfferPlacingType","getConfig","SnapshotListPopup","snapshotList","setSnapshotList","workingId","setWorkingId","offerSubmitDate","offerPlacedInTime","digitalSignature","digitalSignatureDate","offerStatus","empty","verificationDate","getVerificationConfig","verificationsList","setVerificationsList","verificationsListFiltered","setVerificationsListFiltered","searchText","setSearchText","fillFilteredList","positionName","useSalesNotification","functionality","SIGNATURE_VERIFICATOR","OfferPositionForm","loadedPosition","loadedPositionCounted","setLoadedPositionCounted","chooseSnapshotPopup","setChooseSnapshotPopup","verifyPopup","setVerifyPopup","counted","printVerificationSalesCheck","salesNotificationKeys","SpellcheckIcon","additionalOfferAltMode","formDisabled","hadStageWithOffer","rootGrid","adornmentGrid","discardButton","positionsLoaded","OfferPositionStatusToAvatar","statusTranslated","endDate","offerTmpDate","createTitle","borderTop","floatingMenu","menuBarPaper","ownProps","positionsRef","searchReg","setSearchReg","hideNoOfferPositionsOperator","setHideNoOfferPositionsOperator","onKeyPress","inputRef","VisibilityOff","Visibility","ButtonsBar","toLeft","buttonListLeft","buttonList","memoButtons","bb","propDefault","progressBar","NavigationBar","menuBar","translateLabel","createSubmitFormButton","isSaveButton","nameColumn","POPUP_MODE","getListText","onSuccess","popupMode","contractorOfferStatus","isSupported","positionsFiltered","setPositionsFiltered","part","getButtonText","posIds","requiredSignatures","CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID","OfferCommonData","headColumn","borderBottomColor","getVerificationBeforePlaceOfferPopupConfig","VerificationBeforePlaceOfferPopup","signedFile","signatureFiles","sFile","partColumn","errorColumn","entryLpColumn","entryColumn","ImportOfferFormPopup","setResult","upload","cellAddress","StageSectionsUrlParams","choosePositionPopup","setChoosePositionPopup","importTemplatePopup","setImportTemplatePopup","verifyBeforePlacePopup","setVerifyBeforePlacePopup","unsavedPos","readyPositions","submitChoosePositions","submitChoosePositionsWithdraw","submitDeleteOffer","espdComplete","offerEspdType","missing","posId","missingPos","doSubmitChoosePositions","sigType","signatureFileId","submitPlaceOffer","submitWithdrawOffer","requireEncryption","signWithdrawOffer","placingOffer","createMultiButton","navigationBarButtons","OfferExpansionSectionTitle","getSectionVariant","OfferEditSectionTitle","passResp","OfferPlacedPanel","OfferPlacedSectionTitle","submitSignWithdrawOffer","encryptionRoundId","offerCollectionEnded","AdditionalOfferCommonData","envelopeOfferDate","startMoment","startDate","endMoment","additionalOfferEdit","chooseEnvelopeOfferDatePopup","setChooseEnvelopeOfferDatePopup","doSignOffer","doDeleteOffer","doSignWithdrawOffer","doStopSigningOperation","AdditionalOfferPlacedPanel","AuctionRule","ENGLISH","DYNAMIC","JAPANESE","DUTCH","AuctionRuleLabel","AuctionStatus","AuctionStatusLabel","AuctionType","AuctionTypeLabel","AuctionTypeItems","TooltipRow","AuctionRow","handleAssignToAuction","confirmOpened","setConfirmOpened","customWidth","HelpOutlineIcon","overtime","overtimeCount","rule","decisionTime","openInNewTab","idColumn","userColumn","AuctionsTable","auctions","auctionWrapper","offerAuctionsListData","AUCTION_OFFER_EDIT","AdditionalOfferPlacedSectionTitle","AdditionalOfferEditSectionTitle","GeneralInfoSectionTitle","StageSectionsOrder","ADDITIONAL_OFFER_PLACED","DASHBOARD","GeneralInfoPanel","OfferEditPanel","AdditionalOfferEditPanel","AdditionalOfferEditAltPanel","AuctionOfferEditPanel","AuctionOfferPlacedPanel","StageSectionsTitles","OfferTableRow","openEnvelopeEdit","collectionFinished","addLoading","contractorName","offerUser","contractorAddress","dateOfEnvelopeReceipt","hasAdditionalRounds","consorciumOffer","outOfDateOffer","apiOffers","WarningRoundedIcon","RfxOfferService","supplierColumn","authorColumn","addressColumn","OfferTable","headRow","addContractorsTab","onclose","receiveMessage","onePlaceContractor","dialog","iframe","contractorImport","inlineBlock","nameError","RegisterEnvelopeForm","newEnvelope","handleClearContractor","suggestContractor","contractorNameError","getFormButtons","platformAdded","rfxRoundId","loadedEnvelope","setLoadedEnvelope","dateOfReceipt","req","invitation","offersActions","demandStatistics","offerLoading","setOfferLoading","registerEnvelopePopupOpened","setRegisterEnvelopePopupOpened","downloadWorking","setDownloadWorking","useSearch","refreshCurrentRows","loadedRows","curPageSize","numberOfOffers","runDownload","getAdditionalButtons","verifyAttachments","itemSummaryXls","itemParametersXls","summaryXls","summaryPdf","curDemandValidation","downloadOffersEnabled","registerEnvelopeEnabled","PROCEDURE_TYPES","noticeOjsType","noticeBzpType","siwzTypes","setErrorText","downloadSuccess","setDownloadSuccess","processResponse","bzpSiwzType","pickAutopublish","pickParent","parentId","autopublishId","createParentSelectTab","createDownloadHistoryFile","DownloadHistoryPopup","downloadHistoryFile","downloadHistory","setDownloadHistory","historyLoading","setHistoryLoading","handleHistoryLoad","paginator","curState","downloadCount","downloadUserFullName","ipAddress","downloadDate","WorkableIconDownloadCountButton","CloudDoneIcon","WarningRoundedButton","DemandValidationContext","DemandValidationProvider","SiwzVersionsTableRow","onOpenDownloadHistory","shareFilePopup","setShareFilePopup","getPublishDateCellValue","onShareFile","downloadDetails","versionColumn","SiwzVersionsTable","SiwzFileTableRow","onEditNoticeReferenceNumber","currentDemandValidation","expand","enterNoticeReferenceNumber","hasVersions","checkRealizationAmountValue","createEditNoticeReferenceNumberFile","editNoticeReferenceNumberFile","openConfirmDeleteAll","setOpenConfirmDeleteAll","setEditNoticeReferenceNumberFile","openDownloadHistory","parentRowIdentity","openEditNoticeReferenceNumber","SelectSiwzDocument","topButtons","addBzpNoticePopupOpened","setAddBzpNoticePopupOpened","swzParamsOpen","setSwzParamsOpen","isBzpAttachmentNotice","isBzpAttachmentNoticeType","isOfferCollectionOrModification","validationShema","SelectFolderPopup","repoVisibilityTypes","repoVisibility","visibilityStatus","isFile","visibilityTypes","setVisibilityTypes","WorkableIconEjectButton","RepoFileTableRow","onSetRepoVisibility","onMoveToSiwz","moveToSiwz","changeVisibility","visibilityColumn","sizeColumn","RepoFileTable","setRepoVisibility","folderType","onSelectFileToMoveToSiwz","updateFolderFilesVisibility","deleteFolderFiles","headTable","nameCell","descriptionCell","verticalAlign","iconColumn","nameEdited","setNameEdited","openConfirmDeleteFolder","setOpenConfirmDeleteFolder","curDisabled","nameFormId","onShareFolder","getItems","SelectRepoDocument","moveToSiwzFolderAndFile","setMoveToSiwzFolderAndFile","openFolderPopup","setOpenFolderPopup","CreateNewFolderIcon","firstTable","showInternalDocuments","setShowInternalDocuments","siwzEditable","repoEditable","documentsLoading","setDocumentsLoading","siwzListPromise","siwzTypesPromise","repoFolderListPromise","repoVsibilityTypesPromise","ContractorVerificationProcedureType","ContractorVerificationProcedureTypeLabel","VerificationProcedureType","contractorVerificationProcedure","handleProcedureChange","verificationProcedure","ContractorVerificationOfferStatus","ALLOWED","ALLOWED_PARTIALLY","EXCLUDED","REVERSE_PROCEDURE","OFFER_REJECTED","NOT_SCORED","NOT_VERIFIED","CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID","CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID","getContractors","updateContractorStatus","curRes","getProcedure","updateProcedure","statusCell","ContractorVerificationRow","contractorElem","rowWorking","setRowWorking","statusToConfirm","setStatusToConfirm","statusesList","changeable","newStatus","confirmed","ContractorVerificationService","ContractorVerificationTable","marginBottomItalic","contractorVerificationList","readonly","OFFER_EVALUATION_LIST_RESOURCE_ID","getOffers","handleUpdate","offerItem","rowItem","changeType","AVAILABLE_CHANGE_TYPES","STATUS","ROW","offerEvaluations","list2","newList2","updateStatus","updateScore","score","criteriaEvaluation","OfferEvaluationViewMode","SUPPLIER","OfferEvaluationPositionStatus","EXTREMELY_LOW","OUT_OF_DATE","EXCLUDED_FROM_CONTRACT","scoreRegex","emptyRegex","emptyEditMode","OffersEvaluationScoreColumn","offerEvaluationRow","offerEvaluationCriterion","editMode","setEditMode","onScoreClick","userSelect","evenRow","lastRow","scoreColumn","statusSelect","OffersEvaluationRow","rowNumber","even","statusWorking","setStatusWorking","scoreWorking","setScoreWorking","onUpdateScore","onUpdateStatus","array","first","last","rowSpan","ViewMode","scoreTotalColumn","critColumn","weightColumn","valueColumn","OffersEvaluationTable","offerEvaluationItem","pageInputInput","pageInput","emptyWidth","goToPage","DottedPagination","showManualInputField","pageValue","setPageValue","handleConfirmPageValue","Pagination","ceil","newPage","showFirstButton","showLastButton","siblingCount","boundaryCount","intVal","Types","PaginationButton","variantDisabled","OfferEvaluationRoundType","ADDITIONAL_OFFERS","decisionsList","OfferEvaluationSearch","paginationClear","center","offerEvaluationList","OfferEvaluationService","setMode","searchOb","PaginationButtonTypes","OFFER_CHOICE_LIST_RESOURCE_ID","updateInProgress","callSectionsValidation","sectionsToRefresh","_doUpdatePosition","newPos","_doUpdateAuction","currentAdditionalRoundInfo","auc","getChoiceList","getPositionsWithNoOffer","getChoiceJustificationBasis","createAdditionalRound","filteredContractors","departmentIds","prepareAdditionalRound","cancelPositionsWithNoOffer","offerChoiceDate","saveOfferChoice","canceled","chosenSupplierIds","offerChoiceJustification","updateAuctionInAdditionalRoundInfo","addAuctionToAdditionalRoundInfo","removeAuctionFromAdditionalRoundInfo","updatePosition","modifyChoice","getPositionAuctions","checkForPrimaryTenderChoiceOptions","postPrimaryTenderDoOfferChoice","postPrimaryTenderDoNegotiations","rowsPerPageOptions","TablePagination","rowsPerPage","onPageChange","onRowsPerPageChange","labelRowsPerPage","labelDisplayedRows","backIconButtonProps","nextIconButtonProps","columnChecked","unavailable","maxPoints","iconMax","OfferChoiceContractorRowPart","chosen","chooseSupplierCountReached","offerChoiceContractor","offerChoiceRow","chooseSupplier","maxPartScore","maxScore","offerScore","unavailableReason","maxOfferChoiceCount","getTooltip","CheckBoxIcon","CheckBoxOutlineBlankIcon","IndeterminateCheckBoxIcon","AuctionTypeList","auctionType","AuctionHistoryPopup","setAuctions","OfferChoiceService","prod","choiceSize","body2","choiceStatus","choiceControls","choiceControlsEnd","auctionHistory","float","offerChoiceJustifications","chosenStatusDone","setChosenStatusDone","chosenSuppliers","auctionHistoryPopup","setAuctionHistoryPopup","offerChoiceDateError","setOfferChoiceDateError","modifyConfirmOpen","setModifyConfirmOpen","setOfferChoiceJustification","setOfferChoiceDate","disabledInputs","auctionHistoryVisible","dateValue","AdditionalRoundStatus","AdditionalRoundStatusesPending","HOUR_SECONDS","DAY_SECONDS","zeroTable","getDaysHoursMinutesSeconds","sec","zeroValue","secLeft","days","floor","hours","minutes","formatDaysHoursMinutesSeconds","ret","changeDates","getOffersDecryptionStatus","getOffersDecryptionProgress","startOffersDecryptionProcess","dateTimePicker","roundName","additionalRoundId","additionalRoundEndDate","additionalRoundStatus","additionalRoundOpenOfferDate","offerOpenDate","AdditionalRoundService","handleEndDate","countTimeFunction","serverBrowserTimeDiffSeconds","setLeftTable","timerInterval","endTimeCallback","end","nowBrowserTime","secondsDiff","clearInterval","OfferChoiceSummaryCellAdditionalRound","refreshRow","serverBrowserTimeDiff","leftTableToOfferEnd","setLeftTableToOfferEnd","leftTableToOpenOffer","setLeftTableToOpenOffer","editDatesOpened","setEditDatesOpened","decryptionStatus","setDecryptionStatus","decryptionProgress","setDecryptionProgress","decryptionInterval","decryptionFinished","secondsLeftToOfferEnd","setInterval","openOffer","ProgressStatus","formatValues","create","editDates","pause","resume","prepare","netOverGross","downloadAuctionInvitation","AuctionItemBidType","AuctionItemBidTypeLabel","AuctionItemBidTypeItems","auctionRule","fixedOfferVat","inputColumn","boundaryColumn","OfferChoiceCreateAuctionTable","isCriterion","bidType","criterias","biddableDisabled","biddable","minOfferValue","measureUnit","maxOfferValue","minOfferPrice","maxOfferPrice","tableItems","formElement","dd","preparedAuction","setPreparedAuction","AuctionService","textYesNoOrList","critShape","itemShape","rules","handleUseNetOverGrossChange","priceItemCount","offerCount","AuctionTypePart","buttonWorks","setCreatePopupOpened","deleteAuction","editAuction","publishAuction","unpublishAuction","cancelAuction","pauseAuction","acceptAuction","resumeAuction","auctionDetails","prodAuctionStatus","secondsLeftToStart","secondsFromStart","secondsToWindowEnd","secondsLeftToEnd","btns","createConfirmAuctionCfg","sendEmail","confirmButtonLabel","ConfirmAuction","cfg","setSendEmail","SaveDialogBase","iconClassName","enter","AuctionSaveError","inviteButton","OfferChoiceSummaryCellAuction","createPopupAuctionType","setCreatePopupAuctionType","editPopupAuction","setEditPopupAuction","auctionError","setAuctionError","confirmCfg","setConfirmCfg","downloadInvitationWorking","setDownloadInvitationWorking","prodButtonWorks","dispatchProdButtonWorks","testButtonWorks","dispatchTestButtonWorks","dispatchButtonWorks","_DECISION_STATES","noOffer","OfferChoiceRow","offerChoices","setChosenSuppliers","curWorking","setCurWorking","doUpdateStatus","doModifyChoice","isAdditionalOffers","isAuction","getRow","contractorColumn","checkColumn","OfferChoiceTable","offerChoiceList","Alert","positionsWithNoOffer","setPositionsWithNoOffer","decision","OFFER_CHOSEN","CANCELED","OfferChoiceSearch","smallColumn","contractorsTable","rowHidden","divHidden","divOpen","elemTransition","showContractors","positionChecked","allContractorsChecked","elemId","handleContractorsHeadCheckboxChange","rounds","setRounds","setShowContractors","relative","realizationValues","getValidationSchema","xs","realizationPublishDate","setRealizationValues","toCompare","errorDialogOpen","setErrorDialogOpen","realizationDialogOpen","setRealizationDialogOpen","cancelWhereNoOffersPopupOpen","setCancelWhereNoOffersPopupOpen","createPopupType","setCreatePopupType","refreshData","createRoundButton","additionalActionsButton","OFFER_CHOICE_RESULT_LIST_RESOURCE_ID","roundResult","publishUntilDate","positionOrders","repositoryFiles","repositoryIds","OfferChoiceResultFileState","buttonCell","OfferChoiceResultFilesTableRow","offerChoiceResultItem","onDeleteFile","onUpdateFile","canDownloadFile","doPublishChange","OffersChoiceResultService","datePublished","unpublishFile","publishFile","deleteFile","OfferChoiceResultFilesTable","fileToDelete","fileToUpdate","OfferChoiceResultFiles","filesWorking","setFilesWorking","WorkableIconPrintButton","WorkableIconCalendarButton","EventIcon","openFilesCell","OfferChoiceResultRow","canDownloadPaper","publishPopupOpened","setPublishPopupOpened","load","filesLoaded","ArrowUpIcon","ArrowDownIcon","offerChoiceResultList","AgreementListType","CREATED","AVAILABLE","AgreementsListType","listType","setListType","AGREEMENTS_RESOURCE_ID","AGREEMENTS_AVAILABLE_RESOURCE_ID","AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID","getAgreementsList","getAgreementsAvailableList","getAgreementsAvailableOrganizationsList","createNoAgreements","deleteAgreement","objType","createAgreements","orgForAgreement","oneAgreement","agreementsAvailableOrganizationsList","AgreementsService","confirmOpen","setConfirmOpen","InfoOutlinedIcon","agreementsAvailableList","confirmNoAgrOpened","setConfirmNoAgrOpened","createOpened","setCreateOpened","setSelected","checkClick","agreementsList","confirmDelete","setConfirmDelete","extObjId","doFinishEvaluation","cancelRound","onInvalidate","prevErrors","openInvalidate","setOpenInvalidate","hasPrevErrors","cancelVisible","cancelVisibleEnabled","EvaliationFinishService","RfxRoundService","ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID","getAdditionalPassiveRoundsList","updateAdditionalPassiveRound","getAvailableContractors","createAdditionalPassiveRound","AdditionalRoundPassiveStatusCell","AdditionalRoundPassiveRow","AdditionalRoundPassiveService","AdditionalRoundPassiveTable","additionalPassiveRounds","setContractors","refresh","createPopupOpened","negotiationButton","setNegotiationButton","foundExtremelyLowOfferStatus","setFoundExtremelyLowOfferStatus","choicePending","showNegotiationPathButton","extremelyLowOfferStatusFound","makeNegotiations","skipNegotiations","negotiationsCreated","choiceDate","NoticeYesNoInput","formTr","formTip","FormTranslationContext","tip","NoticeIntegerInput","dialogPaper","breakpoints","sm","opacity","max100","SelectTreeView","useObjectInsteadOfValues","prefixLabelsWithKeys","itemsFiltered","setItemsFiltered","keyToData","doItem","hasChildren","getLabel","node","renderTree","nodes","TreeItem","nodeId","nodeValue","fExp","parentVisible","childrenFiltered","itemsF","onClosePopup","startAdornment","newSelected","TreeView","defaultCollapseIcon","defaultExpandIcon","onNodeToggle","nodeIds","onNodeSelect","elemObject","NoticeGlossaryInput","NoticeNumericInput","exceptionChip","getKey","dictionaries","setDictionaries","translations","setTranslations","DemandAdditionalInfoService","labels","tips","getDict","mp_3_offers","OffersPanel","mp_3_documents","DocumentsPanel","mp_3_contractor_verification","ContractorVerification","mp_3_offers_evaluation","OffersEvaluation","mp_3_offer_choice","OfferChoice","mp_3_additional_round_passive","AdditionalRoundPassive","mp_3_primary_tender_choice","PrimaryTenderChoice","mp_3_offers_choice_result","OffersChoiceResult","mp_3_evaluation_finish","EvaluationFinish","mp_3_stage_finish","StageFinish","mp_3_papers_generator","PapersGenerator","mp_3_agreements","AgreementsPanel","mp_3_evaluation_additional_info","panelsValidationKeys","RESULT_NOTICE_RESOURCE_ID","checkAndUpdateAttachment","getResultNotice","publishOjsResultNotice","checkOjsResultNotice","rollbackOjsResultNotice","addResultNoticeAttachments","deleteResultNotice","publishResultNotice","unpublishResultNotice","unpublishResultNoticeAttachment","publishResultNoticeAttachment","clearResultNoticeResources","AttachmentResultNoticeRow","onDownloadHistory","onEditNoticeReferenceNumberFile","ResultNoticeService","noticePublication","published","AttachmentResultNotice","PublishConst","ResultNoticeType","OJS","ATTACHMENT","text1","resultOjsPublicationStatus","ojsAdmin","ojsResultNoticeSend","canPublishOjsResultNotice","hasOjsNotice","resultNoticeStatusInterval","setResultNoticeStatusInterval","startResultNoticeStatusInterval","interval","bzpEditable","DEMAND_ARCHIVING_RESOURCE_ID","getDemandArchiving","scheduleArchive","clearDemandArchiving","ArchivingStatus","demandArchiving","ArchivingService","downloadArchive","archiveUrl","archivingStatus","demandNumber","demandName","orderDate","getButton","FINISH_DEMAND_RESOURCE_ID","getFinishDemand","backToOfferEvaluation","clearFinishDemand","backToResultNotice","withdrawalNoticeDate","unpublishDate","cancelDemand","initialDate","FinishDemandService","exPostButton","exPostBackButton","backConfirm","setBackConfirm","backToResultConfirm","setBackToResultConfirm","unpublishDatePopup","setUnpublishDatePopup","ProcedureStatusValues","ProcedureStatusLabels","canCancel","ojsResultNoticeSent","canBackState","canBackToResultNotice","canSetWithdrawalNoticeDate","DEMAND_PLAN_REALIZATIONS_RESOURCE_ID","valuesTouched","CalcIcon","WorkableIconCalcButton","NetGrossCalcPopup","setNetValue","setGrossValue","setOptionValue","setOtherValue","notSelected","otherVatValue","handleOtherChange","NetGrossCalc","calcOpen","setCalcOpen","noValues","cancelColumn","valueInput","DemandPlanRealizationRow","realization","isCancelled","dealingName","planItemName","planItemNumber","partName","DemandPlanRealizationTable","demandPlanRealizations","realizationId","DemandPlanRealizationService","realizationValue","mp_4_result_notice","ResultNoticePanel","mp_4_finish_documents","FinishDocumentsPanel","mp_4_demand_plan_realization","mp_4_finish_demand","FinishDemandPanel","mp_4_archiving","ArchivingPanel","mp_4_finish_additional_info","objectId","panelsValidationKeys1","panelsValidationKeys3","panelsValidationKeys4","validateAfterSave","sectionIndex","openForm","openImporter","historyOpen","setHistoryOpen","validationObj","hasPlanItems","isOpenForm","FormElement","initialPickDateInsteadOfPeriod","radioId","dateId","conditionalValue","getRadioValues","periodValues","SCHEDULE_RESOURCE_ID","_prepareData","offerEndDate","bindWithOfferPeriodOrDate","isDate","pickDateInsteadOfPeriod","period","schedules","Deadlines","scheduleList","ScheduleService","offerOpenDateClone","getPickDateInsteadOfPeriod","stageNumber","questionEndDate","errorObj","errorId","erId","DeadlinesEdit","memnerId","titleKey","descriptionKey","e1","e2","e3","e4","getInitValues","espdList","s1","s2","s3","s4","elements2","n1","true","false","ESPD_LIST_RESOURCE_KEY","_formatSingleEspd","qualifications","selection","declaration","_formatData","separateForEachDealing","espds","separate","force","onBuyerTypeChanged","buyerTypes","selectItems","arrow","noCheckbox","isChecked","checkedValue","descArr","titleComponent","AllElements","AllSections","sectorBuyer","exclusionValues","EspdBooleanItems","setConfirmPopupData","defaultConfirmData","JEDZFormContent","handleJedzTypeChange","sectionCompleted","confirmPopupData","isSectorBuyer","buyerType","handleBuyerTypeChanged","newBuyerType","fieldPath","separateForDealing","demandSectorBuyer","espdBuyerType","dealingIdPrefix","dealingSectorBuyer","EspdService","exportTemplate","JEDZ","typeChanged","getSingleJedzValue","getExInitValues","getSeInitValues","orgName","orgCountry","searchForBooleanValue","searchedBooleanValue","findBooleanValue","initVal","getEspdVSObject","qualiOk","buyerTypeOk","estimatedNetValueId","warningThreshold","isWarning","guaranteeValue","estimatedNetValue","setWarning","wadiumColumn","createItems","GUARANTEE_LIST_RESOURCE_ID","GuaranteeService","IconExternalSignButton","LocationDisabledIcon","LocationSearchingIcon","nipColumn","ContractorTable","handleExternalSign","showJoinDate","showExternalSignColumn","externalOfferSign","invitationDate","joinMethod","joinDate","NOTICE_LINK_RESOURCE_ID","NOTICE_PREVIEW_RESOURCE_ID","getLink","getPreviewUrl","noticeLink","NoticeService","BZP_CONTRACT_NOTICE_STATUS","reqSectionsError","errorSections","NationalNoticeService","_FIRST_PUBLICATION_RESOURCE_ID","checkPublishOjs","publishExPost","clearOjsStatus","markFirstPublication","isFirstPublication","wasPublished","PublishSection","isPublishActive","isCancelActive","moveToOfferCollection","classesRoot","clearPublishResources","openCancelModificationPopup","setOpenCancelModificationPopup","openPublishPopup","setOpenPublishPopup","showPublishLimitUsedAlert","setShowPublishLimitUsedAlert","handleConfirmCancelModification","handleConfirmPublish","PublishService","ojsPublicationStatus","bzpContractNoticeStatus","getUncompletedSections","NationalNoticeStatus","minusMargin","noticePreview","isPublicOjsActive","isPreviewOjsActive","checkNoticeStatus","handleRollback","isPreviewActive","isPreviewNoticeActive","isPreviewDemandPublicFormActive","isOjsProcessing","uncompletedSections","isBzpPublishActive","isBzpProcessing","isPreparing","isModification","competitivenessBaseLink","focus","isNoticeAvailable","bzpNotice","isBzpNoticeAvailable","previewDemandPublicFormDisabled","PP_REQUIRED_GROUPS","MO_REQUIRED_GROUPS","MMiA_REQUIRED_GROUPS","ezWorking","setEzWorking","noticeStatusInterval","setNoticeStatusInterval","compareSection","hasBzpNotice","startNoticeStatusInterval","isPublishButtonActive","isCancelModificationButtonActive","isPreviewButtonActive","isPreviewNoticeButtonActive","isPreviewDemandPublicFormButtonActive","finishButton","openGoToFinishPopup","setOpenGoToFinishPopup","isDemandFinish","mp_1_demand","Demand","mp_1_dealings","Dealings","mp_1_schedule","Schedule","mp_1_commission","Commission","mp_1_espd","Espd","mp_1_siwz","Siwz","mp_1_guarantee","Guarantee","mp_1_contractor","Contractor","mp_1_notice","Notice","mp_1_national_notice","NationalNotice","mp_1_publication","Publication","mp_1_ex_post_go_to_finish","mp_1_preparing_papers_generator","PreparingPapersGenerator","mp_1_preparing_additional_info","mp_1_questionnaire","questionnaireTabUrl","redirectOldPlatform","panels","doHandleClick","_doHandleClick","doHandleClickWithDraftSave","sectionStatus","Component","DemandRelatedObjects","rels","DemandRelatedObjectsPopup","relatedObjectServiceFunction","rel","setRel","purchaseRequests","demands","rfxPrivileges","relatedObjectPopup","setRelatedObjectPopup","openDemandPublicLinkPopup","setOpenDemandPublicLinkPopup","isNew","isDemandNew","isExPost","isOfferCollection","handleModifyClick","updateDemandNumber","hasPurchaseRequests","ListIcon","demandPublicLink","showUpdateNumber","EDIT","RefreshIcon","getNavigationBarButtons","stepsFiltered","URLSearchParams","isInitialHidden","filterSteps","Workspace","fullHeight","rootRef","topOffset","setTopOffset","useNodeTopPosition","nodeRef","withTheme","titleAdditional","RESOURCE_ID","getSuppliers","rfxSupplier","changeExternalSign","suppliers","suppliers2","clearSuppliers","RfxSupplierService","supplierLoading","setSupplierLoading","externalOfferSignConfirm","setExternalOfferSignConfirm","numberOfSuppliers","ADD_CONTRACTOR","circle","transformOrigin","stroke","ProgressRing","percent","radius","circumference","PI","offset","ring","strokeWidth","cx","cy","strokeDasharray","strokeDashoffset","RingCountdown","duration","baseDuration","setDays","setHours","setMinutes","seconds","setSeconds","baseDays","setBaseDays","durationLeft","setDurationLeft","setPeriods","dayPercent","hourPercent","minutePercent","secondsPercent","getTime","newSeconds","intervalFunction","StatisticSection","durations","setDurations","nowTime","asSeconds","startTime","offerStartDate","startNumber","summary","summaryContent","summaryButton","summaryGrid","gridItemCommon","gridItemButton","iconWait","iconWaitOptional","iconFinish","ExpansionProgressPanel","queue","progressAtlText","showProgress","buttonDisabled","onButtonClick","alwaysExpanded","IconWait","PlaylistAddRoundedIcon","ErrorIcon","IconFinish","PlaylistAddCheckRoundedIcon","summaryExpanded","expandIcon","onFocus","rfxOfferDecryptionStatus","setProgress","progressInterval","statusInterval","startProgressInterval","startOfferDecryptionStatusInterval","decryptionEnabled","warnings","getDetails","streamPlatformLabel","sessionOnlineStatus","getTypeElements","streamPlatforms","platform","sessionOnline","onlineSession","editPopupOpen","setEditPopupOpen","EditSessionOnlinePopup","dealingsRealizationValueStatus","curOfferCount","serviceMethod","processPublishUnpublish","handleCancel","handlePublish","realizationOfferAmountPublished","notFilledCount","onlineSessionStatus","isOfferDecryption","offerOpenTimeout","offerDeadline","sent","setSent","getEmailsTab","emailValidator","invalidEmails","isValidSync","fp","Tile","numberText","dangerouslySetText","mirror","tile","TilesRow","offerCollectionOrModification","numberOfUnreadMessagesFromSuppliers","numberOfMessagesFromSuppliers","operatorQnALink","handleCorrespondenceClick","numberOfAttachments","numberOfEmails","getPoll","savePollRating","rating","ratings","PollNpsSwitch","scoreChange","Poll","setPoll","PollService","rate","objectType","refreshStats","setRefreshStats","resendInvitationPopupOpen","setResendInvitationPopup","firstPublication","setFirstPublication","intervalId","loadingInProgress","offerCollection","handlePrevClick","RESEND_INVITATION","changePublication","realizationValuePublished","realizationValuesPopupOpened","setRealizationValuesPopupOpened","p2","p1","p3","p4","CORRESPONDENCE","ForumIcon","showUpdateRealizationValue","stepsMemo","OrganizationsSelect","onChipClick","chipTitle","Autocomplete","noOptionsText","getOptionLabel","filterSelectedOptions","disableCloseOnSelect","ChipProps","renderInput","CorrespondenceEmailList","contractorNameBuilder","recipient","toggleButton","ctrEmailList","ctrEmailListTitle","setSendType","withOfferSwitch","setWithOfferSwitch","contractorEmailList","setContractorEmailList","contractorListForSelect","hasOffer","contractorInRoundList","handleSaveResponse","handleSendResponse","saveResponse","chipClick","ctr","innerText","supplierRecipientIds","recipients","withOffer","onChangeWithOffer","InfoIcon","AddThreadAsSupplierForm","sender","MessageEmailDeliveryPopup","deliveryList","setDeliveryList","invitedSupplier","getStatusCellContent","Mail","deliveryDate","recipientsRoot","downloadAttachmentRegistrationDate","hasEdit","emailDeliveryRecipient","setEmailDeliveryRecipient","verificationWorking","setVerificationWorking","buyerAsContractorUser","showVerifyLimitUsedAlert","setShowVerifyLimitUsedAlert","showAttachmentDownloadInfo","showEmailDelivery","getRecipient","firstEmailDeliveryDate","firstReadDate","linkToSection","threadsAfterEndDate","autoSave","updateMessage","deleteMessage","currentActive","availableRecipients","doAutoSave","rec","createConfirmObject","confirmFn","cancelFn","confirm","actionWrap","PublishMessageConfirmationPopup","publishMessageInfo","autoSaveSemaphore","setPublishMessageInfo","messageOut","holdSetWorking","isSaveRespValid","sendResp","publishResp","cancelPublish","delResp","abortEarly","autoSaveDebounced","correspondencePrivileges","addInProgress","setAddInProgress","summaryRoot","summaryItem","subjectExpanded","hasUnread","redFlag","Thread","onThreadSelectChange","selectedThreads","redFlagWorking","setRedFlagWorking","loadingMessagesWorking","setLoadingMessagesWorking","threadSelected","selectThreadChange","scrollToMessage","doScrollToMessage","flagClick","FlagRoundedIcon","OutlinedFlagRoundedIcon","chip","chipSupplier","chipSubject","threadsList","processMessage","getChips","selectedThreadsIds","reqMessage","shareButton","addAsSupplierOpened","setAddAsSupplierOpened","addPopupOpened","setAddPopupOpened","bulkPopupOpened","setBulkPopupOpened","setSelectedThreads","printWorking","setPrintWorking","shareWorking","setShareWorking","printCorrespondence","printPromise","hasSelected","getPrintButton","getShareButton","chipsGrid","dateTo","CorrespondenceSearch","parsed","parsedFiltered","n","dat","getInitValue","setContractorListForSelect","valueFilteredForSearch","prepareContractorList","respList","handleChangeDate","handleKeyUp","newFlag","threadsBeforeEndDate","correspondenceCheckTime","loadingNewInProgress","searchSelected","setSearchInProgress","setBefore","checkNewMessages","searchPromise","CorrespondencePanel","EMAIL_LIST_RESOURCE_ID","EMAIL_LIST_ACTIONS_RESOURCE_ID","EmailListSearch","handleKeyPress","EmailDeliveriesTable","secContent","preLine","previewBox","previewHtml","previewNoHtml","EmailDetailsPopup","detailed","emailDetails","setEmailDetails","EmailListService","cc","bcc","html","srcDoc","deliveries","recColumn","tooltipContent","recContent","more","emailListActions","exportWorking","setExportWorking","exportEmailList","getHeaders","getColumnClasses","EmailListPanel","NoticeTextInput","inputWithButton","BasicData","updateNotice","gId","defaultVal","getDynamicDict","loadDynamicDictionaries","bzpNumber","NoticeTypography","formTrKey","PurchaserDataTogetherList","removePurchaser","ExposureNeg1Icon","pe","ne","deepEq","PurchaserDataTogether","purchaserData","together","PlusOneIcon","addPurchaser","PurchaserDataEntrusted","PurchaserData","FormNavigator","onSave","onCreateNewVersion","memoItems","curStep","lastSave","ArrowIconLeft","ArrowIconRight","newVersion","draft","contractNoticeStepsOrder","strip","orderDealing","primaryDealing","partnershipDealing","refersTo","partialOffers","realization_primary_1","realization_primary_2","realization_primary_3","realization_partnership_2","primaryRealizationType","criteriaValidator","criteriaWeightStrategy","qualityCriterionType","criterionName","criterionPctgWeight","criterionPktWeight","criterionOrder","primaryLotValidator","lot","negotiationsPossible","evaluationMethodDescription","criteriaEvaluationStrategy","evaluationSocialAspects3","evaluationSocialAspects3Info","evaluationSocialAspects12","evaluationSocialAspects12Info","partnershipLotValidator","nonNegotiableRequirements","refersToSocialServices","tenderPlanRelated","tenderPlanNumber","tenderPlanItemIdentities","onlyArt94Suppliers","art94Suppliers","onlyArt361Suppliers","ueFunded","ueProgramName","phoneNumber","faxNumber","typeOther","activitySubject","activitySubjectOther","togetherCount","togetherDuties","togetherRegulations","branch","nationalIdNumber","street","nuts3","phone","fax","www","entrusted","orderRealizationType","frameworkRealizationType","documentsAccess","ezamowieniaDemand","restrictedAccess","restrictedAccessInfo","electronicOffersOnly","electronicOffersInfo","electronicOffersRequirements","toolsWww","toolsNotWidelyAvailable","notWidelyAvailableToolsInfo","offerCatalog","notElectronicOffersReason","notElectronicOffersMethod","offerLang","rodoInfo","rodoLimitations","offerCatalogUsage","orderObject","marketConsultations","dividedIntoLots","lotsValueNet","lotsValueNetCurrency","orderValueNet","orderValueNetCurrency","frameworkAgreementValueNet","frameworkAgreementValueNetCurrency","dealingCount","offerType","dealingLimited","dealingLimitPerSupplier","socialAspectsConsidered","socialAspects","notDivided","purchaserNeedsDescription","innovationProductNeed","orderSubjectDescription","mainCpv","additionalCpv","includesOptions","includesOptionsInfo","realizationPeriod","realizationPeriodDateFrom","realizationPeriodDateTo","realizationPeriodAmount","planRenewals","planRenewalsInfo","planOtherOrderForCurrentSupplier","planOtherOrderForCurrentSupplierInfo","divided","dealingValue","dealingValueCurrency","qualification","predictedExclusion","predictedExclusionInfo","participationConditions","participationConditionsInfo","art125Statement","inclusionSubjectiveEvidence","exclusionSubjectiveEvidence","objectiveEvidence","objectiveEvidenceInfo","plansEvidence","plansEvidenceInfo","otherDocumentsList","orderTerms","variantsAllowed","variantsAllowedInfo","auctionPlanned","auctionUrl","auctionPlannedInfo","guaranteeRequired","guaranteeRequiredInfo","properExecutionGuarantee","togetherRequirements","possibleDemandInvalidation","contractDraft","advancePayment","advancePaymentInfo","contractChanges","contractChangesInfo","socialAspectsInfo","orderDetails","frameworkAgreement","suppliersNumber","suppliersNumberLimited","suppliersNumberLimit","art314Order","periodExceedInfo","offerSubmitPlace","bindWithOffer","bindWithOfferDays","bindWithOfferDate","maxSupplierNumber","limitSuppliersNumberInfo","noNegotiationsTermsDescription","primaryLots","primaryNoLots","partnership","phasedNegotiations","suppliersLimited","suppliersLimitedInfo","criteriaComplianceDeclaration","criteriaComplianceList","minSuppliersCount","maxSuppliersCount","partnershipLots","partnershipNoLots","additionalInfo","RealizationTypeData","DocumentsAccessData","NoticeCpvInput","NoticeDateInput","OrderObjectNotDivided","DealingsNavigator","addPart","onlyNotice","OrderObjectDivided","removePart","OrderObjectDividedList","OrderObjectData","basicDataRefersTo","QualificationData","ObjectiveEvidenceData","OrderTermsData","ContractDraftData","OrderDetailsFrameworkAgreement","OrderDetailsLotCriterion","removeCriterion","deleteAvailable","CRITERION_TYPE","COST","QUALITY","OrderDetailsPrimaryLot","lotNumber","realizationTypeX11","realizationTypeX12","realizationTypeX13","addAvailable","strategy","newCriterions","getDefaultCriteria","addCriterion","NoticeDateTimeInput","OrderDetailsPrimary","dateTimeInput","OrderDetailsPartnership","OrderDetailsPartnershipLot","OrderDetailsData","realization_x_1_1","realization_x_1_2","realization_x_1_3","realization_1_2","curPrimaryDealingIndex","curPartnershipDealingIndex","AdditionalInfoData","collapse","confirmRemove","setConfirmRemove","navigateToError","errorpath","formikPath","createNewVersion","deleteLastVersion","canLoadDynamicDictionaries","_passive","_onlyNotice","_updateNotice","contractNoticeValidation","ezamowieniaErrors","casted","isString","XmlUzpPresidentPaper","NationalNoticePage","NationalNoticePanel","PartsRouter","Part1","Part2","Part3","Part4","Page","floatingWorkspace","mixins","InfoData","headerData","procedureTypeTr","demandRealizationTypeTr","linkRow","IconAfter","titleWrapped","attach","openDelete","setOpenDelete","stepsId","extendFindSectionEditable","isDeleteActive","isInvalidationActive","CancelOutlinedIcon","InfoBar","setAttach","infoContainer","borderColor","borderStyle","currentText","borderBottomWidth","StageElement","thin","gridItem","label2","stageClick","preparing","offerDecryption","evaluation","StepperPages","SearchInput","hadleClick","SearchBar","setFilters","filters","getObj","WorkableIconDuplicateButton","DuplicateIcon","numberColumn","oneLine","Started","openDeleteId","setOpenDeleteId","openCloneId","setOpenCloneId","usePathParams","DemandsService","fetchData","getSortProps","handleSortChange","hasClone","hasDelete","headerClasses","datePublish","deadlineForOffers","createDeleteButton","createCloneButton","stepOne","stepTwo","stepThree","stepFour","oldSystemUrl","handleEnterDemand","handleClone","HomeRoute","exact","MyProcedureHome","MyProcedure","rps","openedSectionParam","openedSection","mainSectionName","stageSection","emailListAvailable","hasDemand","newReloadTimeout","PurchasingGroupStageNr","PurchasingGroupStagesRouter","PurchaserGroupInfoBar","purchaserGroupHeader","createStageBarElement","historyPush","StageBarCommon","PurchasingGroupStatus","DATA_COLLECTION","REALIZATION","PurchasingGroupStatusLabel","stageBarElements","elems","lastStageStarted","PurchasingGroupSearch","PurchasingGroupList","purchasingGroupList","setPurchasingGroupList","setActions","goToGroup","hasAdd","dateModified","PurchasingGroupMemberList","getTemplatesList","getTemplateListHasEdit","cloneTemplate","deleteTemplate","activateTemplate","deactivateTemplate","WorkableIconDeactivateButton","ToggleOnIcon","WorkableIconActivateButton","ToggleOffIcon","PurchasingGroupTemplatesList","templatesList","setTemplatesList","setHasEdit","workingIds","setWorkingIds","PurchasingGroupTemplateService","goToTpl","clearWorkingId","doDeactivate","doActivate","doClone","IconDragButton","DragIndicator","SortableHandle","SortableHandleComponent","RadioGroupYesNo","yesNo","ol","paddingInlineStart","PurchasingGroupTemplateField","setAggregatedFieldId","aggregatedFieldErrorValue","allFields","updated","newAllFields","aggregatedFields","fieldsList","setFieldsList","curSelected","fieldsListTmp","uniqueIds","PurchasingGroupTemplateForm","aggregatedFieldId","fieldsErrorValue","newFields","back","bar","tpl","setTpl","testContext","PurchasingGroup","PurchasingGroupTemplate","PurchasingGroupStages","getRegistrationsList","acceptRegistration","rejectRegistration","getRegistration","getAvailableOrgs","getRegistrationOrganization","saveRegistrationOrganization","RegistrationStatusLabel","NEW","ACCEPTED","REJECTED","RegistrationsSearch","initSearch","organizationNameColumn","RegistrationsList","registrationsList","setRegistrationsList","RegistrationService","decisionDate","goToRegistration","InfoEntry","rejectionReason","representativeGrid","EMPTY_REPRESENTATIVE","registrationId","onCreate","setWrapper","externalId","nip","representatives","representativesTitleDictionary","representativesRoleDictionary","OrganizationUnitRepresentative","removeRepresentative","addRepresentative","backGrid","registration","setRegistration","setAvailableOrganizations","rejectPopup","setRejectPopup","addOrgPopup","setAddOrgPopup","emailAlreadyUsed","orgs","goToList","RemoveCircleIcon","notes","decisionUser","curRoles","roles","availableRoles","attrKeys","availableAttributes","attrKey","initAttr","rest","selectOrganization","Admin","UserRegistration","TitleComponent","popupConfig","passwordInfo","setPasswordInfo","setPassword","passwordError","setPasswordError","onStorePassword","messageHtml","OfferSections","oldPlatformOfferTabUrl","demandStagesList","stageTranslations","setStageTranslations","getStageTranslation","PurchaserScenesRouter","PurchaserOfferPanel","setContextSection","PurchaserDemand","PurchaserPreviewPanel","PurchaserStepperPages","AnnualReportStatus","DRAFT","SENDING","SENT","APPROVED","APPROVED_MODIFIED","annualReportStatusTr","ANNUAL_REPORT_TABLES_RESOURCE_ID","ANNUAL_REPORT_LIST_RESOURCE_ID","ANNUAL_REPORT_RESOURCE_ID","getAnnualReportList","getAnnualReport","getAnnualReportFormValues","markDraft","getAnnualReportListAvailableOrgs","addAnnualReport","getAnnualReportPrevVersions","sendAnnualReportToEzamowienia","submitAnnualReportToEzamowienia","correctAnnualReportToEzamowienia","downloadAnnualReportPdfFromEzamowienia","saveAnnualReportTableEntry","reportStep","currentType","distType","distArr","entry","moveAnnualReportTableEntry","tableEntryId","destination","formPart","deleteAnnualReportTableEntry","initializeTable","initializeTableFromPrevVersion","initializeTableEntry","saveAnnualReportForm","getAnnualReportDictionaries","getAnnualReportTranslations","AnnualReportsService","AnnualReportListTableRow","parentWorking","correct","prevVersions","setPrevVersions","goToReport","ezamowieniaNumber","dateSend","AddBoxIcon","versionsTable","orgColumn","empty_object","reportsList","years","minYear","maxYear","annualReportSteps","belowEu","aboveEu","conflict","community","social","innovative","exception","notIncluded","annualReportStepsOrder","annualReportTablesWithInitialize","tableCell","tableCellBorderRight","tableCellBorderLeft","borderLeft","variantRow","variantRow2","demandsRow","lightGreen","lightRed","demandsCell","demandsTable","addCell","sectionErrorIcon","tableMainHeaderRow","noOptions","moveEntryRadio","exceptionName","AnnualReportNavigator","onCurStepChange","onSendToEzamowienia","onSubmitInEzamowienia","AnnualReportNoticeSource","BZP","TED","dataLoaded","purchaserPartName","purchaserIdentifier","purchaserType","purchaserOtherType","purchaserActivityType","purchaserStreet","purchaserCity","purchaserCode","purchaserProvince","purchaserCountry","purchaserUrl","issueNumber","noticeNumber","codeCPV","tenderMode","contractorCountryList","contractValue","numberOfAwardedLots","numberOfRejectedOffers","numberOfOffersSubmittedByMMSP","contractAwardedToMMSP","codeCpv","tenderModeBzp","tenderModeTed","numberOfCasesOfConflictOfInterest","numberOfDetectedAgreements","numberOfContractorsWithRejectedOffer","serviceDescription","reservedTender","numberOfOffersMMSP","inDescriptionRequirementsForAccessibility","definedSocialAspectsInOfferEvaluationCriteria","definedRequirementsBasedOnEmploymentRelationship","definedSocialAspectsRequirements","definedLabelRelatedToSocialAspects","contractorType","environmentalRequirements","environmentalManagementSystemAndStandards","environmentalAspectsInEvaluationCriteria","costCriterionUsingLifeCycleCostingApplied","environmentalAspectsRequirements","labelRelatedToEnvAspectsOrMeasureOfEvidence","innovativeAspectsInEvaluationCriteria","innovativeAspectsRequirements","AnnualReportPurchaserForm","setFrom","submitSemaphore","annualReportValidation","isRequired","bool","AnnualReportTableCell","annulaReportClasses","getAnnualReportEditPopup","newEntry","autoValidate","AnnualReportEditPopup","FormComponent","reload","scrollContainer","scrollToContainer","ReplayIcon","AnnualReportAboveEuEditForm","formatBoolean","formatInteger","AnnualReportSearchBar","setEditPopup","AnnualReportTableHeadCell","getMoveAnnualReportEntryConfig","inputLabel","WorkableIconErrorButton","AnnualReportTablePart","setMovePopup","columnCount","getRowValues","hasIncomplete","setHasIncomplete","entriesFilteres","changeComplete","incompleteEntry","incomplete","RadioButtonUncheckedIcon","SwapVerticalCircleIcon","columns","AnnualReportAboveEuForm","dictTranslations","editPopup","movePopup","AnnualReportBelowEuEditForm","AnnualReportBelowEuTablePart","entriesCounted","setEntriesCounted","worksCount","worksAmount","deliveriesCount","deliveriesAmount","servicesCount","servicesAmount","AnnualReportSteps","AnnualReportBelowEuForm","AnnualReportConflictEditForm","annualReportTenderMode","AnnualReportConflictForm","AnnualReportCommunityEditForm","AnnualReportCommunityForm","AnnualReportSocialEditForm","AnnualReportSocialForm","AnnualReportInnovativeEditForm","AnnualReportInnovativeForm","AnnualReportExceptionEditForm","AnnualReportExceptionTablePart","exceptions","AnnualReportExceptionForm","AnnualReportNotIncludedEditForm","agreementStateId","AnnualReportNotIncludedTablePart","AnnualReportNotIncludedForm","doItems","trMap","oneLevel","dictToTranslationMap","dict","AnnualReportError","getMapKeys","iterator","getTranslatedErrorsView","translatedErrors","getErrors","errorsDescribed","described","wholeKey","subKey","getDescribedErrors","ReloadAnnualReportTableFromPrevVersionButton","ReloadAnnualReportTableButton","initFormValues","currentForm","setDictTranslations","setCurStep","newStep","pdf","dictTr","previewUrl","AnnualReport","AnnualReportsList","AnnualReportPage","PurchaserRouter","notificationSend","img","confirmationMessage","clearSalesNotification","setProcessed","handleCloseDialog","SalesService","ConfirmThreeButtons","onSecondConfirm","labelSecondConfirm","confirmCloseStepper","clearConfirmCloseStepper","openQuestion","FeedbackContentOpen","openQuestionRef","setScore","sendPool","answer","FeedbackContentClosed","showTimeout","nextPollDate","nextPoll","confirmationWindow","setConfirmationWindow","authWindowInterval","authWindow","ezamowieniaOauthRef","callbackUrlRef","closeWindow","openWindow","closed","callFail","authorized","authorizationUrl","logoutUrl","userInfo","callbackOrigin","missingRoles","groups","continueEnabled","organization_role","given_name","family_name","PurchaserRoot","Browser","ieOpen","setIeOpen","CtrCorrespondencePanel","ContractorClock","dashboardSection","setEndTime","secondEndTime","setSecondEndTime","clockTitle","setClockTitle","noOfferStage","secondEnd","offerSecondEndDate","cancelled","isSameOrAfter","setupDuration","highlight","OfferTilesRow","digitalSignCheckUrl","publicKnowledgeBaseUrl","messagesCount","getMessagesLabel","infoMsg","setDashboardSection","offerOutOfDateDueToRfxModification","CtrScenesRouter","CtrOfferPanel","loadExternalLibrary","existingScript","getElementById","script","onload","onabort","SUPPORTED_SIG_TYPES","isSupportedSigType","Szafir","setSignatureType","loadedLibrary","startComponentURIErrorCalback","onLoadError","onConfigError","onErrorNoExtension","onErrorNoHostApp","taskListErrorCallback","resultTaskList","successLoadSzafir","SZAFIR_SDK","startComponentURI","startComponentURISuccessCalback","signatureFormat","dataEmbedding","makeTaskList","getTaskList","taskList","doTaskList","taskListSuccessCallback","xmlDoc","jQuery","parseXML","attr","desc","resultCode","descriptionCode","loadSzafir","sdk_location_url","versions_file","debug","ExternalSignature","setFile","handlePlaceOffer","ExternalSignatureWrapper","supported","setSupported","setEncryptionRoundId","Signature","setSigType","selectedType","CtrDemand","CtrStepperPages","ContractorRoot","Router","WelcomeTutorial","TourTooltip","primaryProps","tooltipProps","isLastStep","onEnd","changePage","disableBeacon","Tutorial","setStep","run","setRun","handleEndTour","TEST","EVENTS","STEP_AFTER","TARGET_NOT_FOUND","ACTIONS","PREV","SKIPPED","PAUSED","tooltipComponent","stepIndex","disableOverlayClose","continuous","styles","SaveDialog","showDelete","setIsChecked","Save","useInterval","delay","setIntervalId","savedCallback","Session","timeLeft","setTimeLeft","utc","registerPopup","objKey","authorizeCounter","setRedirectFunc","setRedirectWithoutHistoryFunc","isNewToken","setIsNewToken","firstLoad","canRender","setCanRender","isTokenValid","setIsTokenValid","token","atob","ClientService","UserNavigationService","clearConfirmNotification","clearAlertNotification","loadingScreen","lg","useInitialize","maxSnack","anchorOrigin","horizontal","enrichTheme","isLargeText","appConfig","colors","basicColorLight","basicColorLightDarken","basicColorDark","basicColorDarkDarken","applayClientColors","baseThemeRes","createTheme","baseTheme","overrideTheme","fontFamily","num","lineClamp","disabledBackground","gray","chips","MuiTooltip","overrides","MuiAppBar","colorDefault","MuiAccordion","MuiInput","underline","inputBorder","MuiListItem","MuiButton","outlinedPrimary","containedPrimary","containedSecondary","textSecondary","outlinedSecondary","MuiRadio","colorPrimary","MuiToggleButton","alpha","pointerEvents","MuiTableCell","MuiPaginationItem","textPrimary","MuiPickersModal","dialogRoot","MuiInputAdornment","positionEnd","MuiTreeItem","iconContainer","MuiChip","outlined","transitionProp","easing","sharp","leavingScreen","topOffsetExpanded","enteringScreen","ThemeProvider","App","utils","MomentUtils","hostname","ReactDOM","serviceWorker","ready","unregister"],"mappings":"qMAAe,EACN,IADM,EAEL,IAFK,EAGN,IAHM,EAIN,IAJM,EAKP,IALO,EAMR,I,kBCUA,MAAMA,EAAY,IAfzB,SAAmBC,GACf,IAAIC,EAAOD,EAAQ,IACfE,EAAKC,SAASC,OAAOC,MAAM,KAC/B,IAAI,IAAIC,EAAI,EAAGA,EAAIJ,EAAGK,OAAQD,IAAK,CAC/B,IAAIE,EAAIN,EAAGI,GACX,KAAuB,MAAhBE,EAAEC,OAAO,IACZD,EAAIA,EAAEE,UAAU,GAEpB,GAAwB,IAApBF,EAAEG,QAAQV,GACV,OAAOO,EAAEE,UAAUT,EAAKM,OAAQC,EAAED,OAEzC,CACD,OAAO,IACV,CAGUK,CAAU,WAAa,QCZ5BC,EAAK,CAACC,EAAKC,EAAKC,GAAe,KAGjC,IAAIC,GAF6B,UAAhBlB,IAA0BmB,EAAKC,GAE9BL,GAClB,QAAWM,IAAPH,EAIA,OAAOH,EAEX,GAAIC,EACA,IAAK,IAAIM,KA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SAAS8nN,SAAS5mK,MACvB,2DCVN6mK,IAAS/mI,OAAO,eAAC,GAAD,IAASprF,SAASonN,eAAe,SDyH3C,kBAAmB5zK,WACrBA,UAAU4+K,cAAcC,MAAMzvK,MAAKouJ,IACjCA,EAAashB,YAAb,G","file":"static/js/main.1604d8e5.chunk.js","sourcesContent":["export default {\r\n\tCLOSED: 'c',\r\n\tLOADING: 'l',\r\n\tDIALOG: 'd',\r\n\tDELETE: 'r',\r\n\tERROR: 'e',\r\n\tINFO: 'i',\r\n}","\r\nfunction getCookie(cname) {\r\n    let name = cname + \"=\";\r\n    let ca = document.cookie.split(';');\r\n    for(let i = 0; i < ca.length; i++) {\r\n        let c = ca[i];\r\n        while (c.charAt(0) === ' ') {\r\n            c = c.substring(1);\r\n        }\r\n        if (c.indexOf(name) === 0) {\r\n            return c.substring(name.length, c.length);\r\n        }\r\n    }\r\n    return null;\r\n}\r\n\r\nexport const getLocale = () => {\r\n    return getCookie(\"locale\") || \"pl_PL\";\r\n}","import pl from './pl_PL.json'\r\nimport en from './en_EN.json'\r\nimport {getLocale} from \"libs/locale\";\r\n\r\n\r\nconst Tr = (key, obj, translateObj = false) => {\r\n    const localeTr = getLocale() === \"en_EN\" ? en : pl;\r\n\r\n    let tr = localeTr[key];\r\n    if (tr === undefined) {\r\n        if (process.env.NODE_ENV === 'development') {\r\n            console.warn(`Key \"${key}\" not exist in translation`);\r\n        }\r\n        return key\r\n    }\r\n    if (obj) {\r\n        for (let k in obj) {\r\n            const find = `{{${k}}}`\r\n            tr = tr.replace(new RegExp(find, 'g'), translateObj ? Tr(obj[k]) : obj[k])\r\n        }\r\n    }\r\n    return tr;\r\n};\r\nexport default Tr;","import saveStatusValues from 'constants/status.save'\r\n\r\nfunction action(type, payload) {\r\n    return {\r\n        type,\r\n        payload,\r\n    }\r\n}\r\n\r\n//RESOURCE\r\n\r\nexport function setResource(id, value) {\r\n    return action('SET_RESOURCE', {id, value})\r\n}\r\n\r\nexport function clearResource(id) {\r\n    return setResource(id, undefined);\r\n}\r\n\r\nexport function addObjectResource(id, key, value) {\r\n    return action('ADD_OBJECT_RESOURCE', {id, key, value})\r\n}\r\n\r\nexport function addObjectResources(id, keyValuePairObject) {\r\n    return action('ADD_OBJECT_RESOURCES', {id, keyValuePairObject})\r\n}\r\n\r\n//PRIVILEGE\r\n\r\nexport function setPrivileges(id, value) {\r\n    return action('SET_PRIVILEGES', {id, value})\r\n}\r\n\r\nexport function clearPrivileges(id) {\r\n    return setPrivileges(id, undefined);\r\n}\r\n\r\n//SIGNATURE\r\n\r\nexport function setSignature(id, value) {\r\n    return action('SET_SIGNATURE', {id, value})\r\n}\r\n\r\nexport function clearSignature(id) {\r\n    return setSignature(id, undefined);\r\n}\r\n\r\n//STORE\r\n\r\nfunction __setStoreValue(id, value) {\r\n    return action('SET_STORE_VALUE', {id, value})\r\n}\r\n\r\nfunction __setStoreMultiValue(obj) {\r\n    return action('SET_STORE_MULTI_VALUE', obj)\r\n}\r\n\r\nexport function setRedirectWithoutHistoryFunc(func) {\r\n    return __setStoreValue('redirectReplace', func)\r\n}\r\n\r\nexport function setRedirectFunc(func) {\r\n    return __setStoreValue('redirect', func)\r\n}\r\n\r\nexport function setClientColors(value) {\r\n    return __setStoreValue('clientColors', value)\r\n}\r\n\r\nexport function setContrastColors(value) {\r\n    return __setStoreValue('contrast', value)\r\n}\r\n\r\nexport function setLargeText(value) {\r\n    return __setStoreValue('largeText', value)\r\n}\r\n\r\nexport function setMenuOpen(value) {\r\n    return __setStoreValue('isMenuOpen', value)\r\n}\r\n\r\nexport function setSalesNotification(salesNotification) {\r\n    return __setStoreValue('salesNotification', salesNotification)\r\n}\r\n\r\nexport function clearSalesNotification() {\r\n    return setSalesNotification(undefined)\r\n}\r\n\r\nexport function setEzamowieniaOauth(ezamowieniaOauth) {\r\n    return __setStoreValue('ezamowieniaOauth', ezamowieniaOauth)\r\n}\r\n\r\nexport function clearEzamowieniaOauth() {\r\n    return setEzamowieniaOauth(undefined)\r\n}\r\n\r\nexport function setConfirmCloseStepper(handleConfirm, sectionName, handleSecondConfirm) {\r\n    return __setStoreValue('confirmCloseStepper', {handleConfirm, sectionName, handleSecondConfirm})\r\n}\r\n\r\nexport function clearConfirmCloseStepper() {\r\n    return __setStoreValue('confirmCloseStepper', undefined)\r\n}\r\n\r\nexport function setConfirmNotifications(confirmNotification) {\r\n    return __setStoreValue('confirmNotification', confirmNotification)\r\n}\r\nexport function clearConfirmNotification() {\r\n    return setConfirmNotifications(undefined)\r\n}\r\n\r\nexport function setAlertNotifications(alertNotification) {\r\n    return __setStoreValue('alertNotification', alertNotification)\r\n}\r\nexport function clearAlertNotification() {\r\n    return setAlertNotifications(undefined)\r\n}\r\nexport function setLoadingScreen(loadingScreen) {\r\n    return __setStoreValue('loadingScreen', loadingScreen)\r\n}\r\nexport function clearLoadingScreen() {\r\n    return setAlertNotifications(undefined)\r\n}\r\n\r\nfunction __setSaveStatus(value) {\r\n    return __setStoreValue('saveStatus', value)\r\n}\r\n\r\nexport function setSaveStatusLoading() {\r\n    return __setSaveStatus(saveStatusValues.LOADING)\r\n}\r\n\r\nexport function setSaveStatusDeleted() {\r\n    return __setSaveStatus(saveStatusValues.DELETE)\r\n}\r\n\r\nexport function setSaveStatusClosed() {\r\n    return __setSaveStatus(saveStatusValues.CLOSED)\r\n}\r\n\r\nexport function setSaveStatusDialog() {\r\n    return __setSaveStatus(saveStatusValues.DIALOG)\r\n}\r\n\r\nexport function setSaveStatusInfo(message) {\r\n    return __setStoreMultiValue({\r\n        saveStatus: saveStatusValues.INFO,\r\n        saveStatusMessage: message,\r\n    })\r\n}\r\n\r\nexport function setSaveStatusError(errorMessage) {\r\n    return __setStoreMultiValue({\r\n        saveStatus: saveStatusValues.ERROR,\r\n        saveStatusMessage: errorMessage,\r\n    })\r\n}\r\n\r\nexport function setOpenTutorial(value = true) {\r\n    return __setStoreValue('openTutorial', value)\r\n}\r\n\r\nexport function setInnerMenuOpen(obj) {\r\n    return {\r\n        type: 'SET_INNER_MENU',\r\n        payload: obj\r\n    }\r\n}\r\n\r\nexport function setOpenRegisterPopup(value = null) {\r\n    return __setStoreValue('registerPopup', value)\r\n}\r\n\r\n//OPEN DEALINGS PARTS FORM\r\nexport function setOpenForm(value) {\r\n    return __setStoreValue('openForm', value)\r\n}\r\n\r\n//OPEN DEALINGS IMPORTER FORM\r\nexport function setOpenImporter(value) {\r\n    return __setStoreValue('openImporter', value)\r\n}\r\n\r\n// FORM\r\nexport function setForm(id, value) {\r\n    return action('SET_FORM_SUBMIT_FUNC', {id, value})\r\n}\r\n\r\n// FORM VALUES\r\nexport function setFormValues(id, form, dirty) {\r\n    return action('SET_FORM_VALUES', {id, form, dirty})\r\n}\r\n\r\n// FORM AUTO SAVE LOADED\r\nexport function setFormDraftLoaded(id, draftLoaded) {\r\n    return action('SET_FORM_DRAFT_LOADED', {id, draftLoaded})\r\n}\r\n\r\nexport function clearFormValues(id) {\r\n    return action('CLEAR_FORM_VALUES', {id})\r\n}\r\n\r\n//AUTHORIZE\r\nexport function setAuthorizeCounter() {\r\n    return action('SET_AUTHORIZE_COUNTER');\r\n}\r\n\r\n//STEPPER\r\n\r\nexport function setStepperState(state = null) {\r\n    return action('SET_STEPPER_STATE', state);\r\n}\r\n\r\nexport function setStepperStateCloseValidator(closeValidationFunction) {\r\n    return action('SET_STEPPER_STATE_CLOSE_VALIDATOR', closeValidationFunction);\r\n}\r\n\r\nexport function clearStepperStateCloseValidator() {\r\n    return setStepperStateCloseValidator(undefined)\r\n}\r\n\r\nexport function setStepperStateDeleteFormDraftFunction(deleteFormDraftFunc) {\r\n    return action('SET_STEPPER_STATE_DEL_FORM_DRAFT_FUNCTION', deleteFormDraftFunc);\r\n}\r\n\r\nexport function clearStepperStateDeleteFormDraftFunction() {\r\n    return setStepperStateDeleteFormDraftFunction(undefined)\r\n}\r\n\r\nexport function setStepperStateSaveFormDraftFunction(deleteFormDraftFunc) {\r\n    return action('SET_STEPPER_STATE_SAVE_FORM_DRAFT_FUNCTION', deleteFormDraftFunc);\r\n}\r\n\r\nexport function clearStepperStateSaveFormDraftFunction() {\r\n    return setStepperStateSaveFormDraftFunction(undefined)\r\n}","import reduxStore from 'redux/store'\r\nimport {compile} from 'path-to-regexp';\r\nimport {setMenuOpen} from 'redux/actions';\r\nimport querystring from 'querystring';\r\n\r\nexport const createPath = (route, params) => compile(route)(params);\r\n\r\nconst purchaserBaseRoute = \"/react\"\r\nconst purchaserBaseRoute2 = \"/purchaser\"\r\nconst contractorBaseRoute = \"/contractor\"\r\n\r\nconst root = {\r\n    BASE: '/',\r\n}\r\n\r\nconst buyerPaths = {\r\n    BUYER_INIT: purchaserBaseRoute,\r\n    MY_PROCEDURE: purchaserBaseRoute + '/my-procedure',\r\n    FAQ: purchaserBaseRoute + '/faq',\r\n    PURCHASER_INIT: purchaserBaseRoute2,\r\n    PURCHASING_GROUP: purchaserBaseRoute2 + '/purchasing-group',\r\n    ANNUAL_REPORT: purchaserBaseRoute2 + '/annual-report',\r\n    ADMIN: purchaserBaseRoute2 + '/admin',\r\n    DEMAND: purchaserBaseRoute2 + '/demand',\r\n}\r\n\r\n\r\nconst ctrPaths = {\r\n    CTR_INIT: contractorBaseRoute,\r\n    CTR_DEMAND: contractorBaseRoute + '/demand',\r\n}\r\n\r\nconst ctrDemand = {\r\n\told: {\r\n\t\tCTR_DEMAND_CORRESPONDENCE_ID: ctrPaths.CTR_DEMAND + '/correspondence/:id(\\\\d+)'\r\n\t},\r\n\tsteps: {\r\n        CTR_DEMAND_ID: ctrPaths.CTR_DEMAND + '/:id(\\\\d+)',\r\n        CTR_DEMAND_ID_CORRESPONDENCE: ctrPaths.CTR_DEMAND + '/:id(\\\\d+)/correspondence',\r\n        CTR_DEMAND_ID_OFFER: ctrPaths.CTR_DEMAND + '/:id(\\\\d+)/offer',\r\n        CTR_DEMAND_ID_OFFER_STAGE: ctrPaths.CTR_DEMAND + '/:id(\\\\d+)/offer/stage',\r\n        CTR_DEMAND_ID_OFFER_STAGE_ID: ctrPaths.CTR_DEMAND + '/:id(\\\\d+)/offer/stage/:stageId(\\\\d+)',\r\n        CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION:ctrPaths.CTR_DEMAND + '/:id(\\\\d+)/offer/stage/:stageId(\\\\d+)/:section'\r\n\t}\r\n}\r\n\r\n\r\nconst myProcedureSteps = {\r\n    MP_1: buyerPaths.MY_PROCEDURE + '/1',\r\n    MP_2: buyerPaths.MY_PROCEDURE + '/2',\r\n    MP_3: buyerPaths.MY_PROCEDURE + '/3',\r\n    MP_4: buyerPaths.MY_PROCEDURE + '/4',\r\n    MP_CORRESPONDENCE: buyerPaths.MY_PROCEDURE + '/correspondence',\r\n    MP_EMAIL_LIST: buyerPaths.MY_PROCEDURE + '/email-list',\r\n    MP_NATIONAL_NOTICE: buyerPaths.MY_PROCEDURE + '/nationalNotice',\r\n}\r\n\r\nconst myProcedureStepsTabsEdit = {\r\n\tMP_1_ID: myProcedureSteps.MP_1 + '/:id(\\\\d+)?',\r\n\tMP_2_ID: myProcedureSteps.MP_2 + '/:id(\\\\d+)?',\r\n\tMP_3_ID: myProcedureSteps.MP_3 + '/:id(\\\\d+)?',\r\n\tMP_4_ID: myProcedureSteps.MP_4 + '/:id(\\\\d+)?',\r\n\tMP_CORRESPONDENCE_ID: myProcedureSteps.MP_CORRESPONDENCE + '/:id(\\\\d+)',\r\n\tMP_EMAIL_LIST_ID: myProcedureSteps.MP_EMAIL_LIST + '/:id(\\\\d+)',\r\n\tMP_NATIONAL_NOTICE_FORM_TYPE_ID: myProcedureSteps.MP_NATIONAL_NOTICE + '/:formType/:id',\r\n}\r\n\r\n\r\nconst myProcedure = {\r\n    steps: {\r\n        ...myProcedureSteps,\r\n        ...myProcedureStepsTabsEdit,\r\n    }\r\n}\r\n\r\nconst annualReport = {\r\n    MP_ANNUAL_REPORT: buyerPaths.ANNUAL_REPORT,\r\n    MP_ANNUAL_REPORT_YEAR_LIST: buyerPaths.ANNUAL_REPORT + '/year/:year(\\\\d+)',\r\n\r\n    MP_ANNUAL_REPORT_REPORT: buyerPaths.ANNUAL_REPORT + '/report',\r\n    MP_ANNUAL_REPORT_REPORT_ID: buyerPaths.ANNUAL_REPORT + '/report/:id(\\\\d+)',\r\n    MP_ANNUAL_REPORT_REPORT_ID_TABLE: buyerPaths.ANNUAL_REPORT + '/report/:id(\\\\d+)/:table',\r\n}\r\n\r\nconst purchasingGroup = {\r\n    //bez kontekstu grupy zakupowej\r\n    MP_PURCHASING_GROUP: buyerPaths.PURCHASING_GROUP,\r\n    MP_PURCHASING_GROUP_LIST: buyerPaths.PURCHASING_GROUP + '/list',\r\n    MP_PURCHASING_GROUP_MEMBER_LIST: buyerPaths.PURCHASING_GROUP + '/member/list',\r\n    MP_PURCHASING_GROUP_TEMPLATES: buyerPaths.PURCHASING_GROUP + '/templates',\r\n    MP_PURCHASING_GROUP_TEMPLATES_LIST: buyerPaths.PURCHASING_GROUP + '/templates/list',\r\n    MP_PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID: buyerPaths.PURCHASING_GROUP + '/templates/template/:id(\\\\d+)',\r\n\r\n    //kontekst konkretnej rejestracji\r\n    MP_PURCHASING_GROUP_GROUP: buyerPaths.PURCHASING_GROUP + '/group',\r\n    MP_PURCHASING_GROUP_GROUP_ID: buyerPaths.PURCHASING_GROUP + '/group/:id(\\\\d+)',\r\n    MP_PURCHASING_GROUP_GROUP_ID_EMAIL_LIST: buyerPaths.PURCHASING_GROUP + '/group/:id(\\\\d+)/email-list',\r\n    MP_PURCHASING_GROUP_GROUP_ID_STAGE: buyerPaths.PURCHASING_GROUP + '/group/:id(\\\\d+)/stage',\r\n    MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR: buyerPaths.PURCHASING_GROUP + '/group/:id(\\\\d+)/stage/:stage(\\\\d+)',\r\n    MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR_SECTION: buyerPaths.PURCHASING_GROUP + '/group/:id(\\\\d+)/stage/:stage(\\\\d+)/:section',\r\n}\r\n\r\nconst purchaserDemand = {\r\n    PURCHASER_DEMAND_ID: buyerPaths.DEMAND + '/:id(\\\\d+)',\r\n    PURCHASER_DEMAND_ID_OFFER: buyerPaths.DEMAND + '/:id(\\\\d+)/offer',\r\n    PURCHASER_DEMAND_ID_PREVIEW: buyerPaths.DEMAND + '/:id(\\\\d+)/preview',\r\n    PURCHASER_DEMAND_ID_PREVIEW_ID_STAGE_ID_SECTION: buyerPaths.DEMAND + '/:id(\\\\d+)/preview/stage/:stageId(\\\\d+)/:section',\r\n    PURCHASER_DEMAND_ID_OFFER_CONTRACTOR: buyerPaths.DEMAND + '/:id(\\\\d+)/offer/contractor',\r\n    PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID: buyerPaths.DEMAND + '/:id(\\\\d+)/offer/contractor/:contractorDepartmentId(\\\\d+)',\r\n    PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE: buyerPaths.DEMAND + '/:id(\\\\d+)/offer/contractor/:contractorDepartmentId(\\\\d+)/stage',\r\n    PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID: buyerPaths.DEMAND + '/:id(\\\\d+)/offer/contractor/:contractorDepartmentId(\\\\d+)/stage/:stageId(\\\\d+)',\r\n    PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID_SECTION: buyerPaths.DEMAND + '/:id(\\\\d+)/offer/contractor/:contractorDepartmentId(\\\\d+)/stage/:stageId(\\\\d+)/:section'\r\n}\r\n\r\n\r\nconst admin = {\r\n    ADMIN_REGISTRATIONS: buyerPaths.ADMIN + '/registrations',\r\n    ADMIN_REGISTRATIONS_LIST: buyerPaths.ADMIN + '/registrations/list',\r\n    ADMIN_REGISTRATION_ID: buyerPaths.ADMIN + '/registrations/:id',\r\n}\r\n\r\n\r\nconst matchOpenDrawerMenu = [\r\n    root.MY_PROCEDURE\r\n]\r\n\r\nconst matchOpenDrawerMenuNotExact = []\r\n\r\nexport const setMenuOpenOnPath = (path = window.location.pathname) => {\r\n    const {store} = reduxStore.getState()\r\n    let open = matchOpenDrawerMenu.includes(path);\r\n    for (let i in matchOpenDrawerMenuNotExact) {\r\n        const item = matchOpenDrawerMenuNotExact[i];\r\n        if (path.startsWith(item)) {\r\n            open = true;\r\n            break;\r\n        }\r\n    }\r\n    if (store.isMenuOpen === open) return;\r\n\r\n    reduxStore.dispatch(\r\n        setMenuOpen(open)\r\n    )\r\n}\r\n\r\nexport const redirect = (path, state) => {\r\n    const { store } = reduxStore.getState()\r\n    store.redirect(path, state)\r\n\tsetMenuOpenOnPath(path)\r\n}\r\n\r\nexport const redirectWithoutHistory = (path, state) => {\r\n\tconst { store } = reduxStore.getState()\r\n\tstore.redirectReplace(path, state)\r\n    setMenuOpenOnPath(path)\r\n}\r\n\r\nexport const setSearchObj = searchObj => {\r\n    const {store} = reduxStore.getState()\r\n    const search = querystring.stringify(searchObj)\r\n    const path = window.location.pathname;\r\n    store.redirect(`${path}?${search}`)\r\n}\r\n\r\nexport const redirectWithSearch = (path, searchObj) => {\r\n    const search = querystring.stringify(searchObj)\r\n    redirect(`${path}?${search}`)\r\n}\r\n\r\n\r\nexport default {\r\n    ...root,\r\n    ...buyerPaths,\r\n    ...ctrPaths,\r\n\r\n    myProcedure,\r\n    purchaserDemand,\r\n    purchasingGroup,\r\n    annualReport,\r\n    admin,\r\n\r\n    //ctr... dla wykonawcy, reszta dla zamawiającego\r\n    ctrDemand,\r\n\r\n    redirectWithoutHistory,\r\n    redirect,\r\n    redirectWithSearch,\r\n    createPath,\r\n    setSearchObj,\r\n    setMenuOpenOnPath,\r\n    baseRoute: purchaserBaseRoute\r\n}","import Tr from 'translations/Translations';\r\n\r\nexport const DemandValidation = {\r\n    //part1\r\n    DEMAND: \"DEMAND\",\r\n    COMMISSION: \"COMMISSION\",\r\n    QUESTIONNAIRE: \"QUESTIONNAIRE\",\r\n    DEALINGS: \"DEALINGS\",\r\n    SCHEDULE: \"SCHEDULE\",\r\n    SIWZ: \"SIWZ\",\r\n    PUBLICATION: \"PUBLICATION\",\r\n    EX_POST_GO_TO_FINISH: \"EX_POST_GO_TO_FINISH\",\r\n    ESPD: \"ESPD\",\r\n    NOTICE: \"NOTICE\",\r\n    NATIONAL_NOTICE: \"NATIONAL_NOTICE\",\r\n    CONTRACTOR: \"CONTRACTOR\",\r\n    GUARANTEE: \"GUARANTEE\",\r\n    PREPARING_PAPERS_GENERATOR: \"PREPARING_PAPERS_GENERATOR\",\r\n    PREPARING_ADDITIONAL_INFO: \"PREPARING_ADDITIONAL_INFO\",\r\n    //part3\r\n    PART_3_SECTION: \"PART_3_SECTION\",\r\n    OFFERS: \"OFFERS\",\r\n    DOCUMENTS: \"DOCUMENTS\",\r\n    CONTRACTOR_VERIFICATION: \"CONTRACTOR_VERIFICATION\",\r\n    OFFERS_EVALUATION: \"OFFERS_EVALUATION\",\r\n    OFFER_CHOICE: \"OFFER_CHOICE\",\r\n    PRIMARY_TENDER_CHOICE: \"PRIMARY_TENDER_CHOICE\",\r\n    ADDITIONAL_ROUND_PASSIVE: \"ADDITIONAL_ROUND_PASSIVE\",\r\n    OFFERS_CHOICE_RESULT: \"OFFERS_CHOICE_RESULT\",\r\n    EVALUATION_FINISH: \"EVALUATION_FINISH\",\r\n    STAGE_FINISH: \"STAGE_FINISH\",\r\n    PAPERS_GENERATOR: \"PAPERS_GENERATOR\",\r\n    AGREEMENTS: \"AGREEMENTS\",\r\n    EVALUATION_ADDITIONAL_INFO: \"EVALUATION_ADDITIONAL_INFO\",\r\n    //part 4\r\n    RESULT_NOTICE: \"RESULT_NOTICE\",\r\n    FINISH_DOCUMENTS: \"FINISH_DOCUMENTS\",\r\n    DEMAND_PLAN_REALIZATION: \"DEMAND_PLAN_REALIZATION\",\r\n    FINISH_DEMAND: \"FINISH_DEMAND\",\r\n    ARCHIVING: \"ARCHIVING\",\r\n    FINISH_ADDITIONAL_INFO: \"FINISH_ADDITIONAL_INFO\",\r\n}\r\n\r\nexport const DemandValidationKeys = {\r\n    //part1\r\n    DEMAND: 'mp_1_demand',\r\n    COMMISSION: 'mp_1_commission',\r\n    QUESTIONNAIRE: 'mp_1_questionnaire',\r\n    DEALINGS: 'mp_1_dealings',\r\n    SCHEDULE: 'mp_1_schedule',\r\n    SIWZ: 'mp_1_siwz',\r\n    PUBLICATION: 'mp_1_publication',\r\n    EX_POST_GO_TO_FINISH: 'mp_1_ex_post_go_to_finish',\r\n    ESPD: 'mp_1_espd',\r\n    NOTICE: 'mp_1_notice',\r\n    NATIONAL_NOTICE: 'mp_1_national_notice',\r\n    CONTRACTOR: 'mp_1_contractor',\r\n    GUARANTEE: 'mp_1_guarantee',\r\n    PREPARING_PAPERS_GENERATOR: 'mp_1_preparing_papers_generator',\r\n    PREPARING_ADDITIONAL_INFO: 'mp_1_preparing_additional_info',\r\n    //part3\r\n    OFFERS: 'mp_3_offers',\r\n    DOCUMENTS: 'mp_3_documents',\r\n    CONTRACTOR_VERIFICATION: 'mp_3_contractor_verification',\r\n    OFFERS_EVALUATION: 'mp_3_offers_evaluation',\r\n    OFFER_CHOICE: 'mp_3_offer_choice',\r\n    PRIMARY_TENDER_CHOICE: 'mp_3_primary_tender_choice',\r\n    ADDITIONAL_ROUND_PASSIVE: 'mp_3_additional_round_passive',\r\n    OFFERS_CHOICE_RESULT: 'mp_3_offers_choice_result',\r\n    EVALUATION_FINISH: 'mp_3_evaluation_finish',\r\n    STAGE_FINISH: 'mp_3_stage_finish',\r\n    PAPERS_GENERATOR: 'mp_3_papers_generator',\r\n    AGREEMENTS: 'mp_3_agreements',\r\n    EVALUATION_ADDITIONAL_INFO: 'mp_3_evaluation_additional_info',\r\n    //part 4\r\n    RESULT_NOTICE: 'mp_4_result_notice',\r\n    FINISH_DOCUMENTS: 'mp_4_finish_documents',\r\n    DEMAND_PLAN_REALIZATION: 'mp_4_demand_plan_realization',\r\n    FINISH_DEMAND: 'mp_4_finish_demand',\r\n    ARCHIVING: 'mp_4_archiving',\r\n    FINISH_ADDITIONAL_INFO: \"mp_4_finish_additional_info\",\r\n}\r\n\r\nexport const DemandValidationTr = Object.keys(DemandValidationKeys).reduce((prev, key) => {\r\n    return {...prev, [key]: Tr(DemandValidationKeys[key])}\r\n}, {});\r\n","import Tr from 'translations/Translations';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport {DemandValidation, DemandValidationKeys, DemandValidationTr} from 'constants/DemandValidation';\r\n\r\nconst createItem = (trKey, steps = [], href, hrefExpand = []) => ({\r\n    title: Tr(trKey),\r\n    steps,\r\n    href,\r\n    hrefExpand\r\n})\r\n\r\nconst createStep = (apiId, confirmClosing= false) => ({\r\n    key: DemandValidationKeys[apiId],\r\n    label: DemandValidationTr[apiId],\r\n    apiId,\r\n    confirmClosing\r\n});\r\n\r\nconst rp = RouterPath.myProcedure.steps;\r\n\r\nexport default [\r\n    createItem('mp_1', [\r\n        createStep(DemandValidation.DEMAND, true),\r\n        createStep(DemandValidation.COMMISSION, true),\r\n        createStep(DemandValidation.QUESTIONNAIRE),\r\n        createStep(DemandValidation.DEALINGS, true),\r\n        createStep(DemandValidation.SCHEDULE, true),\r\n        createStep(DemandValidation.SIWZ),\r\n        createStep(DemandValidation.ESPD),\r\n        createStep(DemandValidation.NOTICE),\r\n        createStep(DemandValidation.NATIONAL_NOTICE),\r\n        createStep(DemandValidation.PREPARING_ADDITIONAL_INFO),\r\n        createStep(DemandValidation.PUBLICATION),\r\n        createStep(DemandValidation.CONTRACTOR),\r\n        createStep(DemandValidation.GUARANTEE),\r\n        createStep(DemandValidation.EX_POST_GO_TO_FINISH),\r\n        createStep(DemandValidation.PREPARING_PAPERS_GENERATOR),\r\n    ], rp.MP_1, [rp.MP_1]),\r\n    createItem('mp_2', [], rp.MP_2),\r\n    createItem('mp_3', [\r\n        createStep(DemandValidation.OFFERS),\r\n        createStep(DemandValidation.DOCUMENTS),\r\n        createStep(DemandValidation.CONTRACTOR_VERIFICATION),\r\n        createStep(DemandValidation.OFFERS_EVALUATION),\r\n        createStep(DemandValidation.OFFER_CHOICE),\r\n        createStep(DemandValidation.ADDITIONAL_ROUND_PASSIVE),\r\n        createStep(DemandValidation.PRIMARY_TENDER_CHOICE),\r\n        createStep(DemandValidation.OFFERS_CHOICE_RESULT),\r\n        createStep(DemandValidation.EVALUATION_ADDITIONAL_INFO),\r\n        createStep(DemandValidation.EVALUATION_FINISH),\r\n        createStep(DemandValidation.STAGE_FINISH),\r\n        createStep(DemandValidation.PAPERS_GENERATOR),\r\n        createStep(DemandValidation.AGREEMENTS),\r\n    ], rp.MP_3, [rp.MP_3]),\r\n    createItem('mp_4', [\r\n        createStep(DemandValidation.RESULT_NOTICE),\r\n        createStep(DemandValidation.FINISH_DOCUMENTS),\r\n        createStep(DemandValidation.DEMAND_PLAN_REALIZATION),\r\n        createStep(DemandValidation.FINISH_ADDITIONAL_INFO),\r\n        createStep(DemandValidation.FINISH_DEMAND),\r\n        createStep(DemandValidation.ARCHIVING),\r\n    ], rp.MP_4, [rp.MP_4]),\r\n]","import steps from './initValues/stepper.values'\r\n\r\nconst initialState = {\r\n    state: null,\r\n    steps,\r\n    stateCloseValidator: null,\r\n    stateCloseFunction: null\r\n}\r\n\r\nexport default (state = initialState, {type, payload}) => {\r\n    switch (type) {\r\n\r\n        case 'SET_STEPPER_STATE':\r\n            return {\r\n                ...state,\r\n                stateCloseValidator: null,\r\n                state: payload,\r\n            }\r\n\r\n        case 'SET_STEPPER_STATE_CLOSE_VALIDATOR':\r\n            return {\r\n                ...state,\r\n                stateCloseValidator: payload\r\n            }\r\n\r\n        case 'SET_STEPPER_STATE_DEL_FORM_DRAFT_FUNCTION':\r\n            return {\r\n                ...state,\r\n                deleteFormDraftFunc: payload\r\n            }\r\n\r\n        case 'SET_STEPPER_STATE_SAVE_FORM_DRAFT_FUNCTION':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\tsaveFormDraftFunc: payload\r\n\t\t\t}\r\n\r\n        default:\r\n            return state\r\n    }\r\n}\r\n","import { createStore, combineReducers } from 'redux'\r\nimport { composeWithDevTools } from 'redux-devtools-extension';\r\nimport resources from './reducers/ResourcesReducer'\r\nimport storeReducer from './reducers/StoreReducer'\r\nimport form from './reducers/FormReducer'\r\nimport authorize from './reducers/AuthorizeReducer'\r\nimport stepper from './reducers/StepperReducer'\r\nimport innerMenu from './reducers/InnerMenuReducer'\r\nimport formValues from './reducers/FormValuesReducer'\r\nimport privileges from './reducers/PrivilegeReducer'\r\nimport signature from './reducers/SignatureReducer'\r\n\r\nconst store = createStore(\r\n\tcombineReducers({\r\n\t\tresources,\r\n\t\tprivileges,\r\n\t\tstore: storeReducer,\r\n\t\tform,\r\n\t\tauthorize,\r\n\t\tinnerMenu,\r\n\t\tstepper,\r\n\t\tformValues,\r\n\t\tsignature\r\n\t}),\r\n\tcomposeWithDevTools()\r\n)\r\n\r\nexport default store;","export default (state = {}, {type, payload}) => {\r\n    switch (type) {\r\n        case 'SET_RESOURCE':\r\n            return {\r\n                ...state,\r\n                [payload.id]: payload.value\r\n            };\r\n        case 'ADD_OBJECT_RESOURCE':\r\n            return {\r\n                ...state,\r\n                [payload.id]: {\r\n                    ...state[payload.id],\r\n                    [payload.key]: payload.value,\r\n                }\r\n            };\r\n        case 'ADD_OBJECT_RESOURCES':\r\n            const idObject = {};\r\n            Object.keys(payload.keyValuePairObject).forEach(key => {\r\n                idObject[key] = payload.keyValuePairObject[key];\r\n            });\r\n            return {\r\n                ...state,\r\n                [payload.id]: {\r\n                    ...state[payload.id],\r\n                    ...idObject\r\n                }\r\n            };\r\n        default:\r\n            return state\r\n    }\r\n}\r\n","export default (state = {}, {type, payload}) => {\r\n\tswitch (type) {\r\n\t\tcase 'SET_PRIVILEGES':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id]: payload.value,\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\treturn state\r\n\t}\r\n}\r\n","import saveStatusValues from 'constants/status.save'\r\nexport default (state = {\r\n\tredirect: () => { },\r\n\tredirectReplace: () => { },\r\n\tcontrast: false,\r\n\tlargeText: false,\r\n\tclientColors: null,\r\n\tisMenuOpen: true,\r\n\tsaveStatus: saveStatusValues.CLOSED,\r\n\tsaveStatusMessage: '',\r\n\topenTutorial: false,\r\n}, { type, payload }) => {\r\n\tswitch (type) {\r\n\r\n\t\tcase 'SET_STORE_VALUE':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id]: payload.value,\r\n\t\t\t}\r\n\t\tcase 'SET_STORE_MULTI_VALUE':\r\n\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t...payload,\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\treturn state\r\n\t}\r\n}\r\n","export default (state = {\r\n\r\n}, { type, payload }) => {\r\n\tswitch (type) {\r\n\t\tcase 'SET_FORM_SUBMIT_FUNC':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id]: payload.value\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\treturn state\r\n\t}\r\n}\r\n","export default (state = {\r\n\tcounter: 0\r\n}, { type }) => {\r\n\tswitch (type) {\r\n\r\n\t\tcase 'SET_AUTHORIZE_COUNTER':\r\n\t\t\treturn {\r\n\t\t\t\tcounter: state.counter + 1\r\n\t\t\t}\r\n\r\n\t\tdefault:\r\n\t\t\treturn state\r\n\t}\r\n}\r\n","export default (state = {}, { type, payload }) => {\r\n  switch (type) {\r\n\r\n    case 'SET_INNER_MENU':\r\n      return payload\r\n\r\n    default:\r\n      return state\r\n  }\r\n}\r\n","export default (state = {\r\n\r\n}, { type, payload }) => {\r\n\tswitch (type) {\r\n\t\tcase 'SET_FORM_VALUES':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id]: payload.form,\r\n\t\t\t\t[payload.id + \"_dirty\"]: payload.dirty\r\n\t\t\t}\r\n\t\tcase 'SET_FORM_DRAFT_LOADED':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id + \"_draftLoaded\"]: payload.draftLoaded\r\n\t\t\t}\r\n\t\tcase 'CLEAR_FORM_VALUES':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id]: undefined,\r\n\t\t\t\t[payload.id + \"_dirty\"]: undefined,\r\n\t\t\t\t[payload.id + \"_draftLoaded\"]: undefined\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\treturn state\r\n\t}\r\n}\r\n","export default (state = {}, {type, payload}) => {\r\n\tswitch (type) {\r\n\t\tcase 'SET_SIGNATURE':\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t[payload.id]: payload.value,\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\treturn state\r\n\t}\r\n}\r\n","import React from 'react'\r\nimport { Typography } from '@material-ui/core';\r\n\r\nfunction NotFound() {\r\n\treturn (\r\n\t\t<Typography variant='h1' align='center'>\r\n\t\t\t404 Page not found.\r\n\t\t</Typography>\r\n\t)\r\n}\r\n\r\nexport default NotFound\r\n","import React, {memo} from 'react'\r\nimport {Box, ListItem as ListItemUI, ListItemIcon, ListItemText, Tooltip} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport {withStyles} from '@material-ui/styles';\r\nimport clsx from 'clsx';\r\n// import { redirect } from 'libs/RouterPath';\r\nimport {withRouter} from \"react-router\";\r\nimport ArrowRightIcon from '@material-ui/icons/ArrowRight';\r\n\r\nconst style = theme => ({\r\n\tleftMargin: {\r\n\t\tmarginLeft: theme.spacing(3)\r\n\t},\r\n\trightIcon: {\r\n\t\tminWidth: 'unset'\r\n\t},\r\n\ticonOpen: {\r\n\t\ttransform: 'rotate(-180deg)',\r\n\t},\r\n\tcontrastColor: {\r\n\t\tcolor: theme.palette.primary.contrastText,\r\n\t},\r\n\telementColor: {\r\n\t\t...theme.components.navigation.item.primary\r\n\t},\r\n\tmainPadding: {\r\n\t\tpaddingLeft: 0,\r\n\t},\r\n\ticonInnerOpen: {\r\n\t\ttransform: 'rotate(90deg)',\r\n\t},\r\n\tinnerArrow: {\r\n\t\tminWidth: theme.spacing(3)\r\n\t},\r\n\ttext: {\r\n\t\twhiteSpace: \"normal\"\r\n\t},\r\n\ticonContrast: {\r\n\t\tfill: theme.palette.primary.main,\r\n\t},\r\n\tonHover: {\r\n\t\t'&:hover': {\r\n\t\t\tbackground: theme.palette.primary.light,\r\n\t\t\tcolor: theme.palette.secondary.contrastText,\r\n\t\t\t'& $iconContrast': {\r\n\t\t\t\tfill: theme.palette.secondary.contrastText,\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tepmptySpace: {\r\n\t\twidth: theme.spacing(3)\r\n\t},\r\n\ttextBox: {\r\n\t\tmaxWidth: 200\r\n\t}\r\n})\r\n\r\nfunction ListItem({\r\n\tIcon = \"\",\r\n\tonClick,\r\n\tclassName,\r\n\tclasses,\r\n\tclassesObj,\r\n\ticonPosition,\r\n\topen,\r\n\t// href,\r\n\tlocation,\r\n\tsetInnerMenuOpen,\r\n\tinnerMenu,\r\n\t// innerKey,\r\n\t// directLink,\r\n\topenInner,\r\n\tname,\r\n\turl,\r\n\tinnerKey,\r\n\tsingleLink,\r\n\tsetMenuOpen,\r\n\ttooltip\r\n}) {\r\n\tconst renderItem = (component, shouldRender) => {\r\n\t\t// return Icon && (shouldRender ? component : '')\r\n\t\treturn (shouldRender ? component : '')\r\n\t}\r\n\r\n\tconst isSelected = (() => {\r\n\t\tif (!url) return false;\r\n\t\tconst path = location.pathname;\r\n\r\n\t\treturn (path.startsWith(url) && url.length > 1) || path === url;\r\n\t})();\r\n\r\n\tconst iconBase = (className = '') => (\r\n\t\t<ListItemIcon className={className} >\r\n\t\t\t<Icon\r\n\t\t\t\tclassName={clsx({\r\n\t\t\t\t\t[classes.iconOpen]: open,\r\n\t\t\t\t\t[classes.contrastColor]: isSelected,\r\n\t\t\t\t\t[classes.iconContrast]: !isSelected\r\n\t\t\t\t}, classesObj.icon\r\n\t\t\t\t)}\r\n\t\t\t/>\r\n\t\t</ListItemIcon>\r\n\t)\r\n\r\n\tconst icon = (tooltip, className) => {\r\n\t\tif (!tooltip) {\r\n\t\t\treturn iconBase(className);\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t<Tooltip\r\n\t\t\t\ttitle={tooltip}\r\n\t\t\t>\r\n\t\t\t\t{iconBase(className)}\r\n\t\t\t</Tooltip>\r\n\t\t)\r\n\t}\r\n\r\n\r\n\tconst onArrowClick = () => {\r\n\t\tif (setInnerMenuOpen) {\r\n\t\t\tif (iconPosition === \"right\") {\r\n\t\t\t\tfor (const x in innerMenu) innerMenu[x] = false\r\n\t\t\t\tsetInnerMenuOpen({ ...innerMenu })\r\n\t\t\t} else {\r\n\t\t\t\tsetInnerMenuOpen({\r\n\t\t\t\t\t...innerMenu,\r\n\t\t\t\t\t[innerKey]: !innerMenu[innerKey]\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\tsetMenuOpen(true);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tconst handleClick = () => {\r\n\t\tonClick();\r\n\t\t// if (href) { redirect(href) }\r\n\t\tif (url) window.location.href = url\r\n\r\n\t\tif (singleLink) window.location.href = singleLink\r\n\t\telse onArrowClick()\r\n\t}\r\n\r\n\tconst itemClass = clsx(className, classes.onHover, {\r\n\t\t[classes.elementColor]: isSelected,\r\n\t\t[classes.mainPadding]: openInner\r\n\t})\r\n\treturn (\r\n\t\t<ListItemUI\r\n\t\t\tbutton\r\n\t\t\tclassName={itemClass}\r\n\t\t\tonClick={handleClick}\r\n\t\t>\r\n\t\t\t{singleLink ?\r\n\t\t\t\t<Box component=\"div\" className={classes.epmptySpace} />\r\n\t\t\t\t:\r\n\t\t\t\topenInner && (\r\n\t\t\t\t\tinnerKey ?\r\n\t\t\t\t\t\t<ArrowRightIcon\r\n\t\t\t\t\t\t\tclassName={clsx({\r\n\t\t\t\t\t\t\t\t[classes.contrastColor]: isSelected,\r\n\t\t\t\t\t\t\t\t[classes.iconInnerOpen]: innerMenu[innerKey],\r\n\t\t\t\t\t\t\t}, classes.innerArrow)} />\r\n\t\t\t\t\t\t:\r\n\t\t\t\t\t\t<Box className={classes.leftMargin} />\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t\t{Icon && renderItem(icon(name), iconPosition === 'left')}\r\n\t\t\t<ListItemText\r\n\t\t\t\tclassName={clsx({ [classes.textBox]: iconPosition === 'left' })}\r\n\t\t\t\tprimary={name}\r\n\t\t\t\tprimaryTypographyProps={{\r\n\t\t\t\t\tnoWrap: true,\r\n\t\t\t\t\tclassName: clsx({\r\n\t\t\t\t\t\t[classes.contrastColor]: isSelected,\r\n\t\t\t\t\t\t[classes.text]: openInner,\r\n\t\t\t\t\t})\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t\t{renderItem(icon(tooltip, classes.rightIcon), iconPosition === 'right')}\r\n\t\t</ListItemUI>\r\n\t)\r\n}\r\n\r\nListItem.propTypes = {\r\n\t// text: PropTypes.string,\r\n\t// icon: PropTypes.object,\r\n\tonClick: PropTypes.func,\r\n\tclassName: PropTypes.string,\r\n\tclassesObj: PropTypes.shape({\r\n\t\ticon: PropTypes.string,\r\n\t}),\r\n\ticonPosition: PropTypes.oneOf(['left', 'right']),\r\n\t// href: PropTypes.string,\r\n}\r\n\r\nListItem.defaultProps = {\r\n\t// text: '',\r\n\tclassesObj: {\r\n\t\ticon: '',\r\n\t},\r\n\ticonPosition: 'left',\r\n\topen: false,\r\n\tonClick: () => { },\r\n}\r\n\r\nexport default withRouter(withStyles(style)(memo(ListItem, (prevProps, nextProps) => {\r\n\tif (prevProps.location.pathname !== nextProps.location.pathname) return false;\r\n\tif (prevProps.open !== nextProps.open) return false;\r\n\tif (prevProps.openInner !== nextProps.openInner) return false;\r\n\tif (prevProps.className !== nextProps.className) return false;\r\n\tif (JSON.stringify(prevProps.classes) !== JSON.stringify(nextProps.classes)) return false;\r\n\tif (JSON.stringify(prevProps.classesObj) !== JSON.stringify(nextProps.classesObj)) return false;\r\n\tif (JSON.stringify(prevProps.innerMenu) !== JSON.stringify(nextProps.innerMenu)) return false;\r\n\treturn true;\r\n})))\r\n","import React from 'react'\r\nimport ArrowIcon from '@material-ui/icons/ArrowForward'\r\nimport ListItem from './ListItem';\r\nimport { withStyles } from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tpaddingTop: 0,\r\n\t\tpaddingBottom: 0,\r\n\r\n\t\t...theme.components.navigation.item.primary\r\n\t},\r\n\ticon: {\r\n\t\tfill: theme.palette.primary.contrastText\r\n\t}\r\n})\r\n\r\nfunction RolingElement({\r\n\topen,\r\n\tsetOpen,\r\n\tsetInnerMenuOpen,\r\n\tclasses,\r\n}) {\r\n\tconst handleClick = () => {\r\n\t\tsetOpen(!open)\r\n\t\tsetInnerMenuOpen({})\r\n\t}\r\n\treturn (\r\n\t\t<ListItem\r\n\t\t\tIcon={ArrowIcon}\r\n\t\t\tonClick={handleClick}\r\n\t\t\ticonPosition='right'\r\n\t\t\topen={open}\r\n\t\t\tclassName={classes.root}\r\n\t\t\tclassesObj={{\r\n\t\t\t\ticon: classes.icon\r\n\t\t\t}}\r\n\t\t\ttooltip={open ? Tr('collapse') : Tr('expand')}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nexport default withStyles(style)(RolingElement)\r\n","export default __webpack_public_path__ + \"static/media/logo-long-contrast.f29674e8.png\";","import React, {useMemo} from 'react'\r\nimport logoLong from 'images/logo-long.png'\r\nimport logoIcon from 'images/logo-icon.png'\r\nimport logoLongContrast from 'images/logo-long-contrast.png'\r\nimport logoIconContrast from 'images/logo-icon-contrast.png'\r\nimport { withStyles } from '@material-ui/styles';\r\nimport PropTypes from 'prop-types'\r\nimport { ListItem, Tooltip } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport { Link } from 'react-router-dom'\r\nimport { connect } from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\theight: theme.spacing(6),\r\n\t},\r\n\timage: {\r\n\t\tobjectFit: 'contain',\r\n\t},\r\n\timageOpen: {\r\n\t\twidth: theme.components.navigation.width - theme.spacing(8),\r\n\t\tmarginLeft: theme.spacing(2)\r\n\t},\r\n\timageClose: {\r\n\t\twidth: theme.spacing(3) + 1,\r\n\t}\r\n})\r\n\r\nfunction Logo({\r\n\topen,\r\n\tpurchaser,\r\n\tclasses,\r\n\tisContrast\r\n}) {\r\n\r\n\tconst logoLongMem = useMemo(()=> isContrast ? logoLongContrast : logoLong, [isContrast])\r\n\tconst logoIconMem = useMemo(()=> isContrast ? logoIconContrast : logoIcon, [isContrast])\r\n\r\n\treturn (\r\n\t\t<ListItem\r\n\t\t\tclassName={classes.root}\r\n\t\t>\r\n\t\t\t<Tooltip title={Tr('main_menu')}>\r\n\t\t\t\t<Link to={purchaser ? RouterPath.BUYER_INIT : RouterPath.CTR_INIT}>\r\n\t\t\t\t\t<img\r\n\t\t\t\t\t\tclassName={clsx(classes.image, {\r\n\t\t\t\t\t\t\t[classes.imageOpen]: open,\r\n\t\t\t\t\t\t\t[classes.imageClose]: !open\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\tsrc={open ? logoLongMem : logoIconMem}\r\n\t\t\t\t\t\talt={Tr('ezam')}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</Link>\r\n\t\t\t</ Tooltip>\r\n\t\t</ListItem >\r\n\t)\r\n}\r\n\r\nLogo.propTypes = {\r\n\topen: PropTypes.bool,\r\n}\r\n\r\nLogo.defaultProps = {\r\n\topen: false,\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n\tisContrast: state.store.contrast,\r\n}), {\r\n\r\n})(withStyles(style)(Logo));","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtUAAABkCAMAAAB+ZDygAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFxEAABcRAcom8z8AAAL9UExURUdwT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NhZ8QNBR+IqKh8BMRDcJPRDREfsKhIbJNy6M8GhLbFO/zNAS8j4YZ75vYtuF9C9smvC/SEPC6RIPD+2goeF+hIeB1Kw0Rr/M0aMbrKg0Rr9to0Iy3eVoibsiVhgm2iRaP6zZaHGyOlgmXJVo0w5aVloiLcqVlQ4/QNOOaQlNAT6BJPa4QmgR9QpN6nCe0BfQF2tTjLKFNsEdoU49zhB0Be4LSpg4nhIkdG/ZF9mwZR83KDs3Ylyt7asIhYWHXiiNm9knArhyVXQXHLNwhAV05Kvs04Jis3LPMMCXhrhVHJe7TxQX8Jc9Sua/guI2HaIlrSgF/5JRcXCoP0YwTCp/kcUaufI7DOV75lA1neT5EcJ7jIwRXOD5AcI3jcIKrknIswXVeOVLEHXniMOpwk3CQyeO2WTmCZAwQCm/TGYOsynuWjGGy8IaaMJQvvEhXDJcKL9CY8YQkPKmuGU8JsfK4ZcazklQeUVzGC3ws7KriMt6TVilsqCXOAR/IKcU/tlKW+IdLHj8/Pz8//47/AP6//ENfH7fNAAAAAElFTkSuQmCC\"","import React from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport {Button as ButtonUI, Tooltip} from '@material-ui/core'\r\nimport {withStyles} from '@material-ui/styles';\r\nimport {connect} from 'react-redux'\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n    icon: {\r\n        marginRight: theme.spacing(1)\r\n    },\r\n    disabled: {\r\n        border: `1px solid ${theme.palette.action.disabled}`,\r\n    },\r\n    transparentBorder: {\r\n        border: `1px solid rgba(255,255,255,0.0)`\r\n    }\r\n})\r\n\r\nfunction Button(\r\n    {\r\n        tooltip,\r\n        hideTooltip = false,\r\n        placement,\r\n        classes,\r\n        Icon,\r\n        children,\r\n        isContrast,\r\n        ...others\r\n    }) {\r\n\r\n    const button = (<ButtonUI\r\n        classes={{\r\n            //text: classes.transparentBorder,\r\n            disabled: clsx({\r\n                [classes.disabled]: isContrast,\r\n                [classes.transparentBorder]: !isContrast,\r\n            })\r\n        }}\r\n        {...others}\r\n    >\r\n        {Icon &&\r\n        <Icon className={classes.icon}/>\r\n        }\r\n        {children}\r\n    </ButtonUI>)\r\n\r\n    if (hideTooltip || !Boolean(tooltip)) {\r\n        return button\r\n    }\r\n\r\n    return (\r\n        <Tooltip title={tooltip} placement={placement}>\r\n\t\t\t<span>\r\n\t\t\t\t{button}\r\n\t\t\t</span>\r\n        </Tooltip>\r\n    )\r\n}\r\n\r\nButton.propTypes = {\r\n    variant: PropTypes.oneOf([ 'text', 'outlined', 'contained']),\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func,\r\n    disabled: PropTypes.bool\r\n}\r\n\r\nButton.defaultProps = {\r\n    variant: 'contained',\r\n    color: 'primary',\r\n    onClick: () => {\r\n    },\r\n}\r\n\r\nexport default connect((state) => ({\r\n    isContrast: state.store.contrast,\r\n}), {})(withStyles(style)(Button));\r\n","import React from 'react'\r\nimport { withStyles, ListItem } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&:hover': {\r\n\t\t\tbackground: theme.palette.primary.light,\r\n\t\t\tcolor: theme.palette.secondary.contrastText\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction ListElement({\r\n\tclasses,\r\n\tonClick,\r\n\tonMouseEnter,\r\n\tonMouseLeave,\r\n\tlabel,\r\n\tdisabled,\r\n}) {\r\n\treturn (\r\n\t\t<ListItem\r\n\t\t\tclassName={classes.root}\r\n\t\t\tbutton\r\n\t\t\tonClick={onClick}\r\n\t\t\tdisabled={disabled}\r\n\t\t\tonMouseEnter={onMouseEnter}\r\n\t\t\tonMouseLeave={onMouseLeave}\r\n\t\t>\r\n\t\t\t{label}\r\n\t\t</ListItem>\r\n\t)\r\n}\r\n\r\nListElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nListElement.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(ListElement);","import React, { useState, useEffect } from 'react'\r\nimport { withStyles, Paper, Popper, List } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ListElement from './ListElement';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tzIndex: theme.zIndex.tooltip,\r\n\t},\r\n})\r\n\r\nfunction NewProcedureMenu({\r\n\tclasses,\r\n\tanchorEl,\r\n\tonClose = () => { },\r\n\titems,\r\n\tplacement = 'right-start',\r\n}) {\r\n\tconst [anchorItem, setAnchorItem] = useState(null)\r\n\r\n\tuseEffect(() => {\r\n\t\tif (Boolean(anchorItem)) {\r\n\t\t\tsetAnchorItem(null)\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [anchorEl])\r\n\r\n\tconst handleClickElement = item => (e) => {\r\n\t\tif (Boolean(item.onClick)) {\r\n\t\t\titem.onClick();\r\n\t\t\tonClose();\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleMouseEnter = item => e => {\r\n\t\tif (Boolean(item.items)) {\r\n\t\t\tsetAnchorItem({\r\n\t\t\t\tanchorEl: e.currentTarget,\r\n\t\t\t\t...item,\r\n\t\t\t})\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleMouseLeave = e => {\r\n\t\tif (e.relatedTarget.attributes.role === undefined) {\r\n\t\t\t\tonClose();\r\n\t\t}\r\n\t}\r\n\r\n\tconst createSubMenu = () => {\r\n\t\tif (Boolean(anchorItem) && Boolean(anchorItem.items)) {\r\n\t\t\treturn <NewProcedureMenu\r\n\t\t\t\tclasses={classes}\r\n\t\t\t\titems={anchorItem.items}\r\n\t\t\t\tanchorEl={anchorItem.anchorEl}\r\n\t\t\t\tplacement='right-start'\r\n\t\t\t\tonClose={onClose}\r\n\t\t\t/>\r\n\t\t}\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Popper\r\n\t\t\t\tclassName={classes.root}\r\n\t\t\t\topen={Boolean(anchorEl)}\r\n\t\t\t\tanchorEl={anchorEl}\r\n\t\t\t\tplacement={placement}\r\n\t\t\t\tonMouseLeave={handleMouseLeave}\r\n\t\t\t>\r\n\t\t\t\t<Paper>\r\n\t\t\t\t\t<List>\r\n\t\t\t\t\t\t{items.map((item, i) => (\r\n\t\t\t\t\t\t\t<ListElement\r\n\t\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\t\tlabel={item.label}\r\n\t\t\t\t\t\t\t\tdisabled={item.disabled}\r\n\t\t\t\t\t\t\t\tonClick={handleClickElement(item)}\r\n\t\t\t\t\t\t\t\tonMouseEnter={handleMouseEnter(item)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</List>\r\n\t\t\t\t</Paper>\r\n\t\t\t</Popper>\r\n\r\n\t\t\t{createSubMenu()}\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nNewProcedureMenu.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nNewProcedureMenu.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(NewProcedureMenu);","import Tr from 'translations/Translations';\r\n\r\nexport const isNonpublicProcedure = (procedureType) => {\r\n\treturn procedureType === ProcedureType.NATIONAL_NONPUBLIC_TYPE || procedureType === ProcedureType.NATIONAL_LOWCOST_TYPE;\r\n}\r\nexport const isNationalProcedure = (procedureType) => {\r\n\treturn procedureType === ProcedureType.NATIONAL_PUBLIC || procedureType === ProcedureType.NATIONAL_SOCIAL_SERVICES;\r\n}\r\nexport const isEuropeProcedure = (procedureType) => {\r\n\t return  procedureType === ProcedureType.EUROPE_PUBLIC || procedureType === ProcedureType.EUROPE_SOCIAL_SERVICES;\r\n}\r\n\r\nexport const ProcedureType = {\r\n\tCOMPETITION: \"competition\",\r\n\tDEMAND: \"demand\",\r\n\tDYNAMICPURCHASINGSYSTEM: \"dynamicPurchasingSystem\",\r\n\tFRAMEWORKDEMAND: \"frameworkdemand\",\r\n\tLOWCOST: \"lowcost\",\r\n\tPUBLIC: \"public\",\r\n\tRESEARCH: \"research\",\r\n\tRESEARCHTECHNICAL: \"researchtechnical\",\r\n\tSOCIALSERVICES: \"socialservices\",\r\n\tSTANDARDPURCHASEREQUEST: \"standardpurchaserequest\",\r\n\tNONPUBLICEXECUTIVE: \"nonpublicExecutive\",\r\n\tEUROPE_PUBLIC: \"europePublic\",\r\n\tNATIONAL_PUBLIC: \"nationalPublic\",\r\n\tNATIONAL_SOCIAL_SERVICES: \"nationalSocialServices\",\r\n\tEUROPE_SOCIAL_SERVICES: \"europeSocialServices\",\r\n\tNATIONAL_NONPUBLIC_TYPE: \"nationalNonpublic\",\r\n\tNATIONAL_LOWCOST_TYPE: \"nationalLowcost\",\r\n\tNATIONAL_LOWCOST: \"nationalLowcost\",\r\n\tNATIONAL_RESEARCH_TYPE: \"nationalResearch\",\r\n\tCONCESSION: \"concession\"\r\n}\r\n\r\nexport const ProcedureTypeTr = {\r\n\t[ProcedureType.COMPETITION]: Tr(\"competition\"),\r\n\t[ProcedureType.DEMAND]: Tr(\"demand\"),\r\n\t[ProcedureType.DYNAMICPURCHASINGSYSTEM]: Tr(\"dynamicpurchasingsystem\"),\r\n\t[ProcedureType.FRAMEWORKDEMAND]: Tr(\"frameworkdemand\"),\r\n\t[ProcedureType.LOWCOST]: Tr(\"lowcost\"),\r\n\t[ProcedureType.PUBLIC]: Tr(\"public\"),\r\n\t[ProcedureType.RESEARCH]: Tr(\"research\"),\r\n\t[ProcedureType.RESEARCHTECHNICAL]: Tr(\"researchtechnical\"),\r\n\t[ProcedureType.SOCIALSERVICES]: Tr(\"socialservices\"),\r\n\t[ProcedureType.STANDARDPURCHASEREQUEST]: Tr(\"standardpurchaserequest\"),\r\n\t[ProcedureType.NONPUBLICEXECUTIVE]: Tr(ProcedureType.NONPUBLICEXECUTIVE),\r\n\t[ProcedureType.EUROPE_PUBLIC]: Tr(ProcedureType.EUROPE_PUBLIC),\r\n\t[ProcedureType.EUROPE_SOCIAL_SERVICES]: Tr(ProcedureType.EUROPE_SOCIAL_SERVICES),\r\n\t[ProcedureType.NATIONAL_PUBLIC]: Tr(ProcedureType.NATIONAL_PUBLIC),\r\n\t[ProcedureType.NATIONAL_SOCIAL_SERVICES]: Tr(ProcedureType.NATIONAL_SOCIAL_SERVICES),\r\n\t[ProcedureType.NATIONAL_NONPUBLIC_TYPE]: Tr(ProcedureType.NATIONAL_NONPUBLIC_TYPE),\r\n\t[ProcedureType.NATIONAL_LOWCOST_TYPE]: Tr(ProcedureType.NATIONAL_LOWCOST_TYPE),\r\n\t[ProcedureType.NATIONAL_LOWCOST]: Tr(ProcedureType.NATIONAL_LOWCOST_TYPE),\r\n\t[ProcedureType.NATIONAL_RESEARCH_TYPE]: Tr(ProcedureType.NATIONAL_RESEARCH_TYPE),\r\n\t[ProcedureType.CONCESSION]: Tr(ProcedureType.CONCESSION)\r\n}\r\n\r\nexport const ProcedureType_PZP_2021 = [\r\n\tProcedureType.EUROPE_PUBLIC,\r\n\tProcedureType.NATIONAL_PUBLIC,\r\n\tProcedureType.EUROPE_SOCIAL_SERVICES,\r\n\tProcedureType.NATIONAL_SOCIAL_SERVICES,\r\n\tProcedureType.NATIONAL_NONPUBLIC_TYPE,\r\n\tProcedureType.NATIONAL_LOWCOST_TYPE,\r\n\tProcedureType.NATIONAL_RESEARCH_TYPE,\r\n\tProcedureType.CONCESSION\r\n]\r\n\r\nexport default Object.values(ProcedureTypeTr)\r\n","import RouterPath from 'libs/RouterPath';\r\nimport {clearResource, setStepperState} from 'redux/actions';\r\nimport reduxStore from 'redux/store'\r\nimport {ProcedureTypeTr} from \"constants/ProcedureType\";\r\nimport Tr from 'translations/Translations';\r\n\r\nconst createItem = (label, items, onClick, disabled = false) => ({\r\n    label,\r\n    items,\r\n    onClick,\r\n    disabled,\r\n})\r\n\r\n//#TODO: translations\r\n\r\nconst newDeamandFunction = (passive, procedureType) => {\r\n    reduxStore.dispatch(clearResource('demand'))\r\n    reduxStore.dispatch(clearResource('dealingsList'))\r\n    reduxStore.dispatch(clearResource('dealing'))\r\n    reduxStore.dispatch(clearResource('demandHeader'));\r\n    //reduxStore.dispatch(clearResource('demandActions'));\r\n    reduxStore.dispatch(setStepperState())\r\n    RouterPath.redirectWithSearch(RouterPath.myProcedure.steps.MP_1, {passive, procedureType})\r\n}\r\nexport default (procedures) => {\r\n\r\n    return procedures.map(proc => {\r\n\r\n        const items = [];\r\n        if (proc.system) {\r\n            items.push(createItem(Tr('activeForm'), undefined, () => newDeamandFunction(false, proc.procedureType)))\r\n        }\r\n        if (proc.passive) {\r\n            items.push(\r\n                createItem(Tr('passiveForm'), undefined, () => newDeamandFunction(true, proc.procedureType)))\r\n        }\r\n        return createItem(ProcedureTypeTr[proc.procedureType], items)\r\n    })\r\n}\r\n\r\n","import React, {useState} from 'react'\r\nimport {ListItem, Tooltip, Typography, withStyles} from '@material-ui/core';\r\nimport Button from 'components/Button';\r\nimport PropTypes from 'prop-types'\r\nimport AddIcon from '@material-ui/icons/Add'\r\nimport Tr from 'translations/Translations'\r\n// import NewForm from 'components/popup/newForm/NewForm';\r\nimport NewProcedureMenu from './newProcedureMenu/NewProcedureMenu';\r\nimport menuItems from './newProcedureMenu/ListElements.values'\r\n\r\nconst style = theme => ({\r\n    button: {\r\n        minWidth: 'unset',\r\n        padding: 0,\r\n    },\r\n    text: {\r\n        marginBottom: -1,\r\n        marginLeft: theme.spacing(1)\r\n    },\r\n    buttonTooltipWraper: {\r\n        display: 'flex'\r\n    }\r\n})\r\n\r\nfunction ListAddButton(\r\n    {\r\n        open,\r\n        procedures,\r\n        classes\r\n    }) {\r\n    // const [openCreateNew, setOpenCreateNew] = useState(false)\r\n    const [anchorEl, setAnchorEl] = useState(null)\r\n\r\n    const handleClick = (e) => {\r\n        // setOpenCreateNew(true)\r\n        setAnchorEl(anchorEl ? null : e.currentTarget)\r\n    }\r\n    const handleClose = () => {\r\n        setAnchorEl(null)\r\n    }\r\n\r\n    const buttonLabel = open ?\r\n        <>\r\n            <AddIcon/>\r\n            <Typography\r\n                variant='body1'\r\n                noWrap\r\n                className={classes.text}\r\n            >\r\n                {Tr('new2')}\r\n            </Typography>\r\n        </>\r\n        : <AddIcon/>\r\n\r\n\r\n    return (\r\n        <ListItem>\r\n            <Button\r\n                onClick={handleClick}\r\n                className={classes.button}\r\n                fullWidth\r\n                size=\"small\"\r\n            >\r\n                <Tooltip title={Tr('create_new_procedure')}>\r\n                    <div className={classes.buttonTooltipWraper}>\r\n                        {buttonLabel}\r\n                    </div>\r\n                </Tooltip>\r\n            </Button>\r\n            {/* <NewForm open={openCreateNew} setOpen={setOpenCreateNew} /> */}\r\n            <NewProcedureMenu\r\n                anchorEl={anchorEl}\r\n                items={menuItems(procedures)}\r\n                onClose={handleClose}\r\n            />\r\n        </ListItem>\r\n\r\n    )\r\n}\r\n\r\nListAddButton.propTypes = {\r\n    open: PropTypes.bool,\r\n    className: PropTypes.string,\r\n}\r\n\r\nListAddButton.defaultProps = {\r\n    open: false,\r\n}\r\n\r\nexport default withStyles(style)(ListAddButton)\r\n","export const devMode = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';\r\nexport default () => devMode;","import RouterPath from \"libs/RouterPath\";\r\nimport {devMode} from \"../libs/isDevMode\";\r\nimport pjson from '../../package.json'\r\n\r\nconst redirect_uri = window.location.origin + RouterPath.baseRoute;\r\n\r\nlet SERVER_URL = window.location.origin\r\n\r\nif (devMode) {\r\n    SERVER_URL = \"http://localhost/app-ezam\";\r\n    //nie można innych używać, bo przeszliśmy na sesję http a jeśli różne domeny to sa różne sesje\r\n    //jak coś gtrzeba skonfigurowac lokalne proxy https://confluence.marketplanet.pl/pages/viewpage.action?pageId=19693610\r\n}\r\n\r\nconst EXT_JS_LIBRARIES = {\r\n    jquery: SERVER_URL + \"/js/jquery-3.3.1.min.js?v=\" + encodeURIComponent(pjson.version),\r\n    szafir: SERVER_URL + \"/js/signature/szafirsdk-module.js?v=\" + encodeURIComponent(pjson.version)\r\n}\r\n\r\n\r\nconst BASE = SERVER_URL + \"/api\"\r\nconst BASE_MP = SERVER_URL + \"/mp\"\r\n\r\nconst oauth = {\r\n    AUTHORIZE: (state) => BASE_MP + `/oauth/authorize?client_id=mp&response_type=code&state=${state}&redirect_uri=${redirect_uri}`,\r\n    TOKEN: BASE_MP + '/oauth/token',\r\n    LOGOUT: `${BASE}/oauth/logout`\r\n}\r\n\r\nconst base = {\r\n    BASE,\r\n    DEMANDS: BASE + \"/demands\",\r\n    DEMAND: BASE + \"/demand\",\r\n    RFX: BASE + \"/rfx\",\r\n    CPV_LIST: BASE + '/cpv/list',\r\n    MEASURE_UNITS: BASE + '/measureUnitTypes/list',\r\n    DEALINGS: BASE + '/dealings',\r\n    ITEMS: BASE + '/items',\r\n    USER: BASE + '/user',\r\n    SALES: BASE + '/sales',\r\n    POLL: BASE + '/poll',\r\n    UPLOAD: (csrf, encryptRoundId) => `${SERVER_URL}/repository/upload/api${encryptRoundId ? \"/encrypt?roundId=\" + encryptRoundId + \"&\" : \"?\"}CSRFToken=${csrf}`,\r\n    //UPLOAD: (csrf) => `${BASE}/upload?CSRFToken=${csrf}`,\r\n    ESPD: BASE + '/espd',\r\n    PURCHASING_GROUP: BASE + \"/purchasingGroup\",\r\n    ADMIN: BASE + \"/admin\",\r\n    CHANG_LANGUAGE: (language, country, csrf, backUrl) => `${SERVER_URL}/servlet/HomeServlet?MP_module=common&MP_action=changeLocale&language=${language}&country=${country}&CSRFToken=${csrf}&backUrl=${encodeURIComponent(backUrl)}`\r\n}\r\n\r\nconst sales = {\r\n    SALES_NOTIFICATION_SEND: (functionalityName) => `${base.SALES}/notification/${functionalityName}/send`\r\n}\r\n\r\nconst poll = {\r\n    POLL_SAVE_RATING: () => `${base.POLL}`,\r\n    POLL_GET: (pollType) => `${base.POLL}/${pollType}`\r\n}\r\n\r\nconst DEMAND_BASE = (id) => `${base.DEMAND}/${id}`;\r\nconst RFX_BASE = (id) => `${base.RFX}/${id}`;\r\n\r\nconst __DEMAND_AUTOSAVE = (id) => base.DEMAND + \"/autoSave/\" + id;\r\nconst __DEMAND_EXPOST_AUTOSAVE = (id) => base.DEMAND + \"/exPost/autoSave/\" + id;\r\nconst demand = {\r\n    DEMAND_SAVE: base.DEMAND + \"/save\",\r\n    DEMAND_SAVE_EX_POST: base.DEMAND + \"/exPost/save\",\r\n    DEMAND_GET_NEW: (params) => base.DEMAND + `/-1${params}`,\r\n    DEMAND_GET_BY_ID: (id, params) => `${DEMAND_BASE(id)}${params}`,\r\n    DEMAND_COMMISION_USER_HISTORY: (id) => base.DEMAND + `/${id}/commission/users/history`,\r\n    DEMAND_AUTOSAVE: (id) => __DEMAND_AUTOSAVE(id),\r\n    DEMAND_AUTOSAVE_CHECK: (id) => __DEMAND_AUTOSAVE(id) + '/check',\r\n    DEMAND_EXPOST_AUTOSAVE: (id) => __DEMAND_EXPOST_AUTOSAVE(id),\r\n    DEMAND_EXPOST_AUTOSAVE_CHECK: (id) => __DEMAND_EXPOST_AUTOSAVE(id) + '/check',\r\n    DEMAND_PREVIEW: (id) => DEMAND_BASE(id) + '/preview',\r\n    DEMAND_ACTIONS: (id) => `${DEMAND_BASE(id)}/actions`,\r\n    DEMAND_DELETE: (id) => `${DEMAND_BASE(id)}/delete`,\r\n    DEMAND_CLONE: (id) => `${DEMAND_BASE(id)}/clone`,\r\n    DEMAND_REALTED_OBJECTS: (id) => `${DEMAND_BASE(id)}/relatedObjects`,\r\n    DEMAND_PRIVILEGES: (id) => `${DEMAND_BASE(id)}/privileges`,\r\n    DEMAND_RFX_PRIVILEGES: (id) => `${DEMAND_BASE(id)}/rfxPrivileges`,\r\n    DEMAND_UPDATE_NUMBER: (id) => `${DEMAND_BASE(id)}/updateNumber`\r\n}\r\n\r\nconst DEALINGS = (id) => `${base.DEALINGS}/${id}`\r\nconst DEALINGS_AUTOSAVE_DEALING = (id, dealingId) => DEALINGS(id) + '/autoSaveDealing/' + (dealingId)\r\n\r\nconst dealings = {\r\n    DEALINGS,\r\n    DEALINGS_SINGLE: (demandId, dealingId) => DEALINGS(demandId) + '/' + dealingId,\r\n    DEALINGS_LIST: (demandId) => DEALINGS(demandId) + '/list',\r\n    DEALINGS_SAVE: (id) => DEALINGS(id) + '/save',\r\n    DEALINGS_VALIDATE: (id) => DEALINGS(id) + '/validate',\r\n    DEALINGS_DELETE: (id) => DEALINGS(id) + '/delete',\r\n    DEALINGS_AUTOSAVE: (id, dealingId) => DEALINGS_AUTOSAVE_DEALING(id, dealingId),\r\n    DEALINGS_AUTOSAVE_CHECK: (id, dealingId) => DEALINGS_AUTOSAVE_DEALING(id, dealingId) + '/check',\r\n    DEALINGS_AUTOSAVE_BATCH: (id) => DEALINGS(id) + '/autoSaveDealing',\r\n    DEALINGS_IMPORT: (id) => DEALINGS(id) + '/import',\r\n    DEALINGS_EXPORT: (id) => DEALINGS(id) + '/export',\r\n    DEALINGS_WITH_CRITERION: (demandId, critId) => DEALINGS(demandId) + `/criterion/${critId}/matching`,\r\n    DEALINGS_MATCHING_CRITERION: (demandId, stageId, criteriumType) => DEALINGS(demandId) + `/stage/${stageId}/criterium/${criteriumType}/matching`\r\n}\r\n\r\nconst DEALING = (id) => `${base.DEMAND}/${id}/dealing`;\r\n\r\nconst dealing = {\r\n    DEALING_REALIZATION_VALUE: (demandId) => `${DEALING(demandId)}/realizationValue`,\r\n    DEALING_FINAL_REALIZATION_VALUE: (demandId) => `${DEALING(demandId)}/finalRealizationValue`,\r\n    DEALING_REALIZATION_VALUE_STATUS: (demandId) => `${DEALING(demandId)}/realizationValueStatus`,\r\n    DEALING_REALIZATION_VALUE_PUBLISH: (demandId) => `${DEALING(demandId)}/realizationOfferAmount/publish`,\r\n    DEALING_REALIZATION_VALUE_UNPUBLISH: (demandId) => `${DEALING(demandId)}/realizationOfferAmount/unpublish`,\r\n}\r\n\r\nconst PAPERS_GENERATOR = (id) => `${DEMAND_BASE(id)}/papersGenerator`;\r\n\r\nconst PAPERS_GENERATOR_PRINT = (identity, paper) => `${SERVER_URL}/servlet/HomeServlet?MP_module=common&MP_action=papersGeneratorPrinter&paper=${paper}&identity=${identity}`;\r\nconst PAPERS_GENERATOR_PRINT_SHARE = (identity, paper, shareSystem) => `${SERVER_URL}/servlet/HomeServlet?MP_module=common&MP_action=papersGeneratorPrinter&paper=${paper}&identity=${identity}&shareSystem=${shareSystem}`;\r\nconst PAPERS_GENERATOR_DEMAND_REPORT = (identity, report) => `${SERVER_URL}/servlet/HomeServlet?MP_module=demand&MP_action=${report}&demandIdentity=${identity}`;\r\n\r\nconst PAPERS_GENERATOR_DEMAND_ATTACHMENT_VERIFICATION_REPORT = (demandId) => `${SERVER_URL}/app/rfx/${demandId}/offer/attachment/verify/report`;\r\nconst PAPERS_GENERATOR_CORRESPONDENCE_ATTACHMENT_VERIFICATION_REPORT = (demandId) => `${SERVER_URL}/app/rfx/correspondence/buyer/${demandId}/supplier/attachments/printVerification/report`;\r\nconst PAPERS_GENERATOR_DEMAND_PROCESS_HISTORY = (demandId) => `${SERVER_URL}/servlet/HomeServlet?MP_module=demand&MP_action=demandPrintProcessHistory&documentIdentity=${demandId}&documentType=DEMAND&processConfigName=Demand`;\r\n\r\nconst papersGenerator = {\r\n    PAPERS_GENERATOR,\r\n    RFX_REQUEST_POSITION: (id) => PAPERS_GENERATOR(id) + `/rfxRequestPosition`,\r\n    SWZ_PARAMS: (id) => PAPERS_GENERATOR(id) + `/swzParams`,\r\n    RFX_INVITED_SUPPLIER_WITH_OFFER: (id) => PAPERS_GENERATOR(id) + `/rfxInvitedSupplierWithOffer`,\r\n    RFX_INVITED_SUPPLIER_POSITION: (id, supplierId) => PAPERS_GENERATOR(id) + `/${supplierId}/rfxInvitedSupplierPosition`,\r\n    SIWZ_GET_GENERATOR_PARAMS: (id) => PAPERS_GENERATOR(id) + `/swzParams`,\r\n    XMM_UZP_PRESIDENT_PAPER: (id) => PAPERS_GENERATOR(id) + `/xmlUzpPresidentPaper`,\r\n    GET_SUPPLIER_ATTACHMENTS_VERIFICATION: (id, supplierId) => PAPERS_GENERATOR(id) + `/${supplierId}/supplierAttachmentsVerification`,\r\n    PAPERS_GENERATOR_PRINT,\r\n    PAPERS_GENERATOR_PRINT_SHARE,\r\n    PAPERS_GENERATOR_DEMAND_REPORT,\r\n    PAPERS_GENERATOR_DEMAND_ATTACHMENT_VERIFICATION_REPORT,\r\n    PAPERS_GENERATOR_CORRESPONDENCE_ATTACHMENT_VERIFICATION_REPORT,\r\n    PAPERS_GENERATOR_DEMAND_PROCESS_HISTORY\r\n}\r\n\r\nconst EMAIL_LIST = (id) => `${DEMAND_BASE(id)}/emailList`;\r\n\r\nconst emailList = {\r\n    EMAIL_LIST,\r\n    EMAIL_LIST_ACTIONS: (demandId) => `${EMAIL_LIST(demandId)}/actions`,\r\n    EMAIL_DETAILS: (demandId, emailId) => `${EMAIL_LIST(demandId)}/${emailId}/details`,\r\n    EMAIL_PRINT: (demandId, emailId) => `${EMAIL_LIST(demandId)}/${emailId}/print`,\r\n}\r\n\r\nconst SCHEDULE = (id) => `${DEMAND_BASE(id)}/schedule`;\r\n\r\nconst schedule = {\r\n    SCHEDULE,\r\n    SCHEDULE_AUTOSAVE: (id) => SCHEDULE(id) + '/autoSave/' + id,\r\n    SCHEDULE_AUTOSAVE_CHECK: (id) => SCHEDULE(id) + '/autoSave/' + id + '/check',\r\n    SCHEDULE_SAVE: (id) => SCHEDULE(id) + '/save',\r\n    SCHEDULE_VALIDATE: (id) => SCHEDULE(id) + '/validate',\r\n}\r\n\r\nconst COMMISSION = (id) => `${base.DEMAND}/${id}/commission/users`;\r\n\r\nconst commission = {\r\n    COMMISSION,\r\n    COMMISSION_AUTOSAVE: (demandId) => COMMISSION(demandId) + `/autoSave/${demandId}`,\r\n    COMMISSION_AUTOSAVE_CHECK: (demandId) => COMMISSION(demandId) + `/autoSave/${demandId}/check`,\r\n    COMMISSION_VALIDATE: (id) => COMMISSION(id) + '/validate',\r\n    COMMISSION_AVAILABLE: (id) => COMMISSION(id) + `/available`,\r\n    COMMISSION_HISTORY: (id) => COMMISSION(id) + `/history`,\r\n    COMMISSION_DELETE_COMMISION_MEMBER: (demandId, id) => COMMISSION(demandId) + `/${id}`,\r\n    COMMISSION_MARK_HISTORICAL_MEMBER: (demandId, id) => COMMISSION(demandId) + `/markHistorical/${id}`,\r\n    COMMISSION_EXTERNAL: `${base.BASE}/commission/external-users`,\r\n}\r\n\r\nconst GUARANTEE = (id) => `${base.DEMAND}/${id}/guarantee`;\r\nconst GUARANTEE_AUTOSAVE = (id) => `${GUARANTEE(id)}/autoSave/${id}`;\r\n\r\nconst guarantee = {\r\n    GUARANTEE,\r\n    GUARANTEE_VALIDATE: (id) => GUARANTEE(id) + '/validate',\r\n    GUARANTEE_AUTOSAVE: (id) => GUARANTEE_AUTOSAVE(id),\r\n    GUARANTEE_AUTOSAVE_CHECK: (id) => GUARANTEE_AUTOSAVE(id) + '/check'\r\n}\r\n\r\nconst ESPD = (id) => `${base.ESPD}/${id}`;\r\nconst ESPD_AUTOSAVE = (id) => `${base.ESPD}/autoSave/${id}`;\r\n\r\nconst espd = {\r\n    ESPD,\r\n    ESPD_SAVE: (id) => ESPD(id) + `/save`,\r\n    ESPD_VALIDATE: (id) => ESPD(id) + '/validate',\r\n    ESPD_AUTOSAVE: (id) => ESPD_AUTOSAVE(id),\r\n    ESPD_AUTOSAVE_CHECK: (id) => ESPD_AUTOSAVE(id) + `/check`,\r\n    ESPD_EXPORT_FOR_DEMAND: (dealingId) => `${ESPD(dealingId)}/export`,\r\n    ESPD_EXPORT_FOR_DEALING: (demandId, dealingId) => `${ESPD(demandId)}/dealing/${dealingId}/export`,\r\n    ESPD_PRINT_FOR_DEMAND: (dealingId) => `${ESPD(dealingId)}/print`,\r\n    ESPD_PRINT_FOR_DEALING: (demandId, dealingId) => `${ESPD(demandId)}/dealing/${dealingId}/print`,\r\n}\r\n\r\nconst CONTRACTOR = (id) => `${DEMAND_BASE(id)}/contractor`;\r\nconst CONTRACTOR_INVITE = (id) => CONTRACTOR(id) + '/invite';\r\n\r\nconst contractor = {\r\n    CONTRACTOR_ADD: (id) => CONTRACTOR(id) + '/add',\r\n    CONTRACTOR_GET_LIST: (id) => CONTRACTOR(id) + '/list',\r\n    CONTRACTOR_GET_DETAILS: (id, contractorDepartmentId) => CONTRACTOR(id) + `/getContractorData/${contractorDepartmentId}`,\r\n    CONTRACTOR_REMOVE: (id) => CONTRACTOR(id) + '/remove',\r\n    CONTRACTOR_ONEPLACE: (id) => CONTRACTOR(id) + `/onePlace`,\r\n    CONTRACTOR_VALIDATE: (id) => CONTRACTOR(id) + '/validate',\r\n    CONTRACTOR_INVITE,\r\n    CONTRACTOR_CHECK: (id) => CONTRACTOR_INVITE(id) + '/check',\r\n    CONTRACTOR_GET_NIP_LIST: (id) => CONTRACTOR_INVITE(id) + '/nipprefix',\r\n}\r\n\r\nconst CONTRACTOR_VERIFICATION = (id) => `${DEMAND_BASE(id)}/evaluation/contractor`;\r\nconst contractorVerification = {\r\n    CONTRACTOR_VERIFICATION_LIST: (id) => CONTRACTOR_VERIFICATION(id) + \"/list\",\r\n    CONTRACTOR_VERIFICATION_STATUS: (id) => CONTRACTOR_VERIFICATION(id) + \"/status\",\r\n    CONTRACTOR_VERIFICATION_PROCEDURE: (id) => CONTRACTOR_VERIFICATION(id) + \"/procedure\",\r\n    CONTRACTOR_VERIFICATION_VALIDATE: (id) => CONTRACTOR_VERIFICATION(id) + \"/validate\"\r\n}\r\n\r\nconst user = {\r\n    USER_DATA: base.USER + '/data',\r\n    USER_PROFILE: base.USER + '/profile',\r\n    USER_LOGGED_MENU_LIST: base.USER + '/logged/menu/list',\r\n    USER_SESSION_TIME: base.USER + '/sessionTime',\r\n    USER_SERVER_TIME: base.USER + '/serverTime',\r\n}\r\n\r\nconst header = {\r\n    HEADER: (id) => DEMAND_BASE(id) + '/header'\r\n}\r\n\r\nconst client = {\r\n    CLIENT_LOGO: BASE + '/client/logo',\r\n    CLIENT_COLORS: BASE + '/client/colors'\r\n}\r\n\r\nconst publish = {\r\n    PUBLISH_DEMAND: (id) => DEMAND_BASE(id) + '/publish',\r\n    IS_PUBLISH_DEMAND: (id) => DEMAND_BASE(id) + '/published',\r\n    PUBLISH_OJS_NOTICE: (id) => DEMAND_BASE(id) + '/publication/ojs/publish',\r\n    ROLLBACK_OJS_NOTICE: (id) => DEMAND_BASE(id) + '/publication/ojs/rollback',\r\n    CHECK_OJS_NOTICE: (id) => DEMAND_BASE(id) + '/publication/ojs/status',\r\n    CHECK_PUBLICATION_LIMIT: (id) => DEMAND_BASE(id) + '/publication/checkLimit',\r\n    PUBLISH_DEMAND_EX_POST: (id) => DEMAND_BASE(id) + '/exPost/goToFinish'\r\n}\r\n\r\nconst NOTICE = (id) => `${DEMAND_BASE(id)}/notice`;\r\n\r\nconst notice = {\r\n    NOTICE,\r\n    NOTICE_PREVIEW: (id) => NOTICE(id) + '/preview',\r\n    NOTICE_DOWNLOAD_PREVIEW: (id) => NOTICE(id) + '/printPreview', //print instead of download\r\n    NOTICE_VALIDATE: (id) => NOTICE(id) + '/validate',\r\n}\r\n\r\nconst SIWZ = (demandId) => `${base.DEMAND}/${demandId}/siwz`;\r\nconst SIWZ_ID = (demandId, id, source) => `${SIWZ(demandId)}/${source}/${id}`;\r\n\r\nconst siwz = {\r\n    SIWZ,\r\n    SIWZ_MOVE_FROM_REPO: (demandId) => SIWZ(demandId) + '/moveFromRepo',\r\n    SIWZ_VALIDATE: (demandId) => SIWZ(demandId) + '/validate',\r\n    SIWZ_VALIDATE_DOCUMENTS: (demandId) => SIWZ(demandId) + '/validate/documents',\r\n    SIWZ_ID,\r\n    SIWZ_ID_DOWNLOAD_HISTORY: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/downloadHistory`,\r\n    SIWZ_ID_UPDATE_DESCRIPTION: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/updateDescription`,\r\n    SIWZ_ID_UPDATE_NOTICE_REFERENCE_NUMBER: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/updateNoticeNumber`,\r\n    SIWZ_ID_UPDATE_SHARE: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/share`,\r\n    SIWZ_ID_UPDATE_STATUS: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/updateStatus`,\r\n    SIWZ_ID_PUBLISH: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/publish`,\r\n    SIWZ_ID_VERSIONS: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/versions`,\r\n    SIWZ_ID_UNPUBLISH: (demandId, id, source) => SIWZ_ID(demandId, id, source) + `/unpublish`,\r\n    SIWZ_ID_GET_DOWNLOAD_URL: (demandId, id, source, openInBrowser) => SIWZ_ID(demandId, id, source) + `/url/${openInBrowser ? 'open' : 'download'}`,\r\n    SIWZ_EDITABLE: (demandId) => SIWZ(demandId) + '/editable',\r\n    SIWZ_TYPES: (demandId) => SIWZ(demandId) + `/types`,\r\n    SIWZ_DOWNLOAD_ALL: (demandId) => SIWZ(demandId) + `/downloadZip`,\r\n    SIWZ_ADD_BZP_NOTICE: (demandId) => SIWZ(demandId) + `/bzpNotice`,\r\n    SIWZ_POST_PRINT_SWZ: (demandId) => SIWZ(demandId) + `/printSwz`,\r\n    SIWZ_POST_SHARE_SWZ: (demandId) => SIWZ(demandId) + `/shareSwz`,\r\n}\r\n\r\nconst STATISTIC_CURRENT_ROUND = (demandId) => `${base.DEMAND}/${demandId}/statistic/getCurrentRound`;\r\nconst STATISTIC = (demandId, roundId) => `${base.DEMAND}/${demandId}/statistic/${roundId}`;\r\n\r\nconst statistic = {\r\n    STATISTIC_CURRENT_ROUND,\r\n    STATISTIC,\r\n}\r\n\r\nconst SUPPLIERS = (demandId, roundId) => `${base.DEMAND}/${demandId}/rfx/${roundId}/supplier`;\r\nconst supplier = {\r\n    SUPPLIERS_ADD: (demandId, roundId) => `${SUPPLIERS(demandId, roundId)}/add`,\r\n    SUPPLIERS_INVITE: (demandId, roundId) => `${SUPPLIERS(demandId, roundId)}/invite`,\r\n    SUPPLIERS_LIST: (demandId, roundId) => `${SUPPLIERS(demandId, roundId)}/list`,\r\n    SUPPLIERS_CHANGE_EXTERNAL_SIGN: (demandId, roundId, supplierId) => `${SUPPLIERS(demandId, roundId)}/${supplierId}/externalOfferSign`\r\n}\r\n\r\nconst rfxRound = {\r\n    RFX_ROUND_CANCEL: (roundId) => `${RFX_BASE(roundId)}/cancel`,\r\n    RFX_ROUND_PRIVILEGES: (roundId) => `${RFX_BASE(roundId)}/privileges`,\r\n}\r\n\r\nconst RFX_OFFERS_BASE = (roundId) => `${RFX_BASE(roundId)}/offer`;\r\nconst RFX_DECRYPTION_BASE = (roundId) => `${RFX_BASE(roundId)}/decryption`;\r\nconst offers = {\r\n    RFX_OFFERS_LIST: (roundId) => `${RFX_OFFERS_BASE(roundId)}/list`,\r\n    RFX_OFFERS_SEND_INVITE: (roundId) => `${RFX_OFFERS_BASE(roundId)}/sendInvite`,\r\n    RFX_OFFERS_ATTACHMENTS: (roundId) => `${RFX_OFFERS_BASE(roundId)}/attachments`,\r\n    RFX_OFFERS_VERIFY_ATTACHMENTS: (roundId) => `${RFX_OFFERS_BASE(roundId)}/verifyAttachments`,\r\n    RFX_OFFERS_ENVELOPE: (roundId) => `${RFX_OFFERS_BASE(roundId)}/envelope`,\r\n    RFX_OFFERS_ENVELOPE_ID: (roundId, offerEnvelopeId) => `${RFX_OFFERS_BASE(roundId)}/envelope/${offerEnvelopeId}`,\r\n    RFX_OFFERS_ADDITIONAL_ROUND_OFFERS: (roundId, supplierId) => `${RFX_OFFERS_BASE(roundId)}/supplier/${supplierId}/additionalRoundOffers`,\r\n    RFX_OFFERS_ACTIONS: (roundId) => `${RFX_OFFERS_BASE(roundId)}/actions`,\r\n    RFX_OFFERS_SUMMARY: (roundId, type) => `${RFX_OFFERS_BASE(roundId)}/summary/${type}`,\r\n    RFX_OFFERS_PUBLIC_SESSION_START: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/processPublicSession`,\r\n    RFX_OFFERS_PUBLIC_SESSION_STATUS: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/publicSessionStatus`,\r\n    RFX_OFFERS_PUBLIC_SESSION_PROGRESS: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/publicSessionProgress`,\r\n    RFX_OFFERS_DECRYPTION_START: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/processOfferDecryption`,\r\n    RFX_OFFERS_DECRYPTION_STATUS: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/offerDecryptionStatus`,\r\n    RFX_OFFERS_DECRYPTION_STATUS_LIGHT: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/offerDecryptionStatusLight`,\r\n    RFX_OFFERS_DECRYPTION_PROGRESS: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/offerDecryptionProgress`,\r\n    RFX_OFFERS_PUBLIC_SESSION_ONLINE_SAVE: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/saveSessionOnline`,\r\n    RFX_OFFERS_PUBLIC_SESSION_ONLINE_STATUS: (roundId) => `${RFX_DECRYPTION_BASE(roundId)}/publicSessionOnlineStatus`\r\n}\r\n\r\nconst REPO = (demandId) => `${DEMAND_BASE(demandId)}/repo`;\r\nconst REPO_FOLDER = (demandId, folderId) => REPO(demandId) + `/folder/${folderId}`;\r\nconst REPO_FILE = (demandId, fileId) => REPO(demandId) + `/file/${fileId}`;\r\n\r\nconst repo = {\r\n    REPO,\r\n    REPO_EDITABLE: (demandId) => REPO(demandId) + \"/editable\",\r\n    REPO_PUBLISH_OPENING_OFFER_FOLDER: (demandId) => REPO(demandId) + \"/publishOpeningOfferFolder\",\r\n    REPO_VISIBILITY_TYPES: (demandId) => REPO(demandId) + \"/visibilityTypes\",\r\n    REPO_FOLDER,\r\n    REPO_FILES_VISIBILITY: (demandId, folderId) => REPO_FOLDER(demandId, folderId) + \"/filesVisibility\",\r\n    REPO_FOLDER_SHARE: (demandId, folderId) => REPO_FOLDER(demandId, folderId) + \"/share\",\r\n    REPO_DOWNLOAD_ALL: (demandId, folderId) => REPO_FOLDER(demandId, folderId) + \"/downloadZip\",\r\n    REPO_DELETE_ALL_FOLDER_FILES: (demandId, folderId) => REPO_FOLDER(demandId, folderId) + \"/allFiles\",\r\n    REPO_FILE,\r\n    REPO_FILE_VISIBILITY: (demandId, fileId) => REPO_FILE(demandId, fileId) + \"/visibility\",\r\n    REPO_FILE_SHARE: (demandId, fileId) => REPO_FILE(demandId, fileId) + \"/share\",\r\n    REPO_FILE_DOWNLOAD_HISTORY: (demandId, fileId) => REPO_FILE(demandId, fileId) + \"/downloadHistory\",\r\n    REPO_FILE_UPDATE_DESCRIPTION: (demandId, fileId) => REPO_FILE(demandId, fileId) + \"/updateDescription\",\r\n    REPO_FILE_GET_DOWNLOAD_URL: (demandId, fileId, openInBrowser) => REPO_FILE(demandId, fileId) + `/url/${openInBrowser ? 'open' : 'download'}`\r\n}\r\n\r\nconst DEMAND_MODIFICATION = (demandId) => `${DEMAND_BASE(demandId)}/modify`;\r\n\r\nconst modification = {\r\n    DEMAND_MODIFICATION,\r\n    DEMAND_MODIFICATION_PUBLISH: (demandId) => DEMAND_MODIFICATION(demandId) + \"/publish\",\r\n    DEMAND_MODIFICATION_CANCEL: (demandId) => DEMAND_MODIFICATION(demandId) + \"/rollback\",\r\n    DEMAND_MODIFICATION_PUBLISH_OJS: (demandId) => DEMAND_MODIFICATION(demandId) + \"/ojs/publish\",\r\n    DEMAND_MODIFICATION_ROLLBACK_OJS: (demandId) => DEMAND_MODIFICATION(demandId) + \"/ojs/rollback\",\r\n    DEMAND_MODIFICATION_OJS_STATUS: (demandId) => DEMAND_MODIFICATION(demandId) + \"/ojs/status\",\r\n    DEMAND_MODIFICATION_CHANGED: (demandId) => DEMAND_MODIFICATION(demandId) + \"/changed\"\r\n}\r\n\r\nconst DEMAND_SECTIONS = (demandId) => `${DEMAND_BASE(demandId)}/sections`;\r\n\r\nconst sections = {\r\n    DEMAND_PREPARING_SECTIONS: (demandId) => `${DEMAND_SECTIONS(demandId)}/preparing`,\r\n    DEMAND_EVALUATION_SECTIONS: (demandId) => `${DEMAND_SECTIONS(demandId)}/evaluation`,\r\n    DEMAND_FINISHING_SECTIONS: (demandId) => `${DEMAND_SECTIONS(demandId)}/finishing`\r\n}\r\n\r\nconst OFFER_EVALUATION = (demandId) => `${DEMAND_BASE(demandId)}/evaluation/offer`;\r\n\r\nconst offerEvaluation = {\r\n    OFFER_EVALUATION_LIST: (demandId, viewMode, roundType) => `${OFFER_EVALUATION(demandId)}/${viewMode}/${roundType}`,\r\n    OFFER_EVALUATION_LIST_UPDATE_STATUS: (demandId, viewMode, roundType) => `${OFFER_EVALUATION(demandId)}/${viewMode}/${roundType}/changeOfferStatus`,\r\n    OFFER_EVALUATION_LIST_UPDATE_SCORE: (demandId, viewMode, roundType) => `${OFFER_EVALUATION(demandId)}/${viewMode}/${roundType}/changeCriterionScore`,\r\n    OFFER_EVALUATION_VALIDATE: (demandId) => `${OFFER_EVALUATION(demandId)}/validate`\r\n}\r\n\r\n\r\nconst OFFER_CHOICE = (demandId) => `${DEMAND_BASE(demandId)}/evaluation/choice`;\r\n\r\nconst offerChoice = {\r\n    OFFER_CHOICE: (demandId) => `${OFFER_CHOICE(demandId)}`,\r\n    OFFER_CHOICE_CANCEL_WHERE_NO_OFFERS: (demandId) => `${OFFER_CHOICE(demandId)}/cancelWhereNoOffers`,\r\n    OFFER_CHOICE_POSITIONS_WITH_NO_OFFER: (demandId) => `${OFFER_CHOICE(demandId)}/positionWithNoOffer`,\r\n    OFFER_CHOICE_PREPARE_ADDITIONAL_ROUND: (demandId, roundType) => `${OFFER_CHOICE(demandId)}/prepareAdditionalRound/${roundType.toLowerCase()}`,\r\n    OFFER_CHOICE_PREPARE_AUCTION_INFO: (demandId, positionId) => `${OFFER_CHOICE(demandId)}/prepareAuctionInfo/${positionId}`,\r\n    OFFER_CHOICE_REVOKE: (demandId, positionId) => `${OFFER_CHOICE(demandId)}/position/${positionId}/revoke`,\r\n    OFFER_CHOICE_CREATE_ADDITIONAL_ROUND: (demandId) => `${OFFER_CHOICE(demandId)}/createAdditionalRound`,\r\n    OFFER_CHOICE_GET_POSITION: (demandId, positionId) => `${OFFER_CHOICE(demandId)}/position/${positionId}`,\r\n    OFFER_CHOICE_VALIDATE: (demandId) => `${OFFER_CHOICE(demandId)}/validate`,\r\n    OFFER_CHOICE_JUSTIFICATIONS: (demandId) => `${OFFER_CHOICE(demandId)}/choiceJustificationBasis`,\r\n    OFFER_CHOICE_PRIMARY_CHECK: (demandId) => `${OFFER_CHOICE(demandId)}/primaryTenderPathChoice/check`,\r\n    OFFER_CHOICE_PRIMARY_DO_NEGOTIATIONS: (demandId) => `${OFFER_CHOICE(demandId)}/primaryTenderPathChoice/doNegotiations`,\r\n    OFFER_CHOICE_PRIMARY_DO_OFFER_CHOICE: (demandId) => `${OFFER_CHOICE(demandId)}/primaryTenderPathChoice/chooseOffers`,\r\n}\r\n\r\nconst ADDITIONAL_ROUND = (demandId) => `${DEMAND_BASE(demandId)}/evaluation/additionalRound`;\r\nconst additionalRound = {\r\n    ADDITIONAL_ROUND_CHANGE_DATES: (demandId) => `${ADDITIONAL_ROUND(demandId)}/changeDates`\r\n}\r\n\r\nconst DEMAND_ADDITIONAL_INFO = (demandId) => `${DEMAND_BASE(demandId)}/additionalInfo`;\r\nconst demandAdditionalInfo = {\r\n    DEMAND_ADDITIONAL_INFO: DEMAND_ADDITIONAL_INFO,\r\n    DEMAND_ADDITIONAL_INFO_VALIDATE: (id) => DEMAND_ADDITIONAL_INFO(id) + \"/validate\",\r\n    DEMAND_ADDITIONAL_INFO_AUTOSAVE: (id) => `${DEMAND_ADDITIONAL_INFO(id)}/autoSave/${id}`,\r\n    DEMAND_ADDITIONAL_INFO_AUTOSAVE_CHECK: (id) => `${DEMAND_ADDITIONAL_INFO(id)}/autoSave/${id}/check`\r\n}\r\n\r\nconst AUCTION = (demandId) => `${DEMAND_BASE(demandId)}/auction`;\r\nconst AUCTION_RFX = (demandId, roundId) => `${AUCTION(demandId)}/${roundId}`;\r\n\r\nconst auction = {\r\n    AUCTION_PREPARE: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/prepare`,\r\n    AUCTION_CREATE: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/create`,\r\n    AUCTION_EDIT_DATES: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/editDates`,\r\n    AUCTION_PUBLISH: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/publish`,\r\n    AUCTION_UNPUBLISH: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/unpublish`,\r\n    AUCTION_PAUSE: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/pause`,\r\n    AUCTION_RESUME: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/resume`,\r\n    AUCTION_CANCEL: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/cancel`,\r\n    AUCTION_DELETE: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/delete`,\r\n    AUCTION_DOWNLOAD_INVITATION: (demandId, roundId) => `${AUCTION_RFX(demandId, roundId)}/auctionInvitation`,\r\n    AUCTION_ACCEPT: (demandId, roundId, auctionId) => `${AUCTION_RFX(demandId, roundId)}/accept/${auctionId}`,\r\n    AUCTION_DETAILS: (demandId, roundId, auctionId) => `${AUCTION_RFX(demandId, roundId)}/details/${auctionId}`,\r\n}\r\n\r\nconst OFFER_CHOICE_RESULT = (demandId) => `${DEMAND_BASE(demandId)}/evaluation/result`;\r\nconst OFFER_CHOICE_RESULT_ID = (demandId, roundResultId) => `${OFFER_CHOICE_RESULT(demandId)}/${roundResultId}`;\r\nconst OFFER_CHOICE_RESULT_FILE = (demandId, roundResultId) => `${OFFER_CHOICE_RESULT_ID(demandId, roundResultId)}/file`;\r\nconst OFFER_CHOICE_RESULT_FILE_ID = (demandId, roundResultId, resultFileId) => `${OFFER_CHOICE_RESULT_FILE(demandId, roundResultId)}/${resultFileId}`;\r\n\r\nconst offerChoiceResult = {\r\n    OFFER_CHOICE_RESULT: (demandId) => `${OFFER_CHOICE_RESULT(demandId)}`,\r\n    OFFER_CHOICE_RESULT_GET: (demandId, roundResultId) => `${OFFER_CHOICE_RESULT_ID(demandId, roundResultId)}/get`,\r\n    OFFER_CHOICE_RESULT_PRINT: (demandId, roundResultId) => `${OFFER_CHOICE_RESULT_ID(demandId, roundResultId)}/print`,\r\n    OFFER_CHOICE_RESULT_SHARE: (demandId, roundResultId) => `${OFFER_CHOICE_RESULT_ID(demandId, roundResultId)}/share`,\r\n    OFFER_CHOICE_RESULT_PUBLISH_UNTIL_DATE: (demandId, roundResultId) => `${OFFER_CHOICE_RESULT_ID(demandId, roundResultId)}/publishUntilDate`,\r\n    OFFER_CHOICE_RESULT_FILE: (demandId, roundResultId) => OFFER_CHOICE_RESULT_FILE(demandId, roundResultId),\r\n    OFFER_CHOICE_RESULT_FILE_PUBLISH: (demandId, roundResultId, resultFileId) => `${OFFER_CHOICE_RESULT_FILE_ID(demandId, roundResultId, resultFileId)}/publish`,\r\n    OFFER_CHOICE_RESULT_FILE_UNPUBLISH: (demandId, roundResultId, resultFileId) => `${OFFER_CHOICE_RESULT_FILE_ID(demandId, roundResultId, resultFileId)}/unpublish`,\r\n    OFFER_CHOICE_RESULT_FILE_DELETE: (demandId, roundResultId, resultFileId) => `${OFFER_CHOICE_RESULT_FILE_ID(demandId, roundResultId, resultFileId)}/delete`,\r\n    OFFER_CHOICE_RESULT_FILE_DOWNLOAD_HISTORY: (demandId, roundResultId, resultFileId) => `${OFFER_CHOICE_RESULT_FILE_ID(demandId, roundResultId, resultFileId)}/history`,\r\n    OFFER_CHOICE_RESULT_FILE_SHARE: (demandId, roundResultId, resultFileId) => `${OFFER_CHOICE_RESULT_FILE_ID(demandId, roundResultId, resultFileId)}/share`,\r\n    OFFER_CHOICE_RESULT_FILE_DOWNLOAD_URL: (demandId, roundResultId, resultFileId, openInBrowser) => `${OFFER_CHOICE_RESULT_FILE_ID(demandId, roundResultId, resultFileId)}/url/${openInBrowser ? \"open\" : \"download\"}`,\r\n    OFFER_CHOICE_RESULT_VALIDATE: (demandId) => `${OFFER_CHOICE_RESULT(demandId)}/validate`\r\n}\r\n\r\nconst AGREEMENTS = (demandId) => `${DEMAND_BASE(demandId)}/evaluation/agreement`;\r\n\r\nconst agreements = {\r\n    AGREEMENTS_AVAILABLE: (demandId) => `${AGREEMENTS(demandId)}/without`,\r\n    AGREEMENTS_CREATED: (demandId) => `${AGREEMENTS(demandId)}/created`,\r\n    AGREEMENTS_CREATE_NO_AGREEMENT: (demandId) => `${AGREEMENTS(demandId)}/createNoAgreement`,\r\n    AGREEMENTS_CREATE_AGREEMENT: (demandId) => `${AGREEMENTS(demandId)}/createAgreement`,\r\n    AGREEMENTS_AVAILABLE_ORGANIZATIONS: (demandId) => `${AGREEMENTS(demandId)}/organizations`,\r\n    AGREEMENTS_DELETE: (demandId, objId) => `${AGREEMENTS(demandId)}/delete/extObj/${objId}`,\r\n    AGREEMENTS_DELETE_AGR: (demandId, objId) => `${AGREEMENTS(demandId)}/delete/agreement/${objId}`,\r\n    AGREEMENTS_VALIDATE: (demandId) => `${AGREEMENTS(demandId)}/validate`\r\n}\r\n\r\nconst RESULT_NOTICE = (demandId) => `${DEMAND_BASE(demandId)}/resultNotice`;\r\nconst RESULT_NOTICE_ID = (demandId, resultNoticeId) => `${DEMAND_BASE(demandId)}/resultNotice/${resultNoticeId}`;\r\nconst RESULT_NOTICE_ATTACHMENT_ID = (demandId, resultNoticeId, resultNoticeAttachmentId) => `${RESULT_NOTICE_ID(demandId, resultNoticeId)}/file/${resultNoticeAttachmentId}`;\r\n\r\nconst resultNotice = {\r\n    RESULT_NOTICE: (demandId) => `${RESULT_NOTICE(demandId)}`,\r\n    RESULT_NOTICE_BZP: (demandId) => RESULT_NOTICE(demandId) + `/bzpNotice`,\r\n    RESULT_NOTICE_PUBLISH_OJS_NOTICE: (demandId) => `${RESULT_NOTICE(demandId)}/publication/ojs/publish`,\r\n    RESULT_NOTICE_CHECK_OJS_NOTICE: (demandId) => `${RESULT_NOTICE(demandId)}/publication/ojs/check`,\r\n    RESULT_NOTICE_ROLLBACK_OJS_NOTICE: (demandId) => `${RESULT_NOTICE(demandId)}/publication/ojs/rollback`,\r\n    RESULT_NOTICE_ID: (demandId, resultNoticeId) => `${RESULT_NOTICE_ID(demandId, resultNoticeId)}`,\r\n    RESULT_NOTICE_VALIDATE: (demandId) => `${RESULT_NOTICE(demandId)}/validate`,\r\n    RESULT_NOTICE_DELETE: (demandId, resultNoticeId, resultNoticeAttachmentId) => `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/delete`,\r\n    RESULT_NOTICE_PUBLISH: (demandId) => `${RESULT_NOTICE(demandId)}/publish`,\r\n    RESULT_NOTICE_UNPUBLISH: (demandId) => `${RESULT_NOTICE(demandId)}/unpublish`,\r\n    RESULT_NOTICE_ATTACHMENT_PUBLISH: (demandId, resultNoticeId, resultNoticeAttachmentId) => `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/publish`,\r\n    RESULT_NOTICE_ATTACHMENT_UNPUBLISH: (demandId, resultNoticeId, resultNoticeAttachmentId) => `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/unpublish`,\r\n    RESULT_NOTICE_DESCRIPTION: (demandId, resultNoticeId, resultNoticeAttachmentId) => `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/description`,\r\n    RESULT_NOTICE_REFERENCE_NUMBER: (demandId, resultNoticeId, resultNoticeAttachmentId) => `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/noticeReferenceNumber`,\r\n    RESULT_NOTICE_DOWNLOAD_FILE_URL: (demandId, resultNoticeId, resultNoticeAttachmentId, openInBrowser) =>\r\n        `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/url/${openInBrowser ? \"open\" : \"download\"}`,\r\n    RESULT_NOTICE_DOWNLOAD_FILE_HISTORY: (demandId, resultNoticeId, resultNoticeAttachmentId) =>\r\n        `${RESULT_NOTICE_ATTACHMENT_ID(demandId, resultNoticeId, resultNoticeAttachmentId)}/downloadHistory`\r\n}\r\n\r\nconst EVALUATION_FINISH = (demandId) => `${DEMAND_BASE(demandId)}/evaluation/finish`;\r\nconst evaluationFinish = {\r\n    EVALUATION_FINISH: (demandId) => `${EVALUATION_FINISH(demandId)}`\r\n}\r\n\r\nconst DEMAND_PLAN_REALIZATION = (demandId) => `${DEMAND_BASE(demandId)}/planRealization`;\r\nconst demandPlanRealization = {\r\n    DEMAND_PLAN_REALIZATION: (demandId) => `${DEMAND_PLAN_REALIZATION(demandId)}`,\r\n    DEMAND_PLAN_REALIZATION_VALIDATE: (demandId) => `${DEMAND_PLAN_REALIZATION(demandId)}/validate`\r\n}\r\n\r\nconst FINISH_DEMAND = (demandId) => `${DEMAND_BASE(demandId)}/finish`;\r\nconst finishDemand = {\r\n    FINISH_DEMAND: (demandId) => `${FINISH_DEMAND(demandId)}`,\r\n    FINISH_DEMAND_BACK_TO_OFFER_EVALUATION: (demandId) => `${FINISH_DEMAND(demandId)}/backToOfferEvaluation`,\r\n    FINISH_DEMAND_BACK_TO_RESULT_NOTICE: (demandId) => `${FINISH_DEMAND(demandId)}/backToResultNotice`,\r\n    FINISH_DEMAND_WITHDRAWAL_NOTICE_DATE: (demandId) => `${FINISH_DEMAND(demandId)}/withdrawalNoticeDate`,\r\n    FINISH_DEMAND_CANCEL: (demandId) => `${FINISH_DEMAND(demandId)}/cancelDemand`,\r\n    FINISH_DEMAND_FINISH: (demandId) => `${FINISH_DEMAND(demandId)}/finishDemand`,\r\n    FINISH_DEMAND_VALIDATE: (demandId) => `${FINISH_DEMAND(demandId)}/validate`\r\n}\r\n\r\nconst ARCHIVING = (demandId) => `${DEMAND_BASE(demandId)}/archiving`;\r\nconst archiving = {\r\n    ARCHIVING: (demandId) => `${ARCHIVING(demandId)}`,\r\n    ARCHIVING_SCHEDULE: (demandId) => `${ARCHIVING(demandId)}/scheduleArchive`,\r\n    ARCHIVING_VALIDATE: (demandId) => `${ARCHIVING(demandId)}/validate`\r\n}\r\n\r\nconst ADDITIONAL_ROUNDS_PASSIVE = (demandId) => `${DEMAND_BASE(demandId)}/additionalRoundPassive`;\r\nconst additionalRoundsPassive = {\r\n    ADDITIONAL_ROUNDS_PASSIVE: (demandId) => `${ADDITIONAL_ROUNDS_PASSIVE(demandId)}`,\r\n    ADDITIONAL_ROUNDS_PASSIVE_ROUND: (demandId, roundId) => `${ADDITIONAL_ROUNDS_PASSIVE(demandId)}/round/${roundId}`,\r\n    ADDITIONAL_ROUNDS_PASSIVE_AVAILABLE_CONTRACTORS: (demandId) => `${ADDITIONAL_ROUNDS_PASSIVE(demandId)}/availableContractors`,\r\n    ADDITIONAL_ROUNDS_PASSIVE_VALIDATE: (demandId) => `${ADDITIONAL_ROUNDS_PASSIVE(demandId)}/validate`\r\n}\r\n\r\nconst CORRESPONDENCE_BASE = `${base.RFX}/correspondence`;\r\n\r\nconst CORRESPONDENCE_BUYER_BASE = (roundId) => `${CORRESPONDENCE_BASE}/buyer/${roundId}`;\r\n\r\nconst correspondenceBuyer = {\r\n    CORRESPONDENCE_BUYER_CTR_IN_ROUND: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/getContractorsInRound`,\r\n    CORRESPONDENCE_BUYER_THREAD_LIST: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/list`,\r\n    CORRESPONDENCE_BUYER_NEW_MESSAGES: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/newMessages`,\r\n    CORRESPONDENCE_BUYER_SEARCH: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/search`,\r\n\r\n    CORRESPONDENCE_BUYER_THREAD_ADD: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/add`,\r\n    CORRESPONDENCE_BUYER_THREAD_AS_CRT_SEND: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/asContractor/thread/send`,\r\n    CORRESPONDENCE_BUYER_BULK_MESSAGES_SEND: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/bulk/message/send`,\r\n    CORRESPONDENCE_BUYER_BULK_MESSAGES_PUBLISH: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/bulk/message/publish`,\r\n    CORRESPONDENCE_BUYER_PRIVILEGES: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/privileges`,\r\n    CORRESPONDENCE_BUYER_PRINT: (roundId, type, before) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/${type}/${before === true ? \"before\" : (before === false ? \"after\" : \"all\")}/print`,\r\n    CORRESPONDENCE_BUYER_SHARE: (roundId, type, before) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/${type}/${before === true ? \"before\" : (before === false ? \"after\" : \"all\")}/share`,\r\n\r\n    CORRESPONDENCE_BUYER_MESSAGE_LIST: (roundId, threadId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/${threadId}/message/list`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_CREATE: (roundId, threadId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/${threadId}/message/create`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_MARK_AS_READ: (roundId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/messages/markAsRead`,\r\n    CORRESPONDENCE_BUYER_FLAG: (roundId, threadId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/${threadId}/flag`,\r\n    CORRESPONDENCE_BUYER_UNFLAG: (roundId, threadId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/${threadId}/unflag`,\r\n    CORRESPONDENCE_BUYER_THREAD_EMAIL_LIST: (roundId, threadId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/thread/${threadId}/emailList`,\r\n\r\n    CORRESPONDENCE_BUYER_MESSAGE_SEND: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/send`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_PUBLISH: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/publish`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_UPDATE: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/update`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_DELETE: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/delete`,\r\n\r\n    CORRESPONDENCE_BUYER_ATTACHMENT_URL: (roundId, attachmentId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/attachment/${attachmentId}/url`,\r\n\r\n    CORRESPONDENCE_BUYER_MESSAGE_EMAIL_DELIVERY: (roundId, messageId, type, identity) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/emailDelivery/${type}/${identity}`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_ZIP: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/attachments`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_CHECK_LIMIT: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/attachments/checkVerificationLimit`,\r\n    CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_VERIFY: (roundId, messageId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/message/${messageId}/attachments/printVerification`,\r\n    CORRESPONDENCE_BUYER_CONTRACTOR_EMAIL_LIST: (roundId, departmentId) => `${CORRESPONDENCE_BUYER_BASE(roundId)}/contractor/${departmentId}/emailList`,\r\n}\r\n\r\nconst CORRESPONDENCE_CONTRACTOR_BASE = (roundId) => `${CORRESPONDENCE_BASE}/contractor/${roundId}`;\r\n\r\nconst correspondenceContractor = {\r\n    CORRESPONDENCE_CONTRACTOR_THREAD_LIST: (roundId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/thread/list`,\r\n    CORRESPONDENCE_CONTRACTOR_NEW_MESSAGES: (roundId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/newMessages`,\r\n    CORRESPONDENCE_CONTRACTOR_SEARCH: (roundId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/search`,\r\n\r\n    CORRESPONDENCE_CONTRACTOR_THREAD_ADD: (roundId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/thread/add`,\r\n    CORRESPONDENCE_CONTRACTOR_PRIVILEGES: (roundId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/privileges`,\r\n    CORRESPONDENCE_CONTRACTOR_PRINT: (roundId, type, before) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/${type}/${before === true ? \"before\" : (before === false ? \"after\" : \"all\")}/print`,\r\n\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_LIST: (roundId, threadId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/thread/${threadId}/message/list`,\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_CREATE: (roundId, threadId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/thread/${threadId}/message/create`,\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_MARK_AS_READ: (roundId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/messages/markAsRead`,\r\n    CORRESPONDENCE_CONTRACTOR_FLAG: (roundId, threadId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/thread/${threadId}/flag`,\r\n    CORRESPONDENCE_CONTRACTOR_UNFLAG: (roundId, threadId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/thread/${threadId}/unflag`,\r\n\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_UPDATE: (roundId, messageId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/message/${messageId}/update`,\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_SEND: (roundId, messageId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/message/${messageId}/send`,\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_DELETE: (roundId, messageId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/message/${messageId}/delete`,\r\n\r\n    CORRESPONDENCE_CONTRACTOR_ATTACHMENT_URL: (roundId, attachmentId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/attachment/${attachmentId}/url`,\r\n\r\n    CORRESPONDENCE_CONTRACTOR_MESSAGE_ATTACHMENTS_ZIP: (roundId, messageId) => `${CORRESPONDENCE_CONTRACTOR_BASE(roundId)}/message/${messageId}/attachments`,\r\n}\r\n\r\nconst DEMAND_OFFERS_BASE = (id) => `${DEMAND_BASE(id)}/offers`\r\nconst DEMAND_OFFERS_STAGE_BASE = (id, stageId) => `${DEMAND_OFFERS_BASE(id)}/${stageId}`\r\n\r\nconst demandOffers = {\r\n    DEMAND_OFFERS_CONTRACTOR_STAGES_LIST: (id, contractorDepartmentId) => `${DEMAND_OFFERS_BASE(id)}/stages/${contractorDepartmentId ? 'operator' : 'contractor'}`,\r\n    DEMAND_OFFERS_CONTRACTOR_STAGE_SECTIONS_LIST: (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/sections/${supplierId ? 'operator' : 'contractor'}`,\r\n    DEMAND_OFFERS_CONTRACTOR_STAGE_TRANSLATIONS: (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/translations/${supplierId ? 'operator' : 'contractor'}`,\r\n    DEMAND_OFFERS_CONTRACTOR_STAGE_SECTION: (id, stageId, section, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/sections/${section}/${supplierId ? 'operator' : 'contractor'}`,\r\n    DEMAND_OFFERS_STAGE_CURRENT_ROUND: (id, stageId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/currentRound`,\r\n    DEMAND_OFFERS_CONTRACTOR_STAGE_PASSWORD: (id, stageId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/password`,\r\n    DEMAND_OFFERS_VALIDATE: (demandId) => `${DEMAND_OFFERS_BASE(demandId)}/validate`\r\n}\r\n\r\nconst DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE = (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/${supplierId ? \"operator\" : \"contractor\"}/generalInfo`\r\nconst demandOffersGeneralInfo = {\r\n    DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_BASIC_DATA: (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE(id, stageId, supplierId)}/basicData`,\r\n    DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS: (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE(id, stageId, supplierId)}/documents`,\r\n    DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS_DOWNLOAD_URL: (id, stageId, type, documentId, supplierId) => `${DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE(id, stageId, supplierId)}/documents/downloadUrl/${type}/${documentId}`,\r\n    DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS_DOWNLOAD_ZIP: (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE(id, stageId, supplierId)}/documents/download/zip`,\r\n    DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_PUBLIC_ANSWERS: (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_CONTRACTOR_GENERAL_INFO_BASE(id, stageId, supplierId)}/publicAnswers`,\r\n}\r\n\r\nconst DEMAND_OFFERS_STAGE_OFFER_BASE = (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/${supplierId ? 'operator' : 'contractor'}/offer`;\r\n\r\nconst demandOffersOffer = {\r\n    DEMAND_OFFERS_STAGE_CONTRACTOR_OFFER: (demandId, stageId, supplierId) => DEMAND_OFFERS_STAGE_OFFER_BASE(demandId, stageId, supplierId),\r\n    DEMAND_OFFERS_OFFER_MODE: (id, stage, supplierId, mode) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}`,\r\n    DEMAND_OFFERS_OFFER_MODE_POSITIONS: (id, stage, mode, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/positions`,\r\n    DEMAND_OFFERS_OFFER_MODE_FILES: (id, stage, mode, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/files`,\r\n    DEMAND_OFFERS_OFFER_MODE_TEMPLATE: (id, stage, mode, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/template`,\r\n    DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL: (id, stage, mode, fileId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/file/${fileId}`,\r\n    DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_ZIP: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/documents/download/zip`,\r\n    DEMAND_OFFERS_OFFER_FILE: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/file`,\r\n    DEMAND_OFFERS_OFFER_FILES: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/files`,\r\n    DEMAND_OFFERS_OFFER_FILE_ID: (id, stage, fileId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/file/${fileId}`,\r\n    DEMAND_OFFERS_OFFER_FILE_ID_SIGN_FILE: (id, stage, fileId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/file/${fileId}/signFile`,\r\n\r\n    DEMAND_OFFERS_OFFER_ESPD: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/espd`,\r\n    DEMAND_OFFERS_OFFER_ESPDS: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/espds`,\r\n    DEMAND_OFFERS_OFFER_ESPD_ID: (id, stage, espdId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/espd/${espdId}`,\r\n    DEMAND_OFFERS_OFFER_ESPD_ID_SIGN_FILE: (id, stage, espdId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/espd/${espdId}/signFile`,\r\n    DEMAND_OFFERS_OFFER_ESPD_MP_APP_URL: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/espd/mpAppUrl`,\r\n    DEMAND_OFFERS_OFFER_ESPD_EXPORT_FILE_URL: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/espd/exportFileUrl`,\r\n    DEMAND_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL: (id, stage, mode, espdId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/espd/${espdId}`,\r\n\r\n    DEMAND_OFFERS_OFFER_PLACE_OFFER: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/placeOffer`,\r\n    DEMAND_OFFERS_OFFER_WITHDRAW_OFFER: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/withdrawOffer`,\r\n    DEMAND_OFFERS_OFFER_SIGN_OFFER: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/signOffer`,\r\n    DEMAND_OFFERS_OFFER_SIGN_WITHDRAW: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/signWithdraw`,\r\n    DEMAND_OFFERS_OFFER_DOC_TO_SIGN: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/offerDocumentToSign`,\r\n    DEMAND_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/withdrawDocumentToSign`,\r\n    DEMAND_OFFERS_OFFER_STOP_SIGNING_OPERATION: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/stopSigningOperation`,\r\n    DEMAND_OFFERS_OFFER_REQUIRE_WITHDRAW_ENCRYPTION: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/requireWithdrawEncryption`,\r\n    DEMAND_OFFERS_OFFER_DELETE_OFFER: (id, stage) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage)}/deleteOffer`,\r\n\r\n    DEMAND_OFFERS_OFFER_POSITION: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/position`,\r\n    DEMAND_OFFERS_OFFER_MODE_POSITION_ID: (id, stage, mode, positionId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/position/${positionId}`,\r\n\r\n    DEMAND_OFFERS_OFFER_SNAPSHOTS: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/snapshots`,\r\n    DEMAND_OFFERS_OFFER_SNAPSHOT_ID: (id, stage, snapshotId, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/snapshot/${snapshotId}`,\r\n    DEMAND_OFFERS_OFFER_VERIFICATIONS: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/verifications`,\r\n    DEMAND_OFFERS_OFFER_VERIFICATION_BEFORE_PLACE: (id, stage, supplierId) => `${DEMAND_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/verificationBeforePlaceOffer`,\r\n\r\n}\r\n\r\nconst DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE = (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/${supplierId ? 'operator' : 'contractor'}/additionalOffers`;\r\n\r\nconst demandAdditionalOffersOffer = {\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE: (id, stage, mode, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITIONS: (id, stage, mode, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/positions`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILES: (id, stage, mode, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/files`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL: (id, stage, mode, fileId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/file/${fileId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_ZIP: (id, stage, mode, fileId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/documents/download/zip`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_FILE: (id, stage, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/file`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_FILES: (id, stage, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/files`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID: (id, stage, fileId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/file/${fileId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID_SIGN_FILE: (id, stage, fileId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/file/${fileId}/signFile`,\r\n\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL: (id, stage, mode, espdId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/espd/${espdId}`,\r\n\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_PLACE_OFFER: (id, stage, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/placeOffer`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_OFFER: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/withdrawOffer`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_SIGN_OFFER: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/signOffer`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_SIGN_WITHDRAW: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/signWithdraw`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_DOC_TO_SIGN: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/offerDocumentToSign`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/withdrawDocumentToSign`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_STOP_SIGNING_OPERATION: (id, stage, positionId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/stopSigningOperation/${positionId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_REQUIRE_WITHDRAW_ENCRYPTION: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/requireWithdrawEncryption`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_DELETE_OFFER: (id, stage) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage)}/deleteOffer`,\r\n\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_POSITION: (id, stage, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/position`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITION_ID: (id, stage, mode, positionId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/position/${positionId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_SNAPSHOTS: (id, stage, positionId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/snapshots/${positionId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_SNAPSHOT_ID: (id, stage, positionId, snapshotId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/snapshot/${positionId}/${snapshotId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATIONS: (id, stage, positionId, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/verifications/${positionId}`,\r\n    DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATION_BEFORE_PLACE: (id, stage, supplierId) => `${DEMAND_ADDITIONAL_OFFERS_STAGE_OFFER_BASE(id, stage, supplierId)}/verificationBeforePlaceOffer`,\r\n}\r\n\r\nconst DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE = (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/${supplierId ? 'operator' : 'contractor'}/additionalAuction`;\r\n\r\nconst demandAdditionalAuction = {\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_AUCTIONS: (id, stage) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage)}/auctions`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_AUCTIONS_ASSIGN: (id, stage, auctionId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage)}/${auctionId}/assignToAuction`,\r\n\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE: (id, stage, mode, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_ESPD_DOWNLOAD_URL: (id, stage, mode, espdId, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/espd/${espdId}`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_FILE_DOWNLOAD_URL: (id, stage, mode, fileId, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/file/${fileId}`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_FILES: (id, stage, mode, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/files`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_POSITION: (id, stage, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/position`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_POSITION_ID: (id, stage, mode, positionId, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/position/${positionId}`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_SNAPSHOTS: (id, stage, positionId, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/snapshots/${positionId}`,\r\n    DEMAND_ADDITIONAL_AUCTIONS_OFFER_SNAPSHOT_ID: (id, stage, positionId, snapshotId, supplierId) => `${DEMAND_ADDITIONAL_AUCTIONS_STAGE_OFFER_BASE(id, stage, supplierId)}/snapshot/${positionId}/${snapshotId}`,\r\n}\r\n\r\n\r\nconst DEMAND_PREVIEW_STAGE_OFFER_BASE = (id, stageId, supplierId) => `${DEMAND_OFFERS_STAGE_BASE(id, stageId)}/${supplierId ? 'operator' : 'contractor'}/preview`;\r\nconst demandPublicationPreview = {\r\n    DEMAND_PREVIEW_OFFER_MODE: (id, stage, supplierId, mode) => `${DEMAND_PREVIEW_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}`,\r\n    DEMAND_PREVIEW_OFFER_MODE_SECTION: (id, stage, supplierId, mode) => `${DEMAND_PREVIEW_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/section`,\r\n    DEMAND_PREVIEW_OFFER_MODE_POSITION_ID: (id, stage, mode, positionId, supplierId) => `${DEMAND_PREVIEW_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/position/${positionId}`,\r\n    DEMAND_PREVIEW_OFFER_MODE_POSITION_ID_PRINT: (id, stage, mode, positionId, supplierId) => `${DEMAND_PREVIEW_STAGE_OFFER_BASE(id, stage, supplierId)}/${mode}/position/${positionId}/print`,\r\n}\r\n\r\nconst integrations = {\r\n    SHAREPOINT: (demandId) => `${DEMAND_BASE(demandId)}/sharepoint`,\r\n    EZDRP: (demandId) => `${DEMAND_BASE(demandId)}/ezdrp`,\r\n    EZDPUW: (demandId) => `${DEMAND_BASE(demandId)}/ezdpuw`,\r\n    EZDPUW_DOCUMENTS: (demandId, caseId) => `${DEMAND_BASE(demandId)}/ezdpuw/${caseId}/documents`\r\n}\r\n\r\nconst EZAMOWIENIA_BASE = `${BASE}/ezamowienia`\r\nconst ezamowienia = {\r\n    EZAMOWIENIA_AUTHORIZATION_STATUS: `${EZAMOWIENIA_BASE}/authorizationStatus`,\r\n    EZAMOWIENIA_REVOKE_TOKEN: `${EZAMOWIENIA_BASE}/revokeToken`,\r\n}\r\n\r\nconst ANNUAL_REPORT_BASE = `${BASE}/annualReport`\r\nconst annualReport = {\r\n    ANNUAL_REPORT: ANNUAL_REPORT_BASE,\r\n    ANNUAL_REPORT_REPORT_YEAR: (year) => `${ANNUAL_REPORT_BASE}/year/${year}`,\r\n    ANNUAL_REPORT_REPORT_YEAR_AVAILABLE_ORGS: (year) => `${ANNUAL_REPORT_BASE}/year/${year}/availableOrgs`,\r\n    ANNUAL_REPORT_REPORT_ID: (reportId) => `${ANNUAL_REPORT_BASE}/report/${reportId}`,\r\n    ANNUAL_REPORT_REPORT_ID_ACTION: (reportId, action) => `${ANNUAL_REPORT_BASE}/report/${reportId}/${action}`,\r\n    ANNUAL_REPORT_REPORT_ID_FORM_NAME: (reportId, formName) => `${ANNUAL_REPORT_BASE}/report/${reportId}/form/${formName}`,\r\n    ANNUAL_REPORT_REPORT_ID_INITIALIZE_FORM_NAME: (reportId, formName) => `${ANNUAL_REPORT_BASE}/report/${reportId}/initialize/${formName}`,\r\n    ANNUAL_REPORT_REPORT_ID_INITIALIZE_FROM_PREV_FORM_NAME: (reportId, formName) => `${ANNUAL_REPORT_BASE}/report/${reportId}/copyFromPrev/${formName}`,\r\n    ANNUAL_REPORT_REPORT_ID_INITIALIZE_FORM_NAME_TABLE_ID: (reportId, formName, tableIdentity) => `${ANNUAL_REPORT_BASE}/report/${reportId}/initialize/${formName}/${tableIdentity}`,\r\n    ANNUAL_REPORT_DICTIONARIES: ANNUAL_REPORT_BASE + \"/dictionaries\",\r\n    ANNUAL_REPORT_TRANSLATIONS: ANNUAL_REPORT_BASE + \"/translations\",\r\n}\r\n\r\nconst CONTRACT_NOTICE = (demandId) => `${DEMAND_BASE(demandId)}/nationalNotice/contractNotice`\r\nconst nationalNotice = {\r\n    NATIONAL_NOTICE_VALIDATE: (demandId) => `${DEMAND_BASE(demandId)}/nationalNotice/validate`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE: (demandId) => `${CONTRACT_NOTICE(demandId)}`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_CREATE_NEW_VERSION: (demandId) => `${CONTRACT_NOTICE(demandId)}/createNewVersion`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_DRAFT: (demandId) => `${CONTRACT_NOTICE(demandId)}/draft`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_TRANSLATIONS: (demandId) => `${CONTRACT_NOTICE(demandId)}/translations`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_DICTIONARIES: (demandId) => `${CONTRACT_NOTICE(demandId)}/dictionaries`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH: (demandId) => `${CONTRACT_NOTICE(demandId)}/publish`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_UPDATE: (demandId) => `${CONTRACT_NOTICE(demandId)}/publishUpdate`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_ROLLBACK: (demandId) => `${CONTRACT_NOTICE(demandId)}/publish/rollback`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_UPDATE_ROLLBACK: (demandId) => `${CONTRACT_NOTICE(demandId)}/publishUpdate/rollback`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_STATUS: (demandId) => `${CONTRACT_NOTICE(demandId)}/status`,\r\n    NATIONAL_NOTICE_CONTRACT_MODIFICATION_NOTICE_STATUS: (demandId) => `${CONTRACT_NOTICE(demandId)}/modification/status`,\r\n    NATIONAL_NOTICE_CONTRACT_NOTICE_DYNAMIC_DICTIONARIES: (demandId) => `${CONTRACT_NOTICE(demandId)}/dynamicDictionaries`,\r\n}\r\n\r\nconst PURCHASING_GROUP_ID = (groupId) => `${base.PURCHASING_GROUP}/${groupId}`\r\nconst purchasingGroup = {\r\n    PURCHASING_GROUP_LIST: () => `${base.PURCHASING_GROUP}/list`,\r\n    PURCHASING_GROUP_LIST_ACTIONS: () => `${base.PURCHASING_GROUP}/list/actions`,\r\n    PURCHASING_GROUP_MEMBER_LIST: () => `${base.PURCHASING_GROUP}/member/list`,\r\n    PURCHASING_GROUP_HEADER: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/header`,\r\n    PURCHASING_GROUP_RELATED_OBJECTS: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/relatedObjects`,\r\n    PURCHASING_GROUP_BASIC_DATA: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/basicData`,\r\n    PURCHASING_GROUP_ARCHIVE_LIST: (groupId, archiveType) => `${PURCHASING_GROUP_ID(groupId)}/archiveList/${archiveType}`,\r\n    PURCHASING_GROUP_ARCHIVE_ID: (groupId, archiveType, archiveId) => `${PURCHASING_GROUP_ID(groupId)}/archive/${archiveType}/${archiveId}`,\r\n\r\n    PURCHASING_GROUP_COMMISSION: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/commission`,\r\n    PURCHASING_GROUP_COMMISSION_HISTORY: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/commission/history`,\r\n\r\n    PURCHASING_GROUP_SCHEDULE: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/schedule`,\r\n\r\n    PURCHASING_GROUP_MEMBERS: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/members`,\r\n    PURCHASING_GROUP_MEMBERS_AVAILABLE_CONCERNS: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/members/availableConcerns`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/members/member`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_REJECT: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/reject`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_RESTORE: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/restore`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_CONFIRM_PARTICIPATION: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/confirmParticipation`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_WITHDRAW_PARTICIPATION: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/withdrawParticipation`,\r\n\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_RESEND_INVITE_NOTIFICATION: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/resendInviteNotification`,\r\n\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/document`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID: (groupId, memberId, documentId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/document/${documentId}`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID_URL: (groupId, memberId, documentId, open) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/document/${documentId}/url/${open ? \"open\" : \"download\"}`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/user`,\r\n    PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER_ID: (groupId, memberId, userId) => `${PURCHASING_GROUP_ID(groupId)}/members/member/${memberId}/user/${userId}`,\r\n\r\n\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS: (groupId, apiPath) => `${PURCHASING_GROUP_ID(groupId)}/${apiPath}/documents`,\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS_GENERATE_GROUP_AGREEMENT: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/members/documents/generateGroupAgreementDocument`,\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID: (groupId, apiPath, documentId) => `${PURCHASING_GROUP_ID(groupId)}/${apiPath}/documents/${documentId}`,\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_PUBLISH: (groupId, apiPath, documentId) => `${PURCHASING_GROUP_ID(groupId)}/${apiPath}/documents/${documentId}/publish`,\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_UNPUBLISH: (groupId, apiPath, documentId) => `${PURCHASING_GROUP_ID(groupId)}/${apiPath}/documents/${documentId}/unpublish`,\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_URL: (groupId, apiPath, documentId, open) => `${PURCHASING_GROUP_ID(groupId)}/${apiPath}/documents/${documentId}/url/${open ? \"open\" : \"download\"}`,\r\n\r\n    PURCHASING_GROUP_SWZ_DOCUMENTS: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/swz/documents`,\r\n    PURCHASING_GROUP_SWZ_DOCUMENTS_ID: (groupId, documentId) => `${PURCHASING_GROUP_ID(groupId)}/swz/documents/${documentId}`,\r\n    PURCHASING_GROUP_SWZ_DOCUMENTS_ID_PUBLISH: (groupId, documentId) => `${PURCHASING_GROUP_ID(groupId)}/swz/documents/${documentId}/publish`,\r\n    PURCHASING_GROUP_SWZ_DOCUMENTS_ID_UNPUBLISH: (groupId, documentId) => `${PURCHASING_GROUP_ID(groupId)}/swz/documents/${documentId}/unpublish`,\r\n    PURCHASING_GROUP_SWZ_DOCUMENTS_ID_URL: (groupId, documentId, open) => `${PURCHASING_GROUP_ID(groupId)}/swz/documents/${documentId}/url/${open ? \"open\" : \"download\"}`,\r\n\r\n\r\n    PURCHASING_GROUP_OPINION: (groupId, type) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}`,\r\n    PURCHASING_GROUP_OPINION_ID: (groupId, type, opinionId) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}/${opinionId}`,\r\n    PURCHASING_GROUP_OPINION_ID_MARK_AS_READ: (groupId, type, opinionId) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}/${opinionId}/markAsRead`,\r\n    PURCHASING_GROUP_OPINION_AVAILABLE_MEMBERS: (groupId, type) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}/availableMembers`,\r\n    PURCHASING_GROUP_OPINION_MEMBER_ID: (groupId, type, memberId) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}/member/${memberId}`,\r\n    PURCHASING_GROUP_OPINION_ID_MESSAGE_NEW: (groupId, type, opinionId) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}/${opinionId}/message/new`,\r\n    PURCHASING_GROUP_OPINION_ID_MESSAGE_ID: (groupId, type, opinionId, messageId) => `${PURCHASING_GROUP_ID(groupId)}/opinion/${type}/${opinionId}/message/${messageId}`,\r\n\r\n\r\n    PURCHASING_GROUP_FINISH_PREPARING: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/finishPreparing`,\r\n\r\n    PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_TEMPLATE_FORM_EXPORT: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/papersGenerator/templateFormExport`,\r\n    PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_LEADING_DOCUMENT: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/papersGenerator/gzmLeadingDocument`,\r\n    PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_MANAGEMENT_RESOLUTION: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/papersGenerator/gzmManagementResolution`,\r\n    PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DRAFT_GROUP_AGREEMENT: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/papersGenerator/gzmDraftGroupAgreement`,\r\n    PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DOCUMENT_TO_SIGN: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/papersGenerator/gzmDocumentToSign`,\r\n\r\n    PURCHASING_GROUP_COLLECTING_SCHEDULE: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/collectingSchedule`,\r\n\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/template`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_AVAILABLE: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/template/availableTemplates`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_ID: (groupId, memberId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_DRAFT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/draft`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_CLEAR_DRAFT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/clearDraft`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ACCEPT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/accept`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_REJECT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/reject`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ASK_FOR_EDIT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/askForEdit`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ALLOW_EDIT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/allowEdit`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_REJECT_EDIT: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/rejectEdit`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ARCHIVE_LIST: (groupId, memberId, formId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/archiveList`,\r\n    PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ARCHIVE_ID: (groupId, memberId, formId, archiveId) => `${PURCHASING_GROUP_ID(groupId)}/template/member/${memberId}/form/${formId}/archive/${archiveId}`,\r\n\r\n    PURCHASING_GROUP_FINISH: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/finish`,\r\n    PURCHASING_GROUP_FINISH_DEALINGS_CHANGED: (groupId) => `${PURCHASING_GROUP_ID(groupId)}/finish/sendDealingsChangedNotification`\r\n\r\n}\r\n\r\nconst PURCHASING_GROUP_SECTIONS = (groupId) => `${PURCHASING_GROUP_ID(groupId)}/sections`\r\n\r\nconst purchasingGroupSections = {\r\n    PURCHASING_GROUP_SECTIONS_PREPARING: (groupId) => `${PURCHASING_GROUP_SECTIONS(groupId)}/preparing`,\r\n    PURCHASING_GROUP_SECTIONS_COLLECTING_DATA: (groupId) => `${PURCHASING_GROUP_SECTIONS(groupId)}/collectingData`,\r\n    PURCHASING_GROUP_SECTIONS_SECTION: (groupId) => `${PURCHASING_GROUP_SECTIONS(groupId)}/section`\r\n}\r\n\r\nconst PURCHASING_GROUP_TEMPLATES = `${base.PURCHASING_GROUP}/template`\r\n\r\nconst purchasingGroupTemplate = {\r\n    PURCHASING_GROUP_TEMPLATES_LIST: () => `${PURCHASING_GROUP_TEMPLATES}/list`,\r\n    PURCHASING_GROUP_TEMPLATES_LIST_HAS_EDIT: () => `${PURCHASING_GROUP_TEMPLATES}/list/hasEdit`,\r\n    PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID: (templateId) => `${PURCHASING_GROUP_TEMPLATES}/${templateId}`,\r\n    PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_ACTIVATE: (templateId) => `${PURCHASING_GROUP_TEMPLATES}/${templateId}/activate`,\r\n    PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_DEACTIVATE: (templateId) => `${PURCHASING_GROUP_TEMPLATES}/${templateId}/deactivate`,\r\n    PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_CLONE: (templateId) => `${PURCHASING_GROUP_TEMPLATES}/${templateId}/clone`,\r\n}\r\n\r\nconst ADMIN_USER_REGISTRATION = `${base.ADMIN}/user/registration`\r\n\r\nconst adminUserRegistrations = {\r\n    ADMIN_USER_REGISTRATION_LIST: `${ADMIN_USER_REGISTRATION}/list`,\r\n    ADMIN_USER_REGISTRATION_AVAILABLE_ORGS: `${ADMIN_USER_REGISTRATION}/availableOrgs`,\r\n    ADMIN_USER_REGISTRATION_ID: (regId) => `${ADMIN_USER_REGISTRATION}/${regId}`,\r\n    ADMIN_USER_REGISTRATION_ID_REJECT: (regId) => `${ADMIN_USER_REGISTRATION}/${regId}/reject`,\r\n    ADMIN_USER_REGISTRATION_ID_ACCEPT: (regId) => `${ADMIN_USER_REGISTRATION}/${regId}/accept`,\r\n    ADMIN_USER_REGISTRATION_ID_ORGANIZATION: (regId) => `${ADMIN_USER_REGISTRATION}/${regId}/organization`\r\n}\r\n\r\nconst extensions = () => `${base.BASE}/file/extensions`\r\nconst hotJarSettings = {hjid: 1296211, hjsv: 6}\r\n\r\nexport default {\r\n    redirect_uri,\r\n    oauth,\r\n    ...base,\r\n    ...sales,\r\n    ...demand,\r\n    ...user,\r\n    ...schedule,\r\n    ...siwz,\r\n    ...contractor,\r\n    ...commission,\r\n    ...espd,\r\n    ...guarantee,\r\n    ...contractor,\r\n    ...user,\r\n    ...header,\r\n    ...client,\r\n    ...notice,\r\n    ...repo,\r\n    ...publish,\r\n    ...dealings,\r\n    ...dealing,\r\n    ...statistic,\r\n    ...supplier,\r\n    ...offers,\r\n    ...modification,\r\n    ...rfxRound,\r\n    ...correspondenceBuyer,\r\n    ...correspondenceContractor,\r\n    ...papersGenerator,\r\n    ...emailList,\r\n    ...sections,\r\n    ...contractorVerification,\r\n    ...offerEvaluation,\r\n    ...offerChoice,\r\n    ...offerChoiceResult,\r\n    ...agreements,\r\n    ...evaluationFinish,\r\n    ...resultNotice,\r\n    ...finishDemand,\r\n    ...archiving,\r\n    ...additionalRound,\r\n    ...demandAdditionalInfo,\r\n    ...auction,\r\n    ...additionalRoundsPassive,\r\n    ...demandPlanRealization,\r\n    ...poll,\r\n    ...integrations,\r\n    ...demandOffers,\r\n    ...ezamowienia,\r\n    ...nationalNotice,\r\n    ...purchasingGroup,\r\n    ...purchasingGroupSections,\r\n    ...purchasingGroupTemplate,\r\n    ...adminUserRegistrations,\r\n    ...demandOffers,\r\n    ...demandOffersGeneralInfo,\r\n    ...demandOffersOffer,\r\n    ...demandAdditionalOffersOffer,\r\n    ...demandAdditionalAuction,\r\n    ...demandPublicationPreview,\r\n    ...annualReport,\r\n    extensions,\r\n    SERVER_URL,\r\n    EXT_JS_LIBRARIES,\r\n    hotJarSettings,\r\n}","\r\nexport default {\r\n\tBAD_REQUEST: 400,\r\n\tUNAUTHORIZED: 401,\r\n\tFORBIDDEN: 403,\r\n\tNOT_FOUND: 404,\r\n\tINTERNAL_SERVER_ERROR: 500,\r\n}","export default ({url, name}) => {\r\n\tlet a = document.createElement('a');\r\n\ta.href=url;\r\n\ta.target='_blank'\r\n\ta.setAttribute(\"download\", name)\r\n\ta.click();\r\n}","import Axios from 'axios';\r\nimport reduxStore from 'redux/store'\r\nimport HttpCodes from 'constants/HttpCodes';\r\nimport RouterPath from './RouterPath';\r\nimport querystring from 'querystring'\r\nimport downloadFile from './downloadFile';\r\nimport {setResource, setSaveStatusError} from 'redux/actions';\r\nimport Tr from 'translations/Translations';\r\nimport Endpoints from 'constants/Endpoints';\r\nimport {Sema as semaphore} from 'async-sema';\r\nimport moment from 'moment';\r\n\r\nconst _sem = new semaphore(1);\r\n\r\nconst _refreshSessionTime = () => {\r\n\tconst state = reduxStore.getState();\r\n\tconst sessionTime = state.resources.sessionTime;\r\n\tif (sessionTime) {\r\n\t\tconst endTime = moment().add(sessionTime.time, 's')\r\n\t\treduxStore.dispatch(setResource('sessionTime', {\r\n\t\t\ttime: sessionTime.time,\r\n\t\t\tendTime\r\n\t\t}))\r\n\t}\r\n}\r\n\r\nconst _paramsSerializer = (params) => {\r\n\treturn querystring.stringify(params)\r\n}\r\n\r\nconst _executeRequest = async ({ headers, ...params }) => {\r\n\tlet auth = JSON.parse(localStorage.getItem(\"authorize\"))\r\n\tconst request = await Axios({\r\n\t\theaders: {\r\n\t\t\t'Authorization': 'Bearer ' + auth.access_token,\r\n\t\t\t...headers,\r\n\t\t},\r\n\t\t...params,\r\n\t\tparamsSerializer: _paramsSerializer,\r\n\t});\r\n\t_refreshSessionTime();\r\n\treturn request;\r\n}\r\n\r\nconst _logout = (url) => {\r\n\tlocalStorage.removeItem('authorize');\r\n\tconst location = window.location;\r\n\tconst search = location.search\r\n\tconst params = querystring.parse(search.substr(1))\r\n\tlet state = params['state'];\r\n\tif (!state) {\r\n\t\tstate = window.btoa(location.pathname + location.search);\r\n\t}\r\n\r\n\tconst redUrl = url ? url : RouterPath.BUYER_INIT + '?' + querystring.stringify({\r\n\t\tstate\r\n\t})\r\n\twindow.location.href = redUrl;\r\n}\r\n\r\nexport const SoftLogout = async (url) => {\r\n\ttry {\r\n\t\tawait _logout(url);\r\n\t} catch (error) {\r\n\t\tthrow error;\r\n\t}\r\n}\r\n\r\nconst _refresToken = async () => {\r\n\tconst auth = JSON.parse(localStorage.getItem(\"authorize\"))\r\n\ttry {\r\n\t\tconsole.info(\"RestRequest - refreshing token...\");\r\n\t\tconst res = await Axios({\r\n\t\t\tmethod: 'post',\r\n\t\t\turl: Endpoints.oauth.TOKEN,\r\n\t\t\tparams: {\r\n\t\t\t\tclient_id: 'mp',\r\n\t\t\t\tgrant_type: 'refresh_token',\r\n\t\t\t\trefresh_token: auth.refresh_token\r\n\t\t\t},\r\n\t\t});\r\n\t\tlocalStorage.setItem(\"authorize\", JSON.stringify(res.data))\r\n\t} catch (error) {\r\n\t\tthrow error;\r\n\t}\r\n}\r\nexport const RefreshToken = async () => {\r\n\ttry {\r\n\t\tawait _refresToken();\r\n\t} catch (error) {\r\n\t\tthrow error;\r\n\t}\r\n}\r\n\r\nconst _restRequest = async (args) => {\r\n\tawait _sem.acquire();\r\n\ttry {\r\n\t\treturn await _executeRequest(args);\r\n\t} catch (error) {\r\n\t\tconst response = error.response;\r\n\r\n\t\tswitch (response.status) {\r\n\t\t\tcase HttpCodes.UNAUTHORIZED:\r\n\t\t\t\ttry {\r\n\t\t\t\t\tawait _refresToken();\r\n\t\t\t\t\treturn await _executeRequest(args);\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\t_logout();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase HttpCodes.FORBIDDEN:\r\n\t\t\t\treduxStore.dispatch(setSaveStatusError(Tr('forbidden_error')));\r\n\t\t\t\tthrow error;\r\n\t\t\tcase HttpCodes.BAD_REQUEST:\r\n\t\t\t\treduxStore.dispatch(setSaveStatusError(Tr('bad_request_error')));\r\n\t\t\t\tthrow error;\r\n\t\t\tcase HttpCodes.NOT_FOUND:\r\n\t\t\t\treduxStore.dispatch(setSaveStatusError(Tr('not_found_request_error')));\r\n\t\t\t\tthrow error;\r\n\t\t\tcase HttpCodes.INTERNAL_SERVER_ERROR:\r\n\t\t\t\treduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n\t\t\t\tthrow error;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow error;\r\n\t\t}\r\n\t} finally {\r\n\t\t_sem.release()\r\n\t}\r\n}\r\n\r\nconst RestRequest = async (params) => {\r\n\tconst res = await _restRequest(params);\r\n\treturn res.data;\r\n}\r\n\r\nexport const RestRequestGET = async (url, other) => RestRequest({ url, method: 'get', ...other });\r\nexport const RestRequestDELETE = async (url, other) => RestRequest({ url, method: 'delete', ...other });\r\nexport const RestRequestPOST = async (url, data, other) => RestRequest({ url, data, method: 'post', ...other });\r\nexport const RestRequestPUT = async (url, data, other) => RestRequest({ url, data, method: 'put', ...other });\r\n\r\nexport const RestRequestBLOB = async (url, other, method) => {\r\n\tconst res = await _restRequest({\r\n\t\turl,\r\n\t\tmethod: !!method ? method : 'get',\r\n\t\tresponseType: 'blob',\r\n\t\t...other\r\n\t});\r\n\r\n\tconst type = res.headers['content-type'];\r\n\tif(type.startsWith(\"application/json\")) {\r\n\t\tconst ob = JSON.parse(await res.data.text());\r\n\t\tif(ob.success === false) {\r\n\t\t\treturn ob;\r\n\t\t}\r\n\t}\r\n\r\n\tconst contentDisposition = res.headers['content-disposition'];\r\n\tlet name = contentDisposition.indexOf(\"filename*=\") >= 0\r\n\t\t? contentDisposition.split(\"filename*=\")[1]\r\n\t\t: contentDisposition.split(\"filename=\")[1];\r\n\tname = decodeURIComponent(name);\r\n\tconst fileUrl = window.URL.createObjectURL(\r\n\t\tnew Blob([res.data], { type })\r\n\t)\r\n\tdownloadFile({ url: fileUrl, name })\r\n\twindow.URL.revokeObjectURL(fileUrl)\r\n}\r\n\r\nexport const RestRequestBLOBBase64Encoded = async (url, other) => {\r\n\tconst res = await _restRequest({\r\n\t\turl,\r\n\t\tmethod: 'get',\r\n\t\tresponseType: 'blob',\r\n\t\t...other\r\n\t});\r\n\r\n\tconst type = res.headers['content-type'];\r\n\tif(type.startsWith(\"application/json\")) {\r\n\t\tconst ob = JSON.parse(await res.data.text());\r\n\t\tif(ob.success === false || ob.success === true) {\r\n\t\t\treturn ob;\r\n\t\t}\r\n\t}\r\n\tconst b64 = await blobToBase64(res.data)\r\n\r\n\tconst result = {\"success\":true,\r\n\t\t\"result\":b64.split(\",\")[1],\r\n        \"errors\":null\r\n    }\r\n\r\n\treturn result;\r\n\r\n}\r\n\r\nfunction blobToBase64(blob) {\r\n\treturn new Promise((resolve, _) => {\r\n\t\tconst reader = new FileReader();\r\n\t\treader.onloadend = () => resolve(reader.result);\r\n\t\treader.readAsDataURL(blob);\r\n\t});\r\n}\r\n\r\nexport default RestRequest;","import Endpoints from 'constants/Endpoints'\r\nimport { RestRequestGET, SoftLogout } from 'libs/RestRequest';\r\nimport Axios from 'axios';\r\n\r\nconst logout = async () => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.oauth.LOGOUT);\r\n\t\tawait SoftLogout(resp.result);\r\n\t} catch (error) {\r\n\t\tconsole.error({error})\r\n\t}\r\n}\r\n\r\nconst getToken = async (code) => {\r\n\ttry {\r\n\t\tconst res = await Axios({\r\n\t\t\tmethod: 'post',\r\n\t\t\turl: Endpoints.oauth.TOKEN,\r\n\t\t\tparams: {\r\n\t\t\t\tgrant_type: 'authorization_code',\r\n\t\t\t\tcode,\r\n\t\t\t\tredirect_uri: Endpoints.redirect_uri,\r\n\t\t\t\tclient_id: 'mp'\r\n\t\t\t},\r\n\t\t});\r\n\t\tlocalStorage.setItem(\"authorize\", JSON.stringify(res.data));\r\n\t\treturn true;\r\n\t} catch (error) {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nexport default {\r\n\tlogout,\r\n\tgetToken,\r\n};","import React from 'react'\r\nimport LogoutIcon from '@material-ui/icons/PowerSettingsNew'\r\nimport ListItem from './ListItem';\r\nimport OAuthService from 'services/OAuthService';\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction LogoutButton() {\r\n\treturn (\r\n\t\t<ListItem\r\n\t\t\tname={Tr('logout')}\r\n\t\t\tIcon={LogoutIcon}\r\n\t\t\tonClick={ () => OAuthService.logout()}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nexport default LogoutButton\r\n","\r\nimport React from 'react'\r\nimport { Drawer, List } from '@material-ui/core';\r\nimport { withStyles } from '@material-ui/styles';\r\nimport clsx from 'clsx';\r\nimport ListItem from './ListItem';\r\nimport OpenElement from './OpenElement';\r\nimport Logo from './Logo';\r\nimport ListAddButton from './ListAddButton';\r\nimport LogoutButton from './LogoutButton';\r\nimport { setMenuOpen, setInnerMenuOpen } from 'redux/actions'\r\nimport { connect } from 'react-redux'\r\n\r\nimport GroupWorkIcon from '@material-ui/icons/GroupWork';\r\nimport StarIcon from '@material-ui/icons/Star';\r\nimport ShoppingCartIcon from '@material-ui/icons/ShoppingCart';\r\nimport PeopleIcon from '@material-ui/icons/People';\r\nimport PublicIcon from '@material-ui/icons/Public';\r\nimport DescriptionIcon from '@material-ui/icons/Description';\r\nimport GavelIcon from '@material-ui/icons/Gavel';\r\nimport LocalLibraryIcon from '@material-ui/icons/LocalLibrary';\r\nimport InsertDriveFileIcon from '@material-ui/icons/InsertDriveFile';\r\nimport HowToRegIcon from '@material-ui/icons/HowToReg';\r\nimport MonetizationOnIcon from '@material-ui/icons/MonetizationOn';\r\nimport AssessmentIcon from '@material-ui/icons/Assessment';\r\n\r\nconst style = theme => ({\r\n\tpaper: {\r\n\t\tjustifyContent: 'space-between',\r\n\t\tborderRightColor: theme.palette.border.onlyContrast ? theme.palette.border.onlyContrast : undefined\r\n\t},\r\n\tdrawerOpen: {\r\n\t\twidth: theme.components.navigation.width,\r\n\t\ttransition: theme.transitions.default.open('width'),\r\n\t\toverflowX: 'hidden',\r\n\t},\r\n\tdrawerClose: {\r\n\t\ttransition: theme.transitions.default.close('width'),\r\n\t\toverflowX: 'hidden',\r\n\t\twidth: theme.spacing(7) + 1,\r\n\t},\r\n\tinnerListItem: {\r\n\t\tpaddingLeft: theme.spacing(3),\r\n\t}\r\n})\r\n\r\nfunction Navigation({\r\n\tpurchaser,\r\n\tclasses,\r\n\tisMenuOpen,\r\n\tsetMenuOpen,\r\n\tinnerMenu,\r\n\tsetInnerMenuOpen,\r\n\tnavElements\r\n}) {\r\n\r\n\tconst icons = {\r\n\t\tmy_demands: StarIcon,\r\n\t\tpurchasingGroups: GroupWorkIcon,\r\n\t\tall_demands: ShoppingCartIcon,\r\n\t\tdeputy: PeopleIcon,\r\n\t\tpublic_area: PublicIcon,\r\n\t\tedocument: DescriptionIcon,\r\n\t\tauction: GavelIcon,\r\n\t\tintranet: LocalLibraryIcon,\r\n\t\treport: InsertDriveFileIcon,\r\n\t\tadministration: HowToRegIcon,\r\n\t\tcontractor_area: MonetizationOnIcon,\r\n\t\tannualReport: AssessmentIcon,\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Drawer\r\n\t\t\tvariant=\"permanent\"\r\n\t\t\topen={isMenuOpen}\r\n\t\t\tclasses={{\r\n\t\t\t\tpaper: clsx(classes.paper, {\r\n\t\t\t\t\t[classes.drawerOpen]: isMenuOpen,\r\n\t\t\t\t\t[classes.drawerClose]: !isMenuOpen,\r\n\t\t\t\t}),\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t<List>\r\n\t\t\t\t<Logo\r\n\t\t\t\t\tpurchaser={purchaser}\r\n\t\t\t\t\topen={isMenuOpen}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<OpenElement\r\n\t\t\t\t\topen={isMenuOpen}\r\n\t\t\t\t\tsetOpen={setMenuOpen}\r\n\t\t\t\t\tsetInnerMenuOpen={setInnerMenuOpen}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t{navElements && navElements.newDemandProcedures && <ListAddButton\r\n\t\t\t\t\topen={isMenuOpen}\r\n\t\t\t\t\tprocedures={navElements.newDemandProcedures}\r\n\t\t\t\t/>}\r\n\r\n\t\t\t\t{navElements && navElements.elements.map((item, i) => (\r\n\r\n\t\t\t\t\t\titem.href ?\r\n\t\t\t\t\t\t\t<ListItem\r\n\t\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\t\t{...item}\r\n\t\t\t\t\t\t\t\topenInner={isMenuOpen}\r\n\t\t\t\t\t\t\t/> :\r\n\t\t\t\t\t\t\t<React.Fragment key={i}>\r\n\t\t\t\t\t\t\t\t<ListItem\r\n\t\t\t\t\t\t\t\t\t{...item}\r\n\t\t\t\t\t\t\t\t\tsetInnerMenuOpen={setInnerMenuOpen}\r\n\t\t\t\t\t\t\t\t\tinnerMenu={innerMenu}\r\n\t\t\t\t\t\t\t\t\topenInner={isMenuOpen}\r\n\t\t\t\t\t\t\t\t\tinnerKey={item.key.split(\".\")[1]}\r\n\t\t\t\t\t\t\t\t\tsingleLink={item.menuElementList.length === 1 && item.menuElementList[0].url}\r\n\t\t\t\t\t\t\t\t\tIcon={icons[item.key.split(\".\").pop()]}\r\n\t\t\t\t\t\t\t\t\tsetMenuOpen={setMenuOpen}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t(innerMenu[item.key.split(\".\")[1]] &&\r\n\t\t\t\t\t\t\t\t\t\titem.menuElementList.length > 1)\r\n\t\t\t\t\t\t\t\t\t&&\r\n\t\t\t\t\t\t\t\t\titem.menuElementList.map((innerItem, j) => {\r\n\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t<ListItem\r\n\t\t\t\t\t\t\t\t\t\t\t\tkey={j}\r\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={classes.innerListItem}\r\n\t\t\t\t\t\t\t\t\t\t\t\topenInner={isMenuOpen}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{...innerItem}\r\n\t\t\t\t\t\t\t\t\t\t\t/>)\r\n\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t\t))}\r\n\t\t\t</List>\r\n\t\t\t<LogoutButton />\r\n\t\t</Drawer>\r\n\t)\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tisMenuOpen: state.store.isMenuOpen,\r\n\tinnerMenu: state.innerMenu,\r\n\tnavElements: state.resources.userLoggedMenuList\r\n}), {\r\n\t\tsetMenuOpen,\r\n\t\tsetInnerMenuOpen\r\n\t})(withStyles(style)(Navigation));\r\n","import React from 'react'\r\nimport InvertColorsIcon from '@material-ui/icons/InvertColors'\r\nimport {IconButton, Tooltip} from '@material-ui/core';\r\nimport InvertColorsOffIcon from '@material-ui/icons/InvertColorsOff'\r\nimport {connect} from 'react-redux'\r\nimport {setContrastColors} from 'redux/actions'\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction InvertColorsButton(\r\n\t{\r\n\t\tcontrast,\r\n\t\tsetContrastColors\r\n\t}) {\r\n\tconst Icon = contrast ? InvertColorsOffIcon : InvertColorsIcon;\r\n\r\n\tconst handleClick = () => {\r\n\t\tsetContrastColors(!contrast);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Tooltip title={Tr('contrast_colors')}>\r\n\t\t\t<IconButton onClick={handleClick}>\r\n\t\t\t\t<Icon/>\r\n\t\t\t</IconButton>\r\n\t\t</ Tooltip>\r\n\t)\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tcontrast: state.store.contrast\r\n}), {\r\n\tsetContrastColors\r\n})(InvertColorsButton);\r\n","import React from 'react'\r\nimport TextFieldIcon from '@material-ui/icons/TextFields'\r\nimport {IconButton, Tooltip} from '@material-ui/core';\r\nimport {connect} from 'react-redux'\r\nimport {setLargeText} from 'redux/actions'\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction TextSizeButton(\r\n\t{\r\n\t\tlargeText,\r\n\t\tsetLargeText\r\n\t}) {\r\n\r\n\tconst handleClick = () => {\r\n\t\tsetLargeText(!largeText);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Tooltip title={Tr('larger_letters')}>\r\n\t\t\t<IconButton onClick={handleClick}>\r\n\t\t\t\t<TextFieldIcon/>\r\n\t\t\t</IconButton>\r\n\t\t</Tooltip>\r\n\t)\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tlargeText: state.store.largeText\r\n}), {\r\n\tsetLargeText\r\n})(TextSizeButton);\r\n","import React from 'react'\r\nimport { Grid, Box, Typography } from '@material-ui/core';\r\nimport { withStyles } from '@material-ui/styles';\r\nimport Tr from 'translations/Translations';\r\nimport { connect } from 'react-redux'\r\nimport Endpoints from \"../../../constants/Endpoints\";\r\n\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\twidth: 'unset',\r\n\t\tmarginLeft: theme.spacing(2),\r\n\t},\r\n\tlinkText: {\r\n\t\tcolor: 'inherit',\r\n\t\ttextDecoration: 'none',\r\n\t}\r\n})\r\n\r\nfunction Profile({\r\n\tclasses,\r\n\tuser = { login: '' },\r\n\tuserProfile\r\n}) {\r\n\r\n\treturn (\r\n\t\t<Grid\r\n\t\t\tcontainer\r\n\t\t\tdirection='column'\r\n\t\t\tclassName={classes.root}\r\n\t\t\talignItems='center'\r\n\t\t>\r\n\t\t\t<Grid item>\r\n\t\t\t\t<Typography component=\"div\" variant='body1' >\r\n\t\t\t\t\t<Box fontWeight=\"fontWeightBold\">\r\n\t\t\t\t\t\t{user.login}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t</Typography>\r\n\t\t\t</Grid>\r\n\t\t\t<Grid item>\r\n\t\t\t\t<Typography\r\n\t\t\t\t\tvariant='caption'\r\n\t\t\t\t\tcomponent='a'\r\n\t\t\t\t\thref={userProfile?.link?.url ? userProfile.link.url : Endpoints.SERVER_URL}\r\n\t\t\t\t\tclassName={classes.linkText}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Tr('show_profile')}\r\n\t\t\t\t</Typography>\r\n\t\t\t</Grid>\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tuser: state.resources.userData,\r\n\tuserProfile: state.resources.userProfile,\r\n}), {\r\n\r\n})(withStyles(style)(Profile));\r\n","import React from 'react'\r\n\r\nexport default (props) => {\r\n\treturn (\r\n\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 8 6\" {...props}>\r\n\t\t\t<rect width=\"8\" height=\"6\" fill=\"#dc143c\"/>\r\n\t\t\t<rect width=\"8\" height=\"3\" fill=\"#fff\"/>\r\n\t\t</svg>\r\n\t)\r\n}\r\n\r\n","import React from 'react'\r\n\r\nexport default (props) => {\r\n\treturn (\r\n\t\t<svg {...props} viewBox=\"0 0 36 36\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" role=\"img\">\r\n\t\t\t<path fill=\"#00247D\"\r\n\t\t\t\t  d=\"M0 9.059V13h5.628zM4.664 31H13v-5.837zM23 25.164V31h8.335zM0 23v3.941L5.63 23zM31.337 5H23v5.837zM36 26.942V23h-5.631zM36 13V9.059L30.371 13zM13 5H4.664L13 10.837z\"></path>\r\n\t\t\t<path fill=\"#CF1B2B\"\r\n\t\t\t\t  d=\"M25.14 23l9.712 6.801a3.977 3.977 0 0 0 .99-1.749L28.627 23H25.14zM13 23h-2.141l-9.711 6.8c.521.53 1.189.909 1.938 1.085L13 23.943V23zm10-10h2.141l9.711-6.8a3.988 3.988 0 0 0-1.937-1.085L23 12.057V13zm-12.141 0L1.148 6.2a3.994 3.994 0 0 0-.991 1.749L7.372 13h3.487z\"></path>\r\n\t\t\t<path fill=\"#EEE\"\r\n\t\t\t\t  d=\"M36 21H21v10h2v-5.836L31.335 31H32a3.99 3.99 0 0 0 2.852-1.199L25.14 23h3.487l7.215 5.052c.093-.337.158-.686.158-1.052v-.058L30.369 23H36v-2zM0 21v2h5.63L0 26.941V27c0 1.091.439 2.078 1.148 2.8l9.711-6.8H13v.943l-9.914 6.941c.294.07.598.116.914.116h.664L13 25.163V31h2V21H0zM36 9a3.983 3.983 0 0 0-1.148-2.8L25.141 13H23v-.943l9.915-6.942A4.001 4.001 0 0 0 32 5h-.663L23 10.837V5h-2v10h15v-2h-5.629L36 9.059V9zM13 5v5.837L4.664 5H4a3.985 3.985 0 0 0-2.852 1.2l9.711 6.8H7.372L.157 7.949A3.968 3.968 0 0 0 0 9v.059L5.628 13H0v2h15V5h-2z\"></path>\r\n\t\t\t<path fill=\"#CF1B2B\" d=\"M21 15V5h-6v10H0v6h15v10h6V21h15v-6z\"></path>\r\n\t\t</svg>\r\n\t)\r\n}\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {Grid} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    column: {\r\n        width: '100%'\r\n    },\r\n    flexGrow: {\r\n        flexGrow: 1\r\n    }\r\n}));\r\n\r\nfunction GridBlock(\r\n    {\r\n        direction,\r\n        className,\r\n        itemClassName,\r\n        children,\r\n        alignItems,\r\n        spacing,\r\n        justify,\r\n        wrap,\r\n        column = false,\r\n        onClick,\r\n        flexGrow = false,\r\n        gridClasses,\r\n        id\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    return (\r\n        <Grid\r\n            container\r\n            className={className}\r\n            direction={column ? 'column' : direction}\r\n            alignItems={alignItems}\r\n            spacing={spacing}\r\n            justifyContent={justify}\r\n            wrap={wrap}\r\n            onClick={onClick}\r\n            classes={gridClasses}\r\n            id={id}\r\n        >\r\n            {React.Children.map(children, child => {\r\n                    return child &&\r\n                        <Grid\r\n                            item\r\n                            classes={gridClasses}\r\n                            className={clsx(itemClassName, {\r\n                                [classes.column]: column,\r\n                                [classes.flexGrow]: flexGrow,\r\n                            })}\r\n                        >\r\n                            {child}\r\n                        </Grid>\r\n\r\n                }\r\n            )}\r\n        </Grid>\r\n    )\r\n}\r\n\r\nGridBlock.propTypes = {\r\n    className: PropTypes.string,\r\n}\r\n\r\nGridBlock.defaultProps = {}\r\n\r\nexport default GridBlock;","import Tr from 'translations/Translations';\r\nimport reduxStore from 'redux/store'\r\nimport { setOpenTutorial, setOpenRegisterPopup } from 'redux/actions'\r\nimport RouterPath from 'libs/RouterPath';\r\n\r\nconst createItem = (trKey, action, disabled = true) => ({ label: Tr(trKey), action, disabled })\r\n\r\nexport default [\r\n\tcreateItem('tutorial', () => {\r\n\t\treduxStore.dispatch(setOpenTutorial())\r\n\t}),\r\n\tcreateItem('faq', () => {\r\n\t\tRouterPath.redirect(RouterPath.FAQ)\r\n\t}),\r\n\tcreateItem('contact', () => {\r\n\t\treduxStore.dispatch(setOpenRegisterPopup(true))\r\n\t},\r\n\t\tfalse\r\n\t),\r\n]","import React from 'react'\r\nimport { withStyles, Button } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction CancelButton({\r\n\tclasses,\r\n\tonClick,\r\n\tclassName\r\n}) {\r\n\treturn (\r\n\t\t<Button\r\n\t\t\tfullWidth\r\n\t\t\tclassName={className}\r\n\t\t\tvariant='contained'\r\n\t\t\tonClick={onClick}\r\n\t\t\tcolor='primary'\r\n\t\t>\r\n\t\t\t{Tr('cancel')}\r\n\t\t</Button>\r\n\t)\r\n}\r\n\r\nCancelButton.propTypes = {\r\n\tclassName: PropTypes.string,\r\n\tclasses: PropTypes.any,\r\n\tonClick: PropTypes.func,\r\n}\r\n\r\nCancelButton.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(CancelButton);","import React from 'react'\r\nimport { withStyles, Dialog, DialogTitle, DialogContent, DialogActions } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Button from 'components/Button';\r\nimport dialogButtons from './dialog.buttons'\r\nimport Tr from 'translations/Translations';\r\nimport CancelButton from '../components/CancelButton';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ttitle: {\r\n\t\ttextAlign: 'center'\r\n\t},\r\n\tcontent: {\r\n\t\t...theme.components.popup.smallContainer,\r\n\t\t'&>*': {\r\n\t\t\t'&:not(:first-child)': {\r\n\t\t\t\tmarginTop: theme.spacing(1)\r\n\t\t\t},\r\n\t\t\t'&:last-child': {\r\n\t\t\t\tmarginTop: theme.spacing(4)\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tborder: {\r\n\t\tborder: `1px solid ${theme.palette.common.white}`,\r\n\t}\r\n})\r\n\r\nfunction HelpDialog({\r\n\tclasses,\r\n\tonClose,\r\n\t...other\r\n}) {\r\n\r\n\tconst handleClickButton = (action) => {\r\n\t\tonClose()\r\n\t\taction()\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\tonClose={onClose}\r\n\t\t\t{...other}\r\n\t\t\tPaperProps={{\r\n\t\t\t\tclassName: classes.border\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t<DialogTitle className={classes.title}>{Tr('help_center')}</DialogTitle>\r\n\t\t\t<DialogContent className={classes.content}>\r\n\t\t\t\t{dialogButtons.map(({ label, action, disabled }, i) => (\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\t\tonClick={() => handleClickButton(action)}\r\n\t\t\t\t\t\tfullWidth\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t))}\r\n\t\t\t\t<CancelButton onClick={onClose} />\r\n\t\t\t</DialogContent>\r\n\t\t\t<DialogActions></DialogActions>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nHelpDialog.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\topen: PropTypes.bool.isRequired,\r\n\tonClose: PropTypes.func,\r\n}\r\n\r\nHelpDialog.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(HelpDialog);","import React, {useState} from 'react'\r\nimport {IconButton, Tooltip} from '@material-ui/core';\r\nimport HelpDialog from './HelpDialog';\r\nimport HelpIcon from '@material-ui/icons/Help'\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction Help() {\r\n\tconst [open, setOpen] = useState(false)\r\n\treturn (<>\r\n\t\t<Tooltip title={Tr('help')}>\r\n\t\t\t<IconButton onClick={() => setOpen(true)}>\r\n\t\t\t\t<HelpIcon/>\r\n\t\t\t</IconButton>\r\n\t\t</Tooltip>\r\n\t\t<HelpDialog open={open} onClose={() => setOpen(false)} />\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nHelp.propTypes = {\r\n}\r\n\r\nHelp.defaultProps = {\r\n}\r\n\r\nexport default Help;\r\n","import React from 'react'\r\nimport {IconButton, Tooltip} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n\tflag: {\r\n\t\twidth: theme.spacing(3)\r\n\t}\r\n}))\r\n\r\nfunction ChangeLanguageButtonButtons(\r\n\t{\r\n\t\tlocale,\r\n\t\tsetLocale,\r\n\t\tIcon\r\n\t}) {\r\n\tconst classes = useStyle();\r\n\tconst handleClick = () => {\r\n\t\tsetLocale(locale);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Tooltip title={Tr(\"change_lang_\" + locale)}>\r\n\t\t\t<IconButton onClick={handleClick}>\r\n\t\t\t\t<Icon className={classes.flag}/>\r\n\t\t\t</IconButton>\r\n\t\t</ Tooltip>\r\n\t)\r\n}\r\n\r\nexport default ChangeLanguageButtonButtons;\r\n","import reduxStore from 'redux/store'\r\n\r\nexport default (url) => {\r\n    const form = document.createElement(\"form\");\r\n    form.setAttribute('action', url);\r\n    form.setAttribute('method', 'post');\r\n    form.setAttribute('hidden', 'true');\r\n    const csrfInput = document.createElement(\"input\");\r\n    csrfInput.setAttribute('name', 'CSRFToken');\r\n    csrfInput.setAttribute('hidden', 'true');\r\n    csrfInput.setAttribute('type', 'text');\r\n    csrfInput.value = reduxStore.getState().resources.userData.csrf;\r\n    form.append(csrfInput);\r\n    document.body.appendChild(form);\r\n    form.submit();\r\n}","import React from 'react'\r\nimport {AppBar as AppBarUI, Toolbar} from '@material-ui/core';\r\nimport InvertColorsButton from './InvertColorsButton';\r\nimport TextSizeButton from './TextSizeButton';\r\nimport Profile from './Profile';\r\nimport PolandSvg from 'images/Poland'\r\nimport GreatBritainSvg from 'images/GreatBritain'\r\nimport {connect} from 'react-redux'\r\nimport GridBlock from 'components/GridBlock';\r\nimport clsx from 'clsx';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport SwapHorizIcon from '@material-ui/icons/SwapHoriz';\r\nimport Endpoints from 'constants/Endpoints';\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {withRouter} from \"react-router\";\r\nimport Help from \"../../popup/help/Help\";\r\nimport ChangeLanguageButtonButtons from \"./ChangeLanguageButtonButtons\";\r\nimport redirectUsingPOST from \"libs/redirectUsingPOST\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        paddingLeft: theme.components.navigation.margin.left,\r\n        zIndex: theme.zIndex.appBar + 10,\r\n        borderBottom: `solid 3px ${theme.palette.primary.main}`,\r\n        backgroundColor: theme.palette.background.greyBackground,\r\n    },\r\n    rootBorder: {},\r\n    menuMargin: {\r\n        paddingLeft: theme.components.navigation.width,\r\n        transition: theme.transitions.default.open('margin-left'),\r\n    },\r\n    toolbar: {\r\n        justifyContent: 'space-between'\r\n    },\r\n    rightGrid: {\r\n        width: 'unset'\r\n    },\r\n    beta: {\r\n        paddingLeft: theme.spacing(1),\r\n        color: theme.palette.primary.contrastText\r\n    },\r\n    buttonLight: {\r\n        whiteSpace: 'nowrap',\r\n        marginRight: theme.spacing(1),\r\n    },\r\n    logo: {\r\n        maxHeight: 55,\r\n        maxWidth: 200\r\n    }\r\n}))\r\n\r\nfunction AppBar(\r\n    {\r\n        logo = {},\r\n        isMenuOpen,\r\n        demandHeader,\r\n        id,\r\n        location\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const goSoStatus = !!(demandHeader?.oldPlatformRoundStatusUrl);\r\n\r\n    const handleRedirectToOldSystemVersion = () => {\r\n        if (goSoStatus) {\r\n            window.location.href = demandHeader.oldPlatformRoundStatusUrl;\r\n        } else {\r\n            window.location.href = Endpoints.SERVER_URL;\r\n        }\r\n    };\r\n\r\n    const changeLocale = (locale) => {\r\n        const split = locale.split(\"_\");\r\n        const auth = JSON.parse(localStorage.getItem(\"authorize\"));\r\n        const url = Endpoints.CHANG_LANGUAGE(split[0], split[1], auth.csrf, window.location.href);\r\n        redirectUsingPOST(url);\r\n    }\r\n\r\n    return (\r\n        <AppBarUI\r\n            id={id}\r\n            className={clsx(classes.root, {\r\n                [classes.menuMargin]: isMenuOpen,\r\n                [classes.rootBorder]: !demandHeader\r\n            })}\r\n            elevation={0}\r\n            position='sticky'\r\n        >\r\n            <Toolbar\r\n                className={classes.toolbar}\r\n            >\r\n                <GridBlock alignItems=\"center\">\r\n                    <img\r\n                        className={classes.logo}\r\n                        src={logo.url}\r\n                        alt='logo'\r\n                    />\r\n                    {/*<Typography className={classes.beta} variant=\"body1\">{Tr(\"beta_version\")}</Typography>*/}\r\n                </GridBlock>\r\n                <GridBlock\r\n                    wrap='nowrap'\r\n                    className={classes.rightGrid}\r\n                    alignItems='center'\r\n                >\r\n                    <Button\r\n                        size='small'\r\n                        onClick={handleRedirectToOldSystemVersion}\r\n                        color='secondary'\r\n                        className={classes.buttonLight}\r\n                        variant='text'\r\n                    >\r\n                        <SwapHorizIcon/>\r\n                        {Tr(goSoStatus ? 'redirectToOldVersionStatus' : 'redirectToOldVersion')}\r\n                    </Button>\r\n                    <Help/>\r\n                    <TextSizeButton/>\r\n                    <InvertColorsButton/>\r\n                    {/* <Avatar /> */}\r\n                    <ChangeLanguageButtonButtons Icon={PolandSvg} locale={\"pl_PL\"} setLocale={changeLocale}/>\r\n                    <ChangeLanguageButtonButtons Icon={GreatBritainSvg} locale={\"en_EN\"} setLocale={changeLocale}/>\r\n                    <Profile/>\r\n                </GridBlock>\r\n            </Toolbar>\r\n        </AppBarUI>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    logo: state.resources.logo,\r\n    isMenuOpen: state.store.isMenuOpen,\r\n    demandHeader: state.resources.demandHeader,\r\n}), {})(withRouter(AppBar));\r\n","import React from 'react'\r\nimport {IconButton as MuiIconButton, Tooltip} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport AcUnitIcon from '@material-ui/icons/AcUnit';\r\n\r\n\r\nfunction IconButton(\r\n    {\r\n        tooltip,\r\n        placement = 'top',\r\n        hideTooltip = false,\r\n        Icon = AcUnitIcon,\r\n        children,\r\n        disabled,\r\n        color,\r\n        ...props\r\n    }) {\r\n    const button = (\r\n        <MuiIconButton color={color} disabled={disabled} {...props} >\r\n            <Icon/>\r\n            {children}\r\n        </MuiIconButton>\r\n    )\r\n\r\n    if (hideTooltip || !Boolean(tooltip)) {\r\n        return button\r\n    }\r\n    return (\r\n        <Tooltip title={tooltip} placement={placement}>\r\n\t\t\t<span>\r\n\t\t\t\t{button}\r\n\t\t\t</span>\r\n        </Tooltip>\r\n    )\r\n}\r\n\r\nIconButton.propTypes = {\r\n    tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\r\n    placement: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    Icon: PropTypes.elementType,\r\n    disabled: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default IconButton;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport IconButton from './IconButton';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\n\r\nfunction IconCloseButton({\r\n\tclasses,\r\n\ttooltip = Tr('close'),\r\n\t...props\r\n}) {\r\n\treturn <IconButton\r\n\t\ttooltip={tooltip}\r\n\t\tIcon={CloseIcon}\r\n\t\t{...props}\r\n\t/>\r\n}\r\n\r\nIconCloseButton.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default IconCloseButton;","import React from 'react'\r\nimport CircularProgress from '@material-ui/core/CircularProgress';\r\nimport { withStyles } from '@material-ui/styles';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\twidth: '100%',\r\n\t\theight: '100%',\r\n\t\tminHeight: 40,\r\n\t\tposition: 'relative',\r\n\r\n\t\t'&>*': {\r\n\t\t\tposition: 'absolute',\r\n\t\t\ttop: '50%',\r\n\t\t\tleft: 'calc(50% - 20px)',\r\n\t\t\ttransform: 'translate(-50%, -50%)',\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction Loading({\r\n\tclasses,\r\n\tsize,\r\n\tclassName,\r\n\tref,\r\n}) {\r\n\treturn (\r\n\t\t<div className={clsx(\r\n\t\t\tclasses.root,\r\n\t\t\tclassName\r\n\t\t)}\r\n\t\t\tref={ref}\r\n\t\t>\r\n\t\t\t<div>\r\n\t\t\t\t<CircularProgress size={size} />\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nexport default withStyles(style)(Loading);\r\n","import React from 'react'\r\nimport {Box, Dialog as DialogUI, DialogActions, DialogContent, DialogTitle} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\nimport IconCloseButton from './button/IconCloseButton';\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport Loading from \"./Loading\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n\troot: {\r\n\t\tposition: 'relative'\r\n\t},\r\n\tcontent: {\r\n\t\tminHeight: 50\r\n\t},\r\n\tcentered: {\r\n\t\ttextAlign: 'center'\r\n\t},\r\n\tborder: {\r\n\t\tborder: theme.palette.border.onlyContrast ? `1px solid ${theme.palette.border.onlyContrast}` : undefined,\r\n\t},\r\n\tcloseButtonBox: {\r\n\t\tposition: 'absolute',\r\n\t\tright: theme.spacing(1),\r\n\t\ttop: theme.spacing(1),\r\n\t},\r\n\tcloseButton: {\r\n\t\tcolor: theme.palette.primary.main,\r\n\t},\r\n\tloading: {\r\n\t\twidth: '92%'\r\n\t}\r\n}));\r\n\r\nfunction Dialog({\r\n\ttitle,\r\n\tchildren,\r\n\tfullWidth = true,\r\n\tmaxWidth,\r\n\topen,\r\n\tclassName,\r\n\tcontentClassName,\r\n\ttitleCentered = false,\r\n\ttransitionDuration,\r\n\tonClose,\r\n\tpaperClassName,\r\n\tdialogActions,\r\n\tloading,\r\n\thtmlId\r\n}) {\r\n\tconst classes = useStyle();\r\n\treturn (\r\n\t\t<DialogUI\r\n\t\t\tfullWidth={fullWidth}\r\n\t\t\tmaxWidth={maxWidth}\r\n\t\t\tclassName={clsx(\r\n\t\t\t\tclassName,\r\n\t\t\t\tclasses.root\r\n\t\t\t)}\r\n\t\t\ttransitionDuration={transitionDuration}\r\n\t\t\topen={open}\r\n\t\t\tPaperProps={{\r\n\t\t\t\tclassName: clsx(paperClassName, classes.border)\r\n\t\t\t}}\r\n\t\t\tid={htmlId}\r\n\t\t>\r\n\t\t\t{title &&\r\n\t\t\t\t<DialogTitle className={clsx(\r\n\t\t\t\t\tclasses.title, {\r\n\t\t\t\t\t\t[classes.centered]: titleCentered\r\n\t\t\t\t\t}\r\n\t\t\t\t)}>{title}\r\n\t\t\t\t\t{onClose ? (\r\n\t\t\t\t\t\t<Box className={classes.closeButtonBox}>\r\n\t\t\t\t\t\t\t<IconCloseButton\r\n\t\t\t\t\t\t\t\taria-label=\"close\"\r\n\t\t\t\t\t\t\t\tclassName={classes.closeButton}\r\n\t\t\t\t\t\t\t\tonClick={onClose}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t</DialogTitle>\r\n\t\t\t}\r\n\t\t\t<DialogContent className={clsx(\r\n\t\t\t\tclasses.content,\r\n\t\t\t\tcontentClassName\r\n\t\t\t)}>\r\n\t\t\t\t{\r\n\t\t\t\t\t!!loading ?\r\n\t\t\t\t\t\t<Loading className={classes.loading}/>\r\n\t\t\t\t\t\t:\r\n\t\t\t\t\t\tchildren\r\n\t\t\t\t}\r\n\t\t\t</DialogContent>\r\n\t\t\t<DialogActions children={dialogActions}/>\r\n\t\t</DialogUI>\r\n\t)\r\n}\r\n\r\nDialog.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tmaxWidth: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false])\r\n}\r\n\r\nexport default Dialog;","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tbuttonContainer: {\r\n\t\tdisplay: 'flex',\r\n\t\tjustifyContent: 'flex-end',\r\n\t\tmarginTop: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction IEInfo({\r\n\tclasses,\r\n\topen = false,\r\n\tonClose,\r\n}) {\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\ttitle={Tr('attention')}\r\n\t\t\topen={open}\r\n\t\t\tonClose={onClose}\r\n\t\t>\r\n\t\t\t<Typography>\r\n\t\t\t\t{Tr('ie_info')}\r\n\t\t\t</Typography>\r\n\t\t\t<div className={classes.buttonContainer}>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tonClick={onClose}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Tr('understand')}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nIEInfo.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(IEInfo);","\r\n\r\n//https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser\r\n\r\n// Opera 8.0+\r\nconst isOpera = (!!window.opr && !!window.opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;\r\n\r\n// Firefox 1.0+\r\nconst isFirefox = typeof InstallTrigger !== 'undefined';\r\n\r\n// Safari 3.0+ \"[object HTMLElementConstructor]\" \r\nconst isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === \"[object SafariRemoteNotification]\"; })(!window['safari'] || (typeof window['safari'] !== 'undefined' && window['safari'].pushNotification));\r\n\r\n// Internet Explorer 6-11\r\nconst isIE = /*@cc_on!@*/false || !!document.documentMode;\r\n\r\n// Edge 20+\r\nconst isEdge = !isIE && !!window.StyleMedia;\r\n\r\n// Chrome 1 - 71\r\nconst isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);\r\n\r\n// Blink engine detection\r\nconst isBlink = (isChrome || isOpera) && !!window.CSS;\r\n\r\nexport default {\r\n\tisOpera,\r\n\tisFirefox,\r\n\tisSafari,\r\n\tisIE,\r\n\tisEdge,\r\n\tisChrome,\r\n\tisBlink,\r\n}","import _ from 'lodash'\r\n/**\r\n * Deep diff between two object, using lodash\r\n * @param  {Object} object Object compared\r\n * @param  {Object} base   Object to compare with\r\n * @return {Object}        Return a new object who represent the diff. If no diff it will return null.\r\n * \r\n * Source: https://gist.github.com/Yimiprod/7ee176597fef230d1451\r\n */\r\n\r\nexport default {\r\n\tdiff: (object, base, checkCondition = false) => {\r\n\t\tif (!object || !base) {\r\n\t\t\tconsole.error('Can not diff object if one of them is undefined.')\r\n\t\t\treturn object !== base\r\n\t\t}\r\n\t\tconst changes = (object, base) => _.transform(object, function (result, value, key) {\r\n\t\t\tif (!_.isEqual(value, base[key])) {\r\n\t\t\t\tconst res = (_.isObject(value) && _.isObject(base[key])) ? changes(value, base[key]) : value;\r\n\t\t\t\tif (!_.isObject(res)) {\r\n\t\t\t\t\tresult[key] = res;\r\n\t\t\t\t} else if (Object.keys(res).length > 0) {\r\n\t\t\t\t\tresult[key] = res;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tconst changesObj = changes(object, base)\r\n\t\tif (Object.keys(changesObj).length > 0) return changesObj;\r\n\t\tif (checkCondition) return changesObj;\r\n\t\treturn null;\r\n\t}\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestGET} from \"libs/RestRequest\";\r\n\r\nconst DEMAND_VALIDATION_RESOURCE_ID = \"demandValidation\";\r\n\r\n\r\nconst getPreparingSections = async (id, clear = true) => {\r\n    await getSections(id, clear, Endpoints.DEMAND_PREPARING_SECTIONS);\r\n}\r\n\r\nconst getEvaluationSections = async (id, clear = true) => {\r\n    await getSections(id, clear, Endpoints.DEMAND_EVALUATION_SECTIONS);\r\n}\r\n\r\nconst getFinishingSections = async (id, clear = true) => {\r\n    await getSections(id, clear, Endpoints.DEMAND_FINISHING_SECTIONS);\r\n}\r\n\r\nconst getSections = async (id, clear = true, urlFn) => {\r\n    if (clear) {\r\n        clearResource(DEMAND_VALIDATION_RESOURCE_ID)\r\n    }\r\n\r\n    try {\r\n        const res = await RestRequestGET(urlFn(id));\r\n        reduxStore.dispatch(setResource(DEMAND_VALIDATION_RESOURCE_ID, res))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst clearDemandValidationResources = () => reduxStore.dispatch(clearResource(DEMAND_VALIDATION_RESOURCE_ID));\r\n\r\nexport default {\r\n    getPreparingSections,\r\n    getEvaluationSections,\r\n    getFinishingSections,\r\n    clearDemandValidationResources,\r\n    DEMAND_VALIDATION_RESOURCE_ID\r\n}","import {RestRequestGET} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store';\r\nimport {clearPrivileges, setPrivileges} from 'redux/actions';\r\n\r\nconst CORRESPONDENCE_PRIVILEGE_STORE_KEY = 'correspondence';\r\nconst RFX_PRIVILEGE_STORE_KEY = 'rfx';\r\nconst DEMAND_PRIVILEGE_STORE_KEY = 'demand';\r\n\r\nconst cleanupPrivileges = (id) => {\r\n    reduxStore.dispatch(clearPrivileges(id));\r\n}\r\n\r\nconst getPrivileges = async (url, key) => {\r\n    const resp = await RestRequestGET(url);\r\n    if (resp.success === true)\r\n        reduxStore.dispatch(setPrivileges(key, resp.map))\r\n}\r\n\r\nexport default {\r\n    getPrivileges,\r\n    cleanupPrivileges,\r\n    CORRESPONDENCE_PRIVILEGE_STORE_KEY,\r\n    RFX_PRIVILEGE_STORE_KEY,\r\n    DEMAND_PRIVILEGE_STORE_KEY\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {\r\n    clearResource,\r\n    setResource,\r\n    setSaveStatusClosed,\r\n    setSaveStatusDeleted,\r\n    setSaveStatusDialog,\r\n    setSaveStatusError,\r\n    setSaveStatusLoading,\r\n    setStepperState\r\n} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport RouterPath, {createPath} from 'libs/RouterPath';\r\nimport Tr from 'translations/Translations';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport objectExtension from 'libs/objectExtension'\r\nimport querystring from 'querystring';\r\nimport {ProcedureType} from \"../constants/ProcedureType\";\r\nimport DemandSectionsService from \"./DemandSectionsService\";\r\nimport PrivilegeService from \"./PrivilegeService\";\r\n\r\nconst DEMAND_RESOURCE_ID = 'demand';\r\nconst DEMAND_AVAILABLE_FORM_TYPES_RESOURCE_ID = 'demandAvailableFormTypes';\r\nconst DEMAND_AVAILABLE_REALIZATIONS_RESOURCE_ID = 'demandRealizationTypes';\r\nconst DEMAND_AVAILABLE_ORGANIZATIONS_RESOURCE_ID = 'demandAvailableOrganizations';\r\nconst DEMAND_NUMBER_AUTOMATED = 'demandNumberAutomated';\r\nconst DEMAND_CASE_CLASSIFICATION_SYMBOL_REQUIRED = 'caseClassificationSymbolRequired';\r\n\r\n\r\nconst createParams = (params, defaultProps = {\r\n    procedureType: ProcedureType.EUROPE_PUBLIC,\r\n    passive: false,\r\n    exPost: false\r\n}) => {\r\n    const {procedureType, passive, exPost} = params;\r\n    let queryParams = {}\r\n    if (passive) {\r\n        queryParams['passive'] = passive;\r\n    } else if (defaultProps.passive) {\r\n        queryParams['passive'] = defaultProps.passive;\r\n    }\r\n\r\n    if (procedureType) {\r\n        queryParams['procedureType'] = procedureType;\r\n    } else if (defaultProps.procedureType) {\r\n        queryParams['procedureType'] = defaultProps.procedureType;\r\n    }\r\n\r\n    if (exPost) {\r\n        queryParams['exPost'] = exPost;\r\n    } else if (defaultProps.exPost) {\r\n        queryParams['exPost'] = defaultProps.exPost;\r\n    }\r\n\r\n    return `?${querystring.stringify(queryParams)}`\r\n}\r\n\r\nconst get = async (id, params) => {\r\n    const res = await RestRequestGET(Endpoints.DEMAND_GET_BY_ID(id, createParams(params, {})));\r\n    reduxStore.dispatch(setResource(DEMAND_RESOURCE_ID, res.demand));\r\n    reduxStore.dispatch(setResource(DEMAND_AVAILABLE_REALIZATIONS_RESOURCE_ID, res.demandAvailableRealizationTypes));\r\n    reduxStore.dispatch(setResource(DEMAND_AVAILABLE_ORGANIZATIONS_RESOURCE_ID, res.demandAvailableOrganizations));\r\n    reduxStore.dispatch(setResource(DEMAND_AVAILABLE_FORM_TYPES_RESOURCE_ID, res.demandAvailableFormTypes));\r\n    reduxStore.dispatch(setResource(DEMAND_NUMBER_AUTOMATED, res.numberingAutomated));\r\n    reduxStore.dispatch(setResource(DEMAND_CASE_CLASSIFICATION_SYMBOL_REQUIRED, res.caseClassificationSymbolRequired));\r\n    return res;\r\n}\r\n\r\nconst getCreateNew = async (params) => {\r\n    const res = await RestRequestGET(Endpoints.DEMAND_GET_BY_ID(-1, createParams(params)));\r\n    reduxStore.dispatch(setResource(DEMAND_RESOURCE_ID, res.demand));\r\n    reduxStore.dispatch(setResource(DEMAND_AVAILABLE_REALIZATIONS_RESOURCE_ID, res.demandAvailableRealizationTypes));\r\n    reduxStore.dispatch(setResource(DEMAND_AVAILABLE_ORGANIZATIONS_RESOURCE_ID, res.demandAvailableOrganizations));\r\n    reduxStore.dispatch(setResource(DEMAND_AVAILABLE_FORM_TYPES_RESOURCE_ID, res.demandAvailableFormTypes));\r\n    reduxStore.dispatch(setResource(DEMAND_NUMBER_AUTOMATED, res.numberingAutomated));\r\n    reduxStore.dispatch(setResource(DEMAND_CASE_CLASSIFICATION_SYMBOL_REQUIRED, res.caseClassificationSymbolRequired));\r\n}\r\n\r\nconst _formatFormValues = (values) => {\r\n    const {\r\n        identity,\r\n        enableOptional,\r\n        termOption,\r\n        termDate,\r\n        termDescription,\r\n        orderValueDecisionDate,\r\n        auctionMade,\r\n        digitalSign,\r\n        euFunded,\r\n        ...other\r\n    } = values;\r\n\r\n    const formatDate = (x) => (x ? x.format() : x);\r\n\r\n    return {\r\n        identity: identity,\r\n        agreementRealizationDate: {\r\n            date: termOption === 'date' ? formatDate(termDate) : null,\r\n            text: termOption === 'text' ? termDescription : null,\r\n        },\r\n        orderValueDecisionDate: formatDate(orderValueDecisionDate),\r\n        auctionMade: auctionMade === 'true',\r\n        digitalSign: digitalSign === 'true',\r\n        euFunded: euFunded === 'true',\r\n        ...other\r\n    }\r\n}\r\n\r\nconst _save = async (url, values) => {\r\n    const data = _formatFormValues(values)\r\n    const {resources} = reduxStore.getState()\r\n    const {demand} = resources;\r\n    const diff = objectExtension.diff(data, demand);\r\n    if (diff === null) return null;\r\n\r\n    try {\r\n        return await RestRequestPOST(url, data)\r\n    } catch (error) {\r\n        throw error;\r\n    }\r\n}\r\n\r\nconst getValidate = async (id = -1, clear = true) => {\r\n    if (id === -1) {\r\n        if (clear) {\r\n            reduxStore.dispatch(clearResource(DemandSectionsService.DEMAND_VALIDATION_RESOURCE_ID))\r\n        }\r\n        const data = [\r\n            {\r\n                section: DemandValidation.DEMAND,\r\n                status: \"EMPTY\",\r\n                required: true,\r\n            }\r\n        ]\r\n        reduxStore.dispatch(setResource(DemandSectionsService.DEMAND_VALIDATION_RESOURCE_ID, data))\r\n        return;\r\n    }\r\n\r\n    await DemandSectionsService.getPreparingSections(id, clear)\r\n}\r\n\r\nconst save = async (values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n\r\n    const res = await _save(Endpoints.DEMAND_SAVE, values)\r\n    await _handleSaveResponse(res);\r\n}\r\n\r\nconst saveExPost = async (values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n\r\n    const res = await _save(Endpoints.DEMAND_SAVE_EX_POST, values)\r\n    await _handleSaveResponse(res);\r\n}\r\n\r\nconst _handleSaveResponse = async (res) => {\r\n    try {\r\n        if (res === null) {\r\n            reduxStore.dispatch(setSaveStatusDialog());\r\n            reduxStore.dispatch(setStepperState())\r\n        } else if (res.success) {\r\n            reduxStore.dispatch(setSaveStatusDialog());\r\n            reduxStore.dispatch(setStepperState())\r\n\r\n            const path = createPath(RouterPath.myProcedure.steps.MP_1_ID, {id: res.result})\r\n            if (path === window.location.pathname) {\r\n                await getValidate(res.result, false)\r\n            } else {\r\n                RouterPath.redirect(path)\r\n            }\r\n        } else {\r\n            let msg;\r\n\r\n            for (let prop in res.errors) {\r\n                if (Object.prototype.hasOwnProperty.call(res.errors, prop)) {\r\n                    if (prop === 'number') {\r\n                        msg = res.errors[prop];\r\n                    } else if (prop.startsWith('fundingInstitutionLogo')) {\r\n                        msg = Tr('funding_institution_logo_error');\r\n                    } else if (prop === 'ezdrpId' || prop === 'ezdpuwId') {\r\n                        msg =  Array.isArray(res.errors[prop]) ? res.errors[prop][0] : res.errors[prop];\r\n                    } else if (prop === 'name') {\r\n                        if(Array.isArray(res.errors[prop]))\r\n                            msg = res.errors[prop][0];\r\n                        else if(typeof res.errors[prop] === 'string')\r\n                            msg = res.errors[prop];\r\n                    }\r\n                }\r\n                if (msg) {\r\n                    break;\r\n                }\r\n            }\r\n\r\n            if (!msg) {\r\n                msg = Tr('unknown_error_message');\r\n            }\r\n            reduxStore.dispatch(setSaveStatusError(msg));\r\n        }\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst preview = async (id = -1) => {\r\n\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEMAND_PREVIEW(id))\r\n        window.location.href = res.url\r\n    } catch (error) {\r\n    }\r\n\r\n}\r\n\r\n// const autoSave = async (id = -1) => {\r\n// \tconst { formValues } = reduxStore.getState()\r\n// \tconst values = formValues['mp_1_demand']\r\n// \tif (values === undefined) return;\r\n//\r\n// \ttry {\r\n// \t\tawait _save(Endpoints.DEMAND_AUTOSAVE(id), values)\r\n// \t} catch (error) {\r\n// \t}\r\n// }\r\n//\r\n// const autoSaveCheck = async (id = -1) => {\r\n// \ttry {\r\n// \t\treturn await RestRequestGET(Endpoints.DEMAND_AUTOSAVE_CHECK(id))\r\n// \t} catch (error) {\r\n// \t}\r\n// }\r\n//\r\n// const autoSaveDelete = async (id = -1) => {\r\n// \ttry {\r\n// \t\treturn await RestRequestDELETE(Endpoints.DEMAND_AUTOSAVE(id))\r\n// \t} catch (error) {\r\n// \t}\r\n// }\r\n//\r\n// const autoSaveLoad = async (id = -1) => {\r\n// \ttry {\r\n// \t\tconst res = await RestRequestGET(Endpoints.DEMAND_AUTOSAVE(id))\r\n// \t\treduxStore.dispatch(\r\n// \t\t\tsetResource(DEMAND_RESOURCE_ID, res)\r\n// \t\t)\r\n// \t} catch (error) {\r\n// \t}\r\n// }\r\n//\r\n// const restoreAutosave = async (id = -1) => {\r\n// \tawait autoSaveLoad(id);\r\n// }\r\n//\r\n// const getDemandActions = async (id = -1) => {\r\n// \ttry {\r\n// \t\tlet res = await RestRequestGET(Endpoints.DEMAND_ACTIONS(id))\r\n// \t\treduxStore.dispatch(setResource(\"demandActions\", res))\r\n// \t} catch (error) { }\r\n// }\r\n\r\nconst deteleUrl = async (url) => {\r\n    try {\r\n        await RestRequestDELETE(url);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst action = async (url) => {\r\n    try {\r\n        await RestRequestGET(url);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst deleteDemand = async (id) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        await RestRequestDELETE(Endpoints.DEMAND_DELETE(id));\r\n        reduxStore.dispatch(setSaveStatusDeleted());\r\n    } catch (error) {\r\n        reduxStore.dispatch(setSaveStatusError());\r\n    }\r\n}\r\n\r\nconst clone = async (id) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.DEMAND_CLONE(id))\r\n        if (res.success) {\r\n            reduxStore.dispatch(setSaveStatusClosed());\r\n            const path = createPath(RouterPath.myProcedure.steps.MP_1_ID, {id: res.result})\r\n            RouterPath.redirect(path)\r\n        } else {\r\n        }\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst clearResources = (resource) => reduxStore.dispatch(clearResource(resource));\r\n\r\nconst getRelatedObjects = async (id) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_REALTED_OBJECTS(id));\r\n}\r\nconst getBuyerPrivileges = async (id) => {\r\n    await PrivilegeService.getPrivileges(Endpoints.DEMAND_PRIVILEGES(id), PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY);\r\n}\r\nconst getBuyerRfxPrivileges = async (id) => {\r\n    await PrivilegeService.getPrivileges(Endpoints.DEMAND_RFX_PRIVILEGES(id), PrivilegeService.RFX_PRIVILEGE_STORE_KEY);\r\n}\r\n\r\nconst updateNumber = async (id) => {\r\n    return await RestRequestPOST(Endpoints.DEMAND_UPDATE_NUMBER(id));\r\n}\r\n\r\nconst checkForDraft = async (id) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraft = async (id) => {\r\n    const res = await RestRequestGET(Endpoints.DEMAND_AUTOSAVE(id));\r\n    reduxStore.dispatch(setResource(DEMAND_RESOURCE_ID, res.result));\r\n    return res;\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n    await RestRequestPOST(Endpoints.DEMAND_AUTOSAVE(id), formValues)\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n    await RestRequestDELETE(Endpoints.DEMAND_AUTOSAVE(id));\r\n}\r\n\r\nconst checkForDraftExPost = async (id) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_EXPOST_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraftExPost = async (id) => {\r\n    const res = await RestRequestGET(Endpoints.DEMAND_EXPOST_AUTOSAVE(id));\r\n    reduxStore.dispatch(setResource(DEMAND_RESOURCE_ID, res.result));\r\n    return res;\r\n}\r\n\r\nconst saveDraftExPost = async (id, formValues) => {\r\n    await RestRequestPOST(Endpoints.DEMAND_EXPOST_AUTOSAVE(id), formValues)\r\n}\r\n\r\nconst deleteDraftExPost = async (id) => {\r\n    await RestRequestDELETE(Endpoints.DEMAND_EXPOST_AUTOSAVE(id));\r\n}\r\n\r\nexport default {\r\n    get,\r\n    getCreateNew,\r\n    save,\r\n    saveExPost,\r\n    clone,\r\n    getValidate,\r\n    preview,\r\n    //getDemandActions,\r\n    deteleUrl,\r\n    action,\r\n    deleteDemand,\r\n    clearResources,\r\n    getRelatedObjects,\r\n    getBuyerPrivileges,\r\n    getBuyerRfxPrivileges,\r\n    updateNumber,\r\n    checkForDraft,\r\n    loadDraft,\r\n    saveDraft,\r\n    deleteDraft,\r\n    checkForDraftExPost,\r\n    loadDraftExPost,\r\n    saveDraftExPost,\r\n    deleteDraftExPost,\r\n    DEMAND_RESOURCE_ID,\r\n    DEMAND_AVAILABLE_REALIZATIONS_RESOURCE_ID,\r\n    DEMAND_AVAILABLE_ORGANIZATIONS_RESOURCE_ID,\r\n    DEMAND_AVAILABLE_FORM_TYPES_RESOURCE_ID,\r\n    DEMAND_NUMBER_AUTOMATED,\r\n    DEMAND_CASE_CLASSIFICATION_SYMBOL_REQUIRED\r\n}","\r\nexport default {\r\n\tprocedure: {\r\n\t\tbasicInformation: {\r\n\t\t\tNUMBER: 50,\r\n\t\t\tNAME: 400,\r\n\t\t\tDESCRIPTION: 4000,\r\n\r\n\t\t\tCONTACT_PERSON: 200,\r\n\t\t\tCONTACT_PERSON_PHONE: 20,\r\n\r\n\t\t\tPURCHASER_PHONE: 20,\r\n\t\t\tPURCHASER_FAX: 20,\r\n\t\t\tPURCHASER_EMAIL: 255,\r\n\t\t\tPURCHASER_ADDITIONAL_INFO: 500,\r\n\r\n\t\t\tEOD: 100,\r\n\t\t\tSINGLE_DEALING_JUSTIFICATION: 4000,\r\n\t\t\tESTIMATION_BASE: 255,\r\n\t\t\tFINANCIAL_SOURCE: 4000,\r\n\t\t\tTERM_DESCRIPTION: 1000,\r\n\t\t\tFULL_NAME: 200,\r\n\t\t\tEU_PROJECT_NUMBER: 100\r\n\t\t},\r\n\t\tcontractor: {\r\n\t\t\tNAME: 1000,\r\n\t\t\tPOSTCODE_PL: 6,\r\n\t\t\tPOSTCODE: 50,\r\n\t\t\tEMAIL: 255,\r\n\t\t\tNIP_MIN: 5,\r\n\t\t\tNIP_MAX: 20,\r\n\t\t\tPESEL_PL: 11,\r\n\t\t\tNIP_PL: 10,\r\n\t\t\tCITY: 100,\r\n\t\t\tADDRESS: 500\r\n\t\t},\r\n\t\torganization: {\r\n\t\t\tNAME: 500,\r\n\t\t},\r\n\t\tdealings: {\r\n\t\t\tNAME: 400,\r\n\t\t\tPLANNED_CONTRACTOR_NUMBER: 5\r\n\t\t},\r\n\t\tcondition: {\r\n\t\t\tOTHER_NAME: 400,\r\n\t\t},\r\n\t\tcriteriaSection: {\r\n\t\t\tNAME: 400\r\n\t\t},\r\n\t\tparameters: {\r\n\t\t\tNAME: 400\r\n\t\t},\r\n\t\titemParameters: {\r\n\t\t\tNAME: 30\r\n\t\t},\r\n\t\tdocuments: {\r\n\t\t\tNAME: 255\r\n\t\t},\r\n\t\tcorrespondence: {\r\n\t\t\tSUBJECT: 255\r\n\t\t}\r\n\t},\r\n}","import moment, {isMoment} from \"moment\";\r\nmoment.fn.toJSON = function() { return this.format(); }\r\n\r\nexport {isMoment}\r\nexport default moment","import * as Yup from 'yup'\r\nimport Tr from 'translations/Translations';\r\nimport InputLimits from \"./InputLimits\";\r\nimport moment, {isMoment} from \"libs/moment\";\r\n\r\nconst emailRegexp = /^[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?$/;\r\nconst contractorlimits = InputLimits.procedure.contractor\r\n\r\nYup.addMethod(Yup.string, 'noOnlyWhitespaces', function (message) {\r\n    const usedMessage = message ? message : Tr('not_only_whitespaces')\r\n    return this.test('only-whitespace', usedMessage, function (value) {\r\n        if (value != null && value !== undefined) {\r\n            return value.trim().length > 0;\r\n        }\r\n        return true;\r\n    });\r\n});\r\n\r\nconst maxStringFunc = ({value, max}) => {\r\n    return Tr('too_many_characters', {max})\r\n}\r\n\r\nconst minStringFunc = ({value, min}) => {\r\n    const number = Math.abs(value.length - min)\r\n    return Tr('too_low_characters', {number})\r\n}\r\n\r\nconst amountMin = (min, inclusive) => Yup.string().test('amountMin',\r\n    inclusive ? Tr('v_number_min', {min}) : Tr('v_number_min_exclusive', {min}),\r\n    (val) => {\r\n        if (val) {\r\n            const fVal = parseFloat(val);\r\n            return !isNaN(fVal) && inclusive ? min <= fVal : min < fVal;\r\n        }\r\n        return true;\r\n    })\r\n\r\nconst amountBasicOptional = (min, inclusive) => amountMin(min, inclusive)\r\n    .matches(/^$|^[^-].*$/, Tr('v_positive')).matches(/^$|^[-]?\\d+([,.]|([,.]\\d{1,2})?)$/, Tr(\"amount_error\"))\r\n\r\nconst amountBasicRequired = (min, inclusive) => amountMin(min, inclusive)\r\n    .matches(/^[^-].*$/, Tr('v_positive')).matches(/^[-]?\\d+([,.]|([,.]\\d{1,2})?)$/, Tr(\"amount_error\"))\r\n\r\nconst amountMaxDecimal100 = (value, noZero = true) => {\r\n    let tr = \"\"\r\n    const pValue = parseFloat(value)\r\n    if (noZero && pValue <= 0) return Yup.number().positive(Tr(\"v_positive\"));\r\n    else if (pValue > 100) tr = \"number_cant_be_bigger_than\"\r\n    else tr = \"amount_error\"\r\n    return Yup.string().matches(/(^\\d{1,2}([,.]\\d{1,2})?|100)$/, Tr(tr))\r\n}\r\n\r\nconst stringExactlyBase = (value, message) => Yup.string()\r\n    .matches(value, message)\r\n    .required(Tr('required_field'))\r\n    .nullable();\r\nconst stringNotOneOfBase = (value, message) => Yup.string()\r\n    .notOneOf(value, message)\r\n    .required(Tr('required_field'))\r\n    .nullable();\r\n\r\nconst stringMinAndMax = (min, max) => Yup.string()\r\n    .min(min, minStringFunc)\r\n    .max(max, maxStringFunc)\r\n    .required(Tr('required_field'));\r\n\r\nconst vatinPL = (val, optional) => {\r\n    if (!val && optional)\r\n        return true;\r\n    if (val?.length !== 10) {\r\n        return false;\r\n    }\r\n    if (val.charAt(0) === '0' || val.charAt(2) === '0') {\r\n        return false;\r\n    }\r\n\r\n    let weight = [6, 5, 7, 2, 3, 4, 5, 6, 7];\r\n    let sum = 0;\r\n    let controlNumber = parseInt(val.substring(9, 10));\r\n    let weightCount = weight.length;\r\n    for (let i = 0; i < weightCount; i++) {\r\n        sum += (parseInt(val.substr(i, 1)) * weight[i]);\r\n    }\r\n\r\n    return sum % 11 === controlNumber;\r\n}\r\n\r\nconst peselPL = (val) => {\r\n    if (val?.length !== contractorlimits.PESEL_PL) {\r\n        return false;\r\n    }\r\n\r\n    let weight = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3];\r\n    let sum = 0;\r\n    let controlNumber = parseInt(val.substring(10, 11));\r\n    for (let i = 0; i < weight.length; i++) {\r\n        sum += ((parseInt(val.substring(i, i + 1)) * weight[i]) % 10);\r\n    }\r\n    sum = sum % 10;\r\n    return (10 - sum) % 10 === controlNumber;\r\n}\r\n\r\nconst dateOrDateTimeValid = () => {\r\n    return Yup.mixed().test('dateOrDateTimeValid', Tr('invalid_date_format'), (value) => {\r\n        if (!value) {\r\n            return true;\r\n        }\r\n        if (isMoment(value)) {\r\n            return value.isValid();\r\n        } else if (typeof value === 'string' || value instanceof String) {\r\n            return moment(value, \"YYYY-MM-DD[T]HH:mm:ssZ\", true).isValid() || moment(value, \"YYYY-MM-DD[T]HH:mm:ss.SSSZ\", true).isValid();\r\n        }\r\n        return false;\r\n    })\r\n};\r\n\r\nconst dateMax = (date, tr) => {\r\n    return dateOrDateTimeValid().test('dateValidMax', tr, (value) => {\r\n        if (!value) {\r\n            return true;\r\n        }\r\n\r\n        let dateToCompare = date;\r\n        if (!isMoment(date)) {\r\n            dateToCompare = moment(date);\r\n        }\r\n        let result;\r\n        if (!dateToCompare.isValid()) {\r\n            result = false;\r\n        } else {\r\n            result = !dateToCompare.endOf('day').isBefore(value);\r\n        }\r\n\r\n        return result;\r\n    })\r\n}\r\n\r\n\r\nconst dateMin = (date, tr) => {\r\n    return dateOrDateTimeValid().test('dateValidMin', tr, (value) => {\r\n        if (!value || !value.isValid()) {\r\n            return true;\r\n        }\r\n        let dateToCompare = date;\r\n        if (!isMoment(date)) {\r\n            dateToCompare = moment(date);\r\n        }\r\n        let result;\r\n        if (!dateToCompare.isValid()) {\r\n            result = false;\r\n        } else {\r\n            result = !value.isBefore(dateToCompare.startOf(\"day\"));\r\n        }\r\n        return result;\r\n    })\r\n}\r\n\r\n\r\nconst dateTimeMin = (date, tr) => {\r\n    return dateOrDateTimeValid().test('dateTimeMin', tr, (value) => {\r\n        if (!value || !value.isValid()) {\r\n            return true;\r\n        }\r\n        let dateToCompare = date;\r\n        if (!isMoment(date)) {\r\n            dateToCompare = moment(date);\r\n        }\r\n        let result;\r\n        if (!dateToCompare.isValid()) {\r\n            result = false;\r\n        } else {\r\n            result = !value.isBefore(moment(dateToCompare));\r\n        }\r\n        return result;\r\n    })\r\n}\r\nconst dateTimeMax = (date, tr) => {\r\n    return dateOrDateTimeValid().test('dateTimeMax', tr, (value) => {\r\n        if (!value || !value.isValid()) {\r\n            return true;\r\n        }\r\n        let dateToCompare = date;\r\n        if (!isMoment(date)) {\r\n            dateToCompare = moment(date);\r\n        }\r\n        let result;\r\n        if (!dateToCompare.isValid()) {\r\n            result = false;\r\n        } else {\r\n            result = !dateToCompare.isBefore(value);\r\n        }\r\n        return result;\r\n    })\r\n}\r\n\r\n\r\nexport default {\r\n    stringNoRq: () => Yup.string(),\r\n    string: (value, defTrKey) => {\r\n        let trKey = defTrKey ? defTrKey : 'required_field'\r\n        if (!defTrKey && value !== undefined) {\r\n            trKey = 'v_string_required'\r\n        }\r\n        return Yup.string()\r\n            .required(Tr(trKey, {value}))\r\n            .noOnlyWhitespaces()\r\n            .nullable()\r\n    },\r\n    stringExactly: (value, message) => stringExactlyBase(value, message),\r\n    stringNotOneOf: (value, message) => stringNotOneOfBase(value, message),\r\n    stringExactlyMax: (value, message, max) => stringExactlyBase(value, message)\r\n        .max(max, maxStringFunc),\r\n    stringMax: (max) => Yup.string()\r\n        .max(max, maxStringFunc)\r\n        .noOnlyWhitespaces().nullable()\r\n        .required(Tr('required_field')),\r\n    stringMin: (min) => Yup.string()\r\n        .min(min, minStringFunc)\r\n        .noOnlyWhitespaces()\r\n        .required(Tr('required_field')),\r\n    stringMinAndMax,\r\n    stringMaxNoRq: (max) => Yup.string()\r\n        .max(max, maxStringFunc).nullable(),\r\n    number: (value) => {\r\n        if (value !== undefined) {\r\n            return Yup.number()\r\n                .typeError(Tr('v_number_value', {value}))\r\n                .min(0, Tr('v_positive_value', {value}))\r\n                .required(Tr('v_number'))\r\n        }\r\n        return Yup.number()\r\n            .typeError(Tr('v_number'))\r\n            // .integer(Tr('v_integer'))\r\n            .min(0, Tr('v_positive'))\r\n            .required(Tr('v_number'))\r\n    },\r\n    numberMax: (value, key) => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .min(0, Tr('v_positive'))\r\n        .max(value, Tr(key ? key : 'v_number_max', {value}))\r\n        .required(Tr('v_number')),\r\n    numberMin: (value, key) => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .min(value, Tr(key ? key : 'v_number_min', {min: value}))\r\n        .required(Tr('v_number')),\r\n    numberMin0: () => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .min(0, Tr('v_positive'))\r\n        .required(Tr('v_number')),\r\n    numberMaxNoZero: (value, key) => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .positive(Tr('v_positive'))\r\n        .max(value, Tr(key ? key : 'v_number_max', {value}))\r\n        .required(Tr('v_number')),\r\n    numberPositiveOptional: () => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .positive(Tr('v_positive')).nullable(),\r\n    numberPositiveNoZero: () => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .positive(Tr('v_positive'))\r\n        .required(Tr('v_number')),\r\n    numberMaxMin: (min, max, keyMin, keyMax, fieldName) => Yup.number()\r\n        .typeError(fieldName ? Tr('v_number_value_field', {value: fieldName}) : Tr('v_number'))\r\n        .min(min, Tr(keyMin ? keyMin : 'v_number_min', {min}))\r\n        .max(max, Tr(keyMax ? keyMax : 'v_number_max', {value: max}))\r\n        .required(Tr('v_number')),\r\n    decimalNumber: (value) => Yup.string()\r\n        .matches(/^[-]?\\d+([,.]|([,.]\\d{1,2})?)$/, Tr('decimal_number', {value}))\r\n        .required(Tr('v_number_value_field', {value})).nullable(),\r\n    bigDecimal: () => Yup.string()\r\n        .matches(/^[-]?\\d{1,17}([,.]|([,.]\\d{1,10})?)$/, Tr('v_number'))\r\n        .required(Tr('required_field')).nullable(),\r\n    bigDecimalOptional: () => Yup.string()\r\n        .matches(/^[-]?\\d{1,17}([,.]|([,.]\\d{1,10})?)$/, Tr('v_number'))\r\n        .nullable(),\r\n    integerMin: (value = 0) => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .min(value, Tr('v_number_min',{min: value}))\r\n        .required(Tr('v_number'))\r\n        .integer(Tr('integer_number')),\r\n    integerMax: (value, key) => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .min(1, Tr('v_number_min_0'))\r\n        .max(value, Tr(key ? key : 'v_number_max', {value}))\r\n        .required(Tr('v_number'))\r\n        .integer(Tr('integer_number')),\r\n    integerMinMax: (min, max, keyMin, keyMax) => Yup.number()\r\n        .typeError(Tr('v_number'))\r\n        .min(min, Tr(keyMin ? keyMin : min === 0 ? 'v_number_min_0' : 'v_number_min', {min: min}))\r\n        .max(max, Tr(keyMax ? keyMax : 'v_number_max', {value: max}))\r\n        .required(Tr('v_number'))\r\n        .integer(Tr('integer_number')),\r\n    email: () => Yup.string().email(Tr('invalid_email')).matches(emailRegexp, Tr('invalid_email')),\r\n    emailMax: (max) => Yup.string()\r\n        .max(max, maxStringFunc)\r\n        .email(Tr('invalid_email'))\r\n        .matches(emailRegexp, Tr('invalid_email'))\r\n        .nullable()\r\n        .required(Tr('required_field')),\r\n    emailMaxNoRq: (max) => Yup.string()\r\n        .max(max, maxStringFunc)\r\n        .email(Tr('invalid_email')).matches(emailRegexp, Tr('invalid_email')).nullable(),\r\n    amount: (min = 0, inclusive = true) => amountBasicRequired(min, inclusive)\r\n        .nullable()\r\n        .required(Tr('required_field')),\r\n    amountOptional: (min = 0, inclusive = true) => amountBasicOptional(min, inclusive)\r\n        .nullable(),\r\n    amountMax100NoZero: () => Yup.lazy((value) => amountMaxDecimal100(value)\r\n        .nullable()\r\n        .required(Tr('required_field'))\r\n    ),\r\n    amountMax100: () => Yup.lazy((value) => amountMaxDecimal100(value, false)\r\n        .nullable()\r\n        .required(Tr('required_field'))\r\n    ),\r\n    amountMax100Optional: () => Yup.lazy((value) => amountMaxDecimal100(value, false)\r\n        .nullable()\r\n    ),\r\n    arrayOfShape: (shape) => Yup.array(Yup.object().shape(shape)),\r\n    arrayOf: (shema) => Yup.array().of(shema),\r\n    object: (shape, fields) => Yup.object().shape(shape, fields),\r\n    lazy: (fn) => Yup.lazy(fn),\r\n    arrayRequired: (tr) => Yup.array().nullable().min(1, Tr(tr ? tr : 'required_field')).test(\r\n        'arrayRequired',\r\n        Tr(tr ? tr : 'required_field'),\r\n        (formValue) => {\r\n            return Array.isArray(formValue) && formValue.length >= 0;\r\n        }\r\n    ),\r\n    any: () => Yup.mixed(),\r\n    anyRequired: () => Yup.mixed().required(Tr('required_field')),\r\n    immediatelyError: (tr) => Yup.mixed().test('immediatelyError', tr, (val) => {\r\n        return false;\r\n    }),\r\n    dateMaxNoRq: (date, tr) => dateMax(date, tr),\r\n    dateMax: (date, tr) => dateMax(date, tr).required(Tr('required_field')),\r\n    dateMinNoRq: (date, tr) => dateMin(date, tr),\r\n    dateMin: (date, tr) => dateMin(date, tr).required(Tr('required_field')),\r\n    dateTimeNoReq: () => dateOrDateTimeValid(),\r\n    dateTimeValid: () => dateOrDateTimeValid().required(Tr('required_field')),\r\n    dateTimeMinNoRq: (date, tr) => dateTimeMin(date, tr),\r\n    dateTimeMin: (date, tr) => dateTimeMin(date, tr).required(Tr('required_field')),\r\n    dateTimeMaxNoRq: (date, tr) => dateTimeMax(date, tr),\r\n    dateTimeMax: (date, tr) => dateTimeMax(date, tr).required(Tr('required_field')),\r\n    vatinPLOptional: () => Yup.string().test('vatinPL', Tr(\"invalid_vatin\"), (val) => {\r\n        return vatinPL(val, true);\r\n    }).nullable(),\r\n    vatinOrPeselPL: (tr) => Yup.string().test('vatinOrPeselPL', tr, (val) => {\r\n        const vatinValid = vatinPL(val);\r\n        const peselValid = peselPL(val);\r\n\r\n        return vatinValid || peselValid;\r\n\r\n    }),\r\n    requiredBoolean: () => Yup.boolean().required(Tr('required_field')).nullable(),\r\n    mixed: () => Yup.mixed(),\r\n    requiredObject: () => Yup.object().required(Tr('required_field')).nullable(),\r\n    ref: Yup.ref,\r\n    url: () => Yup.string().url(Tr('invalid_url')).nullable().required(Tr('required_field')),\r\n    urlOptional: () => Yup.string().url(Tr('invalid_url')).nullable(),\r\n    urlMax: (max) => Yup.string().max(max, maxStringFunc).url(Tr('invalid_url')).nullable().required(Tr('required_field')),\r\n    urlMaxOptional: (max) => Yup.string().max(max, maxStringFunc).url(Tr('invalid_url')).nullable(),\r\n    phoneOptional: () => Yup.string().matches(/(^[+]\\d{2}\\s?\\d{9}$)|^\\d{9}$/, Tr('invalid_telephone')).nullable()\r\n}","import React, {useEffect} from 'react'\r\nimport {Formik} from 'formik';\r\nimport Button from './Button';\r\nimport PropTypes from 'prop-types'\r\nimport {setForm} from 'redux/actions'\r\nimport {connect} from 'react-redux'\r\nimport ValidationShema from \"../constants/ValidationShema\";\r\n\r\nfunction InnerForm(\r\n    {\r\n        id,\r\n        htmlFormId,\r\n        setForm,\r\n        formikProps,\r\n        submitLabel,\r\n        children,\r\n        className,\r\n        afterSubmitFunc = () => {\r\n        },\r\n    }) {\r\n\r\n    useEffect(() => {\r\n        if (id !== undefined) {\r\n            // setForm(id, formikProps.submitForm)\r\n            setForm(id, () => {\r\n                formikProps.submitForm().then(afterSubmitFunc)\r\n            })\r\n            setForm(id + \"_reset\", formikProps.resetForm)\r\n        }\r\n        return () => {\r\n            if (id !== undefined) {\r\n                setForm(id);\r\n                setForm(id + \"_reset\");\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    return (\r\n        <form\r\n            id={htmlFormId}\r\n            style={{width: \"100%\"}}\r\n            autoComplete=\"off\"\r\n            className={className}\r\n            onSubmit={formikProps.handleSubmit}\r\n        >\r\n            {children(formikProps)}\r\n            {submitLabel &&\r\n                <Button type=\"submit\">\r\n                    {submitLabel}\r\n                </Button>\r\n            }\r\n        </form>\r\n    )\r\n}\r\n\r\nfunction Form(\r\n    {\r\n        children,\r\n        onSubmit,\r\n        onReset,\r\n        submitLabel,\r\n        initialValues,\r\n        initialTouched,\r\n        validationSchema = ValidationShema.any(),\r\n        id,\r\n        htmlFormId,\r\n        setForm,\r\n        className,\r\n        afterSubmitFunc,\r\n        onChange,\r\n        validateOnMount,\r\n        validateOnChange,\r\n        validateOnBlur\r\n    }) {\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            setForm(id)\r\n        };\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    return (\r\n        <Formik\r\n            enableReinitialize\r\n            initialValues={initialValues}\r\n            validationSchema={validationSchema}\r\n            initialTouched={initialTouched}\r\n            onChange={onChange}\r\n            validateOnMount={validateOnMount}\r\n            validateOnChange={validateOnChange}\r\n            validateOnBlur={validateOnBlur}\r\n            onSubmit={(values, actions) => {\r\n                actions.setSubmitting(false);\r\n                onSubmit(values, actions)\r\n            }}\r\n            onReset={onReset}\r\n        >{(props) => (<InnerForm\r\n            afterSubmitFunc={afterSubmitFunc}\r\n            className={className}\r\n            formikProps={props}\r\n            id={id}\r\n            htmlFormId={htmlFormId}\r\n            setForm={setForm}\r\n            submitLabel={submitLabel}\r\n            children={children}\r\n        />)}</Formik>\r\n    )\r\n}\r\n\r\nForm.propTypes = {\r\n    id: PropTypes.string,\r\n    htmlFormId: PropTypes.string,\r\n    initialValues: PropTypes.any,\r\n    submitLabel: PropTypes.any,\r\n    onSubmit: PropTypes.func,\r\n    onReset: PropTypes.func,\r\n    validationSchema: PropTypes.object,\r\n    className: PropTypes.string,\r\n}\r\n\r\nForm.defaultProps = {\r\n    onSubmit: () => {\r\n    },\r\n    initialValues: {},\r\n    validationSchema: {},\r\n}\r\n\r\nexport default connect((state) => ({}), {\r\n    setForm\r\n})(Form);\r\n","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nfunction Title(\r\n    {\r\n        children,\r\n        align,\r\n        className,\r\n        variant='h5'\r\n    }) {\r\n    return (\r\n        <Typography\r\n            variant={variant}\r\n            align={align}\r\n            className={className}\r\n        >\r\n            {children}\r\n        </Typography>\r\n    )\r\n}\r\n\r\nTitle.propTypes = {\r\n    align: PropTypes.string,\r\n    className: PropTypes.string,\r\n}\r\n\r\nTitle.defaultProps = {}\r\n\r\nexport default Title;","import React from 'react'\r\nimport { withStyles, Divider as DividerUI } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Title from 'components/Title';\r\nimport clsx from \"clsx\";\r\n\r\nconst style = theme => ({\r\n\ttitle: {\r\n\t\tmarginTop: theme.spacing(2),\r\n\t},\r\n\tdivider: {\r\n\t\tmarginBottom: theme.spacing(2),\r\n\t}\r\n})\r\n\r\nfunction Divider({\r\n\tclasses,\r\n\ttitleClassName,\r\n\tchildren,\r\n\tvariant\r\n}) {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Title className={clsx(classes.title, titleClassName)} variant={variant}>\r\n\t\t\t\t{children}\r\n\t\t\t</Title>\r\n\t\t\t<DividerUI className={classes.divider} />\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nDivider.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nDivider.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(Divider);","\r\nexport default (id, obj, defaultValue) => {\r\n\tif(id === undefined) return defaultValue;\r\n\tlet idArray = id.split('.')\r\n\tlet value = obj;\r\n\tfor (let i in idArray) {\r\n\t\tlet key = idArray[i]\r\n\t\tvalue = value[key]\r\n\t\tif (value === undefined\r\n\t\t|| value === null) return defaultValue;\r\n\t}\r\n\treturn value;\r\n}","export default {\r\n\tNUMBER_19: 'number_19',\r\n\tNUMBER_19_WITH_NEGATIVE: 'number_19_neg',\r\n\tNUMBER_POSITIVE_AMOUNT: 'number_positive_amount',\r\n\tNUMBER_DECIMAL: 'number_decimal',\r\n\tINTEGER_POSITIVE_AMOUNT: 'integer_positive_amount',\r\n\tPHONE: 'phone'\r\n}","export default (value, innerReg) => {\r\n    let reg = innerReg ? innerReg : /(?!(\\d|[.,]))\\D/\r\n    let _value = value.toString();\r\n\r\n    if (_value.length > 0) {\r\n        _value = _value.replace(reg, \"\")\r\n    }\r\n\r\n\r\n    _value = _value.replace(/,/g, '.')\r\n\r\n    _value = _value.replace(/\\.\\./g, '.')\r\n\r\n    return _value;\r\n}","import React, {useEffect} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport {TextField, Typography, withStyles} from '@material-ui/core';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport Tr from 'translations/Translations';\r\nimport clsx from 'clsx';\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE'\r\nimport toNumberType from \"libs/toNumberType\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        position: 'relative',\r\n    },\r\n    limit: {\r\n        position: 'absolute',\r\n        bottom: 0,\r\n        right: 0,\r\n        color: theme.palette.text.secondary,\r\n    },\r\n    error: {\r\n        marginBottom: 10,\r\n    }\r\n})\r\n\r\nfunction TextInput({\r\n                       formikProps,\r\n                       id,\r\n                       label,\r\n                       placeholder,\r\n                       className,\r\n                       noError,\r\n                       noErrorSpace,\r\n                       multiline,\r\n                       disabled,\r\n                       required,\r\n                       endAdornment,\r\n                       limit,\r\n                       type = \"text\",\r\n                       onChange = () => {\r\n                       },\r\n                       classes,\r\n                       step,\r\n                       onBlur = () => {\r\n                       },\r\n                       showErrorImmediately = false,\r\n                       fullWidth = true,\r\n\tskipCheckTouched,\r\n\t...other\r\n}) {\r\n\tconst errorValue = getObjectValue(id, formikProps.errors, '')\r\n\tconst touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched)\r\n\tconst value = getObjectValue(id, formikProps.values, '')\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const isError = !noError && (!!errorValue && Boolean(touched))\r\n    const lettersLeft = limit - value.toString().length\r\n\r\n    let _label = label;\r\n    let _placeholder = placeholder;\r\n    if (_label && required) _label += '*';\r\n    if (_placeholder && required) _placeholder += '*';\r\n\r\n\r\n    useEffect(() => {\r\n        if (showErrorImmediately && lettersLeft < 0) {\r\n            formikProps.setFieldTouched(id, true)\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [lettersLeft])\r\n\r\n\tconst handleChange = (e) => {\r\n\t\tlet value = e.target.value;\r\n\t\tswitch (type) {\r\n\t\t\tcase INPUT_TYPE.NUMBER_19:\r\n\t\t\tcase INPUT_TYPE.NUMBER_19_WITH_NEGATIVE:\r\n\t\t\t\tconst withMin = INPUT_TYPE.NUMBER_19_WITH_NEGATIVE === type;\r\n\t\t\t\tvalue = toNumberType(value, withMin ? /(?!(^([-]?)\\d|[.,]|^[-]))\\D/ : undefined);\r\n\t\t\t\tlet valueSplit = value.split('.')\r\n\t\t\t\tif(valueSplit.length > 2) {\r\n\t\t\t\t\tvalueSplit = valueSplit.slice(0, 2)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (valueSplit.length > 1) {\r\n\t\t\t\t\tvalueSplit[0] = valueSplit[0].slice(0, withMin && value.startsWith(\"-\") ? 14 : 13)\r\n\t\t\t\t\tvalueSplit[1] = valueSplit[1].slice(0, 2);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalueSplit[0] = valueSplit[0].slice(0, withMin && value.startsWith(\"-\") ? 14 : 13)\r\n\t\t\t\t}\r\n\t\t\t\tvalue = valueSplit.join('.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase INPUT_TYPE.NUMBER_POSITIVE_AMOUNT:\r\n\t\t\t\tvalue = toNumberType(value);\r\n\t\t\t\tlet valueSplitAmount = value.split('.')\r\n\t\t\t\tif(valueSplitAmount.length > 2) {\r\n\t\t\t\t\tvalueSplit = valueSplit.slice(0, 2)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (valueSplitAmount.length > 1) {\r\n\t\t\t\t\tvalueSplitAmount[0] = valueSplitAmount[0].slice(0, 17)\r\n\t\t\t\t\tvalueSplitAmount[1] = valueSplitAmount[1].slice(0, 10);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalueSplitAmount[0] = valueSplitAmount[0].slice(0, 17)\r\n\t\t\t\t}\r\n\t\t\t\tvalue = valueSplitAmount.join('.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase INPUT_TYPE.INTEGER_POSITIVE_AMOUNT:\r\n\t\t\t\tvalue = toNumberType(value, /\\D/);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INPUT_TYPE.NUMBER_DECIMAL:\r\n\t\t\t\tif (value !== \"-\") {\r\n\r\n\t\t\t\t\tvalue = toNumberType(value, /(?!(^([-]?)\\d|[.,]))\\D/);\r\n\t\t\t\t\tconst valueSplit1 = value.split('.')\r\n\t\t\t\t\tif (valueSplit1.length > 1) {\r\n\t\t\t\t\t\tvalueSplit1[1] = valueSplit1[1].slice(0, 10);\r\n\t\t\t\t\t\tvalueSplit1[0] = valueSplit1[0].slice(0, 17)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvalueSplit1[0] = valueSplit1[0].slice(0, 17)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue = valueSplit1.filter((x, i) => i < 2).join('.');\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase INPUT_TYPE.PHONE:\r\n\t\t\t\tvalue = toNumberType(value, /(?!(^([+]?)[ ]*\\d|[ ]|^[+]))\\D/);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n        onChange(value);\r\n        if (type === 'number' || type === 'text') formikProps.handleChange(e)\r\n        else {\r\n            formikProps.setFieldValue(id, value)\r\n            formikProps.setFieldTouched(id, true)\r\n        }\r\n    }\r\n\r\n    const handleBlur = (e) => {\r\n        onBlur(e)\r\n        formikProps.handleBlur(e)\r\n    }\r\n\r\n\tconst inputType = ((type) => {\r\n\t\tswitch (type) {\r\n\t\t\tcase INPUT_TYPE.NUMBER_19:\r\n\t\t\tcase INPUT_TYPE.NUMBER_19_WITH_NEGATIVE:\r\n\t\t\tcase INPUT_TYPE.NUMBER_POSITIVE_AMOUNT: return 'text';\r\n\t\t\tdefault: return type;\r\n\t\t}\r\n\t})(type)\r\n\r\n    const formatValue = () => {\r\n        let v = '' + value;\r\n        if (type !== \"text\") v = v.replace(/\\./g, ',')\r\n        return v;\r\n    }\r\n\r\n    return (\r\n        <div\r\n            className={clsx({[classes.error]: isError}, classes.root)}\r\n        >\r\n            <TextField\r\n                {...other}\r\n\r\n                className={className}\r\n                type={inputType}\r\n                label={_label}\r\n                name={id}\r\n                onChange={handleChange}\r\n                onBlur={handleBlur}\r\n                value={formatValue()}\r\n                error={isError}\r\n                helperText={noError ? undefined : isError ? errorValue : noErrorSpace ? undefined : ' '}\r\n                placeholder={_placeholder}\r\n                fullWidth={fullWidth}\r\n                multiline={multiline}\r\n                disabled={disabled || !editable}\r\n                InputProps={{\r\n                    endAdornment,\r\n                }}\r\n                maxRows={limit}\r\n                // eslint-disable-next-line\r\n                inputProps={{\r\n                    step: step,\r\n                    \"data-id\": id\r\n                }}\r\n            />\r\n            {limit &&\r\n                <Typography\r\n                    variant='caption'\r\n                    className={classes.limit}\r\n                >\r\n                    {Tr('characters_left', {number: lettersLeft < 0 ? 0 : lettersLeft})}\r\n                </Typography>\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nTextInput.propTypes = {\r\n    formikProps: PropTypes.object,\r\n    id: PropTypes.string.isRequired,\r\n    label: PropTypes.string,\r\n    placeholder: PropTypes.string,\r\n    noError: PropTypes.bool,\r\n}\r\n\r\nTextInput.defaultProps = {\r\n    noError: false,\r\n}\r\n\r\nexport default withStyles(style)(TextInput)\r\n","import React from 'react'\r\nimport {FormControlLabel, Radio, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n})\r\n\r\nfunction RadioGroupElement(\r\n    {\r\n        classes,\r\n        value,\r\n        children,\r\n        size,\r\n        labelClassName,\r\n        className,\r\n        disabled,\r\n        htmlId\r\n    }) {\r\n    return (\r\n        <FormControlLabel\r\n            className={clsx(\r\n                classes.root,\r\n                className,\r\n            )}\r\n            value={value}\r\n            control={<Radio id={htmlId} size={size} color=\"primary\"/>}\r\n            label={children}\r\n            classes={{\r\n                label: labelClassName\r\n            }}\r\n            disabled={disabled}\r\n        />\r\n    )\r\n}\r\n\r\nRadioGroupElement.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(RadioGroupElement);","import React, { memo } from 'react'\r\nimport { RadioGroup as RadioGroupUI, FormControl, FormLabel, FormHelperText } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport RadioGroupElement from './RadioGroupElement';\r\n\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport { withStyles } from '@material-ui/styles';\r\n\r\nconst style = theme => ({\r\n\terror: {\r\n\t\tmarginTop: 0,\r\n\t\tmarginBottom: theme.spacing(2),\r\n\t}\r\n})\r\n\r\nfunction RadioGroup({\r\n\tclasses,\r\n\tformikProps,\r\n\tlabel,\r\n\tid,\r\n\titems,\r\n\tchildren,\r\n\tclassName,\r\n\trequired,\r\n\tnoError,\r\n\tonChange = ()=> {},\r\n\tdisabled\r\n}) {\r\n\tconst errorValue = getObjectValue(id, formikProps.errors, '')\r\n\tconst touched = getObjectValue(id, formikProps.touched, false)\r\n\tconst value = getObjectValue(id, formikProps.values, '')\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n\tconst isError = !noError && (!!errorValue && touched)\r\n\r\n\t// const isError = !!formikProps.errors[id] && formikProps.touched[id]\r\n\tconst helperText = (isError && errorValue) || ' ';\r\n\r\n\tlet _label = label;\r\n\tif (required) _label += '*';\r\n\r\n\treturn (\r\n\t\t<FormControl\r\n\t\t\terror={isError}\r\n\t\t\tclassName={className}\r\n\t\t>\r\n\t\t\t<FormLabel>{_label}</FormLabel>\r\n\t\t\t<RadioGroupUI\r\n\t\t\t\tname={id}\r\n\t\t\t\tonChange={(event) => {\r\n\t\t\t\t\tonChange(event);\r\n\t\t\t\t\tformikProps.handleChange(event);\r\n\t\t\t\t}}\r\n\t\t\t\tonBlur={formikProps.handleBlur}\r\n\t\t\t\t// value={formikProps.values[id]}\r\n\t\t\t\tvalue={value}\r\n\t\t\t>\r\n\t\t\t\t{items.map((item, i) => {\r\n\t\t\t\t\tconst isStr = typeof item === 'string';\r\n\t\t\t\t\tconst value = isStr ? item : String(item.value);\r\n\t\t\t\t\tconst label = isStr ? item : item.label;\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<RadioGroupElement\r\n\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\t\tdisabled={!editable || disabled}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{label}\r\n\t\t\t\t\t\t</RadioGroupElement>\r\n\t\t\t\t\t)\r\n\t\t\t\t})}\r\n\t\t\t\t{children}\r\n\t\t\t</RadioGroupUI>\r\n\t\t\t<FormHelperText className={classes.error}>{helperText}</FormHelperText>\r\n\t\t</FormControl>\r\n\t)\r\n}\r\n\r\nRadioGroup.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tlabel: PropTypes.string,\r\n\tid: PropTypes.string,\r\n\titems: PropTypes.arrayOf(\r\n\t\tPropTypes.oneOfType([\r\n\t\t\tPropTypes.shape({\r\n\t\t\t\tvalue: PropTypes.any.isRequired,\r\n\t\t\t\tlabel: PropTypes.string.isRequired,\r\n\t\t\t}),\r\n\t\t\tPropTypes.string.isRequired,\r\n\t\t])\r\n\t),\r\n\tformikProps: PropTypes.object,\r\n}\r\n\r\nRadioGroup.defaultProps = {\r\n\titems: []\r\n}\r\n\r\nexport default withStyles(style)(memo(RadioGroup, (prevProps, nextProps) => {\r\n\tif (prevProps.label !== nextProps.label) return false;\r\n\tif (prevProps.id !== nextProps.id) return false;\r\n\tif (JSON.stringify(prevProps.items) !== JSON.stringify(nextProps.items)) return false;\r\n\tif (prevProps.children !== nextProps.children) return false;\r\n\tconst id = nextProps.id;\r\n\t// if (prevProps.formikProps.values[id] !== nextProps.formikProps.values[id]) return false;\r\n\t// if (prevProps.formikProps.errors[id] !== nextProps.formikProps.errors[id]) return false;\r\n\t// if (prevProps.formikProps.touched[id] !== nextProps.formikProps.touched[id]) return false;\r\n\tif (getObjectValue(id, prevProps.formikProps.values) !== getObjectValue(id, nextProps.formikProps.values)) return false;\r\n\tif (getObjectValue(id, prevProps.formikProps.errors) !== getObjectValue(id, nextProps.formikProps.errors)) return false;\r\n\tif (getObjectValue(id, prevProps.formikProps.touched) !== getObjectValue(id, nextProps.formikProps.touched)) return false;\r\n\treturn true;\r\n}))","import React from 'react'\r\nimport TypographyUI from '@material-ui/core/Typography';\r\n\r\nfunction Typography(props) {\r\n    return (\r\n        <TypographyUI {...props} />\r\n    )\r\n}\r\n\r\n\r\nexport default (Typography);","import React from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport {Box, MenuItem, TextField} from '@material-ui/core';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport {withStyles} from '@material-ui/styles';\r\nimport clsx from 'clsx';\r\nimport Typography from \"./Typography\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(),\r\n    },\r\n    contrastSelectValue: {\r\n        minHeight: theme.spacing(4)\r\n    },\r\n    selected: {\r\n        background: `${theme.palette.primary.main} !important`,\r\n        color: `${theme.palette.secondary.contrastText} !important`\r\n\r\n    },\r\n    border: {\r\n        border: `1px solid ${theme.palette.common.white}`,\r\n    },\r\n    subLabel: {\r\n        fontStyle: 'italic'\r\n    }\r\n})\r\nexport const createSelectItem = (value, label, subLabel) => ({\r\n    value,\r\n    label: label !== undefined ? label : value,\r\n    subLabel\r\n})\r\n\r\nfunction Select(\r\n    {\r\n        formikProps,\r\n        id,\r\n        label,\r\n        items,\r\n        noError,\r\n        className,\r\n        required,\r\n        classes,\r\n        disabled,\r\n        onChange = () => {\r\n        },\r\n        alwaysEditable = false,\r\n        showErrorWithoutTouched = false\r\n    }) {\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    const touched = getObjectValue(id, formikProps.touched, false)\r\n    const value = getObjectValue(id, formikProps.values, '')\r\n    const editable = alwaysEditable || getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const isError = !noError && !!errorValue && (showErrorWithoutTouched || !!touched)\r\n\r\n    let _label = label;\r\n    if (_label && required) _label += '*';\r\n\r\n    const _value = items.findIndex(x => {\r\n        if (typeof x === 'string') return x === value\r\n        return x.value === value\r\n    }) < 0 ? '' : value;\r\n\r\n    return (\r\n        <TextField\r\n            disabled={disabled || !editable}\r\n            className={clsx(classes.root, className)}\r\n            select\r\n            label={_label}\r\n            name={id}\r\n            onChange={(event) => {\r\n                formikProps.handleChange(event);\r\n                onChange(event)\r\n            }}\r\n            onBlur={formikProps.handleBlur}\r\n            value={_value}\r\n            error={isError}\r\n            helperText={noError ? undefined : isError ? errorValue : ' '}\r\n            fullWidth\r\n            classes={{\r\n                root: classes.contrast,\r\n                // selectMenu: classes.selected,\r\n            }}\r\n            SelectProps={{\r\n                MenuProps: {\r\n                    classes: {\r\n                        paper: classes.border\r\n                    }\r\n                },\r\n            }}\r\n        >\r\n            {\r\n                items.map((item, i) => {\r\n                    const isStr = typeof item === 'string';\r\n                    const value = isStr ? item : item.value;\r\n                    const label = isStr ? item : item.label;\r\n                    const subLabel = isStr ? undefined : item.subLabel;\r\n\r\n                    return (\r\n                        <MenuItem key={i}\r\n                                  classes={{\r\n                                      selected: classes.selected\r\n\r\n                                  }}\r\n                                  value={value}\r\n                                  className={classes.contrastSelectValue}\r\n                        >\r\n                            <Box>\r\n                                <Typography variant=\"inherit\" noWrap>{label}</Typography>\r\n                                { !!subLabel &&\r\n                                    <Typography variant=\"subtitle2\" noWrap className={classes.subLabel}>{subLabel}</Typography>\r\n                                }\r\n                            </Box>\r\n\r\n                        </MenuItem>\r\n                    )\r\n                })\r\n            }\r\n        </TextField>\r\n    )\r\n}\r\n\r\nSelect.propTypes = {\r\n    className: PropTypes.string,\r\n    formikProps: PropTypes.object,\r\n    id: PropTypes.string.isRequired,\r\n    label: PropTypes.string,\r\n    items: PropTypes.arrayOf(\r\n        PropTypes.oneOfType([\r\n            PropTypes.shape({\r\n                value: PropTypes.any.isRequired,\r\n                label: PropTypes.string.isRequired,\r\n            }),\r\n            PropTypes.string.isRequired,\r\n        ])\r\n    )\r\n}\r\n\r\nSelect.defaultProps = {\r\n    items: []\r\n}\r\n\r\nexport default withStyles(style)(Select)\r\n","import Tr from 'translations/Translations';\r\n\r\nconst PrimaryTenderVariant = {\r\n\tVARIANT_1: \"variant_1\",\r\n\tVARIANT_2: \"variant_2\",\r\n\tVARIANT_3: \"variant_3\",\r\n}\r\n\r\nexport const PrimaryTenderVariantTr = {\r\n\t[PrimaryTenderVariant.VARIANT_1]: Tr(\"primarytendervariant.variant_1\"),\r\n\t[PrimaryTenderVariant.VARIANT_2]: Tr(\"primarytendervariant.variant_2\"),\r\n\t[PrimaryTenderVariant.VARIANT_3]: Tr(\"primarytendervariant.variant_3\")\r\n}\r\n\r\nexport default PrimaryTenderVariant;\r\n","import {PrimaryTenderVariantTr} from \"constants/PrimaryTenderVariant\";\r\n\r\nexport default Object.entries(PrimaryTenderVariantTr).map(([value, label]) => ({label, value}))","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (value) => ({label: Tr('pzp_exclusion.' + value), value})\r\n\r\nexport default [\r\n    {label: '---', value: ''},\r\n    createItem('exclusion10'),\r\n    createItem('exclusion1'),\r\n    createItem('exclusion2'),\r\n    createItem('exclusion3'),\r\n    createItem('exclusion4'),\r\n    createItem('exclusion5'),\r\n    createItem('exclusion6'),\r\n    createItem('exclusion7'),\r\n    createItem('exclusion8'),\r\n    createItem('exclusion9'),\r\n    createItem('exclusion11'),\r\n    createItem('exclusion12'),\r\n]","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value) => ({label: Tr(trKey), value})\r\n\r\nexport default [\r\n\tcreateItem('p1s1_ot_1', 'supplies'),\r\n\tcreateItem('p1s1_ot_2', 'services'),\r\n\tcreateItem('p1s1_ot_3', 'works'),\r\n]","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value) => ({label: Tr(trKey), value})\r\n\r\nexport default [\r\n\tcreateItem('p1s1_ot_2', 'services'),\r\n\tcreateItem('p1s1_ot_3', 'works'),\r\n]","import Tr from 'translations/Translations';\r\nimport {createSelectItem} from \"../components/Select\";\r\n\r\nexport default [\r\n    createSelectItem(true, Tr('yes')),\r\n    createSelectItem(false, Tr('no'))\r\n]\r\n\r\n","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value) => ({label: Tr(trKey), value})\r\n\r\nexport default [\r\n    // createItem('p1s1_jedz_1', 'yes'),\r\n    createItem('p1s1_jedz_2', 'yes'),\r\n    createItem('p1s1_jedz_3', 'yesPostpone'),\r\n    createItem('p1s1_jedz_4', 'no'),\r\n]\r\n\r\nexport const jedzTranslations = (value) => {\r\n    switch (value) {\r\n        case \"yes\":\r\n            return Tr(\"p1s1_jedz_2\");\r\n        case \"yesPostpone\":\r\n            return Tr(\"p1s1_jedz_3\");\r\n        case \"no\":\r\n            return Tr(\"p1s1_jedz_4\");\r\n        default:\r\n            return \"\"\r\n    }\r\n\r\n}","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value) => ({label: Tr(trKey), value})\r\n\r\nconst itemsHidedExecutive = [\r\n\tcreateItem('p1s1_ct_1', 'Standard'),\r\n\tcreateItem('p1s1_ct_2', 'Framework')\r\n]\r\n\r\nconst itemsWithExecutive = [\r\n\t...itemsHidedExecutive,\r\n\tcreateItem('p1s1_ct_3', 'Executive')\r\n]\r\n\r\n\r\nexport default (hideExecutiveDemandVariant) => {\r\n    if (hideExecutiveDemandVariant) {\r\n    \treturn itemsHidedExecutive;\r\n    } else {\r\n    \treturn itemsWithExecutive;\r\n\t}\r\n}\r\n","import React from 'react'\r\nimport {Checkbox as CheckboxUI, FormControlLabel, Tooltip} from '@material-ui/core';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction Checkbox(\r\n    {\r\n        formikProps,\r\n        id,\r\n        htmlId,\r\n        label,\r\n        disabled,\r\n        checkboxClassName,\r\n        fullWidth,\r\n        checked,\r\n        className,\r\n        labelClassName,\r\n        onChange = () => {\r\n        },\r\n    }) {\r\n\r\n    const value = checked === undefined ? getObjectValue(id, formikProps.values, false) : checked\r\n\r\n    const checkbox = <Tooltip title={value ? Tr('checkbox_uncheck') : Tr('checkbox_check')}>\r\n        <CheckboxUI\r\n            color='primary'\r\n            name={id}\r\n            checked={value}\r\n            onChange={(event) => {\r\n                if (formikProps) formikProps.handleChange(event);\r\n                onChange(event);\r\n            }}\r\n            onBlur={formikProps ? formikProps.handleBlur : undefined}\r\n            disabled={disabled}\r\n            className={checkboxClassName}\r\n            id={htmlId}\r\n        />\r\n    </Tooltip>\r\n\r\n    if (Boolean(label)) {\r\n        return (\r\n            <FormControlLabel\r\n                className={className}\r\n                style={fullWidth ? { width: '100%' } : undefined}\r\n                control={checkbox}\r\n                label={label}\r\n                classes={{\r\n                    label: labelClassName\r\n                }}\r\n            />\r\n        )\r\n    }\r\n    return checkbox;\r\n}\r\n\r\nexport default Checkbox\r\n","import React from 'react'\r\n\r\nexport default ({ type = 'div', children, props = {} }) => {\r\n\treturn React.createElement(\r\n\t\ttype,\r\n\t\t{\r\n\t\t\tdangerouslySetInnerHTML: {\r\n\t\t\t\t__html: children\r\n\t\t\t},\r\n\t\t\t...props,\r\n\t\t}\r\n\t)\r\n}\r\n","import React from 'react'\r\nimport {CircularProgress, makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport IconButton from \"./IconButton\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    fabProgress: {\r\n        position: 'absolute',\r\n        left: 0,\r\n        top: 0\r\n    }\r\n}))\r\n\r\nfunction WorkableIconButton(\r\n    {\r\n        working,\r\n        disabled,\r\n        ...props\r\n    }) {\r\n    const classes = useStyles();\r\n    return (\r\n        <IconButton  disabled={!!disabled || !!working} {...props}>\r\n            {working && <CircularProgress size={48} className={classes.fabProgress}/>}\r\n        </IconButton>\r\n    )\r\n}\r\n\r\nWorkableIconButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.elementType]),\r\n    hideTooltip: PropTypes.bool,\r\n    Icon: PropTypes.elementType,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport {makeStyles} from '@material-ui/styles';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowDown'\r\nimport clsx from 'clsx';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nconst useStyles = makeStyles({\r\n\trotate: {\r\n\t\ttransform: 'rotate(180deg)'\r\n\t},\r\n})\r\n\r\nfunction WorkableIconExpandButton({\r\n\texpanded,\r\n\ttooltip,\r\n\t...props\r\n}) {\r\n\tconst classes = useStyles();\r\n\tlet _tooltip = tooltip;\r\n\tif (!_tooltip && !props.disabled) {\r\n\t\t_tooltip =  expanded ? Tr('collapse') : Tr('expand');\r\n\t}\r\n\r\n\treturn <WorkableIconButton\r\n\t\ttooltip={_tooltip}\r\n\t\tIcon={ArrowIcon}\r\n\t\tclassName={clsx( props.className, {\r\n\t\t\t[classes.rotate]: expanded\r\n\t\t})}\r\n\t\t{...props}\r\n\t/>\r\n\r\n}\r\n\r\nWorkableIconExpandButton.propTypes = {\r\n\texpanded: PropTypes.bool,\r\n\tworking: PropTypes.bool,\r\n\tdisabled: PropTypes.bool,\r\n\ttooltip: PropTypes.string,\r\n\thideTooltip: PropTypes.bool,\r\n\tcolor: PropTypes.string,\r\n\tonClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconExpandButton;","import React, { useState, useEffect } from 'react'\r\nimport { withStyles, Typography, Collapse } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Checkbox from 'components/Checkbox';\r\nimport clsx from 'clsx';\r\nimport RawHTML from 'components/RawHTML';\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t},\r\n\tradioGroup: {\r\n\t\twidth: '100%',\r\n\t\tmargin: 0,\r\n\t},\r\n\trotate: {\r\n\t\ttransform: 'rotate(180deg)'\r\n\t},\r\n\tmargin: {\r\n\t\tmarginLeft: theme.spacing(2),\r\n\t},\r\n\tfilteredItemRoot: {\r\n\t\tdisplay: 'flex',\r\n\t\twidth: '100%',\r\n\t\talignItems: 'center'\r\n\t}\r\n})\r\n\r\nfunction ListElement({\r\n\tclasses,\r\n\tclassName,\r\n\tformikProps,\r\n\titemValue,\r\n\tsearchKeys,\r\n\t multiple,\r\n\t handleSave\r\n}) {\r\n\r\n\tconst {\r\n\t\tidentity,\r\n\t\tpublicCode,\r\n\t\tname,\r\n\t\tchildren,\r\n\t\tshouldOpen = false,\r\n\t\t...otherItemValues\r\n\t} = itemValue;\r\n\r\n\tconst [boldLabel, setBoldLabel] = useState('')\r\n\tconst [open, setOpen] = useState(shouldOpen)\r\n\r\n\tuseEffect(() => {\r\n\t\tsetOpen(shouldOpen)\r\n\t}, [shouldOpen])\r\n\r\n\r\n\tconst handleArrowClick = () => {\r\n\t\tsetOpen(!open)\r\n\t}\r\n\r\n\tconst checkboxId = JSON.stringify({\r\n\t\tidentity,\r\n\t\tpublicCode,\r\n\t\tname,\r\n\t\t...otherItemValues\r\n\t})\r\n\r\n\tconst _label = `${publicCode} ${name}`;\r\n\r\n\tuseEffect(() => {\r\n\t\tlet label = _label;\r\n\t\tsearchKeys.forEach(key => {\r\n\t\t\tif (key === '') return;\r\n\t\t\tconst reg = new RegExp(`(${key})`, 'ig')\r\n\t\t\tlabel = label.replace(reg, `<b>$1</b>`);\r\n\t\t});\r\n\t\tsetBoldLabel(label)\r\n\t}, [searchKeys, _label])\r\n\r\n\tconst openRow = open;\r\n\r\n\tconst label = (\r\n\t\t<RawHTML type={Typography} props={{ variant: 'body1' }}>\r\n\t\t\t{boldLabel}\r\n\t\t</RawHTML>\r\n\t)\r\n\r\n\t// const checkbox = (id) => {\r\n\t// \tconst value = getObjectValue(id, formikProps.values, false);\r\n\t// \treturn (\r\n\t// \t\t<input\r\n\t// \t\t\ttype='checkbox'\r\n\t// \t\t\tname={id}\r\n\t// \t\t\tonChange={formikProps.handleChange}\r\n\t// \t\t\tonBlur={formikProps.handleBlur}\r\n\t// \t\t\tchecked={value}\r\n\t// \t\t/>\r\n\t// \t)\r\n\t// }\r\n\r\n\tconst renderChildren = () => {\r\n\t\treturn children.map((item, i) => {\r\n\t\t\treturn (\r\n\t\t\t\t<ListElement\r\n\t\t\t\t\tsearchKeys={searchKeys}\r\n\t\t\t\t\titemValue={item}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\tclasses={classes}\r\n\t\t\t\t\tkey={i}\r\n\t\t\t\t\thandleSave={handleSave}\r\n\t\t\t\t\tmultiple={multiple}\r\n\t\t\t\t/>\r\n\t\t\t)\r\n\t\t})\r\n\t}\r\n\r\n\t// if (isFiltered) {\r\n\t// \treturn (\r\n\t// \t\t<>\r\n\t// \t\t\t<div className={classes.filteredItemRoot}>\r\n\t// \t\t\t\t{checkbox(checkboxId)}\r\n\t// \t\t\t\t{label}\r\n\t// \t\t\t</div>\r\n\t// \t\t\t{\r\n\t// \t\t\t\tchildren.length > 0 &&\r\n\t// \t\t\t\t<div className={classes.margin}>\r\n\t// \t\t\t\t\t{renderChildren()}\r\n\t// \t\t\t\t</div>\r\n\t// \t\t\t}\r\n\t// \t\t</>\r\n\t// \t)\r\n\t// }\r\n\r\n\tconst onChange = (e) => {\r\n\t\tif(!multiple && e.target.checked)\r\n\t\t\thandleSave();\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Checkbox\r\n\t\t\t\tid={checkboxId}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tclassName={clsx(\r\n\t\t\t\t\tclasses.radioGroup,\r\n\t\t\t\t\tclassName\r\n\t\t\t\t)}\r\n\t\t\t\tlabelClassName={classes.radioGroup}\r\n\t\t\t\tonChange={onChange}\r\n\t\t\t\tlabel={\r\n\t\t\t\t\t<GridBlock\r\n\t\t\t\t\t\tjustify='space-between'\r\n\t\t\t\t\t\talignItems='center'\r\n\t\t\t\t\t\tclassName={classes.root}\r\n\t\t\t\t\t\twrap='nowrap'\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tchildren.length > 0 &&\r\n\t\t\t\t\t\t\t<WorkableIconExpandButton\r\n\t\t\t\t\t\t\t\tname='button'\r\n\t\t\t\t\t\t\t\tonClick={handleArrowClick}\r\n\t\t\t\t\t\t\t\texpanded={openRow}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t</GridBlock>\r\n\t\t\t\t}\r\n\t\t\t/>\r\n\r\n\t\t\t{\r\n\t\t\t\tchildren.length > 0 &&\r\n\t\t\t\t<div className={classes.margin}>\r\n\t\t\t\t\t<Collapse in={openRow}>\r\n\t\t\t\t\t\t{openRow ? renderChildren() : ''}\r\n\t\t\t\t\t</Collapse>\r\n\t\t\t\t</div>\r\n\t\t\t}\r\n\t\t</>\r\n\r\n\t)\r\n}\r\n\r\nListElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ListElement);","export default (items, search, size) => {\r\n\tif (search.trim().length === 0) return [items, [], false];\r\n\tconst s = search.toLowerCase().replace(/,/g, ' ').replace(/  +/g, ' ');\r\n\tlet searchKeys = s.split(' ');\r\n\tlet counter = 0;\r\n\tlet fastEnd = false;\r\n\r\n\tconst match = (x) => {\r\n\t\tconst publicCode = x.publicCode.toLowerCase();\r\n\t\tconst name = x.name.toLowerCase().replace(/,/g, ' ').replace(/  +/g, ' ');\r\n\t\tconst fullName = publicCode + ' ' + name;\r\n\r\n\t\treturn searchKeys.every(k => k === '' || fullName.includes(k))\r\n\t}\r\n\r\n\tconst find = (object) => {\r\n\t\tlet filteredChildrens = [];\r\n\t\tif (object.children && object.children.length > 0) {\r\n\t\t\tobject.children.forEach((element) => {\r\n\t\t\t\tif (counter > size) {\r\n\t\t\t\t\tfastEnd = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tconst findEl = find(element);\r\n\t\t\t\tif (findEl !== null) {\r\n\t\t\t\t\tfilteredChildrens.push(findEl);\r\n\t\t\t\t\tcounter += 1;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t\tif (filteredChildrens.length > 0) {\r\n\t\t\tcounter += 1;\r\n\t\t\treturn {\r\n\t\t\t\t...object,\r\n\t\t\t\tshouldOpen: true,\r\n\t\t\t\tchildren: filteredChildrens\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (counter > size) {\r\n\t\t\tfastEnd = true\r\n\t\t\treturn null\r\n\t\t}\r\n\t\tconst isMatch = match(object);\r\n\t\tif (isMatch) return object;\r\n\r\n\t\treturn null;\r\n\t}\r\n\tconst newItems = items.reduce((prev, curr) => {\r\n\t\tconst el = find(curr);\r\n\t\tif (el === null) return prev;\r\n\t\treturn [\r\n\t\t\t...prev,\r\n\t\t\tel,\r\n\t\t]\r\n\t}, [])\r\n\treturn [newItems, searchKeys, fastEnd]\r\n}","import React, { useRef, useEffect, useState } from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport InfiniteScroller from 'react-infinite-scroller'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\theight: '45vh',\r\n\t\toverflow: 'auto',\r\n\t\tpaddingRight: theme.scrollSize,\r\n\t}\r\n})\r\n\r\n\r\nfunction RadioListInfiniteScroller({\r\n\tclasses,\r\n\tchildren,\r\n\tsize,\r\n\tmaxSize,\r\n\tpage,\r\n\tloadMore,\r\n}) {\r\n\tconst containerRef = useRef();\r\n\tconst [hasMore, setHasMore] = useState(false)\r\n\tconst threshold = 200;\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!hasMore) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tsetHasMore(maxSize > size);\r\n\t\t\t}, 500)\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [size])\r\n\r\n\tconst load = (page) => {\r\n\t\tsetTimeout(() => {\r\n\t\t\tif (hasMore) {\r\n\t\t\t\tsetHasMore(false);\r\n\t\t\t\tloadMore();\r\n\t\t\t}\r\n\t\t}, 500)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div className={classes.root} ref={containerRef}>\r\n\t\t\t<InfiniteScroller\r\n\t\t\t\tinitialLoad={true}\r\n\t\t\t\tpageStart={page}\r\n\t\t\t\tloadMore={load}\r\n\t\t\t\thasMore={hasMore}\r\n\t\t\t\tloader={'LOADING...'}\r\n\t\t\t\tuseWindow={false}\r\n\t\t\t\tthreshold={threshold}\r\n\t\t\t\tgetScrollParent={() => containerRef.current}\r\n\t\t\t>\r\n\t\t\t\t{children}\r\n\t\t\t</InfiniteScroller>\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nRadioListInfiniteScroller.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(RadioListInfiniteScroller);","export default (items) => {\r\n\r\n\tconst getSize = (list) => {\r\n\t\treturn list.length + list.reduce((count, item) => {\r\n\t\t\treturn count + getSize(item.children);\r\n\t\t}, 0);\r\n\t}\r\n\r\n\treturn !items ? 0 : getSize(items);\r\n}","import React, { useState, useEffect } from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n// import RadioGroup from 'components/RadioGroup';\r\nimport ListElement from './ListElement';\r\nimport filterItems from './libs/filterItems';\r\nimport RadioListInfiniteScroller from './RadioListInfiniteScroller';\r\nimport countItemsFunc from './libs/countItems'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\twidth: '100%'\r\n\t},\r\n})\r\n\r\nlet typingStopTimeout = null;\r\n\r\nfunction RadioList({\r\n\tclasses,\r\n\tformikProps,\r\n\titems = [],\r\n\tcountItems,\r\n   multiple,\r\n   handleSave\r\n}) {\r\n\tconst PAGE_SIZE = 30;\r\n\tconst [page, setPage] = useState(1)\r\n\tconst size = page * PAGE_SIZE;\r\n\tconst [elementLength, setElementLength] = useState(size);\r\n\tconst [filtered, setFiltered] = useState(items)\r\n\tconst [searchKeys, setSearchKeys] = useState([])\r\n\tconst [searchChanged, setSearchChanged] = useState(null)\r\n\tconst [itemsCount, setItemsCount] = useState(countItems)\r\n\r\n\tconst search = formikProps.values.search;\r\n\r\n\tuseEffect(() => {\r\n\t\tclearTimeout(typingStopTimeout);\r\n\t\ttypingStopTimeout = setTimeout(() => {\r\n\t\t\tconst [newItems, newSearchKeys, fastEnd] = filterItems(items, search, size)\r\n\t\t\tsetFiltered(newItems);\r\n\t\t\tsetSearchKeys(newSearchKeys)\r\n\t\t\tif (fastEnd) {\r\n\t\t\t\tif (countItems !== itemsCount) {\r\n\t\t\t\t\tsetItemsCount(countItems)\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsetItemsCount(countItemsFunc(newItems))\r\n\t\t\t}\r\n\t\t\tif (JSON.stringify(newSearchKeys) !== JSON.stringify(searchKeys)) {\r\n\t\t\t\tsetPage(1);\r\n\t\t\t\tsetElementLength(PAGE_SIZE);\r\n\t\t\t\tsetSearchChanged(Math.random())\r\n\t\t\t} else {\r\n\t\t\t\tsetElementLength(size);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(typingStopTimeout);\r\n\t\t}\r\n\t// eslint-disable-next-line\r\n\t}, [search, items, size])\r\n\r\n\tconst getItems = () => {\r\n\t\treturn filtered;\r\n\t}\r\n\r\n\tconst loadFunc = () => {\r\n\t\tsetPage((p) => p += 1);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<RadioListInfiniteScroller\r\n\t\t\tsize={elementLength}\r\n\t\t\tpage={page}\r\n\t\t\tmaxSize={itemsCount}\r\n\t\t\tloadMore={loadFunc}\r\n\t\t\tsearchChanged={searchChanged}\r\n\t\t>\r\n\t\t\t{getItems().map((item, i) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<ListElement\r\n\t\t\t\t\t\tsearchKeys={searchKeys}\r\n\t\t\t\t\t\titemValue={item}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tindex={i}\r\n\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\tmultiple={multiple}\r\n   \t\t\t\t\t\thandleSave={handleSave}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)\r\n\t\t\t})}\r\n\t\t</RadioListInfiniteScroller>\r\n\t)\r\n}\r\n\r\n/* <InfiniteScroller\r\n\tpageStart={1}\r\n\tloadMore={loadFunc}\r\n\thasMore={hasMore()}\r\n\tloader={'LOADING...'}\r\n\tuseWindow={false}\r\n\tthreshold={400}\r\n>\r\n\t\r\n</InfiniteScroller> */\r\n\r\nRadioList.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(RadioList);","import React from 'react'\r\nimport {CircularProgress, makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Button from \"../Button\";\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    progress: {\r\n        marginLeft: theme.spacing()\r\n    },\r\n    contained: {\r\n        color: theme.palette.text.button,\r\n    },\r\n    text: {\r\n        color: theme.palette.primary.main,\r\n    }\r\n}))\r\n\r\nfunction WorkableButton(\r\n    {\r\n        working,\r\n        children,\r\n        variant = 'contained',\r\n        onClick,\r\n        ...props\r\n    }) {\r\n    const classes = useStyles();\r\n    return (\r\n        <Button\r\n            variant={variant}\r\n            onClick={working ? (e)=> e.stopPropagation() : onClick}\r\n            {...props}>\r\n            {children}\r\n            {working && <CircularProgress className={\r\n            clsx(classes.progress, {\r\n                [classes.contained] : variant === 'contained',\r\n                [classes.text] : variant !== 'contained'\r\n            })\r\n\r\n\r\n            } size={20}/>}\r\n        </Button>\r\n    )\r\n}\r\n\r\nWorkableButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.elementType]),\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func,\r\n    variant: PropTypes.oneOf([ 'text', 'outlined', 'contained']),\r\n}\r\n\r\nexport default WorkableButton;","import React from 'react'\r\nimport {Grid, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport WorkableButton from \"../../button/WorkableButton\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    item: {\r\n        minWidth: theme.components.popup.buttons.width,\r\n        '&:nth-child(2)': {\r\n            marginRight: theme.spacing(1)\r\n        },\r\n        '&:nth-child(3)': {\r\n            marginLeft: theme.spacing(1)\r\n        }\r\n    }\r\n})\r\n\r\nfunction DoubleButton(\r\n    {\r\n        className,\r\n        classes,\r\n        labelFirst,\r\n        labelSecond,\r\n        onClickFirst,\r\n        onClickSecond,\r\n        buttonTypeFirst,\r\n        buttonTypeSecond,\r\n        disabledFirst,\r\n        disabledSecond,\r\n        workingFirst,\r\n        workingSecond,\r\n        justify,\r\n        before,\r\n        after,\r\n    }) {\r\n    return (\r\n        <Grid container className={className} justifyContent={justify}>\r\n            <Grid item>{before}</Grid>\r\n            <Grid item className={classes.item}>\r\n                <WorkableButton\r\n                    fullWidth\r\n                    variant='outlined'\r\n                    onClick={onClickFirst}\r\n                    type={buttonTypeFirst}\r\n                    disabled={disabledFirst}\r\n                    working={workingFirst}\r\n                >\r\n                    {labelFirst}\r\n                </WorkableButton>\r\n            </Grid>\r\n            <Grid item className={classes.item}>\r\n                <WorkableButton\r\n                    fullWidth\r\n                    onClick={onClickSecond}\r\n                    type={buttonTypeSecond}\r\n                    disabled={disabledSecond}\r\n                    working={workingSecond}\r\n                >\r\n                    {labelSecond}\r\n                </WorkableButton>\r\n            </Grid>\r\n            <Grid item>{after}</Grid>\r\n        </Grid>\r\n    )\r\n}\r\n\r\nDoubleButton.propTypes = {\r\n    className: PropTypes.string,\r\n    classes: PropTypes.any,\r\n    labelFirst: PropTypes.string,\r\n    labelSecond: PropTypes.string,\r\n    onClickFirst: PropTypes.func,\r\n    onClickSecond: PropTypes.func,\r\n    buttonTypeFirst: PropTypes.string,\r\n    buttonTypeSecond: PropTypes.string,\r\n    disabledFirst: PropTypes.bool,\r\n    disabledSecond: PropTypes.bool,\r\n    workingFirst: PropTypes.bool,\r\n    workingSecond: PropTypes.bool,\r\n}\r\n\r\nDoubleButton.defaultProps = {}\r\n\r\nexport default withStyles(style)(DoubleButton);","import createId from 'libs/createId';\r\nimport { useState } from 'react';\r\n\r\nexport default () => {\r\n\tconst [id] = useState(createId())\r\n\treturn id;\r\n}","export default () => {\r\n\treturn '_'+Math.random().toString(36).substring(2);\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET} from 'libs/RestRequest';\r\n\r\nconst get = async () => {\r\n    try {\r\n        return await RestRequestGET(Endpoints.CPV_LIST);\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\n\r\nexport default {\r\n    get\r\n}","import React, {useEffect, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport GridBlock from 'components/GridBlock';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport RadioList from './RadioList';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport * as Yup from 'yup'\r\n// import ValidationShema from 'constants/ValidationShema'\r\nimport {connect} from 'react-redux'\r\nimport Loading from 'components/Loading';\r\nimport useId from 'hooks/useId';\r\nimport countItems from './libs/countItems';\r\nimport CpvService from \"../../../services/CpvService\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    loading: {\r\n        height: 100,\r\n    }\r\n})\r\n\r\nfunction SelectForm(\r\n    {\r\n        classes,\r\n        onSubmit,\r\n        onCancel,\r\n        formSubmit,\r\n        initCPVValues,\r\n        multiple\r\n    }) {\r\n    const formId = useId();\r\n    const [cpvList, setCpvList] = useState(null)\r\n    const countCpvList = countItems(cpvList)\r\n\r\n    const handleSubmit = ({search, ...values}) => {\r\n        onSubmit(values)\r\n    }\r\n\r\n    const handleSave = () => {\r\n        formSubmit[formId]();\r\n    }\r\n\r\n\r\n    useEffect(() => {\r\n        CpvService.get().then((resp) => setCpvList(resp));\r\n    }, []);\r\n\r\n    return (\r\n        <>\r\n            {!cpvList ?\r\n                <Loading/>\r\n                :\r\n                <Form\r\n                    initialValues={{\r\n                        search: '',\r\n                        ...initCPVValues,\r\n                    }}\r\n                    id={formId}\r\n                    onSubmit={handleSubmit}\r\n                    validationSchema={Yup.object().shape({})}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock column>\r\n                            <TextInput\r\n                                label={Tr('search_label_3')}\r\n                                id='search'\r\n                                formikProps={formikProps}\r\n                            />\r\n                            {Boolean(cpvList) ?\r\n                                <RadioList\r\n                                    formikProps={formikProps}\r\n                                    items={cpvList}\r\n                                    countItems={countCpvList}\r\n                                    multiple={multiple}\r\n                                    handleSave={handleSave}\r\n                                />\r\n                                :\r\n                                <Loading className={classes.loading}\r\n                                />}\r\n                            <GridBlock justify='flex-end'>\r\n                                <DoubleButton\r\n                                    labelFirst={Tr('cancel')}\r\n                                    labelSecond={Tr('save')}\r\n                                    onClickFirst={onCancel}\r\n                                    onClickSecond={handleSave}\r\n                                    disabledSecond={!multiple}\r\n                                />\r\n                            </GridBlock>\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nSelectForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(withStyles(style)(SelectForm));\r\n","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport SelectForm from './SelectForm';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction SelectCPV({\r\n\tclasses,\r\n\topen,\r\n\tonConfirm,\r\n\tonCancel,\r\n\tinitValues,\r\n\tlabel=Tr('cpv_code'),\r\n\tmultiple = true\r\n}) {\r\n\tconst createInitCPV = () => initValues.reduce((obj, value) => {\r\n\t\tconst {\r\n\t\t\tidentity,\r\n\t\t\tpublicCode,\r\n\t\t\tname,\r\n\t\t\thierarchicalId,\r\n\t\t} = value;\r\n\t\treturn {\r\n\t\t\t...obj,\r\n\t\t\t[JSON.stringify({\r\n\t\t\t\tidentity,\r\n\t\t\t\tpublicCode,\r\n\t\t\t\tname,\r\n\t\t\t\thierarchicalId,\r\n\t\t\t})]: true,\r\n\t\t}\r\n\t}, {})\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\ttitleCentered\r\n\t\t\ttitle={label}\r\n\t\t\topen={open}\r\n\t\t\tmaxWidth={'md'}\r\n\t\t\tonClose={onCancel}\r\n\t\t>\r\n\t\t\t<SelectForm\r\n\t\t\t\tonSubmit={onConfirm}\r\n\t\t\t\tonCancel={onCancel}\r\n\t\t\t\tinitCPVValues={createInitCPV()}\r\n\t\t\t\tmultiple={multiple}\r\n\t\t\t/>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nSelectCPV.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(SelectCPV);","import React from 'react'\r\nimport {Box, Chip as ChipUI, Tooltip, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport CancelIcon from '@material-ui/icons/Cancel';\r\nimport Tr from 'translations/Translations';\r\n\r\n\r\nfunction Chip({\r\n\tlabel,\r\n\tvalue,\r\n\tonDelete,\r\n\tclassName,\r\n\tlabelClassName,\r\n\tonClick,\r\n\ttooltip,\r\n\tcustomDeleteIcon,\r\n\tdisabled = false\r\n}) {\r\n\r\n\tconst getLabelBody = () => {\r\n\t\treturn (\r\n\t\t\t<Typography\r\n\t\t\t\tvariant='caption'\r\n\t\t\t\tclassName={labelClassName}\r\n\t\t\t>\r\n\t\t\t\t{label && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Box component='span' fontWeight='fontWeightBold'>\r\n\t\t\t\t\t\t\t{label}:\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t\t{value}\r\n\t\t\t</Typography>\r\n\t\t)\r\n\t}\r\n\r\n\tconst getLabel = () => {\r\n\t\tif (!tooltip) {\r\n\t\t\treturn getLabelBody();\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t<Tooltip\r\n\t\t\t\ttitle={tooltip}\r\n\t\t\t\tplacement=\"top\"\r\n\t\t\t>\r\n\t\t\t\t{getLabelBody()}\r\n\t\t\t</Tooltip>\r\n\t\t)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<ChipUI\r\n\t\t\tclassName={className}\r\n\t\t\tlabel={getLabel()}\r\n\t\t\tdeleteIcon={!!customDeleteIcon ? customDeleteIcon :\r\n\t\t\t\t<Tooltip title={Tr('delete')} placement=\"top\">\r\n\t\t\t\t\t<CancelIcon/>\r\n\t\t\t\t</Tooltip>\r\n\t\t\t}\r\n\t\t\tonDelete={!!customDeleteIcon && !onDelete ? (() => {}) : onDelete}\r\n\t\t\tonClick={onClick}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nChip.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nChip.defaultProps = {\r\n}\r\n\r\nexport default Chip;","import getObjectValue from './getObjectValue';\r\nimport _ from 'lodash';\r\n\r\nexport default (formikProps, id, index) => {\r\n\r\n\tlet values;\r\n\tif (id === undefined) {\r\n\t\tvalues = formikProps.values\r\n\t} else {\r\n\t\tvalues = getObjectValue(id, formikProps.values)\r\n\t}\r\n\tvalues = _.cloneDeep(values);\r\n\tvalues.splice(index, 1)\r\n\tformikProps.setFieldValue(id, values)\r\n\r\n\tlet touched = getObjectValue(id, formikProps.touched)\r\n\r\n\tif (typeof touched === 'boolean') {\r\n\t\tformikProps.setFieldTouched(id, [])\r\n\t} else if (touched) {\r\n\t\tlet newTouched = [...touched]\r\n\t\tnewTouched.splice(index, 1)\r\n\t\tformikProps.setFieldTouched(id, newTouched)\r\n\t}\r\n}","import React, { useState } from 'react'\r\nimport { withStyles, FormLabel, FormHelperText } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport SelectCPV from 'components/popup/selectCpv/SelectCPV';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport Chip from './Chip';\r\nimport removeFormikListElement from 'libs/removeFormikListElement';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tmarginTop: theme.spacing()\r\n\t},\r\n\tchipLabel: {\r\n\t\tmaxWidth: 250,\r\n\t\toverflow: 'hidden',\r\n\t\ttextOverflow: 'ellipsis',\r\n\t},\r\n\tbuttonSelect: {\r\n\t\tmarginRight: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction CPVInput({\r\n\tclasses,\r\n\tformikProps,\r\n\tid,\r\n\trequired,\r\n\tdisabled,\r\n\tlabel=Tr('cpv_code'),\r\n\tskipCheckTouched\r\n}) {\r\n\r\n\tconst [openSelectCPV, setOpenSelectCPV] = useState(false)\r\n\r\n\tconst handleClick = () => {\r\n\t\tsetOpenSelectCPV(true)\r\n\t\tformikProps.setFieldTouched(id, true)\r\n\t}\r\n\r\n\tconst handleClosePoup = () => {\r\n\t\tsetOpenSelectCPV(false)\r\n\t\tformikProps.setFieldTouched(id, true)\r\n\t}\r\n\r\n\tconst handleConfirm = (values) => {\r\n\t\tconst elements = Object.keys(values).reduce((prevValue, currValue) => {\r\n\t\t\tif (!values[currValue]) return prevValue;\r\n\t\t\treturn [\r\n\t\t\t\t...prevValue,\r\n\t\t\t\tJSON.parse(currValue)\r\n\t\t\t]\r\n\t\t}, [])\r\n\t\thandleClosePoup();\r\n\t\tformikProps.setFieldValue(id, elements)\r\n\t}\r\n\r\n\tconst elements = getObjectValue(id, formikProps.values, [])\r\n\tconst errorValue = getObjectValue(id, formikProps.errors, '')\r\n\tconst touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched)\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\tconst errorLabel = touched && errorValue ? errorValue : ' '\r\n\r\n\r\n\tconst handleDelete = (index) => {\r\n\t\tremoveFormikListElement(formikProps, id, index)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div data-id={id}>\r\n\t\t\t<FormLabel>\r\n\t\t\t\t{label} {required && '*'}\r\n\t\t\t</FormLabel>\r\n\t\t\t<GridBlock\r\n\t\t\t\tclassName={classes.root}\r\n\t\t\t\talignItems='center'\r\n\t\t\t\twrap='nowrap'\r\n\t\t\t>\r\n\t\t\t\t{editable && !disabled && <Button\r\n\t\t\t\t\tonClick={handleClick}\r\n\t\t\t\t\tclassName={classes.buttonSelect}\r\n\t\t\t\t\tdisabled={!editable || disabled}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Tr('select')}\r\n\t\t\t\t</Button>}\r\n\r\n\t\t\t\t<GridBlock spacing={1}>\r\n\t\t\t\t\t{elements.map((item, i) => {\r\n\t\t\t\t\t\treturn <Chip\r\n\t\t\t\t\t\t\tlabelClassName={classes.chipLabel}\r\n\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\tvalue={`${item.publicCode} ${item.name}`}\r\n\t\t\t\t\t\t\tonDelete={editable && !disabled ? () => handleDelete(i) : undefined}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t})}\r\n\t\t\t\t</GridBlock>\r\n\r\n\t\t\t</GridBlock>\r\n\t\t\t<SelectCPV\r\n\t\t\t\tinitValues={elements}\r\n\t\t\t\topen={openSelectCPV}\r\n\t\t\t\tonCancel={handleClosePoup}\r\n\t\t\t\tonConfirm={handleConfirm}\r\n\t\t\t\tlabel={label}\r\n\t\t\t\tmultiple\r\n\t\t\t/>\r\n\t\t\t<FormHelperText error>{errorLabel}</FormHelperText>\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nCPVInput.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(CPVInput);","import React from 'react'\r\nimport { withStyles, Tooltip } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport HelpIcon from '@material-ui/icons/Help';\r\nimport clsx from \"clsx\";\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ticonColor: {\r\n\t\tcolor: theme.palette.action.active\r\n\t},\r\n\ttooltipWidth: {\r\n\t\tmaxWidth: 750\r\n\t}\r\n})\r\n\r\nfunction HelpTooltip({\r\n\tclassName,\r\n\tclasses,\r\n\ttext,\r\n\tdangerouslySetTextHTML\r\n}) {\r\n\treturn (\r\n\t\t<Tooltip classes={{ tooltip: classes.tooltipWidth }} title={!!dangerouslySetTextHTML ? <div dangerouslySetInnerHTML={{__html: dangerouslySetTextHTML}}/> : text}>\r\n\t\t\t<HelpIcon className={clsx(classes.iconColor, className)} />\r\n\t\t</Tooltip>\r\n\t)\r\n}\r\n\r\nHelpTooltip.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(HelpTooltip);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport HelpTooltip from 'components/HelpTooltip';\r\nimport GridBlock from 'components/GridBlock';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*:first-child': {\r\n\t\t\twidth: `calc(100% - ${theme.spacing(3)}px)`\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction HelpComponent({\r\n\tclasses,\r\n\tchildren,\r\n\ttext,\r\n\tdangerouslySetTextHTML\r\n}) {\r\n\treturn (\r\n\t\t<GridBlock className={classes.root} alignItems='center'>\r\n\t\t\t{children}\r\n\t\t\t<HelpTooltip text={text} dangerouslySetTextHTML={dangerouslySetTextHTML} />\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nHelpComponent.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(HelpComponent);","import Tr from 'translations/Translations';\r\n\r\n\r\n\r\nexport const VALUES = {\r\n\tALL: '',\r\n\tPREPARING: 'PREPARING',\r\n\tMODIFICATION: 'MODIFICATION',\r\n\tOFFER_COLLECTION: 'OFFER_COLLECTION',\r\n\tOFFER_DECRYPTION: 'OFFER_DECRYPTION',\r\n\tOFFER_EVALUATION: 'OFFER_EVALUATION',\r\n\tFINISHING: 'FINISHING',\r\n\tCANCELLED: 'CANCELLED',\r\n\tANNULLED: 'ANNULLED',\r\n\tFINISHED: 'FINISHED'\r\n}\r\n\r\nexport const LABELS = {\r\n\t[VALUES.ALL]: Tr('procedure_status_0'),\r\n\t[VALUES.PREPARING]: Tr('procedure_status_1'),\r\n\t[VALUES.OFFER_COLLECTION]: Tr('procedure_status_2'),\r\n\t[VALUES.MODIFICATION]: Tr('procedure_status_3'),\r\n\t[VALUES.OFFER_DECRYPTION]: Tr('procedure_status_4_0'),\r\n\t[VALUES.OFFER_EVALUATION]: Tr('procedure_status_4'),\r\n\t[VALUES.FINISHING]: Tr('procedure_status_5'),\r\n\t[VALUES.FINISHED]: Tr('procedure_status_7'),\r\n\t[VALUES.ANNULLED]: Tr('procedure_status_8'),\r\n\t[VALUES.CANCELLED]: Tr('procedure_status_6'),\r\n}\r\n\r\nconst createItem = (e) => ({\r\n\tlabel: LABELS[e],\r\n\tvalue: e,\r\n})\r\n\r\nexport default Object.values(VALUES).map( x => createItem(x))\r\n","const PZPType = {\r\n    PZP_OLD: \"PZP_old\",\r\n    PZP_2021: \"PZP_2021\"\r\n};\r\n\r\nexport default PZPType;","import reduxStore from 'redux/store';\r\nimport {VALUES as demandStatus} from 'constants/ProcedureStatus';\r\nimport {ProcedureType_PZP_2021} from '../constants/ProcedureType';\r\nimport PZPType from '../constants/PZPType';\r\nimport {isEuropeProcedure as isEuProc, isNationalProcedure as isNatProc, isNonpublicProcedure as isNonpubProc} from 'constants/ProcedureType'\r\n\r\nexport const wasEverPublished = () => {\r\n    const {resources} = reduxStore.getState();\r\n    const result = resources.demandHeader ? demandStatus.PREPARING !== resources.demandHeader.status : undefined;\r\n    return result;\r\n}\r\n\r\nexport const isDemandNew = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? resources.demandHeader.status === null : false;\r\n}\r\n\r\nexport const isDemandPreparing = () => {\r\n    const {resources} = reduxStore.getState();\r\n    if (resources.demandHeader) {\r\n        return !resources.demandHeader.status || demandStatus.PREPARING === resources.demandHeader.status\r\n    } else {\r\n        if (resources.demand) {\r\n            return resources.demand.identity === -1 ? true : undefined;\r\n        } else {\r\n            return undefined;\r\n        }\r\n    }\r\n}\r\n\r\nexport const previewDemandPublicFormDisabled = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ?\r\n        resources.demandHeader.demandRealizationType === 'rfq_no_invitation' || resources.demandHeader.demandRealizationType === 'public_exclusion_closed'\r\n        : undefined;\r\n}\r\n\r\nexport const isDemandModification = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? demandStatus.MODIFICATION === resources.demandHeader.status : undefined;\r\n}\r\nexport const isDemandOfferCollection = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? demandStatus.OFFER_COLLECTION === resources.demandHeader.status : undefined;\r\n}\r\n\r\nexport const isDemandOfferDecryption = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? demandStatus.OFFER_DECRYPTION === resources.demandHeader.status : undefined;\r\n}\r\n\r\nexport const isDemandOfferEvaluation = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? demandStatus.OFFER_EVALUATION === resources.demandHeader.status : undefined;\r\n}\r\n\r\nexport const isDemandFinishing = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? demandStatus.FINISHING === resources.demandHeader.status : undefined;\r\n}\r\n\r\nexport const isDemandFinished = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? demandStatus.FINISHED === resources.demandHeader.status : undefined;\r\n}\r\n\r\nexport const getDemandPZPType = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? (ProcedureType_PZP_2021.includes(resources.demandHeader.procedureType) ? PZPType.PZP_2021 : PZPType.PZP_OLD) : undefined;\r\n}\r\n\r\nexport const isNonpublicProcedure = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? isNonpubProc(resources.demandHeader.procedureType) : undefined;\r\n}\r\nexport const isNationalProcedure = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? isNatProc(resources.demandHeader.procedureType) : undefined;\r\n}\r\nexport const isEuropeProcedure = () => {\r\n    const {resources} = reduxStore.getState();\r\n    return resources.demandHeader ? isEuProc(resources.demandHeader.procedureType) : undefined;\r\n}","export default (items, search) => {\r\n    if (search.trim().length === 0) return items;\r\n\r\n    const s = search.toLowerCase().replace(/,/g, ' ').replace(/  +/g, ' ');\r\n    let searchKeys = s.split(' ');\r\n\r\n    const match = (x) => {\r\n        const name = x.label.toLowerCase().replace(/,/g, ' ').replace(/  +/g, ' ');\r\n        return searchKeys.every(k => k === '' || name.includes(k))\r\n    }\r\n\r\n    return items.filter(x => match(x));\r\n}","import React, {useCallback, useEffect, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport * as Yup from 'yup'\r\nimport {connect} from 'react-redux'\r\nimport useId from 'hooks/useId';\r\nimport RadioGroup from \"../../RadioGroup\";\r\nimport Loading from \"../../Loading\";\r\nimport TextInput from \"../../TextInput\";\r\nimport _ from 'lodash';\r\nimport filterItems from \"libs/filterItems\";\r\nimport Typography from \"../../Typography\";\r\nimport getObjectValue from \"../../../libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        height: '45vh',\r\n        overflow: 'auto',\r\n        paddingRight: theme.scrollSize,\r\n        paddingLeft: theme.spacing(2),\r\n        marginRight: -1 * theme.scrollSize,\r\n        marginLeft: -1 * theme.spacing(2),\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    buttonsWrapper: {},\r\n    loading: {\r\n        height: 100,\r\n    }\r\n})\r\n\r\nfunction SelectOrganizationForm(\r\n    {\r\n        classes,\r\n        onSubmit,\r\n        onCancel,\r\n        availableOrganizations,\r\n        formSubmit,\r\n        initOrganization,\r\n    }) {\r\n    const formId = useId();\r\n\r\n    const [items, setItems] = useState();\r\n    const [allItems, setAllItems] = useState();\r\n\r\n    useEffect(() => {\r\n        document.addEventListener(\"keydown\", escFunction, false);\r\n\r\n        const all = availableOrganizations ? availableOrganizations.map((x => createItem(x))) : [];\r\n        setItems(all);\r\n        setAllItems(all);\r\n\r\n        return () => {\r\n            document.removeEventListener(\"keydown\", escFunction, false);\r\n        };\r\n\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    const createItem = (organization) => ({\r\n        label: organization.name,\r\n        value: organization.orgId\r\n    })\r\n\r\n    const handleSubmit = (values) => {\r\n        const {orgId} = values\r\n        const org = availableOrganizations.find((x => x.orgId === orgId))\r\n        onSubmit(org)\r\n    }\r\n\r\n    const handleSave = () => {\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const getInitvalues = () => {\r\n        let initOrgId;\r\n        if (initOrganization) {\r\n            initOrgId = initOrganization.orgId;\r\n        } else {\r\n            initOrgId = availableOrganizations.length > 0 ? availableOrganizations[0].orgId : null;\r\n        }\r\n        return {\r\n            search: '',\r\n            orgId: initOrgId\r\n        }\r\n    }\r\n\r\n    const changeSearch = _.debounce((event) => {\r\n        setItems(filterItems(allItems, event));\r\n    }, 700);\r\n\r\n    const escFunction = useCallback((keyEvent) => {\r\n        const code = (keyEvent.charCode || keyEvent.keyCode);\r\n        if (code === 13) {\r\n            keyEvent.preventDefault();\r\n        } else if (code === 27) {\r\n            onCancel()\r\n        }\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n    if (!availableOrganizations || !items) return <Loading className={classes.loading}/>\r\n\r\n    return (\r\n        <Form\r\n            initialValues={getInitvalues()}\r\n            id={formId}\r\n            onSubmit={handleSubmit}\r\n            validationSchema={Yup.object().shape({})}\r\n        >\r\n            {(formikProps) => (\r\n                <>\r\n                    <GridBlock\r\n                        column>\r\n                        <TextInput\r\n                            label={Tr('search_label_4')}\r\n                            id='search'\r\n                            formikProps={formikProps}\r\n                            onChange={changeSearch}\r\n                        />\r\n\r\n                        <div className={classes.root}>\r\n                            {\r\n                                (items.length > 0) ? <RadioGroup\r\n                                    id='orgId'\r\n                                    formikProps={formikProps}\r\n                                    items={items}/>\r\n                                    : <Typography>{Tr(\"no_options\")}</Typography>\r\n                            }\r\n                        </div>\r\n\r\n                        <div className={classes.buttonsWrapper}>\r\n                            <GridBlock justify='flex-end'>\r\n                                <DoubleButton\r\n                                    labelFirst={Tr('cancel')}\r\n                                    labelSecond={Tr('save')}\r\n                                    onClickFirst={onCancel}\r\n                                    onClickSecond={handleSave}\r\n                                    disabledSecond={getObjectValue(\"orgId\", formikProps.values, null) === null}\r\n                                />\r\n                            </GridBlock>\r\n                        </div>\r\n                    </GridBlock>\r\n                </>\r\n            )}\r\n        </Form>\r\n    )\r\n}\r\n\r\nSelectOrganizationForm.propTypes = {\r\n    availableOrganizations: PropTypes.array.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(withStyles(style)(SelectOrganizationForm));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport SelectOrganizationForm from \"./SelectOrganizationForm\";\r\n\r\nfunction SelectOrganization(\r\n    {\r\n        open,\r\n        onConfirm,\r\n        onCancel,\r\n        initOrganization,\r\n        availableOrganizations,\r\n        title = 'organizational_unit'\r\n    }) {\r\n\r\n    return (<Dialog\r\n        titleCentered\r\n        title={Tr(title)}\r\n        open={open}\r\n        maxWidth={'sm'}\r\n        onClose={onCancel}>\r\n        <SelectOrganizationForm\r\n            onSubmit={onConfirm}\r\n            onCancel={onCancel}\r\n            initOrganization={initOrganization}\r\n            availableOrganizations={availableOrganizations}\r\n        />\r\n    </Dialog>)\r\n}\r\n\r\nSelectOrganization.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default SelectOrganization;","import React, {useState} from 'react'\r\nimport {FormHelperText, FormLabel, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport SelectOrganization from \"./popup/selectOrganization/SelectOrganization\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginTop: theme.spacing()\r\n    },\r\n    chipLabel: {\r\n        maxWidth: 250,\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis',\r\n    },\r\n    buttonSelect: {\r\n        marginRight: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction OrganizationInput(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        required,\r\n        availableOrganizations,\r\n        disabled\r\n    }) {\r\n\r\n    const [openSelectOrganization, setOpenSelectOrganization] = useState(false)\r\n    const initOrganization = getObjectValue(id, formikProps.values, null);\r\n    const handleClick = () => {\r\n        setOpenSelectOrganization(true)\r\n        formikProps.setFieldTouched(id, true)\r\n    }\r\n\r\n    const handleClosePoup = () => {\r\n        setOpenSelectOrganization(false)\r\n        formikProps.setFieldTouched(id, true)\r\n    }\r\n\r\n    const handleConfirm = (values) => {\r\n        handleClosePoup();\r\n        formikProps.setFieldValue(id, values)\r\n    }\r\n\r\n    const element = getObjectValue(id, formikProps.values, {})\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    const touched = getObjectValue(id, formikProps.touched, false)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const errorLabel = touched && errorValue ? errorValue : ''\r\n\r\n    return (\r\n        <>\r\n            <FormLabel>\r\n                {Tr('organizational_unit')} {required && '*'}\r\n            </FormLabel>\r\n            <GridBlock\r\n                className={classes.root}\r\n                alignItems='center'\r\n                wrap='nowrap'\r\n            >\r\n                {(editable && !disabled) && <Button\r\n                    onClick={handleClick}\r\n                    className={classes.buttonSelect}\r\n                    disabled={!editable || disabled}\r\n                >\r\n                    {Tr('select')}\r\n                </Button>}\r\n\r\n                <GridBlock spacing={1}>\r\n                    <Typography>{element.name}</Typography>\r\n                </GridBlock>\r\n            </GridBlock>\r\n            <SelectOrganization\r\n                initOrganization={initOrganization}\r\n                availableOrganizations={availableOrganizations}\r\n                open={openSelectOrganization}\r\n                onConfirm={handleConfirm}\r\n                onCancel={handleClosePoup}/>\r\n            <FormHelperText error>{errorLabel}</FormHelperText>\r\n        </>\r\n    )\r\n}\r\n\r\nOrganizationInput.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(OrganizationInput);","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tbackgroundColor: theme.palette.background.greyBackground,\r\n\t\twidth: '100%',\r\n\t\theight: 100,\r\n\t\tborder: `${theme.palette.common.document} dashed 2px`,\r\n\t\tborderRadius: theme.shape.borderRadius,\r\n\t\tdisplay: 'flex',\r\n\t\tflexDirection: 'column',\r\n\t\talignItems: 'center',\r\n\t\tjustifyContent: 'center'\r\n\t}\r\n})\r\n\r\nfunction GreyBox({\r\n\tclasses,\r\n\tchildren,\r\n}) {\r\n\tconst childrenComponent = () => {\r\n\t\tif(typeof children === 'string'){\r\n\t\t\treturn (\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{children}\r\n\t\t\t\t</Typography>\r\n\t\t\t)\r\n\t\t}\r\n\t\treturn children;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div className={classes.root}>\r\n\t\t\t{childrenComponent()}\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nGreyBox.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nGreyBox.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(GreyBox);","import React, {memo, useCallback} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport {useDropzone} from 'react-dropzone';\r\nimport GreyBox from './GreyBox';\r\nimport GridBlock from './GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport clsx from 'clsx';\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport WorkableButton from \"./button/WorkableButton\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        cursor: 'pointer'\r\n    },\r\n    defaultChildrenGrid: {\r\n        '&>*:not(:first-child)': {\r\n            marginLeft: theme.spacing(2),\r\n        }\r\n    }\r\n}))\r\n\r\nfunction Dropzone(\r\n    {\r\n        children,\r\n        formikProps,\r\n        id,\r\n        multiple,\r\n        submitOnChange,\r\n        className,\r\n        onChange = () => {\r\n        },\r\n        disabled,\r\n        working,\r\n        acceptExtensionList\r\n    }) {\r\n    const classes = useStyles();\r\n    const isError = formikProps ? (!!formikProps.errors[id] && !!formikProps.touched[id]) : false;\r\n    const helperText = formikProps ? (formikProps.errors[id] || ' ') : '';\r\n\r\n    const onDrop = useCallback(acceptedFiles => {\r\n        const files = acceptedFiles;\r\n        onChange(files);\r\n\r\n        if (formikProps) {\r\n            formikProps.setFieldValue(id, files)\r\n            if (submitOnChange) {\r\n                formikProps.submitForm();\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [onChange])\r\n\r\n    const generateExtension = () => {\r\n        if (acceptExtensionList === undefined) return ''\r\n        return acceptExtensionList.map(x => \".\" + x).join(\", \");\r\n    }\r\n\r\n    const {getRootProps, getInputProps} = useDropzone({onDrop, multiple, accept: generateExtension()})\r\n\r\n    const setTouched = () => {\r\n        if (formikProps && !formikProps.touched[id]) {\r\n            formikProps.setFieldTouched(id, true)\r\n        }\r\n    }\r\n\r\n    const {\r\n        onClick,\r\n        ...rootProps\r\n    } = getRootProps({\r\n        onDrop: setTouched,\r\n        onBlur: setTouched,\r\n    });\r\n\r\n    const childrenComponent = () => {\r\n        if (children === undefined) {\r\n            return (\r\n                <GridBlock\r\n                    alignItems='center'\r\n                    justify='center'\r\n                    className={classes.defaultChildrenGrid}\r\n                >\r\n                    <Typography variant='body1' className={classes.text}>\r\n                        {Tr('dropzone_text_1')}\r\n                    </Typography>\r\n                    <WorkableButton onClick={onClick} disabled={disabled || working} working={working}>\r\n                        {Tr(working ? 'file_working' : 'select_file')}\r\n                    </WorkableButton>\r\n                    <Typography variant='body1' className={classes.text}>\r\n                        {Tr('dropzone_text_2')}\r\n                    </Typography>\r\n                </GridBlock>\r\n            )\r\n        }\r\n        if (typeof children === 'string') {\r\n            return (\r\n                <Typography variant='body1' className={classes.text}>\r\n                    {children}\r\n                </Typography>\r\n            )\r\n        }\r\n        return children;\r\n    }\r\n\r\n    return (\r\n        <div {...rootProps} className={clsx(classes.root, className)}>\r\n            <input {...getInputProps({\r\n                onBlur: setTouched,\r\n            })} />\r\n            <GreyBox>\r\n                {childrenComponent()}\r\n                {isError &&\r\n                    <Typography variant='body1' color='error'>\r\n                        {helperText}\r\n                    </Typography>\r\n                }\r\n            </GreyBox>\r\n        </div>\r\n    )\r\n}\r\n\r\nDropzone.propTypes = {\r\n    classes: PropTypes.any,\r\n    formikProps: PropTypes.object,\r\n    id: PropTypes.string,\r\n    multiple: PropTypes.bool,\r\n}\r\n\r\nDropzone.defaultProps = {\r\n    multiple: false\r\n}\r\n\r\nexport default memo(Dropzone, (prevProps, nextProps) => {\r\n    if (prevProps.id !== nextProps.id) return false;\r\n    if (prevProps.working !== nextProps.working) return false;\r\n    const id = nextProps.id;\r\n    if (prevProps.formikProps && nextProps.formikProps) {\r\n        if (prevProps.formikProps.values[id] !== nextProps.formikProps.values[id]) return false;\r\n        if (prevProps.formikProps.errors[id] !== nextProps.formikProps.errors[id]) return false;\r\n        if (prevProps.formikProps.touched[id] !== nextProps.formikProps.touched[id]) return false;\r\n    }\r\n    if (JSON.stringify(prevProps.classes) !== JSON.stringify(nextProps.classes)) return false;\r\n    if (prevProps.acceptExtensionList !== nextProps.acceptExtensionList) return false;\r\n    if (!!prevProps.disabled !== !!nextProps.disabled) return false;\r\n    return true;\r\n})\r\n","import Endpoints from 'constants/Endpoints';\r\nimport RestRequest, {RestRequestGET} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store'\r\nimport {clearResource, setResource} from \"../redux/actions\";\r\n\r\nconst VALID_EXTENSIONS_LIST_RESOURCE_ID = \"validExtensionsList\"\r\n\r\nconst upload = async (\r\n    file,\r\n    onUploadChange = () => {\r\n    },\r\n    url,\r\n    encryptRoundId) => {\r\n\r\n    if (!url) {\r\n        let auth = JSON.parse(localStorage.getItem(\"authorize\"));\r\n        url = Endpoints.UPLOAD(auth.csrf, encryptRoundId);\r\n    }\r\n\r\n    const formData = new FormData();\r\n    formData.append('file', file);\r\n\r\n    try {\r\n        return await RestRequest({\r\n            method: 'post',\r\n            data: formData,\r\n            url: url,\r\n            headers: {\r\n                'Content-Type': 'multipart/form-data',\r\n            },\r\n            onUploadProgress: onUploadChange\r\n        })\r\n    } catch (error) {\r\n        throw error.data\r\n    }\r\n\r\n}\r\n\r\nconst getValidExtensions = async () => {\r\n    try {\r\n        const extensions = await RestRequestGET(Endpoints.extensions());\r\n        reduxStore.dispatch(setResource(VALID_EXTENSIONS_LIST_RESOURCE_ID, extensions))\r\n    } catch (e) {\r\n        console.error(e);\r\n    }\r\n}\r\nconst clearValidExtensionsResource = () => {\r\n    reduxStore.dispatch(clearResource(VALID_EXTENSIONS_LIST_RESOURCE_ID));\r\n}\r\n\r\nexport default {\r\n    upload,\r\n    getValidExtensions,\r\n    clearValidExtensionsResource,\r\n    VALID_EXTENSIONS_LIST_RESOURCE_ID\r\n};","import React from 'react'\r\nimport { Grid, LinearProgress, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport { withStyles } from '@material-ui/styles';\r\n// import Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\tflexShrink: 0,\r\n\t\t}\r\n\t},\r\n\tlabelItem: {\r\n\t\tmarginRight: theme.spacing(2)\r\n\t},\r\n\tprogressItem: {\r\n\t\tflexGrow: 1\r\n\t},\r\n\tprogressGrid: {\r\n\t\theight: '100%',\r\n\t\tjustifyContent: 'center',\r\n\t}\r\n})\r\n\r\nfunction ProgressBar({\r\n\tclasses,\r\n\tvalue,\r\n\tmax\r\n}) {\r\n\tconst progress = parseInt((value/max) * 100)\r\n\treturn (\r\n\t\t<Grid container className={classes.root}>\r\n\t\t\t<Grid item className={classes.labelItem}>\r\n\t\t\t\t<Typography variant='caption'>\r\n\t\t\t\t\t{/* {Tr('completed')} {progress}% ({value}/{max} {Tr('fields')}) */}\r\n\t\t\t\t\t{progress}%\r\n\t\t\t\t</Typography>\r\n\t\t\t</Grid>\r\n\t\t\t<Grid item className={classes.progressItem}>\r\n\t\t\t\t<Grid container direction='column' className={classes.progressGrid}>\r\n\t\t\t\t\t<Grid item>\r\n\t\t\t\t\t\t<LinearProgress  variant='determinate' value={progress} />\r\n\t\t\t\t\t</Grid>\r\n\t\t\t\t</Grid>\r\n\t\t\t</Grid>\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nProgressBar.propTypes = {\r\n\tvalue: PropTypes.number.isRequired,\r\n\tmax: PropTypes.number.isRequired,\r\n}\r\n\r\nProgressBar.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(ProgressBar);\r\n","import React from 'react'\r\nimport {Grid, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Button from 'components/Button';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    item: {\r\n        width: theme.components.popup.buttons.width,\r\n        '&:nth-child(2)': {\r\n            marginRight: theme.spacing(1)\r\n        },\r\n        '&:nth-child(3)': {\r\n            marginLeft: theme.spacing(1)\r\n        }\r\n    }\r\n})\r\n\r\nfunction SingleButton(\r\n    {\r\n        className,\r\n        classes,\r\n        label,\r\n        onClick,\r\n        buttonType,\r\n        disabled,\r\n        justify=\"flex-end\",\r\n        variant,\r\n        before,\r\n        after,\r\n    }) {\r\n    return (\r\n        <Grid container className={className} justifyContent={justify}>\r\n            <Grid item>{before}</Grid>\r\n            <Grid item className={classes.item}>\r\n                <Button\r\n                    fullWidth\r\n                    onClick={onClick}\r\n                    variant={variant}\r\n                    disabled={disabled}\r\n                >\r\n                    {label}\r\n                </Button>\r\n            </Grid>\r\n            <Grid item>{after}</Grid>\r\n        </Grid>\r\n    )\r\n}\r\n\r\nSingleButton.propTypes = {\r\n    className: PropTypes.string,\r\n    classes: PropTypes.any,\r\n    variant: PropTypes.oneOf([ 'text', 'outlined', 'contained']),\r\n    label: PropTypes.string,\r\n    justify: PropTypes.string,\r\n    onClick: PropTypes.func,\r\n    disabled: PropTypes.bool\r\n}\r\n\r\nSingleButton.defaultProps = {}\r\n\r\nexport default withStyles(style)(SingleButton);","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\n\r\nconst DEMAND_STAGES_LIST = 'demandStagesList';\r\nconst DEMAND_STAGE_SECTIONS_LIST = 'demandStageSectionsList';\r\nconst DEMAND_CONTRACTOR_PASSWORD_POPUP = 'offerPasswordPopup';\r\nconst STAGE_CURRENT_ROUND = 'stageCurrentRound';\r\n\r\nconst openContractorPasswordPopup = (successCallback, errorCallback) => {\r\n    reduxStore.dispatch(setResource(DEMAND_CONTRACTOR_PASSWORD_POPUP, {successCallback, errorCallback}));\r\n}\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n}\r\n\r\nconst getStages = async (demandId, contractorDepartmentId) => {\r\n    try {\r\n        const params = {contractorDepartmentId}\r\n\r\n        const res = await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_STAGES_LIST(demandId, contractorDepartmentId), {params});\r\n        reduxStore.dispatch(setResource(DEMAND_STAGES_LIST, res));\r\n\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getStageSections = async (demandId, stageId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const res = await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_STAGE_SECTIONS_LIST(demandId, stageId, supplierId), {params});\r\n        const ob = res.reduce((prev, curr) => {\r\n            prev[curr.section] = curr;\r\n            return prev;\r\n        }, {})\r\n        reduxStore.dispatch(setResource(DEMAND_STAGE_SECTIONS_LIST, ob));\r\n    } catch (error) {\r\n    }\r\n}\r\nconst getStageTranslations = async (demandId, stageId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        return await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_STAGE_TRANSLATIONS(demandId, stageId, supplierId), {params});\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getStageSection = async (demandId, stageId, section, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const res = await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_STAGE_SECTION(demandId, stageId, section, supplierId), {params});\r\n        const {resources} = reduxStore.getState();\r\n        const list = resources[DEMAND_STAGE_SECTIONS_LIST];\r\n        if(list) {\r\n            const newList = {\r\n                ...list,\r\n                [res.section]: res\r\n            }\r\n            reduxStore.dispatch(setResource(DEMAND_STAGE_SECTIONS_LIST, newList));\r\n        }\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getStageCurrentRound = async (demandId, stageId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEMAND_OFFERS_STAGE_CURRENT_ROUND(demandId, stageId));\r\n        reduxStore.dispatch(setResource(STAGE_CURRENT_ROUND, res));\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getPasswordStatus = async (demandId, stageId) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_STAGE_PASSWORD(demandId, stageId));\r\n}\r\n\r\nconst savePassword = async (demandId, stageId, password) => {\r\n    return await RestRequestPOST(Endpoints.DEMAND_OFFERS_CONTRACTOR_STAGE_PASSWORD(demandId, stageId), {password});\r\n}\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.DEMAND_OFFERS_VALIDATE(id));\r\n}\r\n\r\nexport default {\r\n    getStages,\r\n    getStageSections,\r\n    getStageTranslations,\r\n    clearResources,\r\n    getPasswordStatus,\r\n    openContractorPasswordPopup,\r\n    savePassword,\r\n    getStageCurrentRound,\r\n    getStageSection,\r\n    validate,\r\n    DEMAND_STAGES_LIST,\r\n    DEMAND_STAGE_SECTIONS_LIST,\r\n    DEMAND_CONTRACTOR_PASSWORD_POPUP,\r\n    STAGE_CURRENT_ROUND\r\n}","import Tr from \"translations/Translations\";\r\n\r\nconst isResponseValid = (response, setError) => {\r\n    if (response && response.success !== false) {\r\n        return true;\r\n    } else {\r\n        let errorSet = false;\r\n        if (response.errors) {\r\n            if (Array.isArray(response.errors)) {\r\n                if (response.errors.length > 0) {\r\n                    setError(response.errors[0])\r\n                    errorSet = true;\r\n                }\r\n            } else {\r\n                for (const key in response.errors) {\r\n                    if (!response.errors.hasOwnProperty(key)) continue;\r\n                    setError(response.errors[key]);\r\n                    errorSet = true;\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n        if (!errorSet)\r\n            setError(Tr('unknown_error_message'));\r\n    }\r\n    return false;\r\n}\r\n\r\nexport default isResponseValid;","export const ContractorPasswordState = {\r\n    REQUIRED_NEW_PASSWORD: \"REQUIRED_NEW_PASSWORD\",\r\n    REQUIRED_EXISTING_PASSWORD: \"REQUIRED_EXISTING_PASSWORD\",\r\n    HAS_PASSWORD_STORED: \"HAS_PASSWORD_STORED\"\r\n}\r\n","import React, {useEffect, useRef, useState} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport ProgressBar from 'components/ProgressBar'\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport SingleButton from \"../components/SingleButton\";\r\nimport UploadService from \"services/UploadService\";\r\nimport DemandOffersService from \"../../../services/DemandOffersService\";\r\nimport isResponseValid from \"../../../libs/isResponseValid\";\r\nimport {ContractorPasswordState} from \"../../../constants/ContractorPasswordState\";\r\nimport {useParams} from \"react-router\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    item: {\r\n        alignSelf: \"end\"\r\n    }\r\n}))\r\n\r\nfunction UploadFilePopup(\r\n    {\r\n        downloadFiles,\r\n        handleSubmit,\r\n        onUpload,\r\n        encryptRoundId\r\n    }) {\r\n\r\n    const errorTranslate = Tr('file_response')\r\n    const setRefresh = useState(0)[1];\r\n    const filesStatus = useRef();\r\n    const uploadedFiles = useRef([]);\r\n    const params = useParams();\r\n    const classes = useStyle();\r\n    const [dialogClosed, setDialogClosed] = useState(false);\r\n\r\n    useEffect(() => {\r\n        if (encryptRoundId) {\r\n            DemandOffersService.getPasswordStatus(params.id, params.stageId)\r\n                .then((resp) => {\r\n                    if (isResponseValid(resp, onError)) {\r\n                        if (resp.result.state === ContractorPasswordState.HAS_PASSWORD_STORED) {\r\n                            doUpload();\r\n                        } else {\r\n                            DemandOffersService.openContractorPasswordPopup(doUpload, onError)\r\n                        }\r\n                    } else {\r\n                        onError(resp)\r\n                    }\r\n                })\r\n                .catch(onError);\r\n        } else {\r\n            doUpload();\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const onError = (e) => {\r\n        console.error(\"CheckPassword error\", e)\r\n        handleSubmit({\r\n            files: [],\r\n            config: downloadFiles.config\r\n        })\r\n    }\r\n\r\n    const doUpload = () => {\r\n        filesStatus.current = downloadFiles.files.map((element) => ({\r\n            loaded: 0,\r\n            total: 1,\r\n            name: element.name,\r\n            uploadStatus: null,\r\n        }));\r\n\r\n        downloadFiles.files.forEach((element, index) => {\r\n            UploadService.upload(element, handleUploadProgressChange(element, index), null, encryptRoundId)\r\n                .then(res => {\r\n                    filesStatus.current[index].uploadStatus = res.uploadStatus;\r\n                    if (res.uploadStatus === 'OK') {\r\n                        uploadSuccess({...res, originalIndex: index});\r\n                    } else {\r\n                        setRefresh(st => st + 1);\r\n                    }\r\n                })\r\n                .catch((e) => {\r\n                    console.error(e)\r\n                    if (filesStatus.current[index]) {\r\n                        filesStatus.current[index].uploadStatus = 'ERROR';\r\n                    }\r\n                    setRefresh(st => st + 1)\r\n                })\r\n        });\r\n    }\r\n\r\n    const uploadSuccess = (fileData) => {\r\n        uploadedFiles.current.push(fileData);\r\n        if (onUpload)\r\n            onUpload(fileData);\r\n        setRefresh(st => st + 1);\r\n    };\r\n\r\n\r\n    const handleUploadProgressChange = (element, index) => (e) => {\r\n        filesStatus.current[index] = {\r\n            loaded: e.loaded,\r\n            total: e.total,\r\n            name: element.name,\r\n            uploadStatus: e.loaded === e.total ? \"SCANNING_FILE\" : null,\r\n        };\r\n        setRefresh(st => st + 1);\r\n    };\r\n\r\n    const checkFilesLoaded = () => {\r\n        const loaded = filesStatus.current && uploadedFiles.current && filesStatus.current.every(e => e.loaded === e.total) &&\r\n            filesStatus.current.filter((x) => [\"SCANNING_FILE\", \"OK\"].includes(x.uploadStatus)).length === uploadedFiles.current.length\r\n        return loaded;\r\n    };\r\n\r\n    const handleClose = () => {\r\n        setDialogClosed(true);\r\n        handleSubmit({\r\n            files: uploadedFiles.current,\r\n            config: downloadFiles.config\r\n        })\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('file_upload')}\r\n            open\r\n            maxWidth={'md'}\r\n            dialogActions={<SingleButton disabled={!checkFilesLoaded() || dialogClosed} onClick={handleClose} label={Tr('close')}/>}\r\n        >\r\n            {!!filesStatus.current && filesStatus.current.map(({loaded, total, name, uploadStatus}, i) => {\r\n                return (\r\n                    <React.Fragment key={i}>\r\n                        <GridBlock justify='space-between' wrap=\"nowrap\" itemClassName={classes.item}>\r\n                            <Typography variant='body1'>\r\n                                {name}\r\n                            </Typography>\r\n                            <Typography noWrap variant='body2' color={[\"SCANNING_FILE\", \"OK\"].includes(uploadStatus)? undefined : \"error\"}>\r\n                                {errorTranslate[uploadStatus]}\r\n                            </Typography>\r\n                        </GridBlock>\r\n                        <ProgressBar\r\n                            value={loaded}\r\n                            max={total}\r\n                        />\r\n                        <br/>\r\n                    </React.Fragment>\r\n                )\r\n            })}\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nUploadFilePopup.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default UploadFilePopup;","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\nimport GridBlock from './GridBlock';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ttitle: {\r\n\t\tfontWeight: theme.typography.fontWeightBold,\r\n\t},\r\n})\r\n\r\nfunction TitledComponent({\r\n\tclasses,\r\n\tchildren,\r\n\ttitle,\r\n\tclassName,\r\n\trequired,\r\n\tlabelClassName,\r\n\tadditionalElement,\r\n\tcomponentRef\r\n}) {\r\n\r\n\treturn (\r\n\t\t<div ref={componentRef} className={className + ' ' + classes.root}>\r\n\t\t\t<GridBlock justify=\"space-between\">\r\n\t\t\t\t<Typography\r\n\t\t\t\t\tvariant='body1'\r\n\t\t\t\t\tclassName={clsx(\r\n\t\t\t\t\t\tclasses.title,\r\n\t\t\t\t\t\tlabelClassName,\r\n\t\t\t\t\t)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{title}{required && '*'}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t{additionalElement}\r\n\t\t\t</GridBlock>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nTitledComponent.propTypes = {\r\n\tclassName: PropTypes.string,\r\n\tclasses: PropTypes.any,\r\n\ttitle: PropTypes.string,\r\n}\r\n\r\nTitledComponent.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(TitledComponent);","export default {\r\n    DATE_FORMAT: \"DD.MM.YYYY\",\r\n    DATETIME_FORMAT: \"DD.MM.YYYY HH:mm\",\r\n    DATETIME_WITH_SECONDS_FORMAT: \"YYYY.MM.DD HH:mm:ss\"\r\n}\r\n","import React from 'react'\r\nimport Tooltip from '@material-ui/core/Tooltip';\r\nimport PropTypes from 'prop-types';\r\nimport AcUnitIcon from '@material-ui/icons/AcUnit';\r\nimport clsx from 'clsx';\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    pointer: {\r\n        cursor: 'pointer'\r\n    }\r\n}))\r\n\r\nfunction TooltipIcon(\r\n    {\r\n        tooltip,\r\n        placement = 'top',\r\n        hideTooltip = false,\r\n        Icon = AcUnitIcon,\r\n        color,\r\n        fontSize,\r\n        onClick,\r\n        tooltipClasses,\r\n        iconClasses,\r\n        ...otherProps\r\n    }) {\r\n    const classes = useStyles();\r\n    if (hideTooltip || !tooltip) {\r\n        return <Icon />\r\n    }\r\n    return (\r\n        <Tooltip title={tooltip} placement={placement} classes={tooltipClasses}>\r\n\t\t\t<span>\r\n\t\t\t\t<Icon color={color} fontSize={fontSize} onClick={onClick} className={clsx({[classes.pointer]: !!onClick }, iconClasses)} {...otherProps}/>\r\n\t\t\t</span>\r\n        </Tooltip>\r\n    )\r\n}\r\n\r\nTooltipIcon.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default TooltipIcon;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from './GridBlock';\r\nimport Chip from './Chip';\r\nimport Tr from 'translations/Translations';\r\nimport downloadFile from \"../libs/downloadFile\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {DraftsOutlined, MailOutline} from '@material-ui/icons';\r\nimport TooltipIcon from \"./icon/TooltipIcon\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport clsx from 'clsx';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    blackChipIcon: {\r\n        '& svg': {\r\n            color: theme.palette.text.primary\r\n        }\r\n    }\r\n}));\r\n\r\nfunction FilesList(\r\n    {\r\n        elements = [],\r\n        onDelete,\r\n        customAction,\r\n        onDownload,\r\n        showDownloadDate = false\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    return (<GridBlock spacing={1}>\r\n        {elements.map((element, i) => {\r\n            const {file} = element;\r\n            return (\r\n                <Chip\r\n                    className={clsx({[classes.blackChipIcon]: showDownloadDate})}\r\n                    value={file.name}\r\n                    onDelete={onDelete ? ()=> onDelete(i) : undefined}\r\n                    onClick={() => !!onDownload ? onDownload(element) : downloadFile(file) }\r\n                    key={i}\r\n                    tooltip={Tr('download')}\r\n                    disabled={element.inaccessible}\r\n                    customDeleteIcon={!!showDownloadDate ?\r\n                        <TooltipIcon Icon={!!element.firstDownloadDate ? DraftsOutlined : MailOutline}\r\n                                     tooltip={!!element.firstDownloadDate ? `${Tr('file_downloaded')}: ${moment(element.firstDownloadDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}` : Tr('file_not_downloaded')}/>\r\n                        : undefined\r\n                    }\r\n                />\r\n            )\r\n        })}\r\n        {customAction}\r\n    </GridBlock>)\r\n}\r\n\r\nFilesList.propTypes = {\r\n    classes: PropTypes.any,\r\n    elements: PropTypes.array,\r\n    onDelete: PropTypes.func,\r\n    onDownload: PropTypes.func,\r\n    customAction: PropTypes.any\r\n};\r\n\r\nexport default FilesList;","import Endpoints from \"../constants/Endpoints\";\r\nimport {RestRequestGET, RestRequestPOST} from \"../libs/RestRequest\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst showError = (message) => {\r\n\treduxStore.dispatch(setSaveStatusError(message))\r\n}\r\n\r\nconst getFilesAdnFolders = async (demandId, folderPath) => {\r\n\tlet params = {\r\n\t\tfolderPath\r\n\t}\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.SHAREPOINT(demandId), {params});\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst downloadFileFromSharepoint = async (demandId, file) => {\r\n\ttry {\r\n\t\treturn await RestRequestPOST(Endpoints.SHAREPOINT(demandId), file);\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t}\r\n\treturn {uploadStatus: \"ERROR\"}\r\n}\r\n\r\nexport default {\r\n\tgetFilesAdnFolders,\r\n\tdownloadFileFromSharepoint\r\n};\r\n\r\n","import React from 'react'\r\nimport {Grid, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport clsx from \"clsx\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    item: {\r\n        minWidth: theme.components.popup.buttons.width,\r\n        marginRight: theme.spacing(1)\r\n    },\r\n    before: {\r\n        flexGrow: 1,\r\n        marginLeft: theme.spacing(1)\r\n    }\r\n})\r\n\r\nfunction MultiButton(\r\n    {\r\n        className,\r\n        classes,\r\n        buttons,//created by createButton\r\n        justify = 'flex-end',\r\n        before,\r\n        after,\r\n        afterAfter,\r\n    }) {\r\n    return (\r\n        <Grid container className={className} justifyContent={justify}>\r\n            {!!before && <Grid item className={clsx(classes.item, classes.before)}>{before}</Grid>}\r\n            {!!buttons && buttons.map(\r\n                ({\r\n                     label,\r\n                     onClick,\r\n                     variant,\r\n                     disabled,\r\n                     className,\r\n                     working,\r\n                     Icon\r\n                 }, i) => (<Grid item className={classes.item} key={i}>\r\n                    <WorkableButton\r\n                        fullWidth\r\n                        variant={variant}\r\n                        onClick={onClick}\r\n                        disabled={disabled}\r\n                        className={className}\r\n                        working={working}\r\n                        Icon={Icon}\r\n                    >\r\n                        {label}\r\n                    </WorkableButton>\r\n                </Grid>))}\r\n            {!!after && <Grid item className={classes.item}>{after}</Grid>}\r\n            {!!afterAfter && <Grid item>{afterAfter}</Grid>}\r\n        </Grid>\r\n    )\r\n}\r\n\r\nMultiButton.propTypes = {\r\n    className: PropTypes.string,\r\n    classes: PropTypes.any,\r\n}\r\n\r\nMultiButton.defaultProps = {}\r\n\r\nexport const createButton = (label, onClick, variant, disabled = false, className, working = false, Icon) => ({\r\n    label,\r\n    onClick,\r\n    variant,\r\n    disabled,\r\n    className,\r\n    working,\r\n    Icon\r\n});\r\n\r\nexport default withStyles(style)(MultiButton);","import React from 'react'\r\nimport SvgIcon from \"@material-ui/core/SvgIcon\";\r\n\r\n//https://www.svgrepo.com/svg/306418/microsoftsharepoint\r\nfunction SharepointIcon(props) {\r\n    return (<SvgIcon viewBox=\"0 0 24 24\" {...props}>\r\n            <path d=\"M24 13.5q0 1.242-.475 2.332-.474 1.09-1.289 1.904-.814.815-1.904 1.29-1.09.474-2.332.474-.762 0-1.523-.2-.106.997-.557 1.858-.451.862-1.154 1.494-.704.633-1.606.99-.902.358-1.91.358-1.09 0-2.045-.416-.955-.416-1.664-1.125-.709-.709-1.125-1.664Q6 19.84 6 18.75q0-.188.018-.375.017-.188.04-.375H.997q-.41 0-.703-.293T0 17.004V6.996q0-.41.293-.703T.996 6h3.54q.14-1.277.726-2.373.586-1.096 1.488-1.904Q7.652.914 8.807.457 9.96 0 11.25 0q1.395 0 2.625.533T16.02 1.98q.914.915 1.447 2.145T18 6.75q0 .188-.012.375-.011.188-.035.375 1.242 0 2.344.469 1.101.468 1.928 1.277.826.809 1.3 1.904Q24 12.246 24 13.5zm-12.75-12q-.973 0-1.857.34-.885.34-1.577.943-.691.604-1.154 1.43Q6.2 5.039 6.06 6h4.945q.41 0 .703.293t.293.703v4.945l.21-.035q.212-.75.61-1.424.399-.673.944-1.218.545-.545 1.213-.944.668-.398 1.43-.61.093-.503.093-.96 0-1.09-.416-2.045-.416-.955-1.125-1.664-.709-.709-1.664-1.125Q12.34 1.5 11.25 1.5zM6.117 15.902q.54 0 1.06-.111.522-.111.932-.37.41-.257.662-.679.252-.422.252-1.055 0-.632-.263-1.054-.264-.422-.662-.703-.399-.282-.856-.463l-.855-.34q-.399-.158-.662-.334-.264-.176-.264-.445 0-.2.14-.323.141-.123.335-.193.193-.07.404-.094.21-.023.351-.023.598 0 1.055.152.457.153.95.457V8.543q-.282-.082-.522-.14-.24-.06-.475-.1-.234-.041-.486-.059-.252-.017-.557-.017-.515 0-1.054.117-.54.117-.979.375-.44.258-.715.68-.275.421-.275 1.03 0 .598.263.997.264.398.663.68.398.28.855.474l.856.363q.398.17.662.358.263.187.263.457 0 .222-.123.351-.123.13-.31.2-.188.07-.393.087-.205.018-.369.018-.703 0-1.248-.234-.545-.235-1.107-.621v1.875q1.195.468 2.472.468zM11.25 22.5q.773 0 1.453-.293t1.19-.803q.51-.51.808-1.195.299-.686.299-1.459 0-.668-.223-1.277-.222-.61-.62-1.096-.4-.486-.95-.826-.55-.34-1.207-.48v1.933q0 .41-.293.703t-.703.293H7.57q-.07.375-.07.75 0 .773.293 1.459t.803 1.195q.51.51 1.195.803.686.293 1.459.293zM18 18q.926 0 1.746-.352.82-.351 1.436-.966.615-.616.966-1.43.352-.815.352-1.752 0-.926-.352-1.746-.351-.82-.966-1.436-.616-.615-1.436-.966Q18.926 9 18 9t-1.74.357q-.815.358-1.43.973t-.973 1.43q-.357.814-.357 1.74 0 .129.006.258t.017.258q.551.27 1.02.65t.838.855q.369.475.627 1.026.258.55.387 1.148Q17.18 18 18 18Z\"/>\r\n        </SvgIcon>\r\n    );\r\n}\r\n\r\nexport default SharepointIcon;\r\n\r\n\r\n\r\n","import React, {useEffect, useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport SharepointService from \"../../../services/SharepointService\";\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Loading from \"components/Loading\";\r\nimport Typography from \"components/Typography\";\r\nimport {Breadcrumbs, Checkbox, List, ListItem, ListItemIcon, ListItemText} from \"@material-ui/core\";\r\nimport Link from \"@material-ui/core/Link\";\r\nimport FolderIcon from \"@material-ui/icons/Folder\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport SubdirectoryArrowLeftIcon from '@material-ui/icons/SubdirectoryArrowLeft';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport NavigateNextIcon from \"@material-ui/icons/NavigateNext\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport SharepointIcon from \"components/icon/SharepointIcon\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    rotate: {\r\n        transform: 'rotate(90deg)'\r\n    },\r\n    breadcrumbText: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    checkbox: {\r\n        padding: \"0 11px\"\r\n    },\r\n    selDocuments: {\r\n        marginRight: 200\r\n    },\r\n    dialogContent: {\r\n        minHeight: 500\r\n    },\r\n    loading: {\r\n        position: 'absolute',\r\n        width: 900,\r\n        height: 50\r\n    },\r\n    titleIcon: {\r\n        position: 'absolute',\r\n        left: theme.spacing(2),\r\n        color: theme.palette.primary.main,\r\n    }\r\n}))\r\n\r\n\r\nfunction SharepointExplorer(\r\n    {\r\n        demandId,\r\n        onClose,\r\n        handleSubmit\r\n    }) {\r\n    const classes = useStyle();\r\n    const [filesAndFolders, setFilesAndFolders] = useState(null);\r\n    const [selectedFileMap, setSelectedFilesMap] = useState(new Map());\r\n    const [working, setWorking] = useState(true);\r\n\r\n    useEffect(() => {\r\n            SharepointService.getFilesAdnFolders(demandId).then((resp) => setFilesAndFolders(resp)).finally(() => setWorking(false));\r\n    }, [demandId])\r\n\r\n\r\n    const toggleSelectFile = (file) => {\r\n        const newMap = new Map(selectedFileMap);\r\n        if (newMap.has(file.uniqueId)) {\r\n            newMap.delete(file.uniqueId);\r\n            setSelectedFilesMap(new Map(newMap));\r\n        } else {\r\n            newMap.set(file.uniqueId, file)\r\n            setSelectedFilesMap(new Map(newMap));\r\n        }\r\n    }\r\n\r\n    const handleBreadcrumbClick = (event) => {\r\n        event.preventDefault();\r\n        const serverRelativeUrl = event.target.getAttribute('data-serverrelativeurl');\r\n        handleClick(serverRelativeUrl);\r\n    }\r\n\r\n    const handleClick = (serverRelativeUrl) => {\r\n        if (!working) {\r\n            setWorking(true);\r\n            SharepointService.getFilesAdnFolders(demandId, serverRelativeUrl).then((resp) => {\r\n                if(!!resp)\r\n                    setFilesAndFolders(resp);\r\n            }).finally(() => setWorking(false));\r\n        }\r\n    }\r\n\r\n    const folders = useMemo(() => {\r\n\r\n        return filesAndFolders ? filesAndFolders.serverRelativeUrl.split(\"/\") : null;\r\n    }, [filesAndFolders]);\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined'));\r\n        buttons.push(createButton(Tr('add'), () => handleSubmit(Array.from(selectedFileMap).map(([key, value]) => value)), undefined, selectedFileMap.size === 0));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={\r\n            <div>\r\n                <SharepointIcon className={classes.titleIcon} />\r\n                {Tr(\"int_explorer_dialog_title_x\", {x: \"sharepoint\"}, true)}\r\n\r\n            </div>}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            onClose={onClose}\r\n            contentClassName={classes.dialogContent}\r\n            dialogActions={\r\n                <>\r\n                    <MultiButton\r\n                        buttons={getButtons()}\r\n                        before={<Typography className={classes.selDocuments}>{`${Tr('documents_selected')}: ${selectedFileMap.size}`} </Typography>}\r\n                    />\r\n                </>\r\n            }\r\n        >\r\n\r\n            {working && <Loading className={classes.loading}/>}\r\n            {!!filesAndFolders && <>\r\n                <GridBlock>\r\n                    <Typography className={classes.breadcrumbText}>{Tr('you_are_here')}:</Typography>\r\n                    <Breadcrumbs separator={<NavigateNextIcon fontSize=\"small\"/>} maxItems={3}>\r\n\r\n                        {\r\n                            folders.map((elem, index, arr) => {\r\n                                if (index !== arr.length - 1) {\r\n                                    return <Link key={index} href=\"#\" data-serverrelativeurl={arr.slice(0, index + 1).join(\"/\")}\r\n                                                 onClick={handleBreadcrumbClick}>\r\n                                        {index === 0 ? Tr('documents') : elem}\r\n                                    </Link>\r\n                                } else {\r\n                                    return <Typography key={index}>{index === 0 ? Tr('documents') : elem}</Typography>\r\n                                }\r\n                            })\r\n                        }\r\n                    </Breadcrumbs>\r\n                </GridBlock>\r\n\r\n                <List dense>\r\n                    {\r\n                        folders.length > 1 && <ListItem button onClick={() => handleClick(folders.slice(0, folders.length - 1).join(\"/\"))}>\r\n                            <ListItemIcon>\r\n                                <SubdirectoryArrowLeftIcon className={classes.rotate}/>\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary=\"[..]\"\r\n                            />\r\n                        </ListItem>\r\n                    }\r\n\r\n\r\n                    {\r\n                        filesAndFolders.folders.map(x => (<ListItem key={x.uniqueId} button onClick={() => handleClick(x.serverRelativeUrl)}>\r\n                            <ListItemIcon>\r\n                                <FolderIcon/>\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary={x.name}\r\n                            />\r\n                        </ListItem>))\r\n                    }\r\n                    {\r\n                        filesAndFolders.files.map(x => (<ListItem key={x.uniqueId} disableRipple button onClick={() => toggleSelectFile(x)}>\r\n                            <ListItemIcon>\r\n                                <Checkbox\r\n                                    className={classes.checkbox}\r\n                                    edge=\"start\"\r\n                                    checked={selectedFileMap.has(x.uniqueId)}\r\n                                    tabIndex={-1}\r\n                                    disableRipple\r\n                                />\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary={x.name}\r\n                            />\r\n                        </ListItem>))\r\n                    }\r\n                    {\r\n                        filesAndFolders.files.length === 0 && filesAndFolders.folders.length === 0 &&\r\n                        <ListItem disabled>\r\n                            <ListItemIcon>\r\n                               <SharepointIcon />\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary={Tr('no_files_in_directory')}\r\n                            />\r\n                        </ListItem>\r\n                    }\r\n\r\n                </List>\r\n            </>}\r\n\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSharepointExplorer.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    handleSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default SharepointExplorer;","import React, {useEffect, useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport {CircularProgress, List, ListItem, ListItemIcon, ListItemText} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport SingleButton from \"../../popup/components/SingleButton\";\r\n\r\n\r\nimport QueryBuilderIcon from '@material-ui/icons/QueryBuilder';\r\nimport SharepointService from \"../../../services/SharepointService\";\r\nimport CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport Typography from \"../../Typography\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    wait: {color: theme.palette.action.disabled},\r\n    uploading: {\r\n        color: theme.palette.primary.main,\r\n    },\r\n    done: {color: theme.palette.common.success},\r\n    error: {color: theme.palette.common.error},\r\n\r\n}))\r\n\r\n\r\nfunction SharepointDownloadPopup(\r\n    {\r\n        demandId,\r\n        downloadFiles,\r\n        handleSubmit,\r\n        onUpload\r\n    }) {\r\n    const classes = useStyle();\r\n    const [files, setFiles] = useState([]);\r\n    const [working, setWorking] = useState(true);\r\n    const uploadedFiles = useRef([]);\r\n    const errorTranslate = Tr('file_response')\r\n\r\n    useEffect(() => {\r\n        setFiles(downloadFiles.files.map(x => ({...x})));\r\n        (async () => {\r\n            for (let i = 0; i < downloadFiles.files.length; i++) {\r\n                setFiles(prev => {\r\n                    const next = [...prev];\r\n                    next[i].file = {uploadStatus: \"UPLOADING\"};\r\n                    return next;\r\n                })\r\n\r\n                try {\r\n                    const resp = await SharepointService.downloadFileFromSharepoint(demandId, downloadFiles.files[i]);\r\n\r\n                    if (resp.uploadStatus === 'OK') {\r\n                        uploadSuccess({...resp, originalIndex: i});\r\n                    }\r\n\r\n                    setFiles(prev => {\r\n                        const next = [...prev];\r\n                        next[i].file = resp;\r\n                        return next;\r\n                    })\r\n                } catch (e) {\r\n                    console.error(e)\r\n                    if (files && files[i])\r\n                        setFiles(prev => {\r\n                            const next = [...prev];\r\n                            next[i].file = {uploadStatus: \"ERROR\"};\r\n                            return next;\r\n                        })\r\n                }\r\n            }\r\n            setWorking(false);\r\n        })()\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const uploadSuccess = (fileData) => {\r\n        uploadedFiles.current.push(fileData);\r\n        if (onUpload)\r\n            onUpload(fileData);\r\n    };\r\n\r\n\r\n    const getIcon = (file) => {\r\n        if (!file.file) {\r\n            return <QueryBuilderIcon className={classes.wait}/>\r\n        } else if (file.file.uploadStatus === \"UPLOADING\") {\r\n            return <CircularProgress className={classes.uploading} size={20}/>\r\n        } else if (file.file.uploadStatus === \"OK\") {\r\n            return <CheckCircleOutlineIcon className={classes.done}/>\r\n        } else {\r\n            return <ErrorOutlineIcon className={classes.error}/>\r\n        }\r\n    }\r\n\r\n    const getSecondaryText = (file) => {\r\n        if (file.file && file.file.uploadStatus !== \"UPLOADING\" && file.file.uploadStatus !== \"OK\") {\r\n            return <Typography component=\"span\" variant=\"body2\" color=\"error\">{errorTranslate[file.file.uploadStatus]}</Typography>\r\n        }\r\n    }\r\n\r\n    const handleClose = () => {\r\n        handleSubmit({\r\n            files: uploadedFiles.current,\r\n            config: downloadFiles.config\r\n        })\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            maxWidth=\"md\"\r\n            dialogActions={\r\n                <SingleButton onClick={handleClose} justify=\"flex-end\" label={Tr('close')} disabled={working}/>\r\n            }\r\n        >\r\n\r\n            <List dense>\r\n                {files.map(x => (<ListItem key={x.uniqueId}>\r\n                    <ListItemIcon>\r\n                        {getIcon(x)}\r\n                    </ListItemIcon>\r\n                    <ListItemText\r\n                        primary={x.name}\r\n                        secondary={getSecondaryText(x)}\r\n\r\n                    />\r\n                </ListItem>))\r\n                }\r\n            </List>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSharepointDownloadPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    downloadFiles: PropTypes.shape({\r\n        files: PropTypes.arrayOf(PropTypes.shape({\r\n            name: PropTypes.string.isRequired,\r\n            serverRelativeUrl: PropTypes.string.isRequired,\r\n            length: PropTypes.number.isRequired,\r\n            uniqueId: PropTypes.string.isRequired\r\n        })).isRequired,\r\n        config: PropTypes.any\r\n    }),\r\n    handleSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default SharepointDownloadPopup;","import Endpoints from \"../constants/Endpoints\";\r\nimport {RestRequestGET, RestRequestPOST} from \"../libs/RestRequest\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst showError = (message) => {\r\n\treduxStore.dispatch(setSaveStatusError(message))\r\n}\r\n\r\nconst getFilesAdnFolders = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.EZDRP(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n\tthrow new Error();\r\n}\r\n\r\nconst downloadFileFromEzdrp = async (demandId, file) => {\r\n\ttry {\r\n\t\treturn await RestRequestPOST(Endpoints.EZDRP(demandId), file);\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t}\r\n\treturn {uploadStatus: \"ERROR\"}\r\n}\r\n\r\nexport default {\r\n\tgetFilesAdnFolders,\r\n\tdownloadFileFromEzdrp\r\n};\r\n\r\n","import React from 'react'\r\nimport {Checkbox, Collapse, List, ListItem, ListItemIcon, ListItemText} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport FolderIcon from \"@material-ui/icons/Folder\";\r\nimport DescriptionIcon from '@material-ui/icons/Description';\r\nimport UnfoldLessIcon from '@material-ui/icons/UnfoldLess';\r\nimport UnfoldMoreIcon from '@material-ui/icons/UnfoldMore';\r\nimport AttachFileIcon from '@material-ui/icons/AttachFile';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    checkbox: {\r\n        padding: \"0 11px\"\r\n    },\r\n    attachmentIcon: {\r\n        position: \"absolute\",\r\n        fontSize: \"1.3rem\"\r\n    },\r\n    attachmentsCount: {\r\n        marginLeft: theme.spacing(2),\r\n        fontWeight: \"bold\"\r\n    },\r\n    list: {\r\n        marginLeft: theme.spacing(3)\r\n    },\r\n    line: {\r\n        borderBottom: \"solid 1px \" + theme.palette.border.dark\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    }\r\n}))\r\n\r\nconst FileTypes = {\r\n    FILE: \"FILE\",\r\n    PAPER: \"PAPER\",\r\n    FOLDER: \"FOLDER\",\r\n    EMPTY: \"EMPTY\"\r\n}\r\n\r\nfunction EzdrpList(\r\n    {\r\n        documents,\r\n        toggleSelectFile,\r\n        toggleExpandFile,\r\n        selectedFileMap,\r\n        expandedFileMap,\r\n        level = 0\r\n    }) {\r\n    const classes = useStyle();\r\n    const toggleCheckbox = (e, file) => {\r\n        e.stopPropagation();\r\n        if (file.type === FileTypes.FILE)\r\n            toggleSelectFile(file);\r\n    }\r\n\r\n    if (documents.length === 0) {\r\n        documents = [{id: \"id\", name: <span className={classes.italic}>{Tr('no_files_in_directory')}</span>, type: FileTypes.EMPTY, attachments: []}]\r\n    }\r\n\r\n    return (\r\n        <List\r\n            className={classes.list}\r\n            component=\"div\"\r\n            dense\r\n        >\r\n            {\r\n                documents.map(x => {\r\n                    const hasExpand = x.type === FileTypes.PAPER || x.type === FileTypes.FOLDER || x.attachments.length > 0;\r\n                    const expanded = expandedFileMap.has(x.id);\r\n\r\n                    return (<div key={x.id} >\r\n                        <ListItem disableRipple button onClick={hasExpand ? () => toggleExpandFile(x) : (e) => toggleCheckbox(e, x)}>\r\n                            <ListItemIcon>\r\n                                {x.type === FileTypes.FILE && <Checkbox\r\n                                    className={classes.checkbox}\r\n                                    edge=\"start\"\r\n                                    checked={selectedFileMap.has(x.id)}\r\n                                    tabIndex={-1}\r\n                                    disableRipple\r\n                                    onClick={(e) => toggleCheckbox(e, x)}\r\n                                />}\r\n                                {x.type === FileTypes.FOLDER && <FolderIcon/>}\r\n                                {x.type === FileTypes.PAPER && <DescriptionIcon/>}\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary={<>\r\n                                    {x.name}\r\n                                    {hasExpand && <>\r\n                                        <AttachFileIcon className={classes.attachmentIcon}/>\r\n                                        <span className={classes.attachmentsCount}> {'[' + x.attachments.length + ']'}</span>\r\n                                    </>}\r\n                                </>\r\n                                }\r\n                            />\r\n                            {hasExpand ? expanded ? <UnfoldLessIcon/> : <UnfoldMoreIcon/> : null}\r\n                        </ListItem>\r\n                        <Collapse in={expanded} timeout=\"auto\" unmountOnExit>\r\n                            <EzdrpList\r\n                                toggleSelectFile={toggleSelectFile}\r\n                                toggleExpandFile={toggleExpandFile}\r\n                                selectedFileMap={selectedFileMap}\r\n                                expandedFileMap={expandedFileMap}\r\n                                documents={x.attachments}\r\n                                level={level + 1}\r\n                            />\r\n                        </Collapse>\r\n                        {level === 0 && <div className={classes.line}></div>}\r\n                    </div>)\r\n                })}\r\n        </List>)\r\n}\r\n\r\nEzdrpList.propTypes = {\r\n    documents: PropTypes.array.isRequired\r\n}\r\n\r\nexport default EzdrpList;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Loading from \"components/Loading\";\r\nimport Typography from \"components/Typography\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport EzdrpService from \"services/EzdrpService\";\r\nimport EzdrpList from \"./EzdrpList\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    rotate: {\r\n        transform: 'rotate(90deg)'\r\n    },\r\n    breadcrumbText: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    checkbox: {\r\n        padding: \"0 11px\"\r\n    },\r\n    selDocuments: {\r\n        marginRight: 200\r\n    },\r\n    dialogContent: {\r\n        minHeight: 500\r\n    },\r\n    loading: {\r\n        position: 'absolute',\r\n        width: 900,\r\n        height: 50\r\n    },\r\n    titleIcon: {\r\n        position: 'absolute',\r\n        left: theme.spacing(2),\r\n        color: theme.palette.primary.main,\r\n    }\r\n}))\r\n\r\n\r\nfunction EzdrpExplorer(\r\n    {\r\n        demandId,\r\n        onClose,\r\n        handleSubmit\r\n    }) {\r\n    const classes = useStyle();\r\n    const [filesAndFolders, setFilesAndFolders] = useState(null);\r\n    const [selectedFileMap, setSelectedFilesMap] = useState(new Map());\r\n    const [expandedFileMap, setExpandedFilesMap] = useState(new Map());\r\n    const [working, setWorking] = useState(true);\r\n\r\n    useEffect(() => {\r\n        EzdrpService.getFilesAdnFolders(demandId).then((resp) => setFilesAndFolders(resp)).then(() => setWorking(false)).catch(onClose);\r\n        // eslint-disable-next-line\r\n    }, [demandId])\r\n\r\n\r\n    const toggleSelectFile = (file) => {\r\n        const newMap = new Map(selectedFileMap);\r\n        if (newMap.has(file.id)) {\r\n            newMap.delete(file.id);\r\n            setSelectedFilesMap(newMap);\r\n        } else {\r\n            const {attachments, ...others} = file;\r\n            newMap.set(file.id, others)\r\n            setSelectedFilesMap(newMap);\r\n        }\r\n    }\r\n    const toggleExpandFile = (file) => {\r\n        const newMap = new Map(expandedFileMap);\r\n        if (newMap.has(file.id)) {\r\n            newMap.delete(file.id);\r\n            setExpandedFilesMap(newMap);\r\n        } else {\r\n            newMap.set(file.id, file.id)\r\n            setExpandedFilesMap(newMap);\r\n        }\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined'));\r\n        buttons.push(createButton(Tr('add'), () => handleSubmit(Array.from(selectedFileMap).map(([key, value]) => value)), undefined, selectedFileMap.size === 0));\r\n        return buttons;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={\r\n                <div>\r\n                    {Tr(\"int_explorer_dialog_title_x\", {x: \"ezdrp\"}, true)}\r\n                </div>}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            onClose={onClose}\r\n            contentClassName={classes.dialogContent}\r\n            dialogActions={\r\n                <>\r\n                    <MultiButton\r\n                        buttons={getButtons()}\r\n                        before={<Typography className={classes.selDocuments}>{`${Tr('documents_selected')}: ${selectedFileMap.size}`} </Typography>}\r\n                    />\r\n                </>\r\n            }\r\n        >\r\n\r\n            {working && <Loading className={classes.loading}/>}\r\n            {!!filesAndFolders && <>\r\n                <EzdrpList documents={filesAndFolders} selectedFileMap={selectedFileMap} expandedFileMap={expandedFileMap} toggleSelectFile={toggleSelectFile}\r\n                           toggleExpandFile={toggleExpandFile}/>\r\n            </>}\r\n\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEzdrpExplorer.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    handleSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default EzdrpExplorer;","import React, {useEffect, useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport {CircularProgress, List, ListItem, ListItemIcon, ListItemText} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport SingleButton from \"../../popup/components/SingleButton\";\r\n\r\n\r\nimport QueryBuilderIcon from '@material-ui/icons/QueryBuilder';\r\nimport CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport Typography from \"../../Typography\";\r\nimport EzdrpService from \"../../../services/EzdrpService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    wait: {color: theme.palette.action.disabled},\r\n    uploading: {\r\n        color: theme.palette.primary.main,\r\n    },\r\n    done: {color: theme.palette.common.success},\r\n    error: {color: theme.palette.common.error},\r\n\r\n}))\r\n\r\n\r\nfunction EzdrpDownloadPopup(\r\n    {\r\n        demandId,\r\n        downloadFiles,\r\n        handleSubmit,\r\n        onUpload\r\n    }) {\r\n    const classes = useStyle();\r\n    const [files, setFiles] = useState([]);\r\n    const [working, setWorking] = useState(true);\r\n    const uploadedFiles = useRef([]);\r\n    const errorTranslate = Tr('file_response')\r\n\r\n    useEffect(() => {\r\n        setFiles(downloadFiles.files.map(x => ({...x})));\r\n        (async () => {\r\n            for (let i = 0; i < downloadFiles.files.length; i++) {\r\n                setFiles(prev => {\r\n                    const next = [...prev];\r\n                    next[i].file = {uploadStatus: \"UPLOADING\"};\r\n                    return next;\r\n                })\r\n\r\n                try {\r\n                    const resp = await EzdrpService.downloadFileFromEzdrp(demandId, downloadFiles.files[i]);\r\n\r\n                    if (resp.uploadStatus === 'OK') {\r\n                        uploadSuccess({...resp, originalIndex: i});\r\n                    }\r\n\r\n                    setFiles(prev => {\r\n                        const next = [...prev];\r\n                        next[i].file = resp;\r\n                        return next;\r\n                    })\r\n                } catch (e) {\r\n                    console.error(e)\r\n                    if (files && files[i])\r\n                        setFiles(prev => {\r\n                            const next = [...prev];\r\n                            next[i].file = {uploadStatus: \"ERROR\"};\r\n                            return next;\r\n                        })\r\n                }\r\n            }\r\n            setWorking(false);\r\n        })()\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const uploadSuccess = (fileData) => {\r\n        uploadedFiles.current.push(fileData);\r\n        if (onUpload)\r\n            onUpload(fileData);\r\n    };\r\n\r\n\r\n    const getIcon = (file) => {\r\n        if (!file.file) {\r\n            return <QueryBuilderIcon className={classes.wait}/>\r\n        } else if (file.file.uploadStatus === \"UPLOADING\") {\r\n            return <CircularProgress className={classes.uploading} size={20}/>\r\n        } else if (file.file.uploadStatus === \"OK\") {\r\n            return <CheckCircleOutlineIcon className={classes.done}/>\r\n        } else {\r\n            return <ErrorOutlineIcon className={classes.error}/>\r\n        }\r\n    }\r\n\r\n    const getSecondaryText = (file) => {\r\n        if (file.file && file.file.uploadStatus !== \"UPLOADING\" && file.file.uploadStatus !== \"OK\") {\r\n            return <Typography component=\"span\" variant=\"body2\" color=\"error\">{errorTranslate[file.file.uploadStatus]}</Typography>\r\n        }\r\n    }\r\n\r\n    const handleClose = () => {\r\n        handleSubmit({\r\n            files: uploadedFiles.current,\r\n            config: downloadFiles.config\r\n        })\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            maxWidth=\"md\"\r\n            dialogActions={\r\n                <SingleButton onClick={handleClose} justify=\"flex-end\" label={Tr('close')} disabled={working}/>\r\n            }\r\n        >\r\n\r\n            <List dense>\r\n                {files.map(x => (<ListItem key={x.uniqueId}>\r\n                    <ListItemIcon>\r\n                        {getIcon(x)}\r\n                    </ListItemIcon>\r\n                    <ListItemText\r\n                        primary={x.name}\r\n                        secondary={getSecondaryText(x)}\r\n\r\n                    />\r\n                </ListItem>))\r\n                }\r\n            </List>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEzdrpDownloadPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    downloadFiles: PropTypes.shape({\r\n        files: PropTypes.arrayOf(PropTypes.shape({\r\n            name: PropTypes.string.isRequired,\r\n            serverRelativeUrl: PropTypes.string.isRequired,\r\n            length: PropTypes.number.isRequired,\r\n            uniqueId: PropTypes.string.isRequired\r\n        })).isRequired,\r\n        config: PropTypes.any\r\n    }),\r\n    handleSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default EzdrpDownloadPopup;","import Endpoints from \"../constants/Endpoints\";\r\nimport {RestRequestGET, RestRequestPOST} from \"../libs/RestRequest\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst showError = (message) => {\r\n    reduxStore.dispatch(setSaveStatusError(message))\r\n}\r\n\r\nconst getCases = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.EZDPUW(demandId));\r\n        if (isResponseValid(resp, showError)) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n    throw new Error();\r\n}\r\nconst getDocuments = async (demandId, caseId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.EZDPUW_DOCUMENTS(demandId, caseId));\r\n        if (isResponseValid(resp, showError)) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n    throw new Error();\r\n}\r\n\r\nconst downloadFileFromEzdpuw = async (demandId, file) => {\r\n    try {\r\n        return await RestRequestPOST(Endpoints.EZDPUW(demandId), file);\r\n    } catch (e) {\r\n        console.error(e);\r\n    }\r\n    return {uploadStatus: \"ERROR\"}\r\n}\r\n\r\nexport default {\r\n    getCases,\r\n    getDocuments,\r\n    downloadFileFromEzdpuw\r\n};\r\n\r\n","import React, {useEffect, useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport {CircularProgress, List, ListItem, ListItemIcon, ListItemText} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport SingleButton from \"../../popup/components/SingleButton\";\r\n\r\n\r\nimport QueryBuilderIcon from '@material-ui/icons/QueryBuilder';\r\nimport CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport Typography from \"../../Typography\";\r\nimport EzdpuwService from \"services/EzdpuwService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    wait: {color: theme.palette.action.disabled},\r\n    uploading: {\r\n        color: theme.palette.primary.main,\r\n    },\r\n    done: {color: theme.palette.common.success},\r\n    error: {color: theme.palette.common.error},\r\n}))\r\n\r\n\r\nfunction EzdpuwDownloadPopup(\r\n    {\r\n        demandId,\r\n        downloadFiles,\r\n        handleSubmit,\r\n        onUpload\r\n    }) {\r\n    const classes = useStyle();\r\n    const [files, setFiles] = useState([]);\r\n    const [working, setWorking] = useState(true);\r\n    const uploadedFiles = useRef([]);\r\n    const errorTranslate = Tr('file_response')\r\n\r\n    useEffect(() => {\r\n        setFiles(downloadFiles.files.map(x => ({...x})));\r\n        (async () => {\r\n            for (let i = 0; i < downloadFiles.files.length; i++) {\r\n                setFiles(prev => {\r\n                    const next = [...prev];\r\n                    next[i].file = {uploadStatus: \"UPLOADING\"};\r\n                    return next;\r\n                })\r\n\r\n                try {\r\n                    const resp = await EzdpuwService.downloadFileFromEzdpuw(demandId, downloadFiles.files[i]);\r\n\r\n                    if (resp.uploadStatus === 'OK') {\r\n                        uploadSuccess({...resp, originalIndex: i});\r\n                    }\r\n\r\n                    setFiles(prev => {\r\n                        const next = [...prev];\r\n                        next[i].file = resp;\r\n                        return next;\r\n                    })\r\n                } catch (e) {\r\n                    console.error(e)\r\n                    if (files && files[i])\r\n                        setFiles(prev => {\r\n                            const next = [...prev];\r\n                            next[i].file = {uploadStatus: \"ERROR\"};\r\n                            return next;\r\n                        })\r\n                }\r\n            }\r\n            setWorking(false);\r\n        })()\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const uploadSuccess = (fileData) => {\r\n        uploadedFiles.current.push(fileData);\r\n        if (onUpload)\r\n            onUpload(fileData);\r\n    };\r\n\r\n\r\n    const getIcon = (file) => {\r\n        if (!file.file) {\r\n            return <QueryBuilderIcon className={classes.wait}/>\r\n        } else if (file.file.uploadStatus === \"UPLOADING\") {\r\n            return <CircularProgress className={classes.uploading} size={20}/>\r\n        } else if (file.file.uploadStatus === \"OK\") {\r\n            return <CheckCircleOutlineIcon className={classes.done}/>\r\n        } else {\r\n            return <ErrorOutlineIcon className={classes.error}/>\r\n        }\r\n    }\r\n\r\n    const getSecondaryText = (file) => {\r\n        if (file.file && file.file.uploadStatus !== \"UPLOADING\" && file.file.uploadStatus !== \"OK\") {\r\n            return <Typography component=\"span\" variant=\"body2\" color=\"error\">{errorTranslate[file.file.uploadStatus]}</Typography>\r\n        }\r\n    }\r\n\r\n    const handleClose = () => {\r\n        handleSubmit({\r\n            files: uploadedFiles.current,\r\n            config: downloadFiles.config\r\n        })\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            maxWidth=\"md\"\r\n            dialogActions={\r\n                <SingleButton onClick={handleClose} justify=\"flex-end\" label={Tr('close')} disabled={working}/>\r\n            }\r\n        >\r\n            <List dense>\r\n                {files.map(x => (<ListItem key={x.id}>\r\n                    <ListItemIcon>\r\n                        {getIcon(x)}\r\n                    </ListItemIcon>\r\n                    <ListItemText\r\n                        primary={x.name}\r\n                        secondary={getSecondaryText(x)}\r\n                    />\r\n                </ListItem>))\r\n                }\r\n            </List>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEzdpuwDownloadPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    downloadFiles: PropTypes.shape({\r\n        files: PropTypes.arrayOf(PropTypes.shape({\r\n            id: PropTypes.number.isRequired,\r\n            name: PropTypes.string.isRequired,\r\n        })).isRequired,\r\n        config: PropTypes.any\r\n    }),\r\n    handleSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default EzdpuwDownloadPopup;","import React from 'react'\r\nimport FolderIcon from \"@material-ui/icons/Folder\";\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconFolderButton(\r\n    {\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        Icon={FolderIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconFolderButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconFolderButton;","import React from 'react'\r\nimport {Checkbox, Collapse, List, ListItem, ListItemIcon, ListItemText} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport UnfoldLessIcon from '@material-ui/icons/UnfoldLess';\r\nimport UnfoldMoreIcon from '@material-ui/icons/UnfoldMore';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconFolderButton from \"components/button/WorkableIconFolderButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    checkbox: {\r\n        padding: \"0 11px\"\r\n    },\r\n    attachmentIcon: {\r\n        position: \"absolute\",\r\n        fontSize: \"1.3rem\"\r\n    },\r\n    attachmentsCount: {\r\n        marginLeft: theme.spacing(2),\r\n        fontWeight: \"bold\"\r\n    },\r\n    list: {\r\n        marginLeft: theme.spacing(3)\r\n    },\r\n    line: {\r\n        borderBottom: \"solid 1px \" + theme.palette.border.dark\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    }\r\n}))\r\n\r\nconst FileTypes = {\r\n    CASE: \"CASE\",\r\n    FILE: \"FILE\"\r\n}\r\n\r\nfunction EzdpuwList(\r\n    {\r\n        documents,\r\n        toggleSelectFile,\r\n        toggleExpandCase,\r\n        selectedFileMap,\r\n        level = 0,\r\n        workingCase\r\n    }) {\r\n    const classes = useStyle();\r\n    const toggleCheckbox = (e, file) => {\r\n        e.stopPropagation();\r\n        if (file.type === FileTypes.FILE)\r\n            toggleSelectFile(file);\r\n    }\r\n\r\n    if (documents && documents.length === 0) {\r\n        documents = [{id: \"id\", name: <span className={classes.italic}>{Tr(level === 0 ? \"no_cases_associated\" : \"no_files_in_directory\")}</span>, type: FileTypes.EMPTY, attachments: null}]\r\n    }\r\n\r\n    return (\r\n        <List\r\n            className={classes.list}\r\n            component=\"div\"\r\n            dense\r\n        >\r\n            {\r\n                documents.map(x => {\r\n                    const hasExpand = x.type === FileTypes.CASE;\r\n                    const expanded = x.attachments !== null\r\n\r\n                    return (<div key={x.id}>\r\n                        <ListItem disableRipple button onClick={hasExpand ? () => toggleExpandCase(x) : (e) => toggleCheckbox(e, x)}>\r\n                            <ListItemIcon>\r\n                                {x.type === FileTypes.FILE && <Checkbox\r\n                                    className={classes.checkbox}\r\n                                    edge=\"start\"\r\n                                    checked={selectedFileMap.has(x.id)}\r\n                                    tabIndex={-1}\r\n                                    disableRipple\r\n                                    onClick={(e) => toggleCheckbox(e, x)}\r\n                                />}\r\n                                {x.type === FileTypes.CASE && <WorkableIconFolderButton working={workingCase === x.id} disabled={false}/>}\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary={x.name}\r\n                            />\r\n                            {hasExpand ? expanded ? <UnfoldLessIcon/> : <UnfoldMoreIcon/> : null}\r\n                        </ListItem>\r\n                        <Collapse in={expanded} timeout=\"auto\" unmountOnExit>\r\n                            {expanded &&\r\n                                <EzdpuwList\r\n                                    toggleSelectFile={toggleSelectFile}\r\n                                    toggleExpandCase={toggleExpandCase}\r\n                                    selectedFileMap={selectedFileMap}\r\n                                    documents={x.attachments}\r\n                                    level={level + 1}\r\n                                />}\r\n                        </Collapse>\r\n                        {level === 0 && <div className={classes.line}></div>}\r\n                    </div>)\r\n                })}\r\n        </List>)\r\n}\r\n\r\nEzdpuwList.propTypes = {\r\n    documents: PropTypes.array\r\n}\r\n\r\nexport default EzdpuwList;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Loading from \"components/Loading\";\r\nimport Typography from \"components/Typography\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport EzdpuwList from \"./EzdpuwList\";\r\nimport EzdpuwService from \"services/EzdpuwService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    rotate: {\r\n        transform: 'rotate(90deg)'\r\n    },\r\n    breadcrumbText: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    checkbox: {\r\n        padding: \"0 11px\"\r\n    },\r\n    selDocuments: {\r\n        marginRight: 200\r\n    },\r\n    dialogContent: {\r\n        minHeight: 500\r\n    },\r\n    loading: {\r\n        position: 'absolute',\r\n        width: 900,\r\n        height: 50\r\n    },\r\n    titleIcon: {\r\n        position: 'absolute',\r\n        left: theme.spacing(2),\r\n        color: theme.palette.primary.main,\r\n    }\r\n}))\r\n\r\n\r\nfunction EzdpuwExplorer(\r\n    {\r\n        demandId,\r\n        onClose,\r\n        handleSubmit\r\n    }) {\r\n    const classes = useStyle();\r\n    const [filesAndFolders, setFilesAndFolders] = useState(null);\r\n    const [selectedFileMap, setSelectedFilesMap] = useState(new Map());\r\n    const [working, setWorking] = useState(true);\r\n    const [workingCase, setWorkingCase] = useState(null);\r\n\r\n    useEffect(() => {\r\n        EzdpuwService.getCases(demandId).then((resp) => {\r\n            setFilesAndFolders(resp);\r\n        }).then(() => setWorking(false)).catch(onClose);\r\n        // eslint-disable-next-line\r\n    }, [demandId])\r\n\r\n\r\n    const toggleSelectFile = (file) => {\r\n        const newMap = new Map(selectedFileMap);\r\n        if (newMap.has(file.id)) {\r\n            newMap.delete(file.id);\r\n            setSelectedFilesMap(newMap);\r\n        } else {\r\n            const {attachments, ...others} = file;\r\n            newMap.set(file.id, others)\r\n            setSelectedFilesMap(newMap);\r\n        }\r\n    }\r\n    const toggleExpandCase = (file) => {\r\n        if (working || workingCase)\r\n            return;\r\n\r\n        if ((file.attachments !== null)) {\r\n            setFilesAndFolders(filesAndFolders.map(x => x.id === file.id ? {...x, attachments: null} : x))\r\n        } else {\r\n            setWorkingCase(file.id);\r\n            EzdpuwService.getDocuments(demandId, file.id).then((resp) => {\r\n                setFilesAndFolders(filesAndFolders.map(x => x.id === file.id ? {...x, attachments: resp} : x));\r\n            }).finally(() => {\r\n                setWorkingCase(null);\r\n            })\r\n        }\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working || !!workingCase));\r\n        buttons.push(createButton(Tr('add'), () => handleSubmit(Array.from(selectedFileMap).map(([key, value]) => value)), undefined, working || !!workingCase || selectedFileMap.size === 0));\r\n        return buttons;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={\r\n                <div>\r\n                    {Tr(\"int_explorer_dialog_title_x\", {x: \"ezdpuw\"}, true)}\r\n                </div>}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            onClose={onClose}\r\n            contentClassName={classes.dialogContent}\r\n            dialogActions={\r\n                <>\r\n                    <MultiButton\r\n                        buttons={getButtons()}\r\n                        before={<Typography className={classes.selDocuments}>{`${Tr('documents_selected')}: ${selectedFileMap.size}`} </Typography>}\r\n                    />\r\n                </>\r\n            }\r\n        >\r\n\r\n            {working && <Loading className={classes.loading}/>}\r\n            {!!filesAndFolders && <>\r\n                <EzdpuwList documents={filesAndFolders} selectedFileMap={selectedFileMap} toggleSelectFile={toggleSelectFile}\r\n                            toggleExpandCase={toggleExpandCase} workingCase={workingCase}/>\r\n            </>}\r\n\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEzdpuwExplorer.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    handleSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default EzdpuwExplorer;","import React, {useEffect, useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dropzone from 'components/Dropzone'\r\nimport UploadService from 'services/UploadService';\r\nimport UploadFilePopup from './popup/uploadFile/UploadFilePopup';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport removeFormikListElement from 'libs/removeFormikListElement';\r\nimport TitledComponent from './TitledComponent';\r\nimport {makeStyles} from '@material-ui/core';\r\nimport FilesList from \"./FilesList\";\r\nimport {connect} from 'react-redux';\r\nimport PrivilegeService from \"../services/PrivilegeService\";\r\nimport GridBlock from \"./GridBlock\";\r\nimport SharepointExplorer from \"./complex/sharepointExplorer/SharepointExplorer\";\r\nimport Tr from \"../translations/Translations\";\r\nimport SharepointIcon from \"./icon/SharepointIcon\";\r\nimport Button from \"./Button\";\r\nimport SharepointDownloadPopup from \"./complex/sharepointExplorer/SharepointDownloadPopup\";\r\nimport {useParams} from \"react-router\";\r\nimport EzdrpExplorer from \"./complex/ezdrpExplorer/EzdrpExplorer\";\r\nimport EzdrpDownloadPopup from \"./complex/ezdrpExplorer/EzdrpDownloadPopup\";\r\nimport EzdpuwDownloadPopup from \"./complex/ezdpuwExplorer/EzdpuwDownloadPopup\";\r\nimport EzdpuwExplorer from \"./complex/ezdpuwExplorer/EzdpuwExplorer\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    dropzone: {\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    dropzoneParent: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n        },\r\n        '&>*:nth-child(2)': {\r\n            marginLeft: theme.spacing(2),\r\n            marginTop: theme.spacing()\r\n        }\r\n    },\r\n    integrationButton: {\r\n        width: \"100%\",\r\n        marginBottom: theme.spacing()\r\n    }\r\n}));\r\n\r\nconst SupportedTypes = {\r\n    BROWSER: \"BROWSER\",\r\n    SHAREPOINT: \"SHAREPOINT\",\r\n    EZDRP: \"EZDRP\",\r\n    EZDPUW: \"EZDPUW\",\r\n}\r\n\r\nfunction UploadFile(\r\n    {\r\n        //common\r\n        label,\r\n        onUpload,\r\n        onUploadPopupClosed,\r\n        acceptExtensionList,\r\n        disabled,\r\n        working,\r\n\r\n        //formikProps\r\n        multiple = true,\r\n        id,\r\n        formikProps,\r\n        onDelete,\r\n        onDownload,\r\n        onOpenConfigureFiles,\r\n        configuredFiles,\r\n        defaultValidExtensionList,\r\n        demandHeader,\r\n        demandPrivileges = {},\r\n        encryptRoundId\r\n    }) {\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n\r\n    const classes = useStyle();\r\n    const editable = formikProps ? getObjectValue('_editable', formikProps.values, true) : true;\r\n\r\n    const currentProcess = useRef(null);\r\n\r\n    const [browserDownloadFiles, setBrowserDownloadFiles] = useState(null);\r\n\r\n    const [sharepointExplorerOpen, setSharepointExplorerOpen] = useState(false);\r\n    const [sharepointDownloadFiles, setSharepointDownloadFiles] = useState(null);\r\n\r\n    const [ezdrpExplorerOpen, setEzdrpExplorerOpen] = useState(false);\r\n    const [ezdDownloadFiles, setEzdDownloadFiles] = useState(null);\r\n\r\n    const [ezdpuwExplorerOpen, setEzdpuwExplorerOpen] = useState(false);\r\n    const [ezdpuwDownloadFiles, setEzdpuwDownloadFiles] = useState(null);\r\n\r\n    useEffect(() => {\r\n        if (configuredFiles) {\r\n            if (currentProcess.current === SupportedTypes.BROWSER)\r\n                setBrowserDownloadFiles(configuredFiles)\r\n            else if (currentProcess.current === SupportedTypes.SHAREPOINT)\r\n                setSharepointDownloadFiles(configuredFiles)\r\n            else if (currentProcess.current === SupportedTypes.EZDRP)\r\n                setEzdDownloadFiles(configuredFiles)\r\n            else if (currentProcess.current === SupportedTypes.EZDPUW)\r\n                setEzdpuwDownloadFiles(configuredFiles)\r\n            currentProcess.current = null;\r\n\r\n        }\r\n    }, [configuredFiles])\r\n\r\n\r\n    const handleBrowserUpload = ({files, config}) => {\r\n        setBrowserDownloadFiles(null);\r\n        handleDownloadedFiles(files, config);\r\n    };\r\n\r\n    const handleSubmitSharepointDownloadFiles = ({files, config}) => {\r\n        setSharepointDownloadFiles(null)\r\n        handleDownloadedFiles(files, config);\r\n    }\r\n\r\n    const handleSubmitEzdrpDownloadFiles = ({files, config}) => {\r\n        setEzdDownloadFiles(null)\r\n        handleDownloadedFiles(files, config);\r\n    }\r\n\r\n    const handleSubmitEzdpuwDownloadFiles = ({files, config}) => {\r\n        setEzdpuwDownloadFiles(null)\r\n        handleDownloadedFiles(files, config);\r\n    }\r\n\r\n    const handleDownloadedFiles = (files, config) => {\r\n        if (formikProps) {\r\n            const formikFiles = getObjectValue(id, formikProps.values, []);\r\n            files.forEach((fileData, i) => {\r\n                const fileId = `${id}.${formikFiles.length + i}.file`;\r\n                formikProps.setFieldValue(fileId, fileData)\r\n            })\r\n        }\r\n        if (onUploadPopupClosed)\r\n            onUploadPopupClosed(files, config);\r\n    }\r\n\r\n\r\n    const handleBrowserFileSelect = (selectedFiles) => {\r\n        if (onOpenConfigureFiles) {\r\n            currentProcess.current = SupportedTypes.BROWSER;\r\n            onOpenConfigureFiles(selectedFiles);\r\n        } else {\r\n            setBrowserDownloadFiles({files: selectedFiles, config: null});\r\n        }\r\n    }\r\n\r\n    const handleSharepointExplorerSubmit = (selectedFiles) => {\r\n        setSharepointExplorerOpen(false);\r\n        if (onOpenConfigureFiles) {\r\n            currentProcess.current = SupportedTypes.SHAREPOINT;\r\n            onOpenConfigureFiles(selectedFiles)\r\n        } else {\r\n            setSharepointDownloadFiles({files: selectedFiles, config: null})\r\n        }\r\n    }\r\n    const handleEzdrpExplorerSubmit = (selectedFiles) => {\r\n        setEzdrpExplorerOpen(false);\r\n        if (onOpenConfigureFiles) {\r\n            currentProcess.current = SupportedTypes.EZDRP;\r\n            onOpenConfigureFiles(selectedFiles)\r\n        } else {\r\n            setEzdDownloadFiles({files: selectedFiles, config: null})\r\n        }\r\n    }\r\n    const handleEzdpuwExplorerSubmit = (selectedFiles) => {\r\n        setEzdpuwExplorerOpen(false);\r\n        if (onOpenConfigureFiles) {\r\n            currentProcess.current = SupportedTypes.EZDPUW;\r\n            onOpenConfigureFiles(selectedFiles)\r\n        } else {\r\n            setEzdpuwDownloadFiles({files: selectedFiles, config: null})\r\n        }\r\n    }\r\n\r\n\r\n    const deleteFile = (index) => {\r\n        if (onDelete)\r\n            onDelete(index);\r\n\r\n        if (formikProps)\r\n            removeFormikListElement(formikProps, id, index);\r\n    };\r\n\r\n    const fileElements = formikProps ? getObjectValue(id, formikProps.values, []) : [];\r\n\r\n    const getIntegrationButtons = () => {\r\n        if (demandPrivileges?.INTEGRATIONS_DOWNLOAD && !!demandId) {\r\n            const sharepoint = demandHeader?.applicationClientSettings?.sharepointIntegration || {};\r\n            const ezdrp = demandHeader?.applicationClientSettings?.ezdrpIntegration || {};\r\n            const ezdpuw = demandHeader?.applicationClientSettings?.ezdpuwIntegration || {};\r\n\r\n            if (sharepoint.active || ezdrp.active || ezdpuw.active) {\r\n                return (<GridBlock column>\r\n                    {\r\n                        !!sharepoint.active && <Button\r\n                            className={classes.integrationButton}\r\n                            Icon={SharepointIcon}\r\n                            onClick={() => setSharepointExplorerOpen(true)}\r\n                            disabled={disabled || working || !sharepoint.connected}\r\n                            tooltip={!sharepoint.connected ? Tr(\"int_demand_not_connected_x\", {x: \"sharepoint\"}, true) : undefined}\r\n                        >{Tr(\"int_download_from_x\", {x: \"sharepoint\"}, true)}</Button>\r\n                    }\r\n                    {\r\n                        !!ezdrp.active && <Button\r\n                            className={classes.integrationButton}\r\n                            onClick={() => setEzdrpExplorerOpen(true)}\r\n                            disabled={disabled || working || !ezdrp.connected}\r\n                            tooltip={!ezdrp.connected ? Tr(\"int_demand_not_connected_x\", {x: \"ezdrp\"}, true) : undefined}\r\n                        >{Tr(\"int_download_from_x\", {x: \"ezdrp\"}, true)}</Button>\r\n                    }\r\n                    {\r\n                        !!ezdpuw.active && <Button\r\n                            className={classes.integrationButton}\r\n                            onClick={() => setEzdpuwExplorerOpen(true)}\r\n                            disabled={disabled || working || !ezdpuw.connected}\r\n                            tooltip={!ezdpuw.connected ? Tr(\"int_demand_not_connected_x\", {x: \"ezdpuw\"}, true) : undefined}\r\n                        >{Tr(\"int_download_from_x\", {x: \"ezdpuw\"}, true)}</Button>\r\n                    }\r\n                </GridBlock>)\r\n            }\r\n        }\r\n        return false;\r\n    }\r\n\r\n    return (\r\n        <TitledComponent\r\n            title={label}\r\n        >\r\n            {!!formikProps && <FilesList\r\n                elements={fileElements}\r\n                onDelete={(editable && !disabled) ? deleteFile : undefined}\r\n                onDownload={onDownload} />}\r\n            {editable && <>\r\n                <GridBlock className={classes.dropzoneParent}>\r\n                    <Dropzone\r\n                        className={classes.dropzone}\r\n                        onChange={handleBrowserFileSelect}\r\n                        multiple={multiple}\r\n                        acceptExtensionList={acceptExtensionList ? acceptExtensionList : defaultValidExtensionList}\r\n                        disabled={disabled}\r\n                        working={working}\r\n                    />\r\n                    {\r\n                        getIntegrationButtons()\r\n                    }\r\n\r\n                </GridBlock>\r\n\r\n                {browserDownloadFiles && <UploadFilePopup\r\n                    downloadFiles={browserDownloadFiles}\r\n                    handleSubmit={handleBrowserUpload}\r\n                    onUpload={onUpload}\r\n                    encryptRoundId={encryptRoundId}\r\n                />}\r\n\r\n\r\n                {sharepointExplorerOpen && <SharepointExplorer\r\n                    onClose={() => setSharepointExplorerOpen(false)}\r\n                    handleSubmit={handleSharepointExplorerSubmit}\r\n                    demandId={demandId}\r\n                />}\r\n\r\n                {ezdrpExplorerOpen && <EzdrpExplorer\r\n                    onClose={() => setEzdrpExplorerOpen(false)}\r\n                    handleSubmit={handleEzdrpExplorerSubmit}\r\n                    demandId={demandId}\r\n                />}\r\n\r\n                {ezdpuwExplorerOpen && <EzdpuwExplorer\r\n                    onClose={() => setEzdpuwExplorerOpen(false)}\r\n                    handleSubmit={handleEzdpuwExplorerSubmit}\r\n                    demandId={demandId}\r\n                />}\r\n\r\n                {!!sharepointDownloadFiles &&\r\n                    <SharepointDownloadPopup\r\n                        demandId={demandId}\r\n                        downloadFiles={sharepointDownloadFiles}\r\n                        handleSubmit={handleSubmitSharepointDownloadFiles}\r\n                        onUpload={onUpload}\r\n                    />\r\n                }\r\n\r\n                {!!ezdDownloadFiles &&\r\n                    <EzdrpDownloadPopup\r\n                        demandId={demandId}\r\n                        downloadFiles={ezdDownloadFiles}\r\n                        handleSubmit={handleSubmitEzdrpDownloadFiles}\r\n                        onUpload={onUpload}\r\n                    />\r\n                }\r\n\r\n                {!!ezdpuwDownloadFiles &&\r\n                    <EzdpuwDownloadPopup\r\n                        demandId={demandId}\r\n                        downloadFiles={ezdpuwDownloadFiles}\r\n                        handleSubmit={handleSubmitEzdpuwDownloadFiles}\r\n                        onUpload={onUpload}\r\n                    />\r\n                }\r\n\r\n            </>}\r\n        </TitledComponent>\r\n    )\r\n}\r\n\r\nUploadFile.propTypes = {\r\n    onDelete: PropTypes.func,\r\n    onDownload: PropTypes.func,\r\n\r\n    configuredFiles: PropTypes.shape({\r\n        files: PropTypes.array.isRequired,\r\n        config: PropTypes.any.isRequired\r\n    }),\r\n    working: PropTypes.bool\r\n\r\n};\r\n\r\nexport default connect((state) => ({\r\n    defaultValidExtensionList: state.resources[UploadService.VALID_EXTENSIONS_LIST_RESOURCE_ID],\r\n    demandHeader: state.resources.demandHeader,\r\n    demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY]\r\n}))(UploadFile);","import Tr from 'translations/Translations';\r\nimport {createSelectItem} from \"../components/Select\";\r\n\r\nexport const PriceType = {\r\n    NET: 'NET',\r\n    NET_VAT: 'NET_VAT',\r\n    NET_GROSS: 'NET_GROSS',\r\n    GROSS_VAT: 'GROSS_VAT',\r\n    GROSS: 'GROSS',\r\n}\r\nconst _TR_PREFIX = 'price_type_';\r\n\r\nexport const PriceTypeLabel = (priceType) => (Tr(_TR_PREFIX + priceType.toLowerCase()));\r\n\r\nexport const PriceTypeItems = [\r\n    createSelectItem(PriceType.NET, PriceTypeLabel(PriceType.NET)),\r\n    createSelectItem(PriceType.NET_VAT, PriceTypeLabel(PriceType.NET_VAT)),\r\n    createSelectItem(PriceType.NET_GROSS, PriceTypeLabel(PriceType.NET_GROSS)),\r\n    createSelectItem(PriceType.GROSS_VAT, PriceTypeLabel(PriceType.GROSS_VAT)),\r\n    createSelectItem(PriceType.GROSS, PriceTypeLabel(PriceType.GROSS))\r\n]\r\n\r\nconst UseNetOverGrossForAuctionPopup = {\r\n    NET: true,\r\n    GROSS: false\r\n}\r\n\r\nexport const PriceTypeItemsForAuction = [\r\n    createSelectItem(UseNetOverGrossForAuctionPopup.GROSS, PriceTypeLabel(PriceType.GROSS)),\r\n    createSelectItem(UseNetOverGrossForAuctionPopup.NET, PriceTypeLabel(PriceType.NET))\r\n]\r\n\r\n\r\nconst NET_FIELD_VISIBLE = [PriceType.NET, PriceType.NET_VAT, PriceType.NET_GROSS];\r\nconst GROSS_FIELD_VISIBLE = [PriceType.GROSS, PriceType.GROSS_VAT, PriceType.NET_GROSS];\r\nconst VAT_FIELD_VISIBLE = [PriceType.NET_VAT, PriceType.GROSS_VAT, PriceType.NET_GROSS];\r\n\r\nexport const PriceTypeNetFieldVisible = (priceType) => NET_FIELD_VISIBLE.includes(priceType);\r\nexport const PriceTypeGrossFieldVisible = (priceType) => GROSS_FIELD_VISIBLE.includes(priceType);\r\nexport const PriceTypeVatFieldVisible = (priceType) => VAT_FIELD_VISIBLE.includes(priceType);\r\n\r\n\r\nconst NET_SUM_PRICE_TYPES = [PriceType.NET, PriceType.NET_VAT]\r\nexport const NetSumPriceVisible = (priceType) => NET_SUM_PRICE_TYPES.includes(priceType);\r\n\r\nconst TOTAL_NET_FIELD_VISIBLE = [PriceType.NET, PriceType.NET_VAT, PriceType.NET_GROSS];\r\nconst TOTAL_GROSS_FIELD_VISIBLE = [PriceType.NET_GROSS, PriceType.GROSS_VAT, PriceType.GROSS];\r\nexport const TotalPriceTypeNetFieldVisible = (priceType) => TOTAL_NET_FIELD_VISIBLE.includes(priceType);\r\nexport const TotalPriceTypeGrossFieldVisible = (priceType) => TOTAL_GROSS_FIELD_VISIBLE.includes(priceType);","import Tr from 'translations/Translations';\r\nimport {ProcedureType} from \"./ProcedureType\";\r\n\r\nexport const DemandCategoryType = {\r\n    CLASSIC: \"CLASSIC\",\r\n    SECTOR: \"SECTOR\",\r\n    DEFENSE_AND_SECURITY: \"DEFENSE_AND_SECURITY\",\r\n}\r\nconst _TR_PREFIX = 'demand_category_type_';\r\nexport const DemandCategoryTypeLabel = (type) => (Tr(_TR_PREFIX + type));\r\n\r\n\r\nexport const DemandCategoryTypesForProcedure = (procedure) =>\r\n    ProcedureType.NATIONAL_SOCIAL_SERVICES === procedure || ProcedureType.EUROPE_SOCIAL_SERVICES === procedure ?\r\n        Object.keys(DemandCategoryType).filter(x => x !== DemandCategoryType.DEFENSE_AND_SECURITY) : Object.keys(DemandCategoryType);","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (value) => ({label: Tr('caseClassificationSymbol.' + value), value})\r\n\r\nexport default [\r\n    {label: '---', value: ''},\r\n    createItem('270'),\r\n    createItem('271'),\r\n    createItem('272')\r\n]","import React from 'react'\r\nimport {Box, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport RadioGroup from 'components/RadioGroup';\r\nimport Select, {createSelectItem} from 'components/Select';\r\nimport GridBlock from 'components/GridBlock';\r\nimport primaryTenderVariantValues from './fieldsOptions/primaryTenderVariant.values'\r\nimport pzpExclusionValues from './fieldsOptions/pzpExclusion.values'\r\nimport orderTypeValues from 'constants/orderType.values'\r\nimport concessionOrderTypeValues from 'constants/concessionOrderType.values'\r\nimport booleanValues from 'constants/BooleanItems'\r\nimport jedzValues from './fieldsOptions/jedz.values'\r\nimport contractTypeValues from './fieldsOptions/contractType.values'\r\nimport CPVInput from 'components/CPVInput';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport HelpComponent from 'components/HelpComponent';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport OrganizationInput from \"components/OrganizationInput\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport {isEuropeProcedure, isNationalProcedure, isNonpublicProcedure} from \"constants/ProcedureType\";\r\nimport {PriceTypeItems} from \"constants/PriceTypes\";\r\nimport {DemandCategoryTypeLabel, DemandCategoryTypesForProcedure} from \"constants/DemandCategoryType\";\r\nimport caseClassificationSymbols from './fieldsOptions/caseClassificationSymbol.values'\r\n\r\n\r\nconst limits = InputLimits.procedure.basicInformation;\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    uploadFile: {\r\n        marginTop: theme.spacing(4)\r\n    }\r\n})\r\n\r\nfunction RequiredFields(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        demandAvailableOrganizations,\r\n        demandRealizationTypes,\r\n        demandAvailableFormTypes,\r\n        demandHeader,\r\n        numberAutomated,\r\n        caseClassificationSymbolRequired,\r\n        hideExecutiveDemandVariant\r\n    }) {\r\n    const passiveOfferForm = getObjectValue('passiveOfferForm', formikProps.values, false);\r\n    const creatingDemand = getObjectValue('identity', formikProps.values, false) <= 0 || isDemandPreparing();\r\n    //const demandVariant = getObjectValue('demandVariant', formikProps.values, false);\r\n    const procedureType = getObjectValue('procedureType', formikProps.values, \"\");\r\n    const realizationType = getObjectValue('demandRealizationType', formikProps.values, \"\");\r\n    const withNotice = realizationType ? demandRealizationTypes.find(x => x.name === realizationType).withNotice : false;\r\n    const europeProcedure = isEuropeProcedure(procedureType);\r\n    const nationalProcedure = isNationalProcedure(procedureType);\r\n    const nonpublicProcedure = isNonpublicProcedure(procedureType);\r\n    const createItem = (prefix, value) => ({label: Tr(prefix + '.' + value), value});\r\n    const demandRealizationTypesTranslated = demandRealizationTypes.map(x => !!x.label ? {value: x.name, label: x.label} : createItem(procedureType, x.name));\r\n    const demandCategoryType = getObjectValue(\"demandCategoryType\", formikProps.values, null);\r\n\r\n    const onDemandRealizationTypeChanged = (realizationType) => {\r\n\r\n        if (realizationType === 'primary_tender') {\r\n            formikProps.setFieldValue('primaryTenderVariant', primaryTenderVariantValues[0].value);\r\n        }\r\n\r\n        const newWithNotice = realizationType ? demandRealizationTypes.find(x => x.name === realizationType).withNotice : false;\r\n        if(!newWithNotice) {\r\n            formikProps.setFieldValue('formType', null);\r\n        }\r\n    };\r\n\r\n    return (\r\n        <GridBlock\r\n            column\r\n        >\r\n            <TextInput\r\n                id='number'\r\n                label={Tr('case_number')}\r\n                formikProps={formikProps}\r\n                required\r\n                disabled={numberAutomated}\r\n                limit={limits.NUMBER}\r\n                showErrorImmediately\r\n            />\r\n\r\n            {\r\n                (creatingDemand || !!demandCategoryType) && <Select\r\n                    id='demandCategoryType'\r\n                    label={Tr('demand_category_type')}\r\n                    formikProps={formikProps}\r\n                    items={DemandCategoryTypesForProcedure(procedureType).map(x => createSelectItem(x, DemandCategoryTypeLabel(x)))}\r\n                    required\r\n                    disabled={!creatingDemand}\r\n                />\r\n            }\r\n\r\n            <Select\r\n                id='caseClassificationSymbol'\r\n                label={Tr('caseClassificationSymbol')}\r\n                formikProps={formikProps}\r\n                items={caseClassificationSymbols}\r\n                required={caseClassificationSymbolRequired}\r\n            />\r\n\r\n            {demandHeader.applicationClientSettings.ezdrpIntegration.active &&\r\n                <TextInput\r\n                    id='ezdrpId'\r\n                    label={Tr('case_ezdrpId')}\r\n                    formikProps={formikProps}\r\n                    limit={limits.NUMBER}\r\n                    showErrorImmediately\r\n                />\r\n            }\r\n\r\n            {demandHeader.applicationClientSettings.ezdpuwIntegration.active &&\r\n                <TextInput\r\n                    id='ezdpuwId'\r\n                    label={Tr('case_ezdpuwId')}\r\n                    formikProps={formikProps}\r\n                    limit={limits.NUMBER}\r\n                    showErrorImmediately\r\n                />\r\n            }\r\n\r\n            <OrganizationInput\r\n                id='organization'\r\n                formikProps={formikProps}\r\n                required\r\n                disabled={!creatingDemand || demandAvailableOrganizations.length < 2}\r\n                availableOrganizations={demandAvailableOrganizations}\r\n           />\r\n\r\n            <TextInput\r\n                id='name'\r\n                label={Tr('proceedings_subject')}\r\n                formikProps={formikProps}\r\n                required\r\n                limit={limits.NAME}\r\n                multiline\r\n                showErrorImmediately\r\n            />\r\n            <TextInput\r\n                id='description'\r\n                label={Tr('proceedings_subject_description')}\r\n                formikProps={formikProps}\r\n                required\r\n                multiline\r\n                limit={limits.DESCRIPTION}\r\n            />\r\n            <HelpComponent text={Tr('tooltip_realization_type')}>\r\n                <Select\r\n                    id='demandRealizationType'\r\n                    label={Tr('proposed_procedure')}\r\n                    formikProps={formikProps}\r\n                    items={demandRealizationTypesTranslated}\r\n                    onChange={e => onDemandRealizationTypeChanged(e.target.value)}\r\n                    required\r\n                    disabled={!creatingDemand}\r\n                />\r\n            </HelpComponent>\r\n\r\n            {nationalProcedure &&\r\n                <Select\r\n                    id='primaryTenderVariant'\r\n                    label={Tr('primary_tender_variant')}\r\n                    formikProps={formikProps}\r\n                    items={primaryTenderVariantValues}\r\n                    required\r\n                    disabled={!creatingDemand}\r\n                />\r\n            }\r\n            {withNotice &&\r\n            <RadioGroup\r\n                id='formType'\r\n                label={Tr('questionnaire_form')}\r\n                formikProps={formikProps}\r\n                items={demandAvailableFormTypes.map(x=> ({value: x.key, label: x.value}))}\r\n                required\r\n                disabled={!creatingDemand}\r\n            />\r\n            }\r\n            {nonpublicProcedure &&\r\n            <Select\r\n                id='pzpExclusion'\r\n                label={Tr('pzp_exclusion')}\r\n                formikProps={formikProps}\r\n                items={pzpExclusionValues}\r\n            />\r\n            }\r\n            <RadioGroup\r\n                id='demandOrderType'\r\n                label={Tr('order_type')}\r\n                formikProps={formikProps}\r\n                items={procedureType === 'concession' ? concessionOrderTypeValues : orderTypeValues}\r\n                required\r\n            />\r\n            <RadioGroup\r\n                id='demandVariant'\r\n                label={Tr('contract_type')}\r\n                formikProps={formikProps}\r\n                items={contractTypeValues(hideExecutiveDemandVariant)}\r\n                disabled={!creatingDemand}\r\n                required\r\n            />\r\n            {!passiveOfferForm &&\r\n            <HelpComponent text={Tr('tooltip_digital_sign')}>\r\n                <RadioGroup\r\n                    id='digitalSign'\r\n                    label={Tr(europeProcedure ? \"electronic_signature_question\" : \"electronic_signature_national_question\")}\r\n                    formikProps={formikProps}\r\n                    items={booleanValues}\r\n                    required\r\n                    disabled={!creatingDemand}\r\n                />\r\n            </HelpComponent>\r\n            }\r\n            {europeProcedure &&\r\n            <HelpComponent text={Tr('tooltip_jedz')}>\r\n                <RadioGroup\r\n                    id='requiredJEDZ'\r\n                    label={Tr('enable_JEDZ_question')}\r\n                    formikProps={formikProps}\r\n                    items={jedzValues}\r\n                    required\r\n                />\r\n            </HelpComponent>\r\n            }\r\n            {!passiveOfferForm &&\r\n            <RadioGroup\r\n                id='priceType'\r\n                label={Tr('price_type_form')}\r\n                formikProps={formikProps}\r\n                items={PriceTypeItems}\r\n                required\r\n                disabled={!creatingDemand}\r\n            />\r\n            }\r\n            {!passiveOfferForm &&\r\n            <HelpComponent text={Tr('tooltip_auction_made')}>\r\n                <RadioGroup\r\n                    id='auctionMade'\r\n                    label={Tr('choose_best_offer_question')}\r\n                    formikProps={formikProps}\r\n                    items={booleanValues}\r\n                    required\r\n                />\r\n            </HelpComponent>\r\n            }\r\n            <HelpComponent text={Tr(nonpublicProcedure ? 'tooltip_cpv_nonpublic' : 'tooltip_cpv')}>\r\n                <CPVInput\r\n                    id='categoryItemCpv'\r\n                    formikProps={formikProps}\r\n                    required\r\n                    disabled={!creatingDemand}\r\n                    label={Tr(nonpublicProcedure ? 'cpv_code_nonpublic' : 'cpv_code')}\r\n                />\r\n            </HelpComponent>\r\n            {!nonpublicProcedure &&\r\n            <Box component=\"div\" className={classes.uploadFile}>\r\n                <UploadFile\r\n                    id='fundingInstitutionLogo'\r\n                    formikProps={formikProps}\r\n                    label={Tr(\"funding_institution_logo\")}\r\n                    acceptExtensionList={['jpg', 'jpeg', 'png']}\r\n                />\r\n            </Box>\r\n            }\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nRequiredFields.propTypes = {\r\n    classes: PropTypes.any,\r\n    formikProps: PropTypes.object,\r\n}\r\n\r\nRequiredFields.defaultProps = {}\r\n\r\nexport default withStyles(style)(RequiredFields);","import React, {useEffect} from 'react'\r\nimport {KeyboardDatePicker} from \"@material-ui/pickers\";\r\nimport {withStyles} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport clsx from 'clsx';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment from \"libs/moment\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        width: 320,\r\n    }\r\n})\r\n\r\nfunction DatePicker(\r\n    {\r\n        formikProps,\r\n        id,\r\n        label,\r\n        minDate,\r\n        maxDate,\r\n        required = false,\r\n        classes,\r\n        className,\r\n        minDateMessage = Tr(\"v_data_can_not_be_past\"),\r\n        maxDateMessage = Tr(\"v_data_can_not_be_future\"),\r\n        onChange = () => {},\r\n        disabled,\r\n        skipCheckTouched\r\n    }) {\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    const value = getObjectValue(id, formikProps.values, null)\r\n    const touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const isError = !!errorValue && Boolean(touched)\r\n    const helperText = errorValue || ' ';\r\n\r\n    useEffect(()=> {\r\n        if( typeof value === 'string' || value instanceof String) {\r\n            const momentVal = moment(value);\r\n            if(momentVal.isValid()) {\r\n                formikProps.setFieldValue(id, momentVal);\r\n                formikProps.validateField(id);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    },[])\r\n\r\n    const handleChange = (date) => {\r\n        const value = date ? //\r\n            (date.isValid() ? date.startOf(\"day\") : date)\r\n            :\r\n            null;\r\n        formikProps.setFieldValue(id, value);\r\n        formikProps.setFieldTouched(id, true);\r\n        setTimeout((id)=> {try {formikProps.validateField(id)} catch (e){}}, 1, id);\r\n        onChange(value ? value.clone() : null)\r\n    }\r\n\r\n    const handleError = (err) => {\r\n        if (!Boolean(errorValue)) {\r\n            if (errorValue !== err && err.length > 0) {\r\n                formikProps.setFieldError(id, err)\r\n            }\r\n        }\r\n    }\r\n\r\n    return (\r\n        <KeyboardDatePicker\r\n            disabled={disabled || !editable}\r\n            className={clsx(classes.root, className)}\r\n            label={required ? label + '*' : label}\r\n            value={value}\r\n            name={id}\r\n            format={DateFormats.DATE_FORMAT}\r\n            onChange={handleChange}\r\n            onBlur={formikProps.handleBlur}\r\n            error={isError}\r\n            helperText={isError ? helperText : ' '}\r\n            minDate={minDate}\r\n            maxDate={maxDate}\r\n            onError={handleError}\r\n            variant='dialog'\r\n            cancelLabel={Tr('cancel')}\r\n            invalidDateMessage={Tr(\"invalid_date_format\")}\r\n            minDateMessage={minDateMessage}\r\n            maxDateMessage={maxDateMessage}\r\n            inputProps={{\r\n                \"data-id\": id\r\n            }}\r\n        />\r\n    )\r\n}\r\n\r\nexport default withStyles(style)(DatePicker);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport TextInput from 'components/TextInput';\r\nimport RadioGroup from 'components/RadioGroup';\r\nimport DatePicker from 'components/DatePicker';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport booleanValues from 'constants/BooleanItems'\r\nimport InputLimits from 'constants/InputLimits';\r\nimport getObjectValue from 'libs/getObjectValue'\r\n\r\nconst limits = InputLimits.procedure.basicInformation;\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction OptionalFields({\r\n\tformikProps,\r\n\tclasses,\r\n}) {\r\n\tconst euFunded = getObjectValue('euFunded', formikProps.values, false)\r\n\treturn (\r\n\t\t<GridBlock\r\n\t\t\tcolumn\r\n\t\t>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='externalPurchaseRequestNumber'\r\n\t\t\t\tlabel={Tr('application_number') + ' (EOD)'}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tlimit={limits.EOD}\r\n\t\t\t/>\r\n\t\t\t<RadioGroup\r\n\t\t\t\tid='euFunded'\r\n\t\t\t\tlabel={Tr('eu_funds_question')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\titems={booleanValues}\r\n\t\t\t/>\r\n\t\t\t{euFunded === \"true\" &&\r\n\t\t\t\t<TextInput\r\n\t\t\t\t\tid='euProjectNumber'\r\n\t\t\t\t\tlabel={Tr('eu_project_number')}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\tlimit={limits.EU_PROJECT_NUMBER}\r\n\t\t\t\t\tmultiline\r\n\t\t\t\t/>}\r\n\t\t\t<TextInput\r\n\t\t\t\tid='singleDealingJustification'\r\n\t\t\t\tlabel={Tr('justification_parts')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tlimit={limits.SINGLE_DEALING_JUSTIFICATION}\r\n\t\t\t\tmultiline\r\n\t\t\t/>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='demandJustification'\r\n\t\t\t\tlabel={Tr('justification_order')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tmultiline\r\n\t\t\t/>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='planPropositionText'\r\n\t\t\t\tlabel={Tr('position_procurement_plan')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tmultiline\r\n\t\t\t/>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='estimationBase'\r\n\t\t\t\tlabel={Tr('contract_calculating_basis')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tlimit={limits.ESTIMATION_BASE}\r\n\t\t\t\tmultiline\r\n\t\t\t/>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='financialSource'\r\n\t\t\t\tlabel={Tr('financing_source')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tlimit={limits.FINANCIAL_SOURCE}\r\n\t\t\t\tmultiline\r\n\t\t\t/>\r\n\t\t\t<RadioGroup\r\n\t\t\t\tid='termOption'\r\n\t\t\t\tlabel={Tr('term_deadline')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\titems={[\r\n\t\t\t\t\t{ label: Tr('date'), value: \"date\" },\r\n\t\t\t\t\t{ label: Tr('description'), value: \"text\" },\r\n\t\t\t\t]}\r\n\t\t\t/>\r\n\t\t\t{formikProps.values.termOption === 'date' ?\r\n\t\t\t\t<DatePicker\r\n\t\t\t\t\tid='termDate'\r\n\t\t\t\t\tlabel={Tr('choose_date')}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t/>\r\n\t\t\t\t:\r\n\t\t\t\t<TextInput\r\n\t\t\t\t\tid='termDescription'\r\n\t\t\t\t\tlabel={Tr('description')}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\tlimit={limits.TERM_DESCRIPTION}\r\n\t\t\t\t\tmultiline\r\n\t\t\t\t/>\r\n\t\t\t}\r\n\t\t\t<DatePicker\r\n\t\t\t\tid='orderValueDecisionDate'\r\n\t\t\t\tlabel={Tr('date_estimating_value')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tmaxDate={new Date()}\r\n\t\t\t/>\r\n\r\n\t\t\t<TextInput\r\n\t\t\t\tid='fullNameOrderValueDecisionPerson'\r\n\t\t\t\tlabel={Tr('fullname_estimating_person')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tlimit={limits.FULL_NAME}\r\n\t\t\t\tmultiline\r\n\t\t\t/>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='managerEntrustedPerson'\r\n\t\t\t\tlabel={Tr('manager_entrusted_person')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tlimit={limits.FULL_NAME}\r\n\t\t\t/>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nOptionalFields.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tformikProps: PropTypes.object,\r\n}\r\n\r\nOptionalFields.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(OptionalFields);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Button from './Button';\r\n\r\nfunction CheckboxButton({\r\n\tclassName,\r\n\tid,\r\n\tlabel,\r\n\tformikProps,\r\n\tonClick\r\n}) {\r\n\t\r\n\tconst handleClick = () => {\r\n\t\tconst value = formikProps.values[id];\r\n\t\tformikProps.setFieldValue(id, !value);\r\n\t\tonClick();\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Button\r\n\t\t\tclassName={className}\r\n\t\t\tonClick={handleClick}\r\n\t\t>\r\n\t\t\t{label}\r\n\t\t</Button>\r\n\t)\r\n}\r\n\r\nCheckboxButton.propTypes = {\r\n\tformikProps: PropTypes.object,\r\n\tid: PropTypes.string.isRequired,\r\n\tlabel: PropTypes.string,\r\n\tonClick: PropTypes.func,\r\n}\r\n\r\nCheckboxButton.defaultProps = {\r\n\tonClick: () => {}\r\n}\r\n\r\nexport default CheckboxButton","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE';\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\n\r\nconst limits = InputLimits.procedure.basicInformation;\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    text: {\r\n        margin: `${theme.spacing(2)}px 0`\r\n    },\r\n})\r\n\r\nfunction ContactFields(\r\n    {\r\n        classes,\r\n        formikProps,\r\n    }) {\r\n\r\n    const creatingDemand = getObjectValue('identity', formikProps.values, false) <= 0 || isDemandPreparing();\r\n\r\n    return (\r\n        <>\r\n            <TextInput\r\n                id={'contactPerson'}\r\n                formikProps={formikProps}\r\n                label={Tr('contact_person')}\r\n                limit={limits.CONTACT_PERSON}\r\n                multiline\r\n                showErrorImmediately\r\n                disabled={!creatingDemand}\r\n            />\r\n            <TextInput\r\n                id={'contactPersonPhone'}\r\n                formikProps={formikProps}\r\n                label={Tr('contact_person_phone')}\r\n                limit={limits.CONTACT_PERSON_PHONE}\r\n                type={INPUT_TYPE.PHONE}\r\n                disabled={!creatingDemand}\r\n            />\r\n            <TextInput\r\n                id={'contactPersonEmail'}\r\n                formikProps={formikProps}\r\n                label={Tr('contact_person_email')}\r\n                limit={limits.PURCHASER_EMAIL}\r\n                showErrorImmediately\r\n                disabled={!creatingDemand}\r\n            />\r\n\r\n            <TextInput\r\n                id={'purchaserPhone'}\r\n                formikProps={formikProps}\r\n                label={Tr('purchaser_phone_number')}\r\n                limit={limits.PURCHASER_PHONE}\r\n                type={INPUT_TYPE.PHONE}\r\n                disabled={!creatingDemand}\r\n            />\r\n            <TextInput\r\n                id={'purchaserFax'}\r\n                formikProps={formikProps}\r\n                label={Tr('purchaser_fax')}\r\n                limit={limits.PURCHASER_FAX}\r\n                type={INPUT_TYPE.PHONE}\r\n                disabled={!creatingDemand}\r\n            />\r\n            <TextInput\r\n                id={'purchaserEmail'}\r\n                formikProps={formikProps}\r\n                label={Tr('purchaser_email')}\r\n                limit={limits.PURCHASER_EMAIL}\r\n                multiline\r\n                showErrorImmediately\r\n                disabled={!creatingDemand}\r\n            />\r\n            <TextInput\r\n                id={'purchaserAdditionalInfo'}\r\n                formikProps={formikProps}\r\n                label={Tr('additional_information')}\r\n                limit={limits.PURCHASER_ADDITIONAL_INFO}\r\n                multiline\r\n                disabled={!creatingDemand}\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nContactFields.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ContactFields);","//https://github.com/samanmohamadi/use-debounced-effect\r\nimport { useEffect, useRef } from 'react';\r\n\r\nconst DEFAULT_CONFIG = {\r\n    timeout: 0,\r\n    ignoreInitialCall: true,\r\n};\r\nexport function useDebouncedEffect(callback, config, deps = []) {\r\n    let currentConfig;\r\n    if (typeof config === 'object') {\r\n        currentConfig = {\r\n            ...DEFAULT_CONFIG,\r\n            ...config,\r\n        };\r\n    } else {\r\n        currentConfig = {\r\n            ...DEFAULT_CONFIG,\r\n            timeout: config,\r\n        };\r\n    }\r\n\r\n    const { timeout, ignoreInitialCall } = currentConfig;\r\n    const data = useRef({ firstTime: true });\r\n    useEffect(() => {\r\n        const { firstTime, clearFunc } = data.current;\r\n\r\n        if (firstTime && ignoreInitialCall) {\r\n            data.current.firstTime = false;\r\n            return;\r\n        }\r\n\r\n        const handler = setTimeout(() => {\r\n            if (clearFunc && typeof clearFunc === 'function') {\r\n                clearFunc();\r\n            }\r\n            data.current.clearFunc = callback();\r\n        }, timeout);\r\n\r\n        return () => {\r\n            clearTimeout(handler);\r\n        };\r\n        // eslint-disable-next-line\r\n    }, [timeout, ...deps]);\r\n}\r\n\r\nexport default useDebouncedEffect;\r\n","import {useEffect} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {clearFormValues, setFormValues} from 'redux/actions'\r\nimport {connect} from 'react-redux'\r\nimport useDebouncedEffect from \"../hooks/useDebouncedEffect\";\r\n\r\n\r\nfunction SaveFormikValues({\r\n\tid,\r\n\tformikProps,\r\n\tsetFormValues,\r\n\tclearFormValues,\r\n\tsave=true,\r\n\tdebounceTimeout = 500\r\n}) {\r\n\tuseEffect(()=> {\r\n\t\treturn ()=> {\r\n\t\t\tclearFormValues(id);\r\n\t\t}\r\n\t},[id, clearFormValues])\r\n\r\n\tuseDebouncedEffect(() => {\r\n\t\tif(save) {\r\n\t\t\tsetFormValues(id, formikProps.values,  formikProps.dirty)\r\n\t\t}\r\n\t}, {timeout: debounceTimeout, ignoreInitialCall: false},[save, setFormValues, id, formikProps.values, formikProps.dirty])\r\n\r\n\treturn null;\r\n}\r\n\r\nSaveFormikValues.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tdebounceTimeout: PropTypes.number\r\n}\r\n\r\nexport default connect((state) => ({\r\n\r\n}), {\r\n\tsetFormValues,\r\n\tclearFormValues\r\n})(SaveFormikValues);","import VS from 'constants/ValidationShema';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport Tr from 'translations/Translations';\r\nimport {isEuropeProcedure, isNonpublicProcedure, isNationalProcedure} from \"constants/ProcedureType\";\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\n\r\nconst inputLimits = InputLimits.procedure.basicInformation;\r\n\r\nexport default (demandRealizationTypes, numberAutomated, caseClassificationSymbolRequired) => {\r\n    return VS.lazy((values) => {\r\n        const passiveOfferForm = values.passiveOfferForm;\r\n        const euFunded = values.euFunded;\r\n        const procedureType = values.procedureType;\r\n        const realizationType = values.demandRealizationType;\r\n        const europeProcedure = isEuropeProcedure(procedureType);\r\n        const nonpublicProcedure = isNonpublicProcedure(procedureType);\r\n        const nationalProcedure = isNationalProcedure(procedureType);\r\n        const withNotice = realizationType ? demandRealizationTypes.find(x => x.name === realizationType).withNotice : false;\r\n        const creatingDemand = values.identity <= 0 || isDemandPreparing();\r\n\r\n        let baseObj = {\r\n            number: VS.any().when(\"name\", {is: (x) => numberAutomated === true, then: VS.any(), otherwise: VS.stringMax(inputLimits.NUMBER)}),\r\n            demandCategoryType: creatingDemand ? VS.string() : VS.any(),\r\n            name: VS.stringMax(inputLimits.NAME),\r\n            description: VS.stringMax(inputLimits.DESCRIPTION),\r\n            formType: withNotice ? VS.string() : VS.any(),\r\n            demandRealizationType: VS.string(),\r\n            primaryTenderVariant: nationalProcedure ? VS.string() : VS.stringNoRq(),\r\n            demandOrderType: VS.string(),\r\n            categoryItemCpv: VS.arrayRequired(),\r\n\r\n            contactPerson: VS.stringMaxNoRq(inputLimits.CONTACT_PERSON),\r\n\r\n            contactPersonPhone: VS.stringMaxNoRq(inputLimits.CONTACT_PERSON_PHONE),\r\n            contactPersonEmail: VS.emailMaxNoRq(inputLimits.PURCHASER_EMAIL),\r\n            purchaserPhone: VS.stringMaxNoRq(inputLimits.PURCHASER_PHONE),\r\n            purchaserFax: VS.stringMaxNoRq(inputLimits.PURCHASER_FAX),\r\n\r\n            purchaserEmail: VS.emailMaxNoRq(inputLimits.PURCHASER_EMAIL),\r\n            purchaserAdditionalInfo: VS.stringMaxNoRq(inputLimits.PURCHASER_ADDITIONAL_INFO),\r\n\r\n            euProjectNumber: euFunded === \"true\" && VS.stringMax(inputLimits.EU_PROJECT_NUMBER),\r\n            caseClassificationSymbol: VS.any().when(\"name\", {is: (x) => caseClassificationSymbolRequired === true, then: VS.string(), otherwise: VS.any()})\r\n        }\r\n\r\n        if (europeProcedure) {\r\n            baseObj.requiredJEDZ = VS.string();\r\n        }\r\n        if (nonpublicProcedure) {\r\n            baseObj.pzpExclusion = VS.stringNoRq();\r\n        }\r\n\r\n        baseObj.demandVariant = VS.string()\r\n\r\n        if (passiveOfferForm) {\r\n            return VS.object(baseObj)\r\n        }\r\n\r\n        // if (values.termOption === 'date') {\r\n        //     baseObj['termDate'] = VS.dateMinNoRq(new Date(), Tr(\"v_data_can_not_be_past\"))\r\n        // }\r\n\r\n        baseObj = {\r\n            ...baseObj,\r\n\r\n            auctionMade: VS.string(),\r\n            digitalSign: VS.string(),\r\n            priceType: VS.string(),\r\n\r\n            externalPurchaseRequestNumber: VS.stringMaxNoRq(inputLimits.EOD),\r\n            singleDealingJustification: VS.stringMaxNoRq(inputLimits.SINGLE_DEALING_JUSTIFICATION),\r\n            estimationBase: VS.stringMaxNoRq(inputLimits.ESTIMATION_BASE),\r\n            financialSource: VS.stringMaxNoRq(inputLimits.FINANCIAL_SOURCE),\r\n            termDescription: VS.stringMaxNoRq(inputLimits.TERM_DESCRIPTION),\r\n            orderValueDecisionDate: VS.dateMaxNoRq(new Date(), Tr('v_data_can_not_be_future')),\r\n            fullNameOrderValueDecisionPerson: VS.stringMaxNoRq(inputLimits.FULL_NAME),\r\n            managerEntrustedPerson: VS.stringMaxNoRq(inputLimits.FULL_NAME),\r\n        }\r\n\r\n        return VS.object(baseObj)\r\n    })\r\n}","import { useEffect } from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport reduxStore from 'redux/store'\r\nimport { setSaveStatusError } from 'redux/actions'\r\n\r\nconst isErrors = (errors) => {\r\n\tif (Object.keys(errors).length <= 0) return false;\r\n\tfor (let k in errors) {\r\n\t\tconst e = errors[k];\r\n\t\tif (typeof e === 'object') {\r\n\t\t\tif(isErrors(e)) return true;\r\n\t\t} else {\r\n\t\t\tif(e.length > 0) return true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction ShowErrorOnFailedSubmit({\r\n\tsetCheckError,\r\n\tcheckError,\r\n\tformikProps,\r\n}) {\r\n\tuseEffect(() => {\r\n\t\tif (checkError) {\r\n\t\t\tsetCheckError(false)\r\n\t\t\tconst errors = formikProps.errors\r\n\t\t\tif (isErrors(errors)) {\r\n\t\t\t\tconsole.log(errors);\r\n\t\t\t\tconst msg = Tr('submit_error')\r\n\t\t\t\treduxStore.dispatch(setSaveStatusError(msg));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [checkError])\r\n\treturn ''\r\n}\r\n\r\nexport default ShowErrorOnFailedSubmit;","export default () => {\r\n    const href = window.location.href;\r\n    return (href.includes(\"/correspondence/\") || href.includes(\"/nationalNotice/\") || href.includes(\"/offer/contractor/\") || //\r\n        (href.includes(\"/purchaser/demand\") && href.includes(\"/preview\")));\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport { RestRequestGET } from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport supportedNoApiScreens from \"libs/supportedNoApiScreens\";\r\n\r\nconst _get = async (url) => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(url);\r\n\t\tif (res.forceRedirectOldPlatform && !supportedNoApiScreens()) {\r\n\t\t\treduxStore.dispatch(setResource(\"redirectOldPlatform\", true));\r\n\t\t\twindow.location.replace(res.forceRedirectOldPlatform);\r\n\t\t} else {\r\n\t\t\treduxStore.dispatch(\r\n\t\t\t\tsetResource('demandHeader', res)\r\n\t\t\t);\r\n\t\t}\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst get = async (id = -1) => {\r\n\tlet url = Endpoints.HEADER(id)\r\n\r\n\tawait _get(url)\r\n}\r\n\r\nconst clear = () => {\r\n\treduxStore.dispatch(clearResource('demandHeader'))\r\n}\r\n\r\nexport default {\r\n\tget,\r\n\tclear\r\n}\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport HeaderService from 'services/HeaderService';\r\nimport reduxStore from 'redux/store';\r\nimport {clearResource, setResource} from 'redux/actions';\r\n\r\nconst updateHeader = (resp, demandId) => {\r\n    if (resp.success) {\r\n        HeaderService.get(demandId);\r\n        return true;\r\n    } else {\r\n        return false;\r\n    }\r\n}\r\n\r\nexport const modify = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_MODIFICATION(demandId));\r\n        return updateHeader(resp, demandId);\r\n    } catch (error) {\r\n    }\r\n    return false;\r\n};\r\n\r\nexport const publish = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_MODIFICATION_PUBLISH(demandId));\r\n        return updateHeader(resp, demandId);\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport const cancel = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_MODIFICATION_CANCEL(demandId));\r\n        return updateHeader(resp, demandId);\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport const publishOjsNotice = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.DEMAND_MODIFICATION_PUBLISH_OJS(demandId));\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport const rollbackOjsNotice = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.DEMAND_MODIFICATION_ROLLBACK_OJS(demandId))\r\n        return res\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport const noticeOjsStatus = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEMAND_MODIFICATION_OJS_STATUS(demandId));\r\n        reduxStore.dispatch(\r\n            setResource('ojsPublicationStatus', res)\r\n        );\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport const clearDemandChanged = () => {\r\n    reduxStore.dispatch(clearResource('isDemandChanged'));\r\n}\r\nexport const isDemandChanged = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEMAND_MODIFICATION_CHANGED(demandId));\r\n        reduxStore.dispatch(\r\n            setResource('isDemandChanged', res)\r\n        );\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport default {\r\n    modify,\r\n    publish,\r\n    cancel,\r\n    publishOjsNotice,\r\n    rollbackOjsNotice,\r\n    noticeOjsStatus,\r\n    isDemandChanged,\r\n    clearDemandChanged,\r\n}","import {useCallback, useEffect} from 'react'\r\nimport reduxStore from \"../redux/store\";\r\nimport {clearStepperStateCloseValidator, setStepperStateCloseValidator, setStepperStateDeleteFormDraftFunction, clearStepperStateDeleteFormDraftFunction,\r\n    setStepperStateSaveFormDraftFunction, clearStepperStateSaveFormDraftFunction} from \"../redux/actions\";\r\n\r\n\r\nconst useStepperStateCloseValidator = (formId, customCloseValidatorFunction, deleteFormDraftFunc, saveFormDraftFunc) => {\r\n\r\n    const defaultCloseValidatorFunction = useCallback(() => {\r\n        //domyślna implementacja zakłada, że formularz zawiera <SaveFormikValues\r\n        const dirty = reduxStore.getState()?.formValues?.[formId + \"_dirty\"];\r\n        const draftLoaded = reduxStore.getState()?.formValues?.[formId + \"_draftLoaded\"];\r\n        return dirty !== true && !draftLoaded;\r\n    }, [formId])\r\n\r\n    useEffect(() => {\r\n        reduxStore.dispatch(\r\n            setStepperStateCloseValidator(customCloseValidatorFunction ? customCloseValidatorFunction : defaultCloseValidatorFunction));\r\n        if (!!deleteFormDraftFunc && typeof deleteFormDraftFunc === 'function')\r\n            reduxStore.dispatch(setStepperStateDeleteFormDraftFunction(deleteFormDraftFunc));\r\n        if (!!saveFormDraftFunc && typeof saveFormDraftFunc === 'function')\r\n            reduxStore.dispatch(setStepperStateSaveFormDraftFunction(saveFormDraftFunc))\r\n        return () => {\r\n            reduxStore.dispatch(clearStepperStateCloseValidator());\r\n            reduxStore.dispatch(clearStepperStateDeleteFormDraftFunction());\r\n            reduxStore.dispatch(clearStepperStateSaveFormDraftFunction());\r\n        }\r\n    }, [customCloseValidatorFunction, defaultCloseValidatorFunction, formId, deleteFormDraftFunc, saveFormDraftFunc])\r\n}\r\n\r\nexport default useStepperStateCloseValidator;","import PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport {useEffect, useRef} from \"react\";\r\nimport reduxStore from \"redux/store\";\r\nimport moment from \"moment\";\r\n\r\n\r\nfunction AutoSaveFormValues({\r\n\tid,\r\n\tformId,\r\n\tsaveFunc,\r\n\tformikProps,\r\n\tthrottleTimeout = 30000,\r\n\tdebounceTimeout = 10000,\r\n\tignoreInitialCall = true,\r\n\tcustomDirtyRef\r\n}) {\r\n\r\n\tconst data = useRef({ firstTime: true, timeoutSetTime: null });\r\n\r\n\tuseEffect(() => {\r\n\t\tconst { firstTime, timeoutSetTime } = data.current;\r\n\t\tif (firstTime && ignoreInitialCall) {\r\n\t\t\tdata.current.firstTime = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet throttleHandler;\r\n\t\tlet debounceHandler;\r\n\t\tif (!!customDirtyRef ? customDirtyRef.current === \"tak\" : formikProps.dirty) {\r\n\t\t\tif (!timeoutSetTime || moment.now() - timeoutSetTime > throttleTimeout) {\r\n\t\t\t\tdata.current.timeoutSetTime = moment.now();\r\n\t\t\t}\r\n\t\t\tthrottleHandler = setTimeout(() => {\r\n\t\t\t\tclearTimeout(debounceHandler)\r\n\t\t\t\tconst state = reduxStore.getState();\r\n\t\t\t\tsaveFunc(state.formValues[formId]);\r\n\t\t\t}, throttleTimeout - (moment.now() - data.current.timeoutSetTime));\r\n\t\t\tdebounceHandler = setTimeout(() => {\r\n\t\t\t\tclearTimeout(throttleHandler);\r\n\t\t\t\tdata.current.timeoutSetTime = null;\r\n\t\t\t\tconst state = reduxStore.getState();\r\n\t\t\t\tsaveFunc(state.formValues[formId]);\r\n\t\t\t}, debounceTimeout);\r\n\t\t}\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(throttleHandler);\r\n\t\t\tclearTimeout(debounceHandler);\r\n\t\t};\r\n\t\t// eslint-disable-next-line\r\n\t}, [throttleTimeout, debounceTimeout, id, formikProps.values, !!customDirtyRef ? customDirtyRef.current : formikProps.dirty]);\r\n\r\n\treturn null;\r\n}\r\n\r\nAutoSaveFormValues.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\ttimeout: PropTypes.number\r\n}\r\n\r\nexport default connect((state) => ({\r\n}))(AutoSaveFormValues);","import reduxStore from \"redux/store\";\r\n\r\nconst saveFormDraft = (id, saveFunc, formId) => {\r\n    const state = reduxStore.getState();\r\n    saveFunc(id, state.formValues[formId]);\r\n}\r\n\r\nexport default saveFormDraft;","import React, {useState} from 'react'\r\nimport {Collapse} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport Tr from 'translations/Translations';\r\nimport Divider from '../../../../../../../../components/Divider';\r\nimport RequiredFields from './RequiredFields';\r\nimport OptionalFields from './OptionalFields';\r\nimport moment from 'moment';\r\nimport CheckboxButton from 'components/CheckboxButton';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {connect} from 'react-redux'\r\nimport Loading from 'components/Loading';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport DemandService from 'services/DemandService';\r\nimport ContactFields from './ContactFields';\r\nimport HelpTooltip from 'components/HelpTooltip';\r\nimport SaveFormikValues from 'components/SaveFormikValues';\r\nimport validationSchema from './constants/validationSchema';\r\nimport ShowErrorOnFailedSubmit from 'components/ShowErrorOnFailedSubmit';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport {useParams, withRouter} from \"react-router\";\r\nimport {isNonpublicProcedure} from \"constants/ProcedureType\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\nfunction MainForm(\r\n    {\r\n        data,\r\n        demandAvailableOrganizations,\r\n        demandRealizationTypes,\r\n        demandAvailableFormTypes,\r\n        numberAutomated,\r\n        caseClassificationSymbolRequired,\r\n        stepperState,\r\n        demandValidation,\r\n        demandHeader\r\n    }) {\r\n    const [checkError, setCheckError] = useState(false)\r\n    const section = demandValidation.find(x => x.section === DemandValidation.DEMAND);\r\n    const FORM_ID = 'mp_1_demand'\r\n    const params = useParams();\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(FORM_ID, undefined,\r\n        autoSaveFormDraftActive ? () => DemandService.deleteDraft(params.id) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(params.id, DemandService.saveDraft, FORM_ID) : undefined);\r\n\r\n    if (!data || !demandAvailableOrganizations || !demandRealizationTypes || !demandAvailableFormTypes || !demandHeader) {\r\n        return <Loading/>\r\n    }\r\n\r\n\r\n    const handleSubmit = (values) => {\r\n        DemandService.save(values).then(() => {\r\n            if (data.identity !== -1) {\r\n                HeaderService.get(data.identity)\r\n            }\r\n        });\r\n    }\r\n\r\n    const getField = (id, defaultValue = '') => getObjectValue(id, data, defaultValue)\r\n    const getTimeField = (id, defaultValue = null) => {\r\n        const v = getField(id, defaultValue);\r\n\r\n        if (v) return moment(v);\r\n        return v;\r\n    }\r\n\r\n    return (\r\n        <Form\r\n            initialValues={{\r\n                _editable: section ? section.editable : true,\r\n                identity: getField('identity'),\r\n                organization: getField('organization'),\r\n                procedureType: getField('procedureType'),\r\n                authorUser: getField('authorUser'),\r\n                number: getField('number'),\r\n                demandCategoryType: getField('demandCategoryType', null),\r\n                caseClassificationSymbol: getField('caseClassificationSymbol', null),\r\n                name: getField('name'),\r\n                description: getField('description'),\r\n                formType: getField('formType'),\r\n                demandRealizationType: getField('demandRealizationType'),\r\n                pzpExclusion: getField('pzpExclusion'),\r\n                demandOrderType: getField('demandOrderType'),\r\n                demandVariant: getField('demandVariant'),\r\n                primaryTenderVariant: getField('primaryTenderVariant'),\r\n                plannedContractorNumberForAgreement: getField('plannedContractorNumberForAgreement'),\r\n                digitalSign: String(getField('digitalSign')),\r\n                requiredJEDZ: getField('requiredJEDZ'),\r\n                auctionMade: String(getField('auctionMade', false)),\r\n                categoryItemCpv: getField('categoryItemCpv'),\r\n                fundingInstitutionLogo: getField('fundingInstitutionLogo'),\r\n\r\n                contactPerson: getField('contactPerson'),\r\n                contactPersonPhone: getField('contactPersonPhone'),\r\n                contactPersonEmail: getField('contactPersonEmail'),\r\n                purchaserName: getField('purchaserName'),\r\n                purchaserPhone: getField('purchaserPhone'),\r\n                purchaserFax: getField('purchaserFax'),\r\n                purchaserEmail: getField('purchaserEmail'),\r\n                purchaserAdditionalInfo: getField('purchaserAdditionalInfo'),\r\n\r\n                externalPurchaseRequestNumber: getField('externalPurchaseRequestNumber'),\r\n                euFunded: String(getField('euFunded')),\r\n                singleDealingJustification: getField('singleDealingJustification'),\r\n                demandJustification: getField('demandJustification'),\r\n                planPropositionText: getField('planPropositionText'),\r\n                estimationBase: getField('estimationBase'),\r\n                financialSource: getField('financialSource'),\r\n\r\n                termOption: getField('agreementRealizationDate.text') ? \"text\" : \"date\",\r\n                termDate: getTimeField('agreementRealizationDate.date'),\r\n                termDescription: getField('agreementRealizationDate.text', ''),\r\n\r\n                orderValueDecisionDate: getTimeField('orderValueDecisionDate'),\r\n                fullNameOrderValueDecisionPerson: getField('fullNameOrderValueDecisionPerson'),\r\n                managerEntrustedPerson: getField('managerEntrustedPerson'),\r\n\r\n                enableOptional: false,\r\n\r\n                passiveOfferForm: getField('passiveOfferForm'),\r\n                euProjectNumber: getField('euProjectNumber'),\r\n                priceType: getField('priceType'),\r\n\r\n                ezdrpId: getField('ezdrpId'),\r\n                ezdpuwId: getField('ezdpuwId'),\r\n            }}\r\n            validationSchema={validationSchema(demandRealizationTypes, numberAutomated, caseClassificationSymbolRequired)}\r\n            onSubmit={handleSubmit}\r\n            id={FORM_ID}\r\n            afterSubmitFunc={() => {\r\n                setCheckError(true);\r\n                if (isDemandModification()) {\r\n                    ModificationService.isDemandChanged(data.identity);\r\n                }\r\n            }}\r\n        >\r\n            {(formikProps) => {\r\n                const passiveOfferForm = getObjectValue('passiveOfferForm', formikProps.values, false);\r\n                const procedureType = getObjectValue('procedureType', formikProps.values, \"\");\r\n                const nonpublicProcedure = isNonpublicProcedure(procedureType);\r\n                const _editable = getObjectValue('_editable', formikProps.values, true);\r\n                return (\r\n                    <GridBlock\r\n                        column\r\n                    >\r\n                        <ShowErrorOnFailedSubmit\r\n                            formikProps={formikProps}\r\n                            checkError={checkError}\r\n                            setCheckError={setCheckError}\r\n                        />\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={FORM_ID}\r\n                            save={FORM_ID === stepperState}\r\n                        />\r\n                        {autoSaveFormDraftActive &&\r\n                        <AutoSaveFormValues\r\n                            formikProps={formikProps}\r\n                            id={getField('identity')}\r\n                            formId={FORM_ID}\r\n                            saveFunc={(formValues) => {\r\n                                DemandService.saveDraft(getField('identity'), formValues)\r\n                            }}\r\n                        />\r\n                        }\r\n                        <RequiredFields\r\n                            formikProps={formikProps}\r\n                            demandAvailableOrganizations={demandAvailableOrganizations}\r\n                            demandRealizationTypes={demandRealizationTypes}\r\n                            demandAvailableFormTypes={demandAvailableFormTypes}\r\n                            demandHeader={demandHeader}\r\n                            numberAutomated={numberAutomated}\r\n                            caseClassificationSymbolRequired={caseClassificationSymbolRequired}\r\n                            hideExecutiveDemandVariant={getField('hideExecutiveDemandVariant', true)}\r\n                        />\r\n\r\n                        <Divider>\r\n                            {`${Tr('contact_data')} (${Tr('optional')})`}\r\n                        </Divider>\r\n\r\n                        <ContactFields\r\n                            formikProps={formikProps}\r\n                        />\r\n\r\n                        {!passiveOfferForm && !nonpublicProcedure &&\r\n                            <Divider>\r\n                                {`${Tr('additional_data')} (${Tr('optional')})`}\r\n                                <HelpTooltip text={Tr('tooltip_additional_data')}/>\r\n                            </Divider>\r\n                        }\r\n\r\n                        {!passiveOfferForm && !nonpublicProcedure &&\r\n                            <Collapse in={formikProps.values.enableOptional}>\r\n                                <OptionalFields formikProps={formikProps}/>\r\n                            </Collapse>\r\n                        }\r\n\r\n                        {!passiveOfferForm && !nonpublicProcedure &&\r\n                            <CheckboxButton\r\n                                id='enableOptional'\r\n                                label={\r\n                                    formikProps.values.enableOptional ?\r\n                                        Tr('hide_additional_fields') :\r\n                                        _editable ? Tr('fill_additional_fields') : Tr('show_additional_fields')\r\n                                }\r\n                                formikProps={formikProps}\r\n                            />\r\n                        }\r\n\r\n                    </GridBlock>\r\n                )\r\n            }}\r\n        </Form>\r\n    )\r\n}\r\n\r\nMainForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nMainForm.defaultProps = {}\r\n\r\n\r\nexport default connect((state) => ({\r\n    data: state.resources.demand,\r\n    demandAvailableOrganizations: state.resources.demandAvailableOrganizations,\r\n    demandRealizationTypes: state.resources.demandRealizationTypes,\r\n    demandAvailableFormTypes: state.resources.demandAvailableFormTypes,\r\n    numberAutomated: state.resources.demandNumberAutomated,\r\n    caseClassificationSymbolRequired: state.resources.caseClassificationSymbolRequired,\r\n    demandHeader: state.resources.demandHeader,\r\n    stepperState: state.stepper.state,\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(MainForm));\r\n","export default {\r\n\tSTANDARD: 'STANDARD', //ze słownika\r\n\tNOT_APPLICABLE: 'NOT_APPLICABLE', //nie dotyczy\r\n\tEXEMPTED: 'EXEMPTED', //zwolniony  = value null\r\n\tREVERSED: 'REVERSED', //odwrócony  = value null\r\n\tMIXED: 'MIXED', //mieszany, value null, wpisujemy netto i brutto ręcznie\r\n\tOTHER: 'OTHER', //spoza słownika wartość wpisywana recznie, brutto obliczmy\r\n}","import Tr from 'translations/Translations';\r\nimport VatType from './VatType';\r\n\r\nconst createItem = (value) => ({\r\n\tlabel: value + '%',\r\n\tvalue: '' + value,\r\n})\r\n\r\nconst createItemText = (label, value) => ({\r\n\tlabel,\r\n\tvalue,\r\n})\r\n\r\n// [0,3,5,7,8,23].map( x => createItem(x))\r\n\r\nexport const SELECT_VALUE = {\r\n\tDEFAULT: null,\r\n\tNOT_APPLICABLE: VatType.NOT_APPLICABLE,\r\n\tCANCEL: VatType.EXEMPTED,\r\n\tREVERSED: VatType.REVERSED,\r\n\tDIFFRENT_VAT: VatType.MIXED,\r\n\tOTHER: VatType.OTHER,\r\n}\r\n\r\nexport default [\r\n\tcreateItemText(Tr('not_applicable'), SELECT_VALUE.NOT_APPLICABLE),\r\n\tcreateItemText(Tr('released'), SELECT_VALUE.CANCEL),\r\n\tcreateItemText(Tr('reversed'), SELECT_VALUE.REVERSED),\r\n\tcreateItem(0),\r\n\tcreateItem(3),\r\n\tcreateItem(5),\r\n\tcreateItem(7),\r\n\tcreateItem(8),\r\n\tcreateItem(23),\r\n\tcreateItemText(Tr('different_vat_rates'), SELECT_VALUE.DIFFRENT_VAT),\r\n\tcreateItemText(Tr('other_2'), SELECT_VALUE.OTHER),\r\n]\r\n\r\n","export default (value) => {\r\n\tconst reg = /[,.]+$/g\r\n\r\n\tlet _value = '' + value\r\n\t_value.replace(reg, '')\r\n\t\r\n\treturn parseFloat(_value, 10)\r\n}","import {SELECT_VALUE} from \"../constants/VATItems\";\r\n\r\nexport const calcGrossValue = (netValue, vatOptionValue, optionOtherValue) => {\r\n\r\n    if (vatOptionValue === null) return;\r\n\r\n    if (isNaN(netValue)) return;\r\n\r\n    if (vatOptionValue === SELECT_VALUE.DIFFRENT_VAT) {\r\n        return;\r\n    }\r\n\r\n    if(vatOptionValue === SELECT_VALUE.CANCEL) {\r\n        vatOptionValue = 0;\r\n    }\r\n\r\n    if (vatOptionValue === SELECT_VALUE.OTHER) {\r\n        vatOptionValue = optionOtherValue;\r\n    }\r\n\r\n    let vatMultipler = vatOptionValue / 100\r\n\r\n    let newGrossValue = netValue + netValue * vatMultipler;\r\n    if (isNaN(newGrossValue)) return\r\n\r\n    return Math.round(newGrossValue * 100) / 100;\r\n}\r\n\r\n\r\nexport const calcNetValue = (grossValue, vatOptionValue, optionOtherValue) => {\r\n    if (vatOptionValue === null) return;\r\n    if (isNaN(grossValue)) return\r\n\r\n    if (vatOptionValue === SELECT_VALUE.DIFFRENT_VAT) {\r\n        return;\r\n    } else if(vatOptionValue === SELECT_VALUE.CANCEL) {\r\n        vatOptionValue = 0;\r\n    } else if (vatOptionValue === SELECT_VALUE.OTHER) {\r\n        vatOptionValue = optionOtherValue;\r\n    }\r\n\r\n    const vatMultipler = vatOptionValue / 100;\r\n\r\n    let newNetValue = grossValue;\r\n    if (vatMultipler !== 0) newNetValue = Math.round((grossValue / (1 + vatMultipler)) * 100) / 100;\r\n\r\n    if (isNaN(newNetValue)) return\r\n\r\n    return newNetValue;\r\n}","import {useEffect, useRef} from 'react'\r\nimport {devMode} from \"../libs/isDevMode\";\r\n\r\n\r\nexport const useDidUpdateEffect = (effect, deps) => {\r\n    if (devMode) {\r\n        if (deps !== undefined && !Array.isArray(deps)) {\r\n            throw new Error('Deps should be an Array');\r\n        }\r\n    }\r\n\r\n    const didMountRef = useRef(false);\r\n\r\n    useEffect(() => {\r\n        if (didMountRef.current)\r\n            return effect();\r\n        else\r\n            didMountRef.current = true;\r\n        // eslint-disable-next-line\r\n    }, deps);\r\n}","import React from 'react'\r\nimport {IconButton, InputAdornment, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from './GridBlock';\r\nimport TitledComponent from './TitledComponent';\r\nimport Select from './Select';\r\nimport TextInput from './TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport VATItems, {SELECT_VALUE} from 'constants/VATItems'\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport CloseIcon from '@material-ui/icons/Close'\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE';\r\nimport toFloat from 'libs/toFloat';\r\nimport {calcGrossValue, calcNetValue} from \"../libs/netGrosCalculations\";\r\nimport {useDidUpdateEffect} from \"../hooks/useDidUpdateEffect\";\r\nimport {PriceType, PriceTypeNetFieldVisible, PriceTypeVatFieldVisible, PriceTypeGrossFieldVisible} from \"constants/PriceTypes\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tgrid: {\r\n\t\t'&>*': {\r\n\t\t\tflexGrow: 1,\r\n\t\t\t'&:not(:first-child)': {\r\n\t\t\t\tmarginLeft: theme.spacing(2)\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\ticonButton: {\r\n\t\tpadding: theme.spacing(1) / 2,\r\n\t},\r\n\totherTextInput: {\r\n\t\t'& input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button': {\r\n\t\t\t'-webkit-appearance': 'none',\r\n\t\t\tmargin: 0\r\n\t\t}\r\n\t},\r\n\tregularTitle: {\r\n\t\tfontWeight: theme.typography.fontWeightRegular,\r\n\t},\r\n})\r\n\r\nfunction NetGrossField({\r\n\tclasses,\r\n\tformikProps,\r\n\tid,\r\n\tpathPrefix,\r\n\ttitle,\r\n\trequired,\r\n\tpriceType = PriceType.NET_GROSS\r\n}) {\r\n\tconst net = !!pathPrefix ? `${pathPrefix}Value` : `${id}.value`;\r\n\tconst gross = !!pathPrefix ? `${pathPrefix}GrossValue` : `${id}.grossValue`\r\n\tconst option = !!pathPrefix ? `${pathPrefix}VatRate` : `${id}.vatRate`\r\n\tconst optionOther = !!pathPrefix ? `${pathPrefix}VatRateOther` : `${id}.vatRateOther`\r\n\r\n\r\n\tconst netValue = toFloat(getObjectValue(net, formikProps.values, 0))\r\n\tconst grossValue = toFloat(getObjectValue(gross, formikProps.values, 0))\r\n\tconst optionValue = getObjectValue(option, formikProps.values, null)\r\n\tconst optionOtherValue = getObjectValue(optionOther, formikProps.values, '')\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n\tconst doCalcGrossValue = () => {\r\n\t\tconst curGross = getObjectValue(gross, formikProps.values, 0);\r\n\t\tlet newGrossValue = calcGrossValue(netValue, optionValue, optionOtherValue);\r\n\t\tif(newGrossValue !== undefined && curGross !== newGrossValue)\r\n\t\t\tformikProps.setFieldValue(gross, newGrossValue.toFixed(2))\r\n\t}\r\n\r\n\tconst doCalcNetValue = () => {\r\n\t\tconst newNetValue = calcNetValue(grossValue, optionValue, optionOtherValue);\r\n\t\tif(newNetValue !== undefined)\r\n\t\t\tformikProps.setFieldValue(net, newNetValue.toFixed(2))\r\n\t}\r\n\r\n\tuseDidUpdateEffect(() => {\r\n\t\tdoCalcGrossValue()\r\n\t}, [netValue, optionValue, optionOtherValue])\r\n\r\n\tconst handleGrossBlur = () => {\r\n\t\tdoCalcNetValue()\r\n\t}\r\n\r\n\tconst closeTextInput = () => {\r\n\t\tformikProps.setFieldValue(option, \"\")\r\n\t}\r\n\treturn (\r\n\t\t<TitledComponent\r\n\t\t\ttitle={title}\r\n\t\t\trequired={required}\r\n\t\t\tlabelClassName={!!pathPrefix ? classes.regularTitle : ''}\r\n\t\t>\r\n\t\t\t<GridBlock\r\n\t\t\t\tclassName={classes.grid}\r\n\t\t\t\twrap='nowrap'\r\n\t\t\t>\r\n\t\t\t\t{PriceTypeNetFieldVisible(priceType) &&\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid={net}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('net')}\r\n\t\t\t\t\t\ttype={INPUT_TYPE.NUMBER_19}\r\n\t\t\t\t\t\tstep=\"0.01\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\r\n\t\t\t\t{PriceTypeVatFieldVisible(priceType) &&\r\n\t\t\t\t\t(optionValue === SELECT_VALUE.OTHER ?\r\n\t\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\t\tid={optionOther}\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tclassName={classes.otherTextInput}\r\n\t\t\t\t\t\t\tlabel={Tr('vat')}\r\n\t\t\t\t\t\t\ttype={INPUT_TYPE.NUMBER_POSITIVE_AMOUNT}\r\n\t\t\t\t\t\t\tendAdornment={\r\n\t\t\t\t\t\t\t\t<InputAdornment position='end'>\r\n\t\t\t\t\t\t\t\t\t%\r\n\t\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\t\tonClick={closeTextInput}\r\n\t\t\t\t\t\t\t\t\t\tclassName={classes.iconButton}\r\n\t\t\t\t\t\t\t\t\t\tdisabled={!editable}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<CloseIcon />\r\n\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t</InputAdornment>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t:\r\n\t\t\t\t\t\t<Select\r\n\t\t\t\t\t\t\tid={option}\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\titems={VATItems}\r\n\t\t\t\t\t\t\tlabel={Tr('vat')}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\r\n\t\t\t\t{PriceTypeGrossFieldVisible(priceType) &&\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid={gross}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('gross')}\r\n\t\t\t\t\t\ttype={INPUT_TYPE.NUMBER_19}\r\n\t\t\t\t\t\tstep=\"0.01\"\r\n\t\t\t\t\t\tonBlur={handleGrossBlur}\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t</GridBlock>\r\n\t\t</TitledComponent>\r\n\t)\r\n}\r\n\r\nNetGrossField.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(NetGrossField);","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport RadioGroup from 'components/RadioGroup';\r\nimport Select, {createSelectItem} from 'components/Select';\r\nimport GridBlock from 'components/GridBlock';\r\nimport primaryTenderVariantValues from './fieldsOptions/primaryTenderVariant.values'\r\nimport orderTypeValues from 'constants/orderType.values'\r\nimport InputLimits from 'constants/InputLimits';\r\nimport HelpComponent from 'components/HelpComponent';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport OrganizationInput from \"components/OrganizationInput\";\r\nimport {isNationalProcedure} from \"constants/ProcedureType\";\r\nimport NetGrossField from \"components/NetGrossField\";\r\nimport TitledComponent from \"components/TitledComponent\";\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE';\r\nimport {DemandCategoryTypeLabel, DemandCategoryTypesForProcedure} from \"constants/DemandCategoryType\";\r\n\r\n\r\nconst limits = InputLimits.procedure.basicInformation;\r\n\r\nconst style = theme => ({\r\n    root: {}\r\n})\r\n\r\nfunction ExPostFields(\r\n    {\r\n        formikProps,\r\n        demandAvailableOrganizations,\r\n        demandRealizationTypes,\r\n        numberAutomated,\r\n        demandHeader,\r\n    }) {\r\n    const creatingDemand = getObjectValue('identity', formikProps.values, false) <= 0 || isDemandPreparing();\r\n    const procedureType = getObjectValue('procedureType', formikProps.values, \"\");\r\n    const nationalProcedure = isNationalProcedure(procedureType);\r\n    const realizationType = getObjectValue('demandRealizationType', formikProps.values, \"\");\r\n    const createItem = (prefix, value) => ({label: Tr(prefix + '.' + value), value});\r\n    const demandRealizationTypesTranslated = demandRealizationTypes.map(x => createItem(procedureType, x.name));\r\n    const demandCategoryType = getObjectValue(\"demandCategoryType\", formikProps.values, null)\r\n    \r\n    const onDemandRealizationTypeChanged = (realizationType) => {\r\n\r\n        if (realizationType === 'primary_tender') {\r\n            formikProps.setFieldValue('primaryTenderVariant', primaryTenderVariantValues[0].value);\r\n        }\r\n    };\r\n\r\n    return (\r\n        <GridBlock\r\n            column\r\n        >\r\n            <TextInput\r\n                id='number'\r\n                label={Tr('case_number')}\r\n                formikProps={formikProps}\r\n                required\r\n                disabled={numberAutomated}\r\n                limit={limits.NUMBER}\r\n                showErrorImmediately\r\n            />\r\n\r\n            {\r\n                (creatingDemand || !!demandCategoryType) && <Select\r\n                    id='demandCategoryType'\r\n                    label={Tr('demand_category_type')}\r\n                    formikProps={formikProps}\r\n                    items={DemandCategoryTypesForProcedure(procedureType).map(x => createSelectItem(x, DemandCategoryTypeLabel(x)))}\r\n                    required\r\n                />\r\n            }\r\n\r\n            {demandHeader?.applicationClientSettings?.ezdrpIntegration?.active &&\r\n                <TextInput\r\n                    id='ezdrpId'\r\n                    label={Tr('case_ezdrpId')}\r\n                    formikProps={formikProps}\r\n                    limit={limits.NUMBER}\r\n                    showErrorImmediately\r\n                />\r\n            }\r\n\r\n            {demandHeader?.applicationClientSettings?.ezdpuwIntegration?.active &&\r\n                <TextInput\r\n                    id='ezdpuwId'\r\n                    label={Tr('case_ezdpuwId')}\r\n                    formikProps={formikProps}\r\n                    limit={limits.NUMBER}\r\n                    showErrorImmediately\r\n                />\r\n            }\r\n\r\n            <OrganizationInput\r\n                id='organization'\r\n                formikProps={formikProps}\r\n                required\r\n                disabled={!creatingDemand || demandAvailableOrganizations.length < 2}\r\n                availableOrganizations={demandAvailableOrganizations}\r\n            />\r\n\r\n            <TextInput\r\n                id='name'\r\n                label={Tr('proceedings_subject')}\r\n                formikProps={formikProps}\r\n                required\r\n                limit={limits.NAME}\r\n                multiline\r\n                showErrorImmediately\r\n            />\r\n\r\n            <HelpComponent text={Tr('tooltip_realization_type')}>\r\n                <Select\r\n                    id='demandRealizationType'\r\n                    label={Tr('proposed_procedure')}\r\n                    formikProps={formikProps}\r\n                    items={demandRealizationTypesTranslated}\r\n                    onChange={e => onDemandRealizationTypeChanged(e.target.value)}\r\n                    required\r\n                    disabled={!creatingDemand}\r\n                />\r\n            </HelpComponent>\r\n\r\n            {nationalProcedure && realizationType === 'primary_tender' &&\r\n                <Select\r\n                    id='primaryTenderVariant'\r\n                    label={Tr('primary_tender_variant')}\r\n                    formikProps={formikProps}\r\n                    items={primaryTenderVariantValues}\r\n                    required\r\n                />\r\n            }\r\n            <RadioGroup\r\n                id='demandOrderType'\r\n                label={Tr('order_type')}\r\n                formikProps={formikProps}\r\n                items={orderTypeValues}\r\n                required\r\n            />\r\n\r\n            <GridBlock>\r\n                <NetGrossField\r\n                    formikProps={formikProps}\r\n                    title={Tr('estimated_value')}\r\n                    id={'estimatedValue'}\r\n                />\r\n            </GridBlock>\r\n\r\n            <TitledComponent\r\n                title={Tr('realization_value')}\r\n            >\r\n                <GridBlock>\r\n                    <TextInput\r\n                        id={'realizationGrossValue'}\r\n                        formikProps={formikProps}\r\n                        label={Tr('gross')}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        step=\"0.01\"\r\n                    />\r\n                    <div/>\r\n                </GridBlock>\r\n            </TitledComponent>\r\n\r\n            <GridBlock>\r\n                <NetGrossField\r\n                    formikProps={formikProps}\r\n                    title={Tr('realizated_value')}\r\n                    id={'realizatedValue'}\r\n                />\r\n            </GridBlock>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nExPostFields.propTypes = {\r\n    classes: PropTypes.any,\r\n    formikProps: PropTypes.object,\r\n};\r\n\r\nExPostFields.defaultProps = {};\r\n\r\nexport default withStyles(style)(ExPostFields);","import VS from 'constants/ValidationShema';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport {SELECT_VALUE} from 'constants/VATItems';\r\n\r\nconst inputLimits = InputLimits.procedure.basicInformation;\r\n\r\nexport default (demandRealizationTypes, numberAutomated) => {\r\n    return VS.lazy(() => {\r\n        let baseObj = {\r\n            number: VS.any().when(\"name\", {is: (x) => numberAutomated === true, then: VS.any(), otherwise: VS.stringMax(inputLimits.NUMBER)}),\r\n            demandCategoryType: VS.string(),\r\n            name: VS.stringMax(inputLimits.NAME),\r\n            demandRealizationType: VS.string(),\r\n            demandOrderType: VS.string(),\r\n            primaryTenderVariant: VS.any().when(\"demandRealizationType\", {is: (x) => x === 'primary_tender', then: VS.string(), otherwise: VS.any()}),\r\n\r\n            estimatedValue: VS.lazy(x => {\r\n                const s = {\r\n                    value: VS.amount(0, false),\r\n                    grossValue: VS.amount(0, false),\r\n                    vatRate: VS.amount(),\r\n                }\r\n                if (x.vatRate === SELECT_VALUE.CANCEL ||\r\n                    x.vatRate === SELECT_VALUE.DIFFRENT_VAT) {\r\n                    s.vatRate = VS.any();\r\n                }\r\n                if (x.vatRate === SELECT_VALUE.OTHER) {\r\n                    return VS.object({\r\n                        ...s,\r\n                        vatRate: VS.any(),\r\n                        vatRateOther: VS.amountMax100()\r\n                    })\r\n                }\r\n                return VS.object(s);\r\n            }),\r\n            realizationGrossValue: VS.amountOptional(0, false),\r\n        }\r\n\r\n        return VS.object(baseObj)\r\n    })\r\n}","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {connect} from 'react-redux'\r\nimport Loading from 'components/Loading';\r\nimport ExPostFields from './ExPostFields';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport DemandService from 'services/DemandService';\r\nimport SaveFormikValues from 'components/SaveFormikValues';\r\nimport validationSchemaExPost from './constants/validationSchemaExPost';\r\nimport ShowErrorOnFailedSubmit from 'components/ShowErrorOnFailedSubmit';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport {useParams, withRouter} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\nfunction MainFormExPost(\r\n    {\r\n        data,\r\n        demandAvailableOrganizations,\r\n        demandRealizationTypes,\r\n        numberAutomated,\r\n        stepperState,\r\n        demandValidation,\r\n        demandHeader\r\n    }) {\r\n    const [checkError, setCheckError] = useState(false)\r\n    const section = demandValidation.find(x => x.section === DemandValidation.DEMAND);\r\n    const FORM_ID = 'mp_1_demand';\r\n    const params = useParams();\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(FORM_ID, undefined,\r\n        autoSaveFormDraftActive ? () => DemandService.deleteDraftExPost(params.id) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(params.id, DemandService.saveDraftExPost, FORM_ID) : undefined);\r\n\r\n    if (!data || !demandAvailableOrganizations || !demandRealizationTypes) {\r\n        return <Loading/>\r\n    }\r\n\r\n\r\n    const handleSubmit = (values) => {\r\n        DemandService.saveExPost(values).then(() => {\r\n            if (data.identity !== -1) {\r\n                HeaderService.get(data.identity)\r\n            }\r\n        });\r\n    }\r\n\r\n    const getField = (id, defaultValue = '') => getObjectValue(id, data, defaultValue);\r\n\r\n    return (\r\n        <Form\r\n            initialValues={{\r\n                _editable: section ? section.editable : true,\r\n                identity: getField('identity'),\r\n                organization: getField('organization'),\r\n                procedureType: getField('procedureType'),\r\n                authorUser: getField('authorUser'),\r\n                number: getField('number'),\r\n                demandCategoryType: getField('demandCategoryType', null),\r\n                name: getField('name'),\r\n                demandRealizationType: getField('demandRealizationType'),\r\n                demandOrderType: getField('demandOrderType'),\r\n                primaryTenderVariant: getField('primaryTenderVariant'),\r\n                estimatedValue: getField('estimatedValue'),\r\n                realizationGrossValue: getField('realizationGrossValue'),\r\n                realizatedValue: getField('realizatedValue'),\r\n\r\n                enableOptional: false,\r\n\r\n                ezdrpId: getField('ezdrpId'),\r\n                ezdpuwId: getField('ezdpuwId'),\r\n            }}\r\n            validationSchema={validationSchemaExPost(demandRealizationTypes, numberAutomated)}\r\n            onSubmit={handleSubmit}\r\n            id={FORM_ID}\r\n            afterSubmitFunc={() => {\r\n                setCheckError(true);\r\n                if (isDemandModification()) {\r\n                    ModificationService.isDemandChanged(data.identity);\r\n                }\r\n            }}\r\n        >\r\n            {(formikProps) => {\r\n                return (\r\n                    <GridBlock\r\n                        column\r\n                    >\r\n                        <ShowErrorOnFailedSubmit\r\n                            formikProps={formikProps}\r\n                            checkError={checkError}\r\n                            setCheckError={setCheckError}\r\n                        />\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={FORM_ID}\r\n                            save={FORM_ID === stepperState}\r\n                        />\r\n                        {autoSaveFormDraftActive &&\r\n                        <AutoSaveFormValues\r\n                            formikProps={formikProps}\r\n                            id={getField('identity')}\r\n                            formId={FORM_ID}\r\n                            saveFunc={(formValues) => {\r\n                                DemandService.saveDraftExPost(getField('identity'), formValues)\r\n                            }}\r\n                        />\r\n                        }\r\n                        <ExPostFields\r\n                            formikProps={formikProps}\r\n                            demandAvailableOrganizations={demandAvailableOrganizations}\r\n                            demandRealizationTypes={demandRealizationTypes}\r\n                            numberAutomated={numberAutomated}\r\n                            demandHeader={demandHeader}\r\n                            hideExecutiveDemandVariant={getField('hideExecutiveDemandVariant', true)}\r\n                        />\r\n\r\n                    </GridBlock>\r\n                )\r\n            }}\r\n        </Form>\r\n    )\r\n}\r\n\r\nMainFormExPost.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nMainFormExPost.defaultProps = {}\r\n\r\n\r\nexport default connect((state) => ({\r\n    data: state.resources.demand,\r\n    demandAvailableOrganizations: state.resources.demandAvailableOrganizations,\r\n    demandRealizationTypes: state.resources.demandRealizationTypes,\r\n    numberAutomated: state.resources.demandNumberAutomated,\r\n    demandHeader: state.resources.demandHeader,\r\n    stepperState: state.stepper.state,\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(MainFormExPost));\r\n","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport DoubleButton from '../components/DoubleButton';\r\n\r\nfunction Confirm(\r\n    {\r\n        open,\r\n        confirmTitle,\r\n        confirmText,\r\n        confirmText2,\r\n        onConfirm,\r\n        onCancel,\r\n        labelConfirm = \"yes\",\r\n        labelCancel = \"no\",\r\n        translateConfirmTexts = true\r\n    }) {\r\n\r\n    return (\r\n        <Dialog\r\n            title={!!confirmTitle ? Tr(confirmTitle) : Tr('attention')}\r\n            open={open}\r\n            titleCentered\r\n            onClose={onCancel}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr(labelCancel)}\r\n                labelSecond={Tr(labelConfirm)}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={onConfirm}\r\n            />}\r\n        >\r\n            {!!confirmText && <Typography variant='body1'>\r\n                {translateConfirmTexts ? Tr(confirmText) : confirmText}\r\n            </Typography>}\r\n            {!!confirmText2 && <Typography variant='body1'>\r\n                {translateConfirmTexts ? Tr(confirmText2) : confirmText2}\r\n            </Typography>}\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nConfirm.propTypes = {\r\n    open: PropTypes.bool.isRequired,\r\n    confirmText: PropTypes.string.isRequired,\r\n    confirmText2: PropTypes.string,\r\n    onConfirm: PropTypes.func.isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    labelConfirm: PropTypes.string,\r\n    labelCancel: PropTypes.string,\r\n    translateConfirmTexts: PropTypes.bool\r\n}\r\n\r\nexport default Confirm;","import {withRouter} from \"react-router\";\r\nimport React, {useEffect, useMemo, useState} from \"react\";\r\nimport DemandService from 'services/DemandService';\r\nimport querystring from \"querystring\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from 'components/Loading';\r\nimport MainForm from \"./MainForm\";\r\nimport MainFormExPost from \"./MainFormExPost\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport {setFormDraftLoaded} from \"redux/actions\";\r\n\r\nfunction MainFormWrapper(\r\n    {\r\n        match,\r\n        location,\r\n        data,\r\n        setFormDraftLoaded\r\n    }) {\r\n    const demandId = match.params.id;\r\n    const search = location.search.slice(1);\r\n    const urlParams = useMemo(() => querystring.parse(search), [search]);\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n\r\n    useEffect(() => {\r\n        if (demandId) {\r\n            DemandService.get(demandId, urlParams).then(res => {\r\n                if (res.autoSaveFormDraftEnabled) {\r\n                    if (!!res.demand.exPost)\r\n                        DemandService.checkForDraftExPost(res.demand.identity).then(res => setDraftConfirm(res.result));\r\n                    else\r\n                        DemandService.checkForDraft(res.demand.identity).then(res => setDraftConfirm(res.result));\r\n                }\r\n            });\r\n        } else {\r\n            DemandService.getCreateNew(urlParams);\r\n            HeaderService.get(demandId);\r\n        }\r\n\r\n        return () => {\r\n            DemandService.clearResources(DemandService.DEMAND_RESOURCE_ID);\r\n            DemandService.clearResources(DemandService.DEMAND_AVAILABLE_REALIZATIONS_RESOURCE_ID);\r\n            DemandService.clearResources(DemandService.DEMAND_AVAILABLE_ORGANIZATIONS_RESOURCE_ID);\r\n            DemandService.clearResources(DemandService.DEMAND_AVAILABLE_FORM_TYPES_RESOURCE_ID);\r\n            DemandService.clearResources(DemandService.DEMAND_NUMBER_AUTOMATED);\r\n            DemandService.clearResources(DemandService.DEMAND_CASE_CLASSIFICATION_SYMBOL_REQUIRED);\r\n        }\r\n    }, [demandId, urlParams]);\r\n\r\n    const loadDemandDraft = (exPost) => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        if (exPost)\r\n            DemandService.loadDraftExPost(demandId).then(res => setFormDraftLoaded('mp_1_demand', res.success));\r\n        else\r\n            DemandService.loadDraft(demandId).then(res => setFormDraftLoaded('mp_1_demand', res.success));\r\n        setWorking(false);\r\n    }\r\n\r\n    if (!data || working) {\r\n        return <Loading/>\r\n    } else if (data.exPost) {\r\n        return <>\r\n            <MainFormExPost/>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={() => loadDemandDraft(true)}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </>\r\n    } else {\r\n        return <>\r\n            <MainForm/>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={() => loadDemandDraft(false)}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </>\r\n    }\r\n}\r\n\r\nexport default connect((state) => ({\r\n    data: state.resources.demand,\r\n}), {setFormDraftLoaded})(withRouter(MainFormWrapper));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport MainFormWrapper from \"./dataEdit/MainFormWrapper\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <MainFormWrapper/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import React from 'react'\r\nimport {Box, ListItem, Typography, withStyles} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport moment from 'moment';\r\nimport DateFormats from \"constants/DateFormats\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    grid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(2),\r\n        },\r\n        '&>*:nth-child(2)': {\r\n            width: 130\r\n        }\r\n    },\r\n})\r\n\r\nfunction ListElement({\r\n     classes,\r\n     item,\r\n    trPrefix = \"\"\r\n\r\n                     }) {\r\n\r\n    const {owner, history} = item\r\n    const {operationType, operationDatetime, role} = history\r\n    const {firstName, lastName, member} = owner\r\n\r\n    const boldDouble = (firstName, lastName) => <Box component='span' fontWeight='fontWeightBold'>{`${firstName} ${lastName}`}</Box>\r\n    const bold = (t) => <Box component='span' fontWeight='fontWeightBold'>{t}</Box>\r\n\r\n    const textVariant = {\r\n        DELETE: (<>\r\n            {Tr('history_popup_del_1')}{' '}\r\n            {bold(Tr('history_popup_del_2'))}{' '}\r\n            {Tr('history_popup_del_3')}\r\n        </>),\r\n        ADD: (<>\r\n            {Tr('history_popup_add_1')}{' '}\r\n            {bold(Tr('history_popup_add_2'))}{' '}\r\n            {Tr('history_popup_add_3')}{' '}\r\n            {Tr('history_popup_add_4')}{' '}\r\n            {bold(Tr(trPrefix + role.toUpperCase()))}\r\n        </>),\r\n        MODIFY: (<>\r\n            {Tr('history_popup_role_0')}{' '}\r\n            {bold(Tr(trPrefix + role.toUpperCase()))}\r\n        </>)\r\n    }\r\n\r\n    return (\r\n        <ListItem>\r\n            <GridBlock\r\n                wrap='nowrap'\r\n                className={classes.grid}\r\n            >\r\n                <Typography variant='body1'>\r\n                    {member ? boldDouble(member.firstName, member.lastName) : boldDouble(firstName, lastName)}\r\n                    {' '}\r\n                    {textVariant[operationType.trim()]}\r\n                </Typography>\r\n                <Typography\r\n                    variant='body1'\r\n                >\r\n                    {moment(operationDatetime).format(DateFormats.DATE_FORMAT)}\r\n                </Typography>\r\n            </GridBlock>\r\n        </ListItem>\r\n    )\r\n}\r\n\r\nexport default withStyles(style)(ListElement);","import React from 'react'\r\nimport {List, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations'\r\nimport GridBlock from 'components/GridBlock';\r\nimport ListElement from './ListElement';\r\nimport Loading from \"../../Loading\";\r\nimport SingleButton from \"../components/SingleButton\";\r\nimport {connect} from \"react-redux\";\r\n\r\n\r\nfunction ChangeHistory(\r\n    {\r\n        open,\r\n        onClose,\r\n        historyTab,\r\n        purchasingGroupHeader\r\n    }) {\r\n\r\n    const createTab = () => {\r\n        let newHistoryTab = []\r\n        historyTab.forEach(x => {\r\n            let {history, ...other} = x\r\n            history.forEach(inner => {\r\n                newHistoryTab.push({\r\n                    history: inner,\r\n                    owner: {...other}\r\n                })\r\n            });\r\n        });\r\n\r\n        let sortTable = newHistoryTab.sort((a, b) => {\r\n            return a.history.operationDatetime - b.history.operationDatetime\r\n        })\r\n\r\n        if (sortTable.length === 0) return (\r\n            <Typography>{Tr('empty_history')}</Typography>\r\n        )\r\n\r\n        return sortTable.reverse().slice(0, 5).map((item, i) => {\r\n            return (\r\n                <ListElement item={item} key={i} trPrefix={purchasingGroupHeader ? \"pg_\" : \"\"}/>\r\n            )\r\n        })\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open={open}\r\n            title={Tr('change_history')}\r\n            titleCentered\r\n            maxWidth='md'\r\n            onClose={onClose}\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={Tr('close')}\r\n                onClick={onClose}/>}\r\n        >\r\n            {!historyTab ?\r\n                <Loading/>\r\n                :\r\n                <GridBlock\r\n                    column\r\n                    alignItems='center'\r\n                >\r\n                    <List>\r\n                        {createTab()}\r\n                    </List>\r\n                </GridBlock>\r\n            }\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nChangeHistory.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\nexport default connect((state) => ({\r\n    purchasingGroupHeader: state.resources.purchasingGroupHeader\r\n}), {\r\n\r\n})(ChangeHistory);\r\n","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Button from 'components/Button';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => {\r\n    const width = 400;\r\n    return {\r\n        root: {\r\n            marginTop: theme.spacing(2)\r\n        },\r\n        button: {\r\n            width,\r\n            height: 60,\r\n        },\r\n        text: {\r\n            width,\r\n            textAlign: 'center',\r\n            marginTop: theme.spacing(2),\r\n        }\r\n    }\r\n}\r\n\r\nfunction StartScreen(\r\n    {\r\n        classes,\r\n        onFormOpen,\r\n        onImporterOpen\r\n    }) {\r\n    return (\r\n        <GridBlock\r\n            className={classes.root}\r\n            justify=\"space-around\"\r\n        >\r\n            <GridBlock column>\r\n                <Button\r\n                    color=\"primary\"\r\n                    className={classes.button}\r\n                    onClick={onFormOpen}\r\n                >\r\n                    {Tr('prepare_offer_form')}\r\n                </Button>\r\n                <Typography\r\n                    className={classes.text}\r\n                >\r\n                    {Tr('prepare_offer_form_description')}\r\n                </Typography>\r\n            </GridBlock>\r\n\r\n            <GridBlock column>\r\n                <Button\r\n                    onClick={onImporterOpen}\r\n                    className={classes.button}\r\n                    color=\"primary\"\r\n                >\r\n                    {Tr('import_form_more_than')}\r\n                </Button>\r\n                <Typography\r\n                    className={classes.text}\r\n                >\r\n                    {Tr('import_form_more_than_description')}\r\n                </Typography>\r\n            </GridBlock>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nStartScreen.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(StartScreen);","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store'\r\nimport {SELECT_VALUE} from 'constants/VATItems';\r\nimport {addObjectResource, addObjectResources, clearResource, setResource, setSaveStatusDialog, setSaveStatusError, setSaveStatusLoading} from 'redux/actions'\r\nimport Tr from 'translations/Translations';\r\nimport VatType from 'constants/VatType';\r\nimport getObjectValue from \"../libs/getObjectValue\";\r\nimport moment from \"libs/moment\";\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n}\r\n\r\nconst getDealingsMatchingCriterion = async (demandId, critId) => {\r\n    const res = await RestRequestGET(Endpoints.DEALINGS_WITH_CRITERION(demandId, critId))\r\n    return res;\r\n}\r\n\r\n\r\nconst getDealingsMatchingCriterionName = async (demandId, stageId, criteriumType, name) => {\r\n    let params = {\r\n        name\r\n    }\r\n    const res = await RestRequestGET(Endpoints.DEALINGS_MATCHING_CRITERION(demandId, stageId, criteriumType), {params});\r\n    return res;\r\n}\r\n\r\nconst _prepareIncomingDealing = (dealing) => {\r\n    const {agreementRealizationDate, ...other} = dealing;\r\n\r\n    const text = getObjectValue('agreementRealizationDate.text', dealing);\r\n    const date = getObjectValue('agreementRealizationDate.date', dealing);\r\n    return {\r\n        ...other,\r\n        termOption: text ? \"text\" : \"date\",\r\n        termDate: date ? moment(date) : null,\r\n        termDescription: text\r\n    }\r\n};\r\n\r\nconst getList = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEALINGS(demandId));\r\n\r\n        const modRes = {\r\n            ...res,\r\n            dealings: res.dealings.map(x => _prepareIncomingDealing(x)),\r\n        };\r\n\r\n\r\n        reduxStore.dispatch(\r\n            setResource('dealingsList', modRes)\r\n        )\r\n    } catch (error) {\r\n        console.error(error)\r\n    }\r\n}\r\n\r\nconst get = async (demandId, dealingId) => {\r\n    const {resources} = reduxStore.getState()\r\n    const dealing = resources.dealing ? resources.dealing[dealingId] : undefined\r\n    if (dealing) return;\r\n\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEALINGS_SINGLE(demandId, dealingId));\r\n        const modRes = _prepareIncomingDealing(res);\r\n        reduxStore.dispatch(\r\n            addObjectResource('dealing', dealingId, modRes)\r\n        )\r\n        return modRes;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getFullList = async (demandId, dealingIds) => {\r\n\r\n    const data = {\r\n        items: dealingIds\r\n    };\r\n\r\n    const res = await RestRequestPOST(Endpoints.DEALINGS_LIST(demandId), data);\r\n    const payload = {};\r\n    res.forEach(item => {\r\n        payload[item.identity] = _prepareIncomingDealing(item)\r\n    });\r\n    reduxStore.dispatch(\r\n        addObjectResources('dealing', payload)\r\n    );\r\n    return payload;\r\n\r\n}\r\n\r\nconst _formatSinglePartValues = (values) => {\r\n    // eslint-disable-next-line\r\n    const {\r\n        _open,\r\n        _edit,\r\n        _touched,\r\n        _load,\r\n        amount,\r\n        items,\r\n        name,\r\n        termOption,\r\n        termDescription,\r\n        termDate,\r\n        agreementRealizationDate,\r\n        ...otherValues\r\n    } = values;\r\n\r\n    const {\r\n        vatRate,\r\n        vatRateOther,\r\n        ...otherAmount\r\n    } = amount;\r\n\r\n    let newVatRate = vatRate;\r\n    let vatType = VatType.STANDARD;\r\n    if (vatRate === SELECT_VALUE.OTHER) {\r\n        newVatRate = vatRateOther\r\n        vatType = VatType.OTHER;\r\n    } else if (vatRate === SELECT_VALUE.CANCEL) {\r\n        newVatRate = 0\r\n        vatType = VatType.EXEMPTED\r\n    } else if (vatRate === SELECT_VALUE.DIFFRENT_VAT) {\r\n        newVatRate = 0\r\n        vatType = VatType.MIXED\r\n    }\r\n\r\n    let newItems = items;\r\n    if (newItems.length === 1) {\r\n        const curName = items[0].name ? items[0].name.trim() : null;\r\n        newItems = [{\r\n            ...newItems[0],\r\n            name: !curName ? name : curName\r\n        }]\r\n    }\r\n\r\n    newItems = newItems.map(i => {\r\n        let iNewVatRate = i.offerVatRate;\r\n        let iVatType = VatType.STANDARD;\r\n        if (i.offerVatRate === SELECT_VALUE.OTHER) {\r\n            iNewVatRate = i.offerVatRateOther\r\n            iVatType = VatType.OTHER;\r\n        } else if (i.offerVatRate === SELECT_VALUE.CANCEL) {\r\n            iNewVatRate = 0\r\n            iVatType = VatType.EXEMPTED\r\n        } else if (i.offerVatRate === SELECT_VALUE.DIFFRENT_VAT) {\r\n            iNewVatRate = 0\r\n            iVatType = VatType.MIXED\r\n        } else if (i.offerVatRate === SELECT_VALUE.NOT_APPLICABLE) {\r\n            iNewVatRate = 0\r\n            iVatType = VatType.NOT_APPLICABLE\r\n        } else if (i.offerVatRate === SELECT_VALUE.REVERSED) {\r\n            iNewVatRate = 0\r\n            iVatType = VatType.REVERSED\r\n        }\r\n        return {\r\n            ...i,\r\n            offerVatType: iVatType,\r\n            offerVatValue: iNewVatRate\r\n        }\r\n    });\r\n\r\n    const formatDate = (x) => (x ? x.format() : x);\r\n    return {\r\n        ...otherValues,\r\n        name,\r\n        agreementRealizationDate: {\r\n            date: termOption === 'date' ? formatDate(termDate) : null,\r\n            text: termOption === 'text' ? termDescription : null,\r\n        },\r\n        amount: {\r\n            ...otherAmount,\r\n            vatRate: newVatRate,\r\n            vatType,\r\n        },\r\n        items: newItems\r\n    }\r\n}\r\n\r\nconst _formatFormValues = (values) => {\r\n    const onlyTouchedAndNew = values.form.filter(\r\n        element => element._touched || element.identity < 0\r\n    )\r\n    const formatedValues = onlyTouchedAndNew.reduce((prevValue, currValue) => {\r\n        return [\r\n            ...prevValue,\r\n            _formatSinglePartValues(currValue)\r\n        ]\r\n    }, [])\r\n    return formatedValues\r\n}\r\n\r\nconst _getDeleteElements = (values) => {\r\n    const {resources} = reduxStore.getState()\r\n    const dealings = resources.dealingsList.dealings;\r\n\r\n    return dealings.reduce((prev, curr) => {\r\n        const id = curr.identity;\r\n        const el = values.form.find(x => x.identity === id)\r\n        if (!!el) return prev;\r\n        return [\r\n            ...prev,\r\n            id\r\n        ]\r\n    }, [])\r\n}\r\n\r\nconst _save = async (url, values, demandId) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n\r\n    const dealingsToDelete = _getDeleteElements(values)\r\n    const dealingsToSave = _formatFormValues(values)\r\n\r\n    if (dealingsToSave.length <= 0 && dealingsToDelete.length <= 0) {\r\n        reduxStore.dispatch(setSaveStatusDialog());\r\n        return true;\r\n    }\r\n\r\n    const data = {\r\n        dealingsToDelete,\r\n        dealingsToSave,\r\n    }\r\n\r\n    try {\r\n        let res = await RestRequestPOST(url, data)\r\n        if (res.success) {\r\n            reduxStore.dispatch(setSaveStatusDialog());\r\n            return true;\r\n        } else {\r\n            let msg;\r\n            if (res.errors) {\r\n                if (dealingsToSave.some((d, i) => !!res.errors[`dealingsToSave[${i}].items`])) {\r\n                    const dealingWithErrorId = dealingsToSave.filter((d, i) => !!res.errors[`dealingsToSave[${i}].items`]).map(d => d.identity)[0];\r\n                    const dealingWithErrorIndex = dealingsToSave.map(d => d.identity).indexOf(dealingWithErrorId);\r\n                    msg = res.errors[`dealingsToSave[${dealingWithErrorIndex}].items`];\r\n                } else if (dealingsToSave.some((d, i) => !!res.errors[`dealingsToSave[${i}].stages[0].criterions`])) {\r\n                    const dealingWithErrorId = dealingsToSave.filter((d, i) => !!res.errors[`dealingsToSave[${i}].stages[0].criterions`]).map(d => d.identity)[0];\r\n                    const dealingWithErrorIndex = dealingsToSave.map(d => d.identity).indexOf(dealingWithErrorId);\r\n                    msg = res.errors[`dealingsToSave[${dealingWithErrorIndex}].stages[0].criterions`];\r\n                    if (msg === 'wrongWeightSum') {\r\n                        msg = Tr('v_number_min_criteria', {min: 100});\r\n                    }\r\n                } else if (dealingsToSave.some((d, i) => !!res.errors[`dealingsToSave[${i}].amount.value`])) {\r\n                    const dealingWithErrorId = dealingsToSave.filter((d, i) => !!res.errors[`dealingsToSave[${i}].amount.value`]).map(d => d.identity)[0];\r\n                    const dealingWithErrorIndex = dealingsToSave.map(d => d.identity).indexOf(dealingWithErrorId);\r\n                    msg = `${Tr('part')} ${dealingWithErrorIndex + 1}: ${res.errors[`dealingsToSave[${dealingWithErrorIndex}].amount.value`]}`;\r\n                }\r\n            }\r\n            if (!msg) {\r\n                msg = Tr('unknown_error_message');\r\n            }\r\n            reduxStore.dispatch(setSaveStatusError(msg));\r\n\r\n        }\r\n    } catch (error) {\r\n    }\r\n    return false;\r\n}\r\n\r\nconst save = async (demandId, values) => {\r\n    return await _save(Endpoints.DEALINGS_SAVE(demandId), values, demandId)\r\n}\r\n\r\nconst validate = async (demandId) => {\r\n    return RestRequestGET(Endpoints.DEALINGS_VALIDATE(demandId));\r\n}\r\n\r\nconst checkForDraft = async (id, dealingId) => {\r\n    return await RestRequestGET(Endpoints.DEALINGS_AUTOSAVE_CHECK(id, dealingId));\r\n}\r\n\r\nconst loadDraft = async (id, dealingId) => {\r\n    const res = await RestRequestGET(Endpoints.DEALINGS_AUTOSAVE(id, dealingId));\r\n    if (res.success)\r\n        res.result = _prepareIncomingDealing(res.result);\r\n    return res;\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n    const dealingsToDelete = _getDeleteElements(formValues);\r\n    const dealingsToSave = _formatFormValues(formValues);\r\n    const data = {\r\n        dealingsToDelete,\r\n        dealingsToSave,\r\n    }\r\n    await RestRequestPOST(Endpoints.DEALINGS_AUTOSAVE_BATCH(id), data)\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n    await RestRequestDELETE(Endpoints.DEALINGS_AUTOSAVE_BATCH(id));\r\n}\r\n\r\nconst getRealizationValues = async (demandId) => {\r\n    return await RestRequestGET(Endpoints.DEALING_REALIZATION_VALUE(demandId));\r\n}\r\nconst saveRealizationValues = async (demandId, values, publishMode) => {\r\n    return await RestRequestPOST(Endpoints.DEALING_REALIZATION_VALUE(demandId) + (publishMode != null ? '?publishMode=' + publishMode : ''), values);\r\n}\r\n\r\nconst getFinalRealizationValues = async (demandId) => {\r\n    return await RestRequestGET(Endpoints.DEALING_FINAL_REALIZATION_VALUE(demandId));\r\n}\r\nconst saveFinalRealizationValues = async (demandId, values) => {\r\n    return await RestRequestPOST(Endpoints.DEALING_FINAL_REALIZATION_VALUE(demandId), values);\r\n}\r\n\r\nconst getRealizationValueStatus = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.DEALING_REALIZATION_VALUE_STATUS(demandId));\r\n    reduxStore.dispatch(setResource(RESOURCE_DEALING_REALIZATION_VALUE_STATUS, resp));\r\n    return resp;\r\n}\r\n\r\nconst publishRealizationAmountValue = async (demandId) => {\r\n    await RestRequestPUT(Endpoints.DEALING_REALIZATION_VALUE_PUBLISH(demandId));\r\n}\r\n\r\nconst unpublishRealizationAmountValue = async (demandId) => {\r\n    await RestRequestPUT(Endpoints.DEALING_REALIZATION_VALUE_UNPUBLISH(demandId));\r\n}\r\n\r\nconst RESOURCE_DEALING_REALIZATION_VALUE_STATUS = 'dealingsRealizationValueStatus';\r\n\r\nexport default {\r\n    getList,\r\n    get,\r\n    save,\r\n    checkForDraft,\r\n    loadDraft,\r\n    saveDraft,\r\n    deleteDraft,\r\n    clearResources,\r\n    getDealingsMatchingCriterion,\r\n    getDealingsMatchingCriterionName,\r\n    getFullList,\r\n    getRealizationValues,\r\n    getFinalRealizationValues,\r\n    getRealizationValueStatus,\r\n    saveRealizationValues,\r\n    saveFinalRealizationValues,\r\n    publishRealizationAmountValue,\r\n    unpublishRealizationAmountValue,\r\n    validate,\r\n    RESOURCE_DEALING_REALIZATION_VALUE_STATUS\r\n}","import Tr from \"translations/Translations\";\r\n\r\nconst createItem = (value, key) => ({\r\n    value,\r\n    label: Tr(key),\r\n})\r\n\r\nexport const SOURCE_TYPES = {\r\n    SUPPLIER: \"SUPPLIER\",\r\n    INITIATOR: \"INITIATOR\"\r\n}\r\n\r\nexport default [\r\n    createItem(SOURCE_TYPES.SUPPLIER, 'offerSourceType.supplier'),\r\n    createItem(SOURCE_TYPES.INITIATOR, 'offerSourceType.initiator')\r\n]","import {createSelectItem} from \"components/Select\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nexport const ITEM_TYPES = {\r\n    BASIC: \"basic\",\r\n    OPTIONAL: \"optional\",\r\n}\r\n\r\nexport const ItemTypes = [\r\n    createSelectItem(ITEM_TYPES.BASIC, Tr('position_type.basic')),\r\n    createSelectItem(ITEM_TYPES.OPTIONAL, Tr('position_type.optional'))\r\n]","import {SELECT_VALUE} from 'constants/VATItems'\r\nimport {SOURCE_TYPES} from 'constants/OfferSourceTypes'\r\nimport {ITEM_TYPES} from \"./itemTypes\";\r\n\r\n\r\nconst netGross = {\r\n    grossValue: '',\r\n    value: '',\r\n    vatRate: SELECT_VALUE.DEFAULT,\r\n}\r\n\r\nexport const newItem = {\r\n    name: '',\r\n    description: '',\r\n    quantity: {\r\n        value: \"1\",\r\n        uom: 'SZT'\r\n    },\r\n    type: ITEM_TYPES.BASIC,\r\n    offerVatPredefined: false,\r\n    offerSourceType: SOURCE_TYPES.SUPPLIER,\r\n    allowQuantityEditInOffer: false,\r\n}\r\n\r\nexport const newElement = (identity, demandId) => ({\r\n    identity,\r\n    demandId,\r\n    _edit: true,\r\n    _open: true,\r\n    _touched: true,\r\n    name: null,\r\n    description: '',\r\n    categoryItemCpv: [],\r\n    termOption: \"date\",\r\n    amount: netGross,\r\n    realizationBeforeOfferAmount: netGross,\r\n    items: [newItem],\r\n    stages: [\r\n        {\r\n            conditions: [],\r\n            conditionsInSiwz: true,\r\n            criterions: [],\r\n            parameters: [],\r\n        }\r\n    ],\r\n})\r\n\r\n\r\nexport default [\r\n    newElement(-1),\r\n]\r\n","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Button from 'components/Button';\r\nimport AddIcon from '@material-ui/icons/AddBoxOutlined'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction AddButton({\r\n\tclasses,\r\n\tchildren,\r\n\t...others\r\n}) {\r\n\t\r\n\treturn (\r\n\t\t<Button\r\n\t\t\tIcon={AddIcon}\r\n\t\t\tvariant='text'\r\n\t\t\t{...others}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</Button>\r\n\t)\r\n}\r\n\r\nAddButton.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(AddButton);","import React from 'react'\r\nimport { withStyles, Backdrop } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Loading from '../../Loading';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\ttop: 0,\r\n\t\tleft: 0,\r\n\t\tright: 0,\r\n\t\tbottom: 0,\r\n\t\tzIndex: theme.zIndex.modal,\r\n\t\tposition: 'fixed',\r\n\t},\r\n})\r\n\r\nfunction LoadingScreen({\r\n\t\t\t\t\t\t   classes,\r\n\t\t\t\t\t\t   open = true,\r\n\t\t\t\t\t   }) {\r\n\treturn (\r\n\t\t<div className={clsx({\r\n\t\t\t[classes.root]: open\r\n\t\t})}>\r\n\t\t\t<Backdrop open={open} />\r\n\t\t\t{open && <Loading size={100} />}\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nLoadingScreen.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nLoadingScreen.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(LoadingScreen);","import React from 'react';\r\nimport LoadingScreen from \"components/complex/loadingScreen/LoadingScreen\";\r\n\r\n\r\nconst ImporterForm = (\r\n    {\r\n        downloadingInProgress\r\n    }) => {\r\n\r\n\r\n    return (\r\n        <>\r\n            {downloadingInProgress ? <LoadingScreen/> : ''}\r\n        </>\r\n    )\r\n};\r\n\r\n\r\nexport default ImporterForm\r\n\r\n","import {RestRequestBLOB} from \"libs/RestRequest\";\r\nimport Endpoints from \"constants/Endpoints\";\r\n\r\nexport const downloadImportTemplate = async (demandId, successCallback = () => {}, errorCallback  = () => {}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.DEALINGS_EXPORT(demandId))\r\n            .then(successCallback)\r\n            .catch(errorCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\n","import React from 'react'\r\nimport { withStyles, Table, TableHead, TableBody } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n\ttable: {\r\n\t\ttableLayout: 'fixed',\r\n\r\n\t\t'& td, th': {\r\n\t\t\toverflow: 'hidden',\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction STableContainer({\r\n\tclasses,\r\n\tchildren,\r\n\thead,\r\n\tclassName,\r\n}) {\r\n\treturn (\r\n\t\t<Table className={clsx(\r\n\t\t\tclasses.table,\r\n\t\t\tclassName,\r\n\t\t)}>\r\n\t\t\t<TableHead>\r\n\t\t\t\t{head}\r\n\t\t\t</TableHead>\r\n\t\t\t<TableBody>\r\n\t\t\t\t{children}\r\n\t\t\t</TableBody>\r\n\t\t</Table>\r\n\t)\r\n}\r\n\r\nSTableContainer.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(STableContainer);","import React from 'react'\r\nimport {TableCell, TableRow, TableSortLabel, Tooltip} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\nimport ArrowDownwardIcon from '@material-ui/icons/ArrowDownward';\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction SortIcon(props) {\r\n    return (\r\n        <Tooltip title={Tr('sort')} placement='top'>\r\n            <ArrowDownwardIcon {...props} />\r\n        </Tooltip>\r\n    )\r\n}\r\n\r\nfunction STableRow(\r\n    {\r\n        items = [],\r\n        className,\r\n        cellClassName,\r\n        cellClassNames = []\r\n    }) {\r\n\r\n    if (items.length <= 0) return '';\r\n\r\n    return (\r\n        <TableRow className={className}>\r\n            {items.map((item, i) => {\r\n                let ccn;\r\n                if (cellClassNames.length > i) {\r\n                    ccn = cellClassNames[i];\r\n                }\r\n\r\n                if (item === null) item = '';\r\n                let obj = item;\r\n                if ((typeof item !== 'object') || (typeof item === 'object' && item.value === undefined)) {\r\n                    obj = {value: item}\r\n                }\r\n\r\n                const cellBody = () => {\r\n                    if (obj.sort) {\r\n                        return (\r\n                            <TableSortLabel\r\n                                active={obj.sort.active}\r\n                                direction={obj.sort.direction}\r\n                                onClick={obj.sort.onClick}\r\n                                IconComponent={SortIcon}\r\n                            >\r\n                                {obj.value}\r\n                            </TableSortLabel>\r\n                        )\r\n                    }\r\n                    return obj.value;\r\n                }\r\n\r\n                return <TableCell\r\n                    key={i}\r\n                    colSpan={obj.colSpan}\r\n                    className={clsx(\r\n                        cellClassName,\r\n                        ccn,\r\n                        obj.className,\r\n                    )}\r\n                >\r\n                    {cellBody()}\r\n                </TableCell>\r\n            })}\r\n        </TableRow>\r\n    )\r\n}\r\n\r\nSTableRow.propTypes = {\r\n    classes: PropTypes.any,\r\n    items: PropTypes.arrayOf(PropTypes.oneOfType([\r\n        PropTypes.shape({\r\n            value: PropTypes.any,\r\n            className: PropTypes.string,\r\n        }),\r\n        PropTypes.any,\r\n    ]))\r\n}\r\n\r\n\r\nexport default STableRow;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport STableContainer from './STableContainer';\r\nimport STableRow from './STableRow';\r\n\r\nfunction SimpleTable({\r\n\theaders,\r\n\titems = [],\r\n\tclassName,\r\n\tcellClassName = '',\r\n\tcolumnClasses = [],\r\n\trowClasses = []\r\n\r\n}) {\r\n\t\r\n\treturn (\r\n\t\t<STableContainer\r\n\t\t\tclassName={className}\r\n\t\t\thead={headers ? <STableRow\r\n\t\t\t\tcellClassNames={columnClasses}\r\n\t\t\t\titems={headers}\r\n\t\t\t\tcellClassName={cellClassName}\r\n\t\t\t/>: undefined}\r\n\t\t>\r\n\t\t\t{items.map( (rowElements, i) => {\r\n\t\t\t\treturn( rowElements !== null ?\r\n\t\t\t\t\t<STableRow\r\n\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\titems={rowElements}\r\n\t\t\t\t\t\tcellClassNames={columnClasses}\r\n\t\t\t\t\t\tcellClassName={cellClassName}\r\n\t\t\t\t\t\tclassName={rowClasses[i]}\r\n\t\t\t\t\t/> : null\r\n\t\t\t\t)\r\n\t\t\t})}\r\n\t\t</STableContainer>\r\n\t)\r\n}\r\n\r\nSimpleTable.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default SimpleTable;","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dropzone from 'components/Dropzone'\r\nimport UploadService from 'services/UploadService';\r\nimport {Typography} from '@material-ui/core';\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Tr from \"translations/Translations\";\r\nimport Button from \"components/Button\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport clsx from \"clsx\";\r\nimport {clearResource, setOpenForm, setOpenImporter, setStepperState} from \"redux/actions\";\r\nimport {connect} from \"react-redux\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport LoadingScreen from \"components/complex/loadingScreen/LoadingScreen\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    dropzone: {\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    reasonColumn: {\r\n        color: theme.palette.error.main\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    }\r\n\r\n}));\r\n\r\nfunction UploadImportFile(\r\n    {\r\n        id,\r\n        clearResource,\r\n        setStepperState,\r\n        setUploadOpened,\r\n        setOpenImporter,\r\n        setOpenForm,\r\n        ...others\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    // eslint-disable-next-line\r\n    const [importErrors, setImportErrors] = useState([]);\r\n    const [processingUpload, setProcessingUpload] = useState(false);\r\n    const [openSuccessPopup, setOpenSuccessPopup] = useState(false);\r\n\r\n    const handlePickFile = (files) => {\r\n        setProcessingUpload(true);\r\n\r\n        //start upload\r\n        files.forEach((element, index) => {\r\n            UploadService.upload(element, () => {\r\n            }, Endpoints.DEALINGS_IMPORT(id)).then(res => {\r\n                if (res.success) {\r\n                    setOpenSuccessPopup(true);\r\n                } else {\r\n                    setImportErrors(res.errors)\r\n                }\r\n            }).catch((e) => {\r\n                console.error(e);\r\n                setImportErrors([Tr(\"unknown_error_message\")])\r\n            }).finally(() => setProcessingUpload(false))\r\n        });\r\n    };\r\n    const clearImportErrors = () => {\r\n        setImportErrors([]);\r\n    };\r\n\r\n    const handleCloseSuccessPopup = () => {\r\n        setOpenSuccessPopup(false);\r\n        DealingsService.clearResources('dealing');\r\n        DealingsService.clearResources('dealingsList');\r\n        DealingsService.getList(id).then(() => {\r\n            setOpenImporter(false);\r\n            setOpenForm(true);\r\n        });\r\n    };\r\n\r\n    return (\r\n        <>\r\n            <LoadingScreen open={processingUpload}/>\r\n\r\n            <Dropzone\r\n                className={classes.dropzone}\r\n                onChange={handlePickFile}\r\n                acceptExtensionList={['xlsx']}\r\n                {...others}\r\n            />\r\n            <Dialog\r\n                title={Tr('attention')}\r\n                open={importErrors.length > 0}\r\n                titleCentered\r\n                maxWidth={'md'}\r\n                fullWidth={true}\r\n                onClose={clearImportErrors}\r\n            >\r\n                <Typography>\r\n                    {Tr('import_upload_dialog_error')}\r\n                </Typography>\r\n                <div>\r\n                    <SimpleTable\r\n                        columnClasses={[\r\n                            classes.lpColumn,\r\n                            classes.reasonColumn\r\n                        ]}\r\n                        headers={[Tr('column_lp'), Tr('reason')]}\r\n                        items={importErrors.map((e, index) => [(index + 1), e])}\r\n                    />\r\n\r\n                    <div className={clsx(classes.buttonRow, classes.dropzone)}>\r\n                        <Button\r\n                            onClick={clearImportErrors}\r\n                        >\r\n                            {Tr('close')}\r\n                        </Button>\r\n                    </div>\r\n\r\n                </div>\r\n            </Dialog>\r\n            <Dialog\r\n                title={Tr('attention')}\r\n                open={openSuccessPopup}\r\n                titleCentered\r\n                maxWidth={'md'}\r\n                fullWidth={true}\r\n                onClose={handleCloseSuccessPopup}\r\n            >\r\n                <Typography>\r\n                    {Tr('import_upload_dialog_success_line1')}\r\n                </Typography>\r\n                <Typography>\r\n                    {Tr('import_upload_dialog_success_line2')}\r\n                </Typography>\r\n                <div className={clsx(classes.buttonRow, classes.dropzone)}>\r\n                    <Button\r\n                        onClick={handleCloseSuccessPopup}\r\n                    >\r\n                        {Tr('close')}\r\n                    </Button>\r\n                </div>\r\n            </Dialog>\r\n        </>\r\n    )\r\n}\r\n\r\nUploadImportFile.propTypes = {\r\n    classes: PropTypes.any,\r\n\r\n};\r\n\r\nexport default connect((state) => ({}), {\r\n    setOpenImporter,\r\n    setOpenForm,\r\n    setStepperState,\r\n    clearResource\r\n})(UploadImportFile);","import React, {useMemo, useState} from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport AddButton from 'components/button/AddButton';\r\nimport Tr from 'translations/Translations';\r\nimport {newElement} from '../constants/initialValues'\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {withRouter} from \"react-router\"\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport ImporterForm from \"./ImporterForm\";\r\nimport {downloadImportTemplate} from \"../lib/downloadImportTemplate\";\r\nimport clsx from \"clsx\";\r\nimport UploadImportFile from \"./UploadImportFile\";\r\nimport {connect} from \"react-redux\";\r\nimport {wasEverPublished, isNationalProcedure, isEuropeProcedure} from \"libs/getDemandStatus\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {}\r\n})\r\n\r\nfunction AdditionalButtons(\r\n    {\r\n        classes,\r\n        id,\r\n        formikProps,\r\n        match,\r\n        demandHeader\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const isPublished = useMemo(() => demandHeader ? wasEverPublished() : undefined, [demandHeader]);\r\n    const isPublic = useMemo(() => demandHeader ? isNationalProcedure() || isEuropeProcedure() : undefined, [demandHeader]);\r\n\r\n    const [confirmExportPopup, setConfirmExportPopup] = useState(false);\r\n    const [downloadingInProgress, setDownloadingInProgress] = useState(false);\r\n    const [uploadOpened, setUploadOpened] = useState(false);\r\n\r\n    const handleAdd = () => {\r\n        const elements = getObjectValue(id, formikProps.values);\r\n\r\n        const lastElement = elements.reduce((prev, curr) => {\r\n            if (prev.identity < curr.identity) return prev;\r\n            return curr;\r\n        }, {identity: 0});\r\n        const nextId = lastElement.identity - 1;\r\n        let newElementsList = [...elements];\r\n        newElementsList.forEach((x, i) => {\r\n                newElementsList[i]._open = false;\r\n        });\r\n        newElementsList = [\r\n            ...newElementsList,\r\n            newElement(nextId, demandId)\r\n        ];\r\n\r\n        formikProps.setFieldValue(id, newElementsList)\r\n\r\n    };\r\n\r\n    const hideDownloadingTemplate = () => {\r\n        setDownloadingInProgress(false);\r\n    };\r\n    const downloadImportTemplateClick = () => {\r\n        setConfirmExportPopup(false);\r\n        setDownloadingInProgress(true);\r\n        downloadImportTemplate(demandId, hideDownloadingTemplate, hideDownloadingTemplate);\r\n    }\r\n\r\n    const toggleUploadOpened = () => {\r\n        setUploadOpened(uploadOpened => !uploadOpened);\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock column>\r\n                <AddButton\r\n                    onClick={handleAdd}\r\n                    disabled={!editable || (isPublic && isPublished)}\r\n                >\r\n                    {Tr('add_part')}\r\n                </AddButton>\r\n                <AddButton\r\n                    onClick={() => setConfirmExportPopup(true)}\r\n                >\r\n                    {Tr('export_form')}\r\n                </AddButton>\r\n                <AddButton\r\n                    disabled={!editable || (isPublic && isPublished)}\r\n                    onClick={toggleUploadOpened}\r\n                >\r\n                    {Tr('import_form')}\r\n                </AddButton>\r\n            </GridBlock>\r\n            {\r\n                uploadOpened &&\r\n                <>\r\n                    <Typography\r\n                        className={classes.text}\r\n                    >\r\n                        {Tr('dealings_import_step_two_upload')}\r\n                    </Typography>\r\n                    <Typography\r\n                        className={clsx(classes.text, classes.error)}\r\n                    >\r\n                        {Tr('dealings_import_step_two_upload_warning')}\r\n                    </Typography>\r\n                    <UploadImportFile id={demandId}/>\r\n                </>\r\n            }\r\n            <ImporterForm downloadingInProgress={downloadingInProgress}/>\r\n            <Confirm\r\n                confirmText='make_sure_section_save'\r\n                onCancel={() => setConfirmExportPopup(false)}\r\n                onConfirm={downloadImportTemplateClick}\r\n                open={confirmExportPopup}\r\n                labelConfirm='export'\r\n                labelCancel='cancel'\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nAdditionalButtons.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(withStyles(style)(withRouter(AdditionalButtons)));","import { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport { SortableElement } from 'react-sortable-hoc'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tdivider: {\r\n\t\tmarginTop: theme.spacing(1),\r\n\t\tmarginBottom: theme.spacing(1),\r\n\t}\r\n})\r\n\r\nconst SortableItem = SortableElement(({\r\n\tformikProps,\r\n\ti,\r\n\tid,\r\n\tclasses,\r\n\tchildren,\r\n\t...other\r\n}) => {\r\n\treturn children(formikProps, id, i)\r\n})\r\n\r\n\r\nSortableItem.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(SortableItem);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport { SortableContainer } from 'react-sortable-hoc';\r\nimport SortableItem from './SortableItem'\r\nimport getObjectValue from 'libs/getObjectValue';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nconst SortableList = SortableContainer(({\r\n\tclasses,\r\n\tformikProps,\r\n\tid,\r\n\tchildren\r\n}) => {\r\n\tconst elements = getObjectValue(id, formikProps.values)\r\n\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t{elements.map((item, i) => (\r\n\t\t\t\t<SortableItem\r\n\t\t\t\t\tchildren={children}\r\n\t\t\t\t\tkey={i}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\ti={i}\r\n\t\t\t\t\tindex={i}\r\n\t\t\t\t\tid={id}\r\n\t\t\t\t/>\r\n\t\t\t))}\r\n\t\t</div>\r\n\t)\r\n})\r\n\r\nSortableList.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(SortableList);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport SortableList from './SortableList';\r\nimport {arrayMoveMutable} from 'array-move';\r\nimport getObjectValue from 'libs/getObjectValue';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction SortableContainer({\r\n\tclasses,\r\n\tformikProps,\r\n\tid,\r\n\tchildren,\r\n}) {\r\n\r\n\tconst onSortEnd = ({oldIndex, newIndex}) => {\r\n\t\tconst elements = getObjectValue(id, formikProps.values)\r\n\t\tarrayMoveMutable(elements, oldIndex, newIndex)\r\n\t\tformikProps.setFieldValue(id, elements);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<SortableList\r\n\t\t\tformikProps={formikProps}\r\n\t\t\tid={id}\r\n\t\t\tonSortEnd={onSortEnd}\r\n\t\t\tuseDragHandle\r\n\t\t\tchildren={children}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nSortableContainer.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(SortableContainer);","import Tr from 'translations/Translations';\r\n\r\nexport const CONDITION_TYPE_OTHER = \"OTHER\";\r\n\r\nexport const CONDITION_TYPE = {\r\n\tCOMPETENCES: \"COMPETENCES\",\r\n\tFINANCIAL_SITUATION: \"FINANCIAL_SITUATION\",\r\n\tTECHNICAL_CAPACITY: \"TECHNICAL_CAPACITY\",\r\n\tEMPLOYMENT: \"EMPLOYMENT\",\r\n\tOTHER: CONDITION_TYPE_OTHER\r\n}\r\n\r\nexport const CONDITION_TYPE_PZP_2021 = {\r\n\tCOMPETENCES: \"COMPETENCES\",\r\n\tFINANCIAL_SITUATION: \"FINANCIAL_SITUATION\",\r\n\tTECHNICAL_CAPACITY: \"TECHNICAL_CAPACITY\",\r\n\tEMPLOYMENT: \"EMPLOYMENT\",\r\n\tCOURSE_OF_TRADE: \"COURSE_OF_TRADE\",\r\n\tOTHER: CONDITION_TYPE_OTHER\r\n}\r\n\r\nexport const CONDITIONS_LABEL = {\r\n\t[CONDITION_TYPE.COMPETENCES]: Tr('condition_type_competences'),\r\n\t[CONDITION_TYPE.FINANCIAL_SITUATION]: Tr('condition_type_financial_situation'),\r\n\t[CONDITION_TYPE.TECHNICAL_CAPACITY]: Tr('condition_type_technical_capacity'),\r\n\t[CONDITION_TYPE.EMPLOYMENT]: Tr('condition_type_employment'),\r\n\t[CONDITION_TYPE.OTHER]: Tr('other'),\r\n}\r\n\r\nexport const CONDITIONS_LABEL_PZP_2021 = {\r\n\t[CONDITION_TYPE_PZP_2021.COMPETENCES]: Tr('condition_type_competences_2'),\r\n\t[CONDITION_TYPE_PZP_2021.FINANCIAL_SITUATION]: Tr('condition_type_financial_situation'),\r\n\t[CONDITION_TYPE_PZP_2021.TECHNICAL_CAPACITY]: Tr('condition_type_technical_capacity'),\r\n\t[CONDITION_TYPE_PZP_2021.EMPLOYMENT]: Tr('condition_type_employment'),\r\n\t[CONDITION_TYPE_PZP_2021.COURSE_OF_TRADE]: Tr('condition_type_course_of_trade'),\r\n\t[CONDITION_TYPE_PZP_2021.OTHER]: Tr('other')\r\n}\r\n\r\nconst createItem = (key) => ({\r\n\tlabel: CONDITIONS_LABEL[key],\r\n\tvalue: key\r\n})\r\n\r\nconst createItem_PZP_2021 = (key) => ({\r\n\tlabel: CONDITIONS_LABEL_PZP_2021[key],\r\n\tvalue: key\r\n})\r\n\r\nexport const conditionValues_PZP_2021 = Object.keys(CONDITION_TYPE_PZP_2021).map(x => createItem_PZP_2021(x));\r\n\r\nexport default Object.keys(CONDITION_TYPE).map( x => createItem(x))","import Tr from 'translations/Translations';\r\n\r\nexport const CRYTERIUM_TYPE = {\r\n\tTIME_LIMIT: \"TIME_LIMIT\",\r\n\tGUARANTEE: \"GUARANTEE\",\r\n\tPAYMENT: \"PAYMENT\",\r\n\tOPERATING_COST: \"OPERATING_COST\",\r\n\tSERVICE: \"SERVICE\",\r\n\tCONTRACT_SECURITY: \"CONTRACT_SECURITY\",\r\n\tOWNERSHIP: \"OWNERSHIP\",\r\n\tOTHER: \"OTHER\",\r\n\tPRICE: \"PRICE\",\r\n}\r\n\r\nexport const CRYTERIUM_TYPE_LABEL = {\r\n\t[CRYTERIUM_TYPE.CONTRACT_SECURITY]: Tr('criterion_type_contract_security'),\r\n\t[CRYTERIUM_TYPE.GUARANTEE]: Tr('criterion_type_guarantee'),\r\n\t[CRYTERIUM_TYPE.OPERATING_COST]: Tr('criterion_type_operating_cost'),\r\n\t[CRYTERIUM_TYPE.OWNERSHIP]: Tr('criterion_type_ownership'),\r\n\t[CRYTERIUM_TYPE.PAYMENT]: Tr('criterion_type_payment'),\r\n\t[CRYTERIUM_TYPE.PRICE]: Tr('criterion_type_price'),\r\n\t[CRYTERIUM_TYPE.SERVICE]: Tr('criterion_type_service'),\r\n\t[CRYTERIUM_TYPE.TIME_LIMIT]: Tr('criterion_type_time_limit'),\r\n\t[CRYTERIUM_TYPE.OTHER]: Tr('other'),\r\n}\r\n\r\nconst createItem = (key) => ({\r\n\tlabel: CRYTERIUM_TYPE_LABEL[key],\r\n\tvalue: key\r\n})\r\n\r\nexport default Object.values(CRYTERIUM_TYPE).map( x => createItem(x))","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (label, value) => ({\r\n\tlabel,\r\n\tvalue\r\n})\r\n\r\nexport const VARIANT_CODE = {\r\n\tTEXT: 'TEXT',\r\n\tLIST: 'LIST',\r\n\tNUMBER: 'NUMBER',\r\n\tYESNO: 'YESNO',\r\n\tINTERVAL: 'INTERVAL',\r\n\tPRICE: 'PRICE',\r\n}\r\n\r\nexport const criteriaLabels = {\r\n\t[VARIANT_CODE.TEXT]: Tr('text'),\r\n\t[VARIANT_CODE.YESNO]: `${Tr('yes')}/${Tr('no')}`,\r\n\t[VARIANT_CODE.NUMBER]: Tr('number'),\r\n\t[VARIANT_CODE.LIST]: Tr('list'),\r\n\t[VARIANT_CODE.INTERVAL]: Tr('allocation'),\r\n\t[VARIANT_CODE.PRICE]: Tr('price'),\r\n}\r\n\r\nexport default Object.keys(criteriaLabels).map( x => createItem(criteriaLabels[x], x))\r\n","import Tr from 'translations/Translations'\r\n\r\nexport const Directions = {\r\n    ASCENDING: 'ASCENDING',\r\n    DESCENDING: 'DESCENDING',\r\n}\r\n\r\nexport const PriceDirections = {\r\n    ...Directions,\r\n    DESCENDING_BY_PRICE_ITEMS: 'DESCENDING_BY_PRICE_ITEMS'\r\n}\r\n\r\nconst createItem = (key) => ({\r\n    label: Tr(`direction.${key}`),\r\n    value: key,\r\n})\r\n\r\nexport const CriterionDictionaryItems = Object.keys(Directions).map(key => createItem(key));\r\nexport const PriceCriterionDictionaryItems = Object.keys(PriceDirections).map(key => createItem(key));\r\n","import VS from 'constants/ValidationShema';\r\nimport {SELECT_VALUE} from 'constants/VATItems';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport {CONDITION_TYPE_OTHER, CONDITIONS_LABEL, CONDITIONS_LABEL_PZP_2021} from 'components/popup/newCondition/constants/condition.values';\r\nimport {getDemandPZPType} from \"libs/getDemandStatus\";\r\nimport PZPType from \"constants/PZPType\";\r\nimport Tr from 'translations/Translations';\r\nimport {CRYTERIUM_TYPE, CRYTERIUM_TYPE_LABEL} from 'components/popup/newCriteria/constants/criterium.type';\r\nimport {VARIANT_CODE as CRITERIA_TYPE} from \"components/popup/newCriteria/constants/criteria.variants\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {PriceDirections} from \"constants/DirectionsItems\";\r\nimport {SOURCE_TYPES} from \"../../../../../../../../constants/OfferSourceTypes\";\r\nimport {PriceTypeGrossFieldVisible, PriceTypeNetFieldVisible, PriceTypeVatFieldVisible} from \"../../../../../../../../constants/PriceTypes\";\r\n\r\nconst inputLimits = InputLimits.procedure.dealings;\r\n\r\nconst repeadedElement = (elements, getNameFunc) => {\r\n    return elements.find(x => undefined !== elements\r\n        .find(y => {\r\n            if (x.identity === y.identity) return false;\r\n            const xName = getNameFunc(x);\r\n            const yName = getNameFunc(y);\r\n            return xName === yName;\r\n        }))\r\n}\r\n\r\nconst findRepeatedConditionName = (elements) => {\r\n    const demandPzpType = getDemandPZPType();\r\n    const conditionLabels = PZPType.PZP_2021 === demandPzpType ? CONDITIONS_LABEL_PZP_2021 : CONDITIONS_LABEL;\r\n    const getName = (e) => {\r\n        if (e.type === CONDITION_TYPE_OTHER) return e.otherName;\r\n        return conditionLabels[e.type]\r\n    }\r\n    const e = repeadedElement(elements, getName)\r\n    if (e === undefined) return undefined;\r\n    return getName(e);\r\n}\r\n\r\nconst findRepeatedCriterionName = (elements) => {\r\n    const getName = (e) => {\r\n        if (e.type === CRYTERIUM_TYPE.PRICE) {\r\n            if (Boolean(e.otherName)) return e.otherName;\r\n        }\r\n        if (e.type === CRYTERIUM_TYPE.OTHER) return e.otherName;\r\n        return CRYTERIUM_TYPE_LABEL[e.type]\r\n    }\r\n    const e = repeadedElement(elements, getName)\r\n    if (e === undefined) return undefined;\r\n    return getName(e);\r\n}\r\n\r\nconst schema = (dealingsList = {}) => VS.object({\r\n\r\n    form: VS.arrayOf(\r\n        VS.lazy(formItem => {\r\n            if (formItem === null) return VS.any();\r\n\r\n            const criterions = getObjectValue('stages.0.criterions', formItem);\r\n            const section = criterions.find(x => x.type === CRYTERIUM_TYPE.PRICE);\r\n            const weightVisible = section && section.direction === PriceDirections.DESCENDING_BY_PRICE_ITEMS;\r\n\r\n            let criteriaSum = 0;\r\n            if (weightVisible) {\r\n                const items = getObjectValue('items', formItem);\r\n                criteriaSum = items.map(item => parseFloat(item.weight)).reduce((prev, next) => prev + next);\r\n                criteriaSum = parseFloat(criteriaSum.toFixed(2))\r\n            }\r\n\r\n            if (formItem._touched || formItem._load) {\r\n                return VS.object({\r\n                    name: VS.stringMax(inputLimits.NAME).nullable(),\r\n                    description: VS.string(),\r\n                    plannedContractorNumberForAgreement: 'Framework' === dealingsList.demandVariant && VS.integerMax(99999),\r\n                    planItemIdentity: !!dealingsList.planRequired && VS.string(),\r\n                    termDescription: VS.any().when(\r\n                        'termOption',\r\n                        {\r\n                            is: 'text',\r\n                            then: VS.stringMaxNoRq(InputLimits.procedure.basicInformation.TERM_DESCRIPTION),\r\n                            otherwise: VS.any()\r\n                        }),\r\n                    termDate: VS.any().when(\r\n                        'termOption',\r\n                        {\r\n                            is: 'date',\r\n                            then: VS.dateMinNoRq(new Date(), Tr(\"v_data_can_not_be_past\")),\r\n                            otherwise: VS.any()\r\n                        }),\r\n                    _weightSum: weightVisible ? VS.mixed().test('weightMin100', Tr('v_number_min_criteria', {min: 100}), () => {\r\n                        return !(criteriaSum < 100)\r\n                    }).test('weightMax100', Tr('v_number_max_criteria', {value: 100}), () => {\r\n                        return !(criteriaSum > 100)\r\n                    }) : VS.any(),\r\n                    amount: VS.lazy(x => {\r\n                        const s = {\r\n                            value: VS.amount(0, false),\r\n                            grossValue: VS.amount(0, false),\r\n                            vatRate: VS.amount(),\r\n                        }\r\n                        if (x.vatRate === SELECT_VALUE.CANCEL ||\r\n                            x.vatRate === SELECT_VALUE.DIFFRENT_VAT) {\r\n                            s.vatRate = VS.any();\r\n                        }\r\n                        if (x.vatRate === SELECT_VALUE.OTHER) {\r\n                            return VS.object({\r\n                                ...s,\r\n                                vatRate: VS.any(),\r\n                                vatRateOther: VS.amountMax100()\r\n                            })\r\n                        }\r\n                        return VS.object(s);\r\n                    }),\r\n                    realizationBeforeOfferAmount: VS.lazy((x) => {\r\n                        return VS.object({\r\n                            grossValue: VS.amountOptional(0, true)\r\n                        })\r\n                    }),\r\n                    items: VS.arrayOf(VS.lazy(item => {\r\n                        const shape = {\r\n                            quantity: VS.object({\r\n                                value: VS.numberMax(1000000000000000),\r\n                                uom: VS.string().nullable()\r\n                            })\r\n                        }\r\n\r\n                        shape['name'] = VS.stringMax(inputLimits.NAME).nullable();\r\n                        shape['description'] = VS.stringMaxNoRq(100000).nullable();\r\n\r\n                        if (weightVisible) {\r\n                            shape['weight'] = VS.amountMax100NoZero();\r\n                        }\r\n\r\n                        shape['offerSourceType'] = VS.any().test('itemFilled', Tr('item_not_filled'), (e) => {\r\n                            return ((!item.offerVatPredefined && SOURCE_TYPES.INITIATOR !== item.offerSourceType) || !PriceTypeVatFieldVisible(dealingsList.priceType) || !!item.offerVatRate)\r\n                                && (SOURCE_TYPES.INITIATOR !== item.offerSourceType || !PriceTypeNetFieldVisible(dealingsList.priceType) || !!item.offerValue)\r\n                                && (SOURCE_TYPES.INITIATOR !== item.offerSourceType || !PriceTypeGrossFieldVisible(dealingsList.priceType) || !!item.offerGrossValue);\r\n                        });\r\n\r\n                        return VS.object(shape);\r\n                    })),\r\n                    stages: VS.lazy(stage => {\r\n                        const vsObj = {\r\n                            //conditions: [],\r\n                            criterions: VS.arrayOf(VS.lazy(criterion => {\r\n                                const shape = {\r\n                                    //weight: VS.amountMax100NoZero()\r\n                                }\r\n\r\n                                switch (criterion.uiType) {\r\n                                    case CRITERIA_TYPE.LIST:\r\n                                        const maxListPoints = Math.max(...criterion.valuesList.map(o => o.value), 0);\r\n                                        shape.weight = VS.numberMaxMin(maxListPoints, maxListPoints, 'v_number_weight_min_max_points', 'v_number_weight_less_than_points');\r\n                                        break;\r\n                                    case CRITERIA_TYPE.INTERVAL:\r\n                                        const maxRangePoints = Math.max(...criterion.intervalList.map(o => o.value), 0);\r\n                                        shape.weight = VS.numberMaxMin(maxRangePoints, maxRangePoints, 'v_number_weight_min_max_points', 'v_number_weight_less_than_points');\r\n                                        break;\r\n                                    default:\r\n                                        shape.weight = VS.numberMax(100)\r\n                                }\r\n\r\n                                return VS.object(shape);\r\n                            }))\r\n\r\n                        }\r\n                        const stage0 = stage[0];\r\n\r\n                        let criteriaSum = stage0.criterions.map(item => parseFloat(item.weight)).reduce((prev, next) => prev + next, 0);\r\n                        criteriaSum = parseFloat(criteriaSum.toFixed(2));\r\n\r\n                        vsObj['_criteriaSum'] = VS.mixed().test('weightMin100', Tr('v_number_min_criteria', {min: 100}), () => {\r\n                            return !(criteriaSum < 100)\r\n                        }).test('weightMax100', Tr('v_number_max_criteria', {value: 100}), () => {\r\n                            return !(criteriaSum > 100)\r\n                        });\r\n\r\n\r\n                        const conditionsElements = stage0.conditions;\r\n                        const conditionRepeaded = findRepeatedConditionName(conditionsElements);\r\n                        if (conditionRepeaded) vsObj._conditionsError = VS.immediatelyError(Tr('condition_repeats', {name: conditionRepeaded}))\r\n\r\n                        const criterionsElements = stage0.criterions;\r\n                        const criterionRepeaded = findRepeatedCriterionName(criterionsElements);\r\n                        if (criterionRepeaded) vsObj._criterionsError = VS.immediatelyError(Tr('criterion_repeats', {name: criterionRepeaded}))\r\n\r\n                        return VS.arrayOfShape(vsObj)\r\n                    }),\r\n                    categoryItemCpv: VS.arrayRequired(),\r\n\r\n                })\r\n            }\r\n            return VS.any();\r\n        }))\r\n});\r\n\r\nexport default schema;\r\n\r\n\r\n// conditions: VS.lazy(elements => {\r\n// \tlet obj = {};\r\n// \tconst name = findRepeatedConditionName(elements);\r\n// \tif (name) obj._error = Tr('condition_repeats', { name });\r\n// \treturn VS.arrayOfShape(obj)\r\n// }),","import React from 'react'\r\nimport DeleteIcon from '@material-ui/icons/Delete';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconDeleteButton(\r\n    {\r\n        tooltip = Tr('delete'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={DeleteIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconDeleteButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconDeleteButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport EditIcon from '@material-ui/icons/Edit'\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction WorkableIconEditButton({\r\n\ttooltip = Tr('edit'),\r\n\t...props\r\n}) {\r\n\treturn <WorkableIconButton\r\n\t\ttooltip={tooltip}\r\n\t\tIcon={EditIcon}\r\n\t\t{...props}\r\n\t/>\r\n}\r\n\r\nWorkableIconEditButton.propTypes = {\r\n\texpanded: PropTypes.bool,\r\n\tworking: PropTypes.bool,\r\n\tdisabled: PropTypes.bool,\r\n\ttooltip: PropTypes.string,\r\n\thideTooltip: PropTypes.bool,\r\n\tcolor: PropTypes.string,\r\n\tonClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconEditButton;","import getObjectValue from 'libs/getObjectValue'\r\nimport {SELECT_VALUE} from 'constants/VATItems';\r\nimport VatType from 'constants/VatType';\r\nimport {SOURCE_TYPES} from 'constants/OfferSourceTypes'\r\n\r\nexport default async (dealingElement, formikProps, rootId) => {\r\n    if (dealingElement === undefined) {\r\n        return;\r\n    }\r\n    const createId = key => `${rootId}.${key}`\r\n\r\n\r\n    const emptyStage = {conditions: [], criterions: [], parameters: []}\r\n    const oldStage = getObjectValue(createId('stages.0'), formikProps.values, emptyStage)\r\n    const _open = getObjectValue(createId('_open'), formikProps.values)\r\n    const _edit = getObjectValue(createId('_edit'), formikProps.values)\r\n    const _touched = getObjectValue(createId('_touched'), formikProps.values)\r\n    let stage = dealingElement.stages[0];\r\n    if (!stage) stage = emptyStage\r\n\r\n    const concatNoDuplicates = (a, b) => a.concat(\r\n        b.filter(bElement => !a.find(\r\n            aElement => bElement.identity === aElement.identity\r\n        ))\r\n    )\r\n\r\n    const {amount, items, ...other} = dealingElement;\r\n    let vatRate = amount.vatRate ? amount.vatRate : SELECT_VALUE.DEFAULT;\r\n    let vatType = amount.vatType;\r\n    let vatRateOther = undefined;\r\n    if (vatType === VatType.OTHER) {\r\n        vatRateOther = vatRate;\r\n        vatRate = SELECT_VALUE.OTHER;\r\n    } else if (vatType !== VatType.STANDARD) {\r\n        vatRateOther = 0;\r\n        vatRate = vatType;\r\n    }\r\n\r\n    const stages = [\r\n        {\r\n            ...stage,\r\n            conditions: concatNoDuplicates(stage.conditions, oldStage.conditions),\r\n            criterions: concatNoDuplicates(stage.criterions, oldStage.criterions),\r\n            parameters: concatNoDuplicates(stage.parameters, oldStage.parameters),\r\n        }\r\n    ];\r\n\r\n    const newItems = [];\r\n    items.forEach(i => {\r\n        let offerVatRate = SELECT_VALUE.DEFAULT;\r\n        let offerVatRateOther = undefined;\r\n        if (i.offerVatPredefined || i.offerSourceType === SOURCE_TYPES.INITIATOR) {\r\n            if (i.offerVatType === VatType.OTHER) {\r\n                offerVatRateOther = i.offerVatValue;\r\n                offerVatRate = SELECT_VALUE.OTHER;\r\n            } else if (i.offerVatType !== VatType.STANDARD) {\r\n                offerVatRateOther = 0;\r\n                offerVatRate = i.offerVatType;\r\n            } else {\r\n                offerVatRate = i.offerVatValue.toString();\r\n            }\r\n        }\r\n        newItems.push({\r\n            ...i,\r\n            offerVatRate,\r\n            offerVatRateOther\r\n        })\r\n    });\r\n\r\n    const newDealingElement = {\r\n        ...other,\r\n        amount: {\r\n            ...amount,\r\n            vatRate,\r\n            vatRateOther,\r\n        },\r\n        _open,\r\n        _touched,\r\n        _edit,\r\n        stages,\r\n        items: newItems\r\n    }\r\n\r\n    formikProps.setFieldValue(rootId, newDealingElement)\r\n}","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport DoneIcon from '@material-ui/icons/Done'\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconConfirmButton({\r\n\ttooltip = Tr('confirm'),\r\n\t...props\r\n}) {\r\n\treturn <WorkableIconButton\r\n\t\ttooltip={tooltip}\r\n\t\tIcon={DoneIcon}\r\n\t\t{...props}\r\n\t/>\r\n}\r\n\r\nWorkableIconConfirmButton.propTypes = {\r\n\tworking: PropTypes.bool,\r\n\tdisabled: PropTypes.bool,\r\n\ttooltip: PropTypes.string,\r\n\thideTooltip: PropTypes.bool,\r\n\tcolor: PropTypes.string,\r\n\tonClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconConfirmButton;","import React from 'react'\r\nimport {Box, Tooltip, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport clsx from 'clsx';\r\nimport DealingsService from 'services/DealingsService';\r\nimport {withRouter} from \"react-router\";\r\nimport WarningIcon from '@material-ui/icons/Warning';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconEditButton from 'components/button/WorkableIconEditButton';\r\nimport mergeDealing from '../lib/mergeDealing';\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport WorkableIconConfirmButton from \"components/button/WorkableIconConfirmButton\";\r\n\r\nconst limits = InputLimits.procedure.dealings;\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*:nth-child(1)': {\r\n            flexGrow: 1,\r\n        }\r\n    },\r\n    rootEdit: {\r\n        '&>*:nth-child(2)': {\r\n            flexGrow: 1,\r\n            paddingLeft: theme.spacing(2),\r\n        }\r\n    },\r\n    editInput: {},\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2),\r\n    },\r\n    title: {\r\n        marginLeft: theme.spacing(),\r\n        wordBreak: 'break-all',\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    cursorPointer: {\r\n        cursor: 'pointer'\r\n    }\r\n})\r\n\r\nfunction ElementTitle(\r\n    {\r\n        classes,\r\n        index,\r\n        id,\r\n        onDelete,\r\n        onOpen,\r\n        formikProps,\r\n        open,\r\n        disableDelete,\r\n        match,\r\n    }) {\r\n\r\n    const createId = (key) => `${id}.${key}`;\r\n    const elementId = getObjectValue(createId('identity'), formikProps.values)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const _editId = `${id}._edit`;\r\n    const _touchedId = `${id}._touched`;\r\n    const editTitle = getObjectValue(_editId, formikProps.values, false)\r\n    const setEditTitle = x => {\r\n        formikProps.setFieldValue(_editId, x);\r\n        formikProps.setFieldValue(_touchedId, true);\r\n    }\r\n\r\n    const titleId = createId('name');\r\n    const title = getObjectValue(titleId, formikProps.values)\r\n    const titleError = getObjectValue(titleId, formikProps.errors)\r\n    const titleTouched = getObjectValue(titleId, formikProps.touched)\r\n\r\n    const demendId = match.params.id;\r\n\r\n    const handleEdit = () => {\r\n        if (editTitle && !(Boolean(titleError) && titleTouched)) {\r\n            setEditTitle(false)\r\n        } else if (!editTitle) {\r\n            DealingsService.get(demendId, elementId).then(res => {\r\n                mergeDealing(res, formikProps, id);\r\n                setEditTitle(true);\r\n            })\r\n        }\r\n    }\r\n\r\n    const errors = getObjectValue(id, formikProps.errors, null);\r\n    const touched = getObjectValue(id, formikProps.touched, null);\r\n\r\n    const showTitleComponent = () => (\r\n        <Box\r\n            className={clsx(\r\n                classes.marginLeft,\r\n                classes.cursorPointer\r\n            )}\r\n            component='span'\r\n            fontWeight='fontWeightBold'\r\n            onClick={onOpen}\r\n        >\r\n            {title}\r\n        </Box>\r\n    )\r\n\r\n    const editTitleComponent = () => (\r\n        <TextInput\r\n            limit={limits.NAME}\r\n            className={classes.editInput}\r\n            label={Tr('name')}\r\n            id={titleId}\r\n            formikProps={formikProps}\r\n            multiline\r\n        />\r\n    )\r\n\r\n    return (\r\n        <GridBlock\r\n            alignItems='center'\r\n            className={clsx({\r\n                [classes.root]: !editTitle,\r\n                [classes.rootEdit]: editTitle,\r\n            })}\r\n            wrap='nowrap'\r\n        >\r\n            <div>\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.title}\r\n                >\r\n                    {index + 1}.\r\n                    {!editTitle && showTitleComponent()}\r\n                </Typography>\r\n            </div>\r\n            {editTitle && editTitleComponent()}\r\n            {(errors && touched) &&\r\n            <Tooltip title={Tr('complete_missing_data')} placement=\"top\">\r\n                <WarningIcon color='error'/>\r\n            </Tooltip>\r\n            }\r\n            <GridBlock wrap='nowrap'>\r\n                {editTitle ?\r\n                    <WorkableIconConfirmButton\r\n                        onClick={handleEdit}\r\n                        color='primary'\r\n                        disabled={!editable}\r\n                    /> :\r\n                    <WorkableIconEditButton\r\n                        onClick={handleEdit}\r\n                        color='primary'\r\n                        disabled={!editable}\r\n                    />\r\n                }\r\n                <WorkableIconDeleteButton\r\n                    color='primary'\r\n                    onClick={onDelete}\r\n                    disabled={disableDelete || !editable}\r\n                />\r\n                <WorkableIconExpandButton\r\n                    color='primary'\r\n                    onClick={onOpen}\r\n                    expanded={open}\r\n                />\r\n            </GridBlock>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nElementTitle.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(withRouter(ElementTitle));","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET} from 'libs/RestRequest';\r\n\r\nconst getRequired = async () => {\r\n    return await _get();\r\n};\r\n\r\nconst getWithEmptyOption = async () => {\r\n    const list = await _get();\r\n    return [{label: '---', value: ''}, ...list];\r\n};\r\n\r\nconst _get = async () => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.MEASURE_UNITS);\r\n        resp.sort((a, b) => a.label.localeCompare(b.label));\r\n        return resp;\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\n\r\nexport default {\r\n    getRequired, getWithEmptyOption\r\n}","import React, {useEffect, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport Select from 'components/Select';\r\nimport GridBlock from 'components/GridBlock';\r\nimport MeasureUnitService from 'services/MeasureUnitService';\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE';\r\nimport Loading from \"components/Loading\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\tflexGrow: 1,\r\n\t\t\tflexBasis: 0,\r\n\t\t\t'&:last-child': {\r\n\t\t\t\tflexGrow: 2,\r\n\t\t\t\tmarginLeft: theme.spacing(2),\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n})\r\n\r\nfunction Units({\r\n\tclasses,\r\n\tformikProps,\r\n\tidPrefix,\r\n\tdisabled,\r\n\tunitDisabled\r\n}) {\r\n\tconst quantityId = !!idPrefix ? `${idPrefix}.quantity.value` : `quantity.value`;\r\n\tconst unitId = !!idPrefix ? `${idPrefix}.quantity.uom` : `quantity.uom`\r\n\tconst [measureUnits, setMeasureUnits] = useState(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tMeasureUnitService.getRequired().then((resp) => setMeasureUnits(resp));\r\n\t}, []);\r\n\r\n\tif (!measureUnits) {\r\n\t\treturn (\r\n\t\t\t<Loading/>\r\n\t\t)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<GridBlock className={classes.root}>\r\n\t\t\t<TextInput\r\n\t\t\t\tlabel={Tr('quantity')}\r\n\t\t\t\tid={quantityId}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\ttype={INPUT_TYPE.NUMBER_POSITIVE_AMOUNT}\r\n\t\t\t\trequired\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t/>\r\n\t\t\t<Select\r\n\t\t\t\tlabel={Tr('measure_unit')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tid={unitId}\r\n\t\t\t\trequired\r\n\t\t\t\tdisabled={disabled || unitDisabled}\r\n\t\t\t\titems={measureUnits}\r\n\t\t\t/>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nUnits.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(Units);","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport VisibilityIcon from '@material-ui/icons/Visibility';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconPreviewButton(\r\n    {\r\n        tooltip = Tr('preview'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={VisibilityIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconPreviewButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconPreviewButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport AddIcon from '@material-ui/icons/AddCircle'\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction WorkableIconAddButton({\r\n\ttooltip = Tr('add'),\r\n\t...props\r\n}) {\r\n\treturn <WorkableIconButton\r\n\t\ttooltip={tooltip}\r\n\t\tIcon={AddIcon}\r\n\t\t{...props}\r\n\t/>\r\n}\r\n\r\nWorkableIconAddButton.propTypes = {\r\n\texpanded: PropTypes.bool,\r\n\tworking: PropTypes.bool,\r\n\tdisabled: PropTypes.bool,\r\n\ttooltip: PropTypes.string,\r\n\thideTooltip: PropTypes.bool,\r\n\tcolor: PropTypes.string,\r\n\tonClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconAddButton;","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Units from './Units';\r\nimport GridBlock from 'components/GridBlock';\r\nimport TextInput from \"components/TextInput\";\r\nimport Tr from \"translations/Translations\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport clsx from 'clsx';\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport Select from \"components/Select\";\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport OfferSourceTypes from \"constants/OfferSourceTypes\";\r\nimport {ItemTypes} from \"../../constants/itemTypes\";\r\nimport WorkableIconAddButton from \"components/button/WorkableIconAddButton\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            flexBasis: 0,\r\n\r\n            '&:not(:first-child)': {\r\n                marginLeft: theme.spacing(2),\r\n            },\r\n            '&:last-child': {\r\n                marginLeft: theme.spacing(2),\r\n            },\r\n            '&:nth-child(1)': {\r\n                flexGrow: 4\r\n            },\r\n            '&:nth-child(2)': {\r\n                flexGrow: 3\r\n            },\r\n            '&:nth-child(3)': {\r\n                flexGrow: 1\r\n            },\r\n            '&:nth-child(4)': {\r\n                flexGrow: 1\r\n            },\r\n            '&:nth-child(5)': {\r\n                flexGrow: 1\r\n            },\r\n            '&:nth-child(6)': {\r\n                flexGrow: 1.6\r\n            }\r\n        }\r\n    },\r\n    rootWeight: {\r\n        '&>*': {\r\n            '&:nth-child(7)': {\r\n                flexGrow: 1\r\n            },\r\n        }\r\n    }\r\n})\r\n\r\nfunction SingleVariant(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        handleEditItem,\r\n        weightVisible\r\n    }) {\r\n\r\n    const nameId = `${id}.0.name`;\r\n    const typeId = `${id}.0.type`;\r\n    const allowQuantityEditInOfferId = `${id}.0.allowQuantityEditInOffer`;\r\n    const predefinedVatId = `${id}.0.offerVatPredefined`;\r\n    const offerSourceTypeId = `${id}.0.offerSourceType`;\r\n    const weightId = `${id}.0.weight`;\r\n    const optionalItem = getObjectValue(`${id}.0.optionalItem`, formikProps.values, null);\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    return (\r\n        <GridBlock className={clsx(classes.root, {\r\n            [classes.rootWeight]: weightVisible,\r\n        })}>\r\n            <TextInput\r\n                id={nameId}\r\n                label={Tr('name')}\r\n                formikProps={formikProps}\r\n                multiline\r\n                disabled\r\n            />\r\n            <Units\r\n                idPrefix={`${id}.0`}\r\n                formikProps={formikProps}\r\n                disabled\r\n            />\r\n            <Select\r\n                label={Tr('position_type')}\r\n                formikProps={formikProps}\r\n                id={typeId}\r\n                required\r\n                disabled\r\n                items={ItemTypes}\r\n            />\r\n            <Select\r\n                label={Tr('offerVatPredefined_short')}\r\n                formikProps={formikProps}\r\n                id={predefinedVatId}\r\n                required\r\n                disabled\r\n                items={BooleanItems}\r\n            />\r\n            <Select\r\n                label={Tr('offerSourceType_short')}\r\n                formikProps={formikProps}\r\n                id={offerSourceTypeId}\r\n                required\r\n                disabled\r\n                items={OfferSourceTypes}\r\n                showErrorWithoutTouched\r\n            />\r\n            <Select\r\n                label={Tr('allowQuantityEditInOffer_short')}\r\n                formikProps={formikProps}\r\n                id={allowQuantityEditInOfferId}\r\n                required\r\n                disabled\r\n                items={BooleanItems}\r\n            />\r\n            {weightVisible && <TextInput\r\n                id={weightId}\r\n                type={INPUT_TYPE.NUMBER_19}\r\n                step=\"0.01\"\r\n                label={Tr('weight')}\r\n                endAdornment={'%'}\r\n                formikProps={formikProps}\r\n                required\r\n                disabled\r\n            />}\r\n            {editable ?\r\n                <WorkableIconEditButton\r\n                    onClick={() => handleEditItem(0)}\r\n                />\r\n                :\r\n                <WorkableIconPreviewButton\r\n                    onClick={() => handleEditItem(0)}\r\n                />\r\n            }\r\n            <WorkableIconAddButton\r\n                tooltip={Tr('add_option')}\r\n                onClick={() => handleEditItem(0, true)}\r\n                disabled={!editable || !!optionalItem}\r\n            />\r\n            <div/>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nSingleVariant.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(SingleVariant);","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Units from './Units';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport removeFormikListElement from 'libs/removeFormikListElement';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport clsx from 'clsx';\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport Select from \"components/Select\";\r\nimport OfferSourceTypes from \"constants/OfferSourceTypes\";\r\nimport {ItemTypes} from \"../../constants/itemTypes\";\r\nimport WorkableIconAddButton from \"components/button/WorkableIconAddButton\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            flexBasis: 0,\r\n\r\n            '&:not(:first-child)': {\r\n                marginLeft: theme.spacing(2),\r\n            },\r\n            '&:nth-child(2)': {\r\n                flexGrow: 4\r\n            },\r\n            '&:nth-child(3)': {\r\n                flexGrow: 2\r\n            },\r\n            '&:nth-child(4)': {\r\n                flexGrow: 1\r\n            },\r\n            '&:nth-child(5)': {\r\n                flexGrow: 1\r\n            },\r\n            '&:nth-child(6)': {\r\n                flexGrow: 1\r\n            },\r\n            '&:nth-child(7)': {\r\n                flexGrow: 1.6\r\n            }\r\n        }\r\n    },\r\n    rootWeight: {\r\n        '&>*': {\r\n            '&:nth-child(8)': {\r\n                flexGrow: 1\r\n            },\r\n        }\r\n    }\r\n})\r\n\r\nfunction MultiVariant(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        index,\r\n        option = false,\r\n        handleEditItem,\r\n        weightVisible,\r\n        showConfirmBeforeDelete\r\n    }) {\r\n    const objectPath = option ? `${id}.${index}.optionalItem` : `${id}.${index}`;\r\n    const nameId = `${objectPath}.name`;\r\n    const typeId = `${objectPath}.type`;\r\n    const allowQuantityEditInOfferId = `${objectPath}.allowQuantityEditInOffer`;\r\n    const predefinedVatId = `${objectPath}.offerVatPredefined`;\r\n    const offerSourceTypeId = `${objectPath}.offerSourceType`;\r\n    const weightId = `${objectPath}.weight`;\r\n    const optionalItem = getObjectValue(`${objectPath}.optionalItem`, formikProps.values, null);\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const oneBaseItem = getObjectValue(id, formikProps.values, []).length <= 1;\r\n\r\n    const handleDelete = () => {\r\n        if (option) {\r\n            formikProps.setFieldValue(objectPath, null);\r\n        } else if (!!optionalItem) {\r\n            showConfirmBeforeDelete(id, index);\r\n        } else {\r\n            removeFormikListElement(formikProps, id, index)\r\n        }\r\n    }\r\n\r\n    return (\r\n        <GridBlock\r\n            className={clsx(classes.root, {\r\n                [classes.rootWeight]: weightVisible\r\n            })}\r\n        >\r\n            <Typography variant='body1'>\r\n                {option ? '-' : (index + 1)}\r\n            </Typography>\r\n            <TextInput\r\n                id={nameId}\r\n                label={Tr('name')}\r\n                formikProps={formikProps}\r\n                required\r\n                multiline\r\n                disabled\r\n            />\r\n            <Units\r\n                idPrefix={objectPath}\r\n                formikProps={formikProps}\r\n                disabled\r\n            />\r\n            <Select\r\n                label={Tr('position_type')}\r\n                formikProps={formikProps}\r\n                id={typeId}\r\n                required\r\n                disabled\r\n                items={ItemTypes}\r\n            />\r\n            <Select\r\n                label={Tr('offerVatPredefined_short')}\r\n                formikProps={formikProps}\r\n                id={predefinedVatId}\r\n                required\r\n                disabled\r\n                items={BooleanItems}\r\n            />\r\n            <Select\r\n                label={Tr('offerSourceType_short')}\r\n                formikProps={formikProps}\r\n                id={offerSourceTypeId}\r\n                required\r\n                disabled\r\n                items={OfferSourceTypes}\r\n                showErrorWithoutTouched\r\n            />\r\n            <Select\r\n                label={Tr('allowQuantityEditInOffer_short')}\r\n                formikProps={formikProps}\r\n                id={allowQuantityEditInOfferId}\r\n                required\r\n                disabled\r\n                items={BooleanItems}\r\n            />\r\n            {weightVisible && <TextInput\r\n                id={weightId}\r\n                type={INPUT_TYPE.NUMBER_19}\r\n                step=\"0.01\"\r\n                label={Tr('weight')}\r\n                endAdornment={'%'}\r\n                formikProps={formikProps}\r\n                required\r\n                disabled\r\n            />}\r\n            {editable ?\r\n                <WorkableIconEditButton\r\n                    onClick={() => handleEditItem(index, option)}\r\n                />\r\n                :\r\n                <WorkableIconPreviewButton\r\n                    onClick={() => handleEditItem(index, option)}\r\n                />\r\n            }\r\n            <WorkableIconDeleteButton\r\n                onClick={handleDelete}\r\n                disabled={!editable || (!option && oneBaseItem)}\r\n            />\r\n            <WorkableIconAddButton\r\n                tooltip={Tr('add_option')}\r\n                onClick={() => handleEditItem(index, true)}\r\n                disabled={!editable || option || !!optionalItem}\r\n            />\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nMultiVariant.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(MultiVariant);","import OFFER_VAT_ITEMS, {SELECT_VALUE} from \"constants/VATItems\";\r\nimport TextInput from \"./TextInput\";\r\nimport Tr from \"translations/Translations\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport {IconButton, InputAdornment, withStyles} from \"@material-ui/core\";\r\nimport CloseIcon from \"@material-ui/icons/Close\";\r\nimport Select from \"./Select\";\r\nimport React from \"react\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n\r\n    },\r\n    grid: {\r\n        '&>*': {\r\n            flexGrow: 1,\r\n            '&:not(:first-child)': {\r\n                marginLeft: theme.spacing(2)\r\n            }\r\n        }\r\n    },\r\n    iconButton: {\r\n        padding: theme.spacing(1) / 2,\r\n    },\r\n    otherTextInput: {\r\n        '& input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button': {\r\n            '-webkit-appearance': 'none',\r\n            margin: 0\r\n        }\r\n    }\r\n})\r\n\r\nfunction VatField({\r\n    classes,\r\n    formikProps,\r\n    required,\r\n    editable,\r\n    title = 'vat'\r\n}) {\r\n    const vatRateId = 'offerVatRate';\r\n    const vatRateOtherId = 'offerVatRateOther';\r\n    const vatOption = getObjectValue(vatRateId, formikProps.values, null);\r\n\r\n    const closeTextInput = () => {\r\n        formikProps.setFieldValue(vatRateId, \"\")\r\n    }\r\n\r\n    return (\r\n        <>\r\n            {vatOption === SELECT_VALUE.OTHER ?\r\n                <TextInput\r\n                    id={vatRateOtherId}\r\n                    formikProps={formikProps}\r\n                    className={classes.otherTextInput}\r\n                    label={Tr(title)}\r\n                    type={INPUT_TYPE.NUMBER_POSITIVE_AMOUNT}\r\n                    endAdornment={\r\n                        <InputAdornment position='end'>\r\n                            %\r\n                            <IconButton\r\n                                onClick={closeTextInput}\r\n                                className={classes.iconButton}\r\n                                disabled={!editable}\r\n                            >\r\n                                <CloseIcon />\r\n                            </IconButton>\r\n                        </InputAdornment>\r\n                    }\r\n                    required={required}\r\n                />\r\n                :\r\n                <Select\r\n                    id={vatRateId}\r\n                    formikProps={formikProps}\r\n                    items={OFFER_VAT_ITEMS}\r\n                    label={Tr(title)}\r\n                    required={required}\r\n                />\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nexport default withStyles(style)(VatField);","import Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport React from \"react\";\r\nimport useId from \"hooks/useId\";\r\nimport Form from \"components/Form\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Units from \"./Units\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport InputLimits from \"constants/InputLimits\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport {withStyles} from '@material-ui/core';\r\nimport {connect} from \"react-redux\";\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport {SOURCE_TYPES} from \"constants/OfferSourceTypes\";\r\nimport OfferSourceTypes from \"constants/OfferSourceTypes\";\r\nimport Select from \"components/Select\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport VatField from \"components/VatField\";\r\nimport {SELECT_VALUE} from \"constants/VATItems\";\r\nimport {PriceTypeVatFieldVisible, PriceTypeNetFieldVisible, PriceTypeGrossFieldVisible} from \"constants/PriceTypes\";\r\nimport NetGrossField from \"components/NetGrossField\";\r\nimport {ItemTypes} from \"../../constants/itemTypes\";\r\n\r\nconst style = theme => ({\r\n    actions: {\r\n        marginTop: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction ItemPopup(\r\n    {\r\n        editable,\r\n        onClose,\r\n        onSubmit,\r\n        itemElement,\r\n        weightVisible,\r\n        classes,\r\n        formSubmit,\r\n        priceType\r\n    }) {\r\n    const formId = useId();\r\n    const inputLimits = InputLimits.procedure.dealings;\r\n    const option = !!itemElement.baseItemId;\r\n\r\n    const handleClose = () => {\r\n        onClose();\r\n    }\r\n\r\n    const handleSave = () => {\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const handleSubmit = (values) => {\r\n        onSubmit(values);\r\n    }\r\n\r\n    const validationSchema = (priceType) => {\r\n        return VS.object({\r\n            name: VS.stringMax(inputLimits.NAME).nullable(),\r\n            description: VS.stringMaxNoRq(100000).nullable(),\r\n            quantity: VS.object({\r\n                value: VS.numberMax(1000000000000000),\r\n                uom: VS.string().nullable()\r\n            }),\r\n            type: VS.string(),\r\n            offerVatPredefined: VS.string(),\r\n            offerSourceType: VS.string(),\r\n            offerValue: VS.any().when(\"offerSourceType\", {\r\n                is: offerSourceType => SOURCE_TYPES.INITIATOR === offerSourceType && PriceTypeNetFieldVisible(priceType),\r\n                then: VS.amount(0, false),\r\n                otherwise: VS.any()\r\n            }),\r\n            offerVatRate: VS.any().when([\"offerVatPredefined\", \"offerSourceType\"], {\r\n                is: (offerVatPredefined, offerSourceType) =>  {\r\n                    return offerVatPredefined === true || offerVatPredefined === 'true' || (SOURCE_TYPES.INITIATOR === offerSourceType && PriceTypeVatFieldVisible(priceType))\r\n                },\r\n                then: VS.string(),\r\n                otherwise: VS.any()\r\n            }),\r\n            offerVatRateOther: VS.any().when([\"offerVatPredefined\", \"offerSourceType\", \"offerVatRate\"], {\r\n                is: (offerVatPredefined, offerSourceType, offerVatRate) =>  {\r\n                    return (offerVatPredefined === true || offerVatPredefined === 'true' || SOURCE_TYPES.INITIATOR === offerSourceType) && offerVatRate === SELECT_VALUE.OTHER\r\n                },\r\n                then: VS.amountMax100(),\r\n                otherwise: VS.any()\r\n            }),\r\n            offerGrossValue: VS.any().when(\"offerSourceType\", {\r\n                is: offerSourceType => SOURCE_TYPES.INITIATOR === offerSourceType && PriceTypeGrossFieldVisible(priceType),\r\n                then: VS.amount(0, false),\r\n                otherwise: VS.any()\r\n            }),\r\n            weight: weightVisible ? VS.amountMax100NoZero() : VS.amountMax100Optional()\r\n        });\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={!!itemElement.identity ? Tr('edit_item') : Tr('new_item')}\r\n            open={true}\r\n            maxWidth={'md'}\r\n            onClose={handleClose}\r\n            transitionDuration={0}\r\n        >\r\n            <Form\r\n                id={formId}\r\n                onSubmit={handleSubmit}\r\n                initialValues={{\r\n                    name: itemElement.name,\r\n                    description: itemElement.description,\r\n                    quantity: {\r\n                        value: itemElement.quantity.value,\r\n                        uom: itemElement.quantity.uom,\r\n                    },\r\n                    type: itemElement.type,\r\n                    baseItemId: itemElement.baseItemId,\r\n                    baseItemName: itemElement.baseItemName,\r\n                    weight: itemElement.weight,\r\n                    offerVatPredefined: itemElement.offerVatPredefined,\r\n                    offerVatRate: itemElement.offerVatRate,\r\n                    offerVatRateOther: itemElement.offerVatRateOther,\r\n                    offerSourceType: itemElement.offerSourceType,\r\n                    offerValue: itemElement.offerValue,\r\n                    offerGrossValue: itemElement.offerGrossValue,\r\n                    allowQuantityEditInOffer: itemElement.allowQuantityEditInOffer,\r\n                    _editable: editable,\r\n                }}\r\n                validationSchema={validationSchema(priceType)}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <TextInput\r\n                            id={'name'}\r\n                            label={Tr('name')}\r\n                            formikProps={formikProps}\r\n                            limit={inputLimits.NAME}\r\n                            required\r\n                            multiline\r\n                        />\r\n                        <TextInput\r\n                            id={'description'}\r\n                            label={Tr('description')}\r\n                            formikProps={formikProps}\r\n                            multiline\r\n                        />\r\n                        <Units\r\n                            formikProps={formikProps}\r\n                            unitDisabled={!!itemElement.baseItemId}\r\n                        />\r\n                        <Select\r\n                            label={Tr('position_type')}\r\n                            formikProps={formikProps}\r\n                            id={'type'}\r\n                            required\r\n                            disabled\r\n                            items={ItemTypes}\r\n                        />\r\n                        {option && <TextInput\r\n                            id={'baseItemName'}\r\n                            label={Tr('position_type_basic')}\r\n                            formikProps={formikProps}\r\n                            multiline\r\n                            disabled\r\n                        />}\r\n                        {!option && <Select\r\n                            label={Tr('offerVatPredefined')}\r\n                            formikProps={formikProps}\r\n                            id={'offerVatPredefined'}\r\n                            required\r\n                            disabled={!PriceTypeVatFieldVisible(priceType)}\r\n                            items={BooleanItems}\r\n                        />}\r\n                        {!option && getObjectValue('offerVatPredefined', formikProps.values, false) &&\r\n                            <VatField\r\n                                formikProps={formikProps}\r\n                                required\r\n                                editable={editable}\r\n                                title={'offerVatPredefinedValue'}\r\n                            />\r\n                        }\r\n                        {!option && <Select\r\n                            label={Tr('offerSourceType_long')}\r\n                            formikProps={formikProps}\r\n                            id={'offerSourceType'}\r\n                            required\r\n                            items={OfferSourceTypes}\r\n                        />}\r\n                        {!option && getObjectValue('offerSourceType', formikProps.values, SOURCE_TYPES.SUPPLIER) === SOURCE_TYPES.INITIATOR &&\r\n                        <NetGrossField\r\n                            pathPrefix={'offer'}\r\n                            formikProps={formikProps}\r\n                            required\r\n                            editable={editable}\r\n                            title={Tr('offerSourceType_value')}\r\n                            priceType={priceType}\r\n                        />\r\n                        }\r\n                        {!option && <Select\r\n                            label={Tr('allowQuantityEditInOffer_long')}\r\n                            formikProps={formikProps}\r\n                            id={'allowQuantityEditInOffer'}\r\n                            required\r\n                            items={BooleanItems}\r\n                        />}\r\n                        {weightVisible && <TextInput\r\n                            id={'weight'}\r\n                            type={INPUT_TYPE.NUMBER_19}\r\n                            step=\"0.01\"\r\n                            label={Tr('weight')}\r\n                            endAdornment={'%'}\r\n                            formikProps={formikProps}\r\n                            required\r\n                        />}\r\n                    </>\r\n                )}\r\n            </Form>\r\n            <div className={classes.actions}>\r\n                {editable && <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={!!itemElement ? Tr('save') : Tr('add')}\r\n                    onClickFirst={handleClose}\r\n                    onClickSecond={handleSave}\r\n                />}\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(withStyles(style)(ItemPopup));","import React, {useEffect, useState} from 'react'\r\nimport {Divider, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport SingleVariant from './positions/SingleVariant';\r\nimport MultiVariant from './positions/MultiVariant';\r\nimport Tr from 'translations/Translations';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport AddButton from 'components/button/AddButton';\r\nimport {newItem} from '../constants/initialValues';\r\nimport ItemPopup from './positions/ItemPopup';\r\nimport _ from 'lodash';\r\nimport {CRYTERIUM_TYPE} from \"components/popup/newCriteria/constants/criterium.type\";\r\nimport {PriceDirections} from \"constants/DirectionsItems\";\r\nimport {ITEM_TYPES} from \"../constants/itemTypes\";\r\nimport Confirm from \"../../../../../../../../components/popup/confirm/Confirm\";\r\nimport removeFormikListElement from \"../../../../../../../../libs/removeFormikListElement\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        width: '100%',\r\n        '&>*': {\r\n            width: 'inherit'\r\n        }\r\n    },\r\n    header: {\r\n        marginTop: theme.spacing(1),\r\n        marginBottom: theme.spacing(1),\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n    divider: {\r\n        marginTop: theme.spacing(1),\r\n        marginBottom: theme.spacing(1),\r\n    }\r\n})\r\n\r\nfunction PositionsSection({\r\n    classes,\r\n    formikProps,\r\n    id,\r\n    dealingId,\r\n    priceType\r\n}) {\r\n\r\n    const [editingItem, setEditingItem] = useState(null);\r\n    const [deleteConfirm, setDeleteConfirm] = useState(false);\r\n    const [deleteFunctionParams, setDeleteFunctionParams] = useState(null);\r\n\r\n    const criterions = getObjectValue(`${dealingId}.stages.0.criterions`, formikProps.values, [])\r\n    const section = criterions.find(x => x.type === CRYTERIUM_TYPE.PRICE);\r\n    const weightVisible = section && section.direction === PriceDirections.DESCENDING_BY_PRICE_ITEMS;\r\n    const elements = getObjectValue(id, formikProps.values)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const criteriaSumError = getObjectValue(`${dealingId}._weightSum`, formikProps.errors, [])\r\n    const isError = !!criteriaSumError;\r\n\r\n    const handleAddItem = () => {\r\n        setEditingItem(_.cloneDeep(newItem));\r\n    }\r\n\r\n    const handleShowItem = (index, option) => {\r\n        let clonedItem;\r\n        if (option) {\r\n            if (elements[index].optionalItem) {\r\n                clonedItem = _.cloneDeep(elements[index].optionalItem);\r\n            } else {\r\n                clonedItem = _.cloneDeep(newItem);\r\n                clonedItem.type = ITEM_TYPES.OPTIONAL;\r\n                clonedItem.quantity.uom = elements[index].quantity.uom;\r\n            }\r\n            clonedItem.baseItemId = elements[index].identity;\r\n            clonedItem.baseItemName = elements[index].name;\r\n        } else {\r\n            clonedItem = _.cloneDeep(elements[index]);\r\n        }\r\n        setEditingItem(clonedItem);\r\n    }\r\n\r\n    const handleCloseEditItem = () => {\r\n        setEditingItem(null);\r\n    }\r\n\r\n    const handleEditItem = (values) => {\r\n        const dealing = getObjectValue(`${dealingId}.identity`, formikProps.values);\r\n        if (!!editingItem.baseItemId) {\r\n            const index = elements.findIndex(x => x.identity === editingItem.baseItemId);\r\n            elements[index].optionalItem = {\r\n                ...values,\r\n                identity: !!values.identity && values.identity > 0 ? values.identity : -1,\r\n                quantity: {\r\n                    ...values.quantity,\r\n                    uom: elements[index].quantity.uom\r\n                },\r\n                offerVatPredefined: elements[index].offerVatPredefined,\r\n                offerSourceType: elements[index].offerSourceType,\r\n                offerValue: elements[index].offerValue,\r\n                offerVatRate: elements[index].offerVatRate,\r\n                offerVatRateOther: elements[index].offerVatRateOther,\r\n                offerGrossValue: elements[index].offerGrossValue,\r\n                allowQuantityEditInOffer: elements[index].allowQuantityEditInOffer\r\n            }\r\n        } else if (!editingItem.identity) {\r\n            const mindIdFound = elements.map(e => e.identity).reduce((x1, x2) => x1 < x2 ? x1 : x2);\r\n            const newId = mindIdFound < 0 ? (mindIdFound - 1) : -1;\r\n            elements.push({\r\n                ...values,\r\n                identity: newId,\r\n                dealing: dealing\r\n            });\r\n        } else {\r\n            const index = elements.findIndex(x => x.identity === editingItem.identity);\r\n            const oldItem = elements[index];\r\n            elements[index] = {\r\n                ...values,\r\n                identity: oldItem.identity,\r\n                dealing: oldItem.dealing,\r\n                optionalItem: oldItem.optionalItem\r\n            };\r\n            if (elements[index].optionalItem) {\r\n                elements[index].optionalItem.quantity.uom = elements[index].quantity.uom;\r\n                elements[index].optionalItem.offerVatPredefined = elements[index].offerVatPredefined;\r\n                elements[index].optionalItem.offerSourceType = elements[index].offerSourceType;\r\n                elements[index].optionalItem.offerValue = elements[index].offerValue;\r\n                elements[index].optionalItem.offerVatRate = elements[index].offerVatRate;\r\n                elements[index].optionalItem.offerVatRateOther = elements[index].offerVatRateOther;\r\n                elements[index].optionalItem.offerGrossValue = elements[index].offerGrossValue;\r\n                elements[index].optionalItem.allowQuantityEditInOffer = elements[index].allowQuantityEditInOffer;\r\n            }\r\n        }\r\n        formikProps.setFieldValue(id, elements);\r\n        setEditingItem(null);\r\n    }\r\n\r\n    const renderSingle = () => {\r\n        return (\r\n            <>\r\n                <SingleVariant\r\n                    formikProps={formikProps}\r\n                    id={id}\r\n                    handleEditItem={handleShowItem}\r\n                    weightVisible={weightVisible}\r\n                />\r\n            </>\r\n        )\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (elements.length < 2) {\r\n            const elId = `${id}.0.name`\r\n            formikProps.setFieldTouched(elId, false)\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [elements.length]);\r\n\r\n    const showDeleteConfirm = (idParam, indexParam) => {\r\n        setDeleteConfirm(true);\r\n        setDeleteFunctionParams([idParam, indexParam]);\r\n    }\r\n\r\n    const doDeleteAfterConfirm = () => {\r\n        setDeleteConfirm(false);\r\n        removeFormikListElement(formikProps, deleteFunctionParams[0], deleteFunctionParams[1])\r\n    }\r\n\r\n    const renderMulti = () => {\r\n        return (\r\n            <>\r\n                <Divider/>\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.header}\r\n                >\r\n                    {Tr('positions')}({elements.length})\r\n                </Typography>\r\n                {\r\n                    elements.map((item, i) => {\r\n                        return (\r\n                            <React.Fragment key={`item.${item.identity}`}>\r\n                                <MultiVariant\r\n                                    formikProps={formikProps}\r\n                                    id={id}\r\n                                    index={i}\r\n                                    handleEditItem={handleShowItem}\r\n                                    weightVisible={weightVisible}\r\n                                    showConfirmBeforeDelete={showDeleteConfirm}\r\n                                />\r\n                                {item.optionalItem &&\r\n                                <MultiVariant\r\n                                    formikProps={formikProps}\r\n                                    id={id}\r\n                                    index={i}\r\n                                    option={true}\r\n                                    handleEditItem={handleShowItem}\r\n                                    weightVisible={weightVisible}\r\n                                    showConfirmBeforeDelete={showDeleteConfirm}\r\n                                />\r\n                                }\r\n                            </React.Fragment>\r\n                        )\r\n                    })\r\n                }\r\n            </>\r\n        )\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                className={classes.root}\r\n                column\r\n            >\r\n                {elements.length < 2 && elements[0].optionalItem == null ? renderSingle() : renderMulti()}\r\n                <GridBlock justify='space-between'>\r\n                    <AddButton\r\n                        onClick={handleAddItem}\r\n                        disabled={!editable}\r\n                    >\r\n                        {Tr('add_position')}\r\n                    </AddButton>\r\n                    {(isError) &&\r\n                    <Typography variant='body1' color='error'>\r\n                        {criteriaSumError}\r\n                    </Typography>\r\n                    }\r\n                    <></>\r\n                </GridBlock>\r\n                <Divider\r\n                    className={classes.divider}\r\n                />\r\n            </GridBlock>\r\n            {!!editingItem && <ItemPopup\r\n                editable={editable}\r\n                onClose={handleCloseEditItem}\r\n                onSubmit={handleEditItem}\r\n                itemElement={editingItem}\r\n                weightVisible={weightVisible}\r\n                priceType={priceType}\r\n            />}\r\n            {deleteConfirm && <Confirm\r\n                open={deleteConfirm}\r\n                onConfirm={doDeleteAfterConfirm}\r\n                onCancel={() => {\r\n                    setDeleteConfirm(false);\r\n                    setDeleteFunctionParams(null);\r\n                }}\r\n                confirmText=\"positions_with_option_delete\"\r\n            />}\r\n        </>)\r\n}\r\n\r\nPositionsSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(PositionsSection);","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport clsx from 'clsx';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconEditButton from 'components/button/WorkableIconEditButton';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginRight: theme.spacing(1),\r\n    },\r\n    disableDelete: {\r\n        marginRight: theme.spacing(3)\r\n    }\r\n})\r\n\r\nfunction ConditionElement(\r\n    {\r\n        classes,\r\n        name,\r\n        index,\r\n        id,\r\n        formikProps,\r\n        onEdit,\r\n        onDelete,\r\n        disableDelete = false,\r\n        disabled,\r\n    }) {\r\n\r\n    return (\r\n        <GridBlock\r\n            wrap='nowrap'\r\n            alignItems='center'\r\n            className={classes.root}\r\n        >\r\n            <Typography variant='body1'>\r\n                {name}\r\n            </Typography>\r\n            <WorkableIconEditButton\r\n                onClick={onEdit}\r\n                className={clsx({\r\n                    [classes.disableDelete]: disableDelete\r\n                })}\r\n            />\r\n            {!disableDelete &&\r\n            <WorkableIconDeleteButton\r\n                onClick={() => onDelete(index)}\r\n                disabled={disabled}\r\n            />\r\n            }\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nConditionElement.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ConditionElement);","import React from 'react'\r\nimport {Checkbox as MuiCheckbox, FormHelperText, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport SimpleTable from 'components/complex/simpleTable/SimpleTable';\r\nimport Checkbox from 'components/Checkbox';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport clsx from \"clsx\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    textBold: {\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n    samllColumn: theme.components.table.lpColumn,\r\n    orderColumn: theme.components.table.ipColumn,\r\n    checkboxColumn: {\r\n        width: theme.spacing()\r\n    },\r\n    cells: {\r\n        paddingTop: theme.spacing(1),\r\n        paddingBottom: theme.spacing(1),\r\n    },\r\n    checkbox: {\r\n        padding: 0,\r\n    },\r\n    cursor: {\r\n        cursor: \"pointer\"\r\n    }\r\n})\r\n\r\nfunction PartsTable(\r\n    {\r\n        classes,\r\n        className,\r\n        formikProps,\r\n        id,\r\n        elementList = [],\r\n        label,\r\n        orderLabel = \"part_number\",\r\n        editable = true,\r\n        required=true,\r\n        disabled\r\n    }) {\r\n    const elements = getObjectValue(id, formikProps.values, []);\r\n    const errorValue = getObjectValue(id, formikProps.errors, '');\r\n    const touched = getObjectValue(id, formikProps.touched, false);\r\n    const isAllChecked = elementList.length > 0 && !elementList.find(x => elements[x.identity] !== true)\r\n\r\n    const handleHeadCheckboxChange = (e, value) => {\r\n        const newElements = elementList.reduce((acc, x) => {\r\n            return {\r\n                ...acc,\r\n                [x.identity]: value\r\n            }\r\n        }, {})\r\n        formikProps.setFieldValue(id, newElements)\r\n    }\r\n\r\n    const isError = editable && !!errorValue && Boolean(touched);\r\n    const helperText = errorValue || ' ';\r\n    const hasOrder = !!(elementList?.[0]?.order);\r\n    return (\r\n        <GridBlock\r\n            className={clsx(classes.root, className)}\r\n            column\r\n        >\r\n            <Typography\r\n                variant='body1'\r\n                className={classes.textBold}\r\n            >\r\n                {label ? label : Tr('assign_to_part')}{required ? '*' : ''}\r\n            </Typography>\r\n            <SimpleTable\r\n                headers={[\r\n                    <MuiCheckbox\r\n                        color='primary'\r\n                        className={classes.checkbox}\r\n                        onChange={handleHeadCheckboxChange}\r\n                        checked={isAllChecked}\r\n                        disabled={disabled}\r\n                    />,\r\n                    (hasOrder ?  Tr(orderLabel) : Tr('column_lp')),\r\n                    Tr('name')\r\n                ]}\r\n                items={elementList.map((x, i) => {\r\n                    return [\r\n                        <Checkbox\r\n                            id={`${id}.${x.identity}`}\r\n                            formikProps={formikProps}\r\n                            checkboxClassName={classes.checkbox}\r\n                            htmlId={`${id}.${x.identity}`}\r\n                            disabled={disabled}\r\n                        />,\r\n                        <label className={classes.cursor} htmlFor={`${id}.${x.identity}`}>{!!x.order ? x.order : i + 1}</label>,\r\n                        <label className={classes.cursor} htmlFor={`${id}.${x.identity}`}>{x.name}</label>,\r\n                    ]\r\n                })}\r\n                cellClassName={classes.cells}\r\n                columnClasses={[\r\n                    classes.checkboxColumn,\r\n                    hasOrder ? classes.orderColumn : classes.samllColumn\r\n                ]}\r\n            />\r\n            {isError && <FormHelperText error>{helperText}</FormHelperText>}\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nPartsTable.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(PartsTable);\r\n","import * as Yup from 'yup'\r\nimport { CONDITION_TYPE_OTHER } from './condition.values'\r\nimport ValidationShema from 'constants/ValidationShema';\r\nimport Tr from 'translations/Translations';\r\nimport ImputLimits from 'constants/InputLimits';\r\n\r\nconst limits = ImputLimits.procedure.condition;\r\n\r\nexport default (selectedItems) => Yup.lazy(values => {\r\n\tif (values.type !== CONDITION_TYPE_OTHER) {\r\n\t\treturn Yup.object()\r\n\t}\r\n\tconst reg = '^(?!(' + selectedItems.map(x => x.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|')+ ')$).*$';\r\n\tconst otherNameRegExp = new RegExp(reg)\r\n\treturn Yup.object().shape({\r\n\t\totherName: ValidationShema.stringExactlyMax(\r\n\t\t\totherNameRegExp,\r\n\t\t\tTr('v_condition_exist'),\r\n\t\t\tlimits.OTHER_NAME\r\n\t\t)\r\n\t})\r\n})","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport Select from 'components/Select';\r\nimport conditionValues, {CONDITION_TYPE_OTHER, CONDITIONS_LABEL, CONDITIONS_LABEL_PZP_2021, conditionValues_PZP_2021} from './constants/condition.values';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport PartsTable from 'components/PartsTable';\r\nimport validationSchema from './constants/validation.form'\r\nimport ImputLimits from 'constants/InputLimits';\r\nimport {getDemandPZPType, isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport PZPType from \"constants/PZPType\";\r\n\r\nconst limits = ImputLimits.procedure.condition;\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t},\r\n\tuploadFile: {\r\n\t\tmarginBottom: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction ConditionForm({\r\n\tclasses,\r\n\tonSubmit = () => { },\r\n\tid,\r\n\tpartId,\r\n\tinitValues,\r\n\telementList,\r\n\tselectedItems,\r\n\teditable,\r\n}) {\r\n\r\n\tconst demandPzpType = getDemandPZPType();\r\n\tconst conditionLabels = PZPType.PZP_2021 === demandPzpType ? CONDITIONS_LABEL_PZP_2021 : CONDITIONS_LABEL;\r\n\tconst conditionValuesDict = PZPType.PZP_2021 === demandPzpType ? conditionValues_PZP_2021 : conditionValues;\r\n\r\n\tconst getInitialValues = (typeElements) => {\r\n\t\tif (initValues !== undefined) {\r\n\t\t\treturn {\r\n\t\t\t\t...initValues,\r\n\t\t\t\tparts: {\r\n\t\t\t\t\t[partId]: true,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\ttype: typeElements[0].value,\r\n\t\t\tdescription: '',\r\n\t\t\tparts: {\r\n\t\t\t\t[partId]: true,\r\n\t\t\t},\r\n\t\t\totherName: '',\r\n\t\t\tfile: null,\r\n\t\t}\r\n\t}\r\n\r\n\tconst getNames = () => {\r\n\t\tlet selected = selectedItems.map(x => {\r\n\t\t\tif (x.type === CONDITION_TYPE_OTHER) return x.otherName;\r\n\t\t\treturn conditionLabels[x.type];\r\n\t\t})\r\n\t\tif (initValues !== undefined) {\r\n\t\t\tlet initValuesName = conditionLabels[initValues.type];\r\n\t\t\tif (initValues.type === CONDITION_TYPE_OTHER) {\r\n\t\t\t\tinitValuesName = initValues.otherName;\r\n\t\t\t}\r\n\t\t\tvar index = selected.indexOf(initValuesName);\r\n\t\t\tif (index > -1) {\r\n\t\t\t\tselected.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn selected;\r\n\t}\r\n\r\n\r\n\tconst typeElements = conditionValuesDict.reduce((acc, item) => {\r\n\t\tif (item.value === CONDITION_TYPE_OTHER) return [...acc, item];\r\n\t\tif (initValues !== undefined) {\r\n\t\t\tif (item.value === initValues.type) {\r\n\t\t\t\treturn [...acc, item]\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (selectedItems.find(x => x.type === item.value)) {\r\n\t\t\treturn acc;\r\n\t\t}\r\n\t\treturn [...acc, item]\r\n\t}, [])\r\n\r\n\treturn (\r\n\t\t<Form\r\n\t\t\tid={id}\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tinitialValues={{\r\n\t\t\t\t...getInitialValues(typeElements),\r\n\t\t\t\t_editable: editable,\r\n\t\t\t}}\r\n\t\t\tvalidationSchema={validationSchema(getNames())}\r\n\t\t>\r\n\t\t\t{(formikProps) => (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<Select\r\n\t\t\t\t\t\tid={'type'}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\titems={typeElements}\r\n\t\t\t\t\t\tlabel={Tr('condition')}\r\n\t\t\t\t\t\tdisabled={!isDemandPreparing() && !!initValues}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{formikProps.values.type === CONDITION_TYPE_OTHER &&\r\n\t\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\t\tid='otherName'\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tlabel={Tr('condition_name')}\r\n\t\t\t\t\t\t\tlimit={limits.OTHER_NAME}\r\n\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\tdisabled={!isDemandPreparing() && !!initValues}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid={'description'}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('condition_description')}\r\n\t\t\t\t\t\tmultiline\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t{/*<Box component=\"div\" className={classes.uploadFile}>\r\n\t\t\t\t\t\t<UploadFile\r\n\t\t\t\t\t\t\tid=\"attachments\"\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tlabel={Tr(\"attachment\")}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Box>*/}\r\n\t\t\t\t\t{elementList.length > 1 &&\r\n\t\t\t\t\t\t<PartsTable\r\n\t\t\t\t\t\t\tid={'parts'}\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\telementList={elementList}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\t\t</Form>\r\n\t)\r\n}\r\n\r\nConditionForm.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ConditionForm);","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport useId from 'hooks/useId';\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport ConditionForm from './ConditionForm';\r\n\r\nconst style = theme => ({\r\n    root: {}\r\n})\r\n\r\nfunction NewCondition(\r\n    {\r\n        classes,\r\n        onAdd,\r\n        onClose,\r\n        formSubmit,\r\n    \tpartId,\r\n        initValues,\r\n        elementList,\r\n        selectedItems,\r\n        showParts\r\n    }) {\r\n    const formId = useId();\r\n\r\n    const handleClose = () => {\r\n        onClose();\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        formSubmit[formId]()\r\n    }\r\n\r\n    const handleAdd = (values) => {\r\n        onAdd(values);\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={initValues ? Tr('edit_condition') : Tr('new_condition')}\r\n            open={true}\r\n            maxWidth={'md'}\r\n            onClose={handleClose}\r\n            transitionDuration={0}\r\n        >\r\n            <ConditionForm\r\n                initValues={initValues}\r\n                editable={showParts}\r\n                onSubmit={handleAdd}\r\n                id={formId}\r\n\t\t\t\tpartId={partId}\r\n                elementList={elementList}\r\n                selectedItems={selectedItems}\r\n            />\r\n            <div className={classes.actions}>\r\n                {showParts && <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={initValues ? Tr('save') : Tr('add')}\r\n                    onClickFirst={handleClose}\r\n                    onClickSecond={handleSubmit}\r\n                />}\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nNewCondition.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(withStyles(style)(NewCondition));","\r\nconst setObjectValue = (idArray, obj, value) => {\r\n\tconst id = idArray.shift();\r\n\tif(idArray.length > 0){\r\n\t\tlet subObj = setObjectValue(idArray, obj[id], value);\r\n\t\tobj[id] = subObj;\r\n\t\treturn obj;\r\n\t} else {\r\n\t\tobj[id] = value;\r\n\t\treturn obj;\r\n\t}\r\n}\r\n\r\nexport default (id, obj, value) => {\r\n\tif(id === undefined) return;\r\n\tlet idArray = id.split('.')\r\n\tsetObjectValue(idArray, obj, value);\r\n};","\r\nexport default {\r\n\tPARAMETERS: \"parameters\",\r\n\tCRITERIONS: \"criterions\",\r\n\tCONDITIONS: \"conditions\",\r\n\tITEM_PARAMETERS: \"itemParameters\"\r\n}","import getObjectValue from 'libs/getObjectValue';\r\nimport reduxStore from 'redux/store'\r\nimport DealingsService from 'services/DealingsService';\r\nimport {setSaveStatusClosed, setSaveStatusLoading} from 'redux/actions';\r\nimport setObjectValue from 'libs/setObjectValue';\r\nimport _ from 'lodash';\r\nimport stageValues from '../constants/stage.values';\r\nimport {CONDITION_TYPE_OTHER, CONDITIONS_LABEL, CONDITIONS_LABEL_PZP_2021} from 'components/popup/newCondition/constants/condition.values';\r\nimport {CRYTERIUM_TYPE, CRYTERIUM_TYPE_LABEL} from 'components/popup/newCriteria/constants/criterium.type';\r\nimport {getDemandPZPType} from \"libs/getDemandStatus\";\r\nimport PZPType from \"constants/PZPType\";\r\n\r\nconst doElement = (critArray, editedCriterion, originalCriterion, stageName, dealingId, doDelete) => {\r\n    const _formikCritArrayCopy = _.cloneDeep(critArray);\r\n    const _editedCritCopy = _.cloneDeep(editedCriterion);\r\n    const demandPzpType = getDemandPZPType();\r\n    const conditionLabels = PZPType.PZP_2021 === demandPzpType ? CONDITIONS_LABEL_PZP_2021 : CONDITIONS_LABEL;\r\n    if (!originalCriterion) {\r\n        //dodanie nowego kryterium, więc nie mamy \"zmienianego\"\r\n        originalCriterion = _editedCritCopy;\r\n    }\r\n\r\n    let oldFieldIndex;\r\n\r\n    switch (stageName) {\r\n        case stageValues.CONDITIONS:\r\n            oldFieldIndex = _formikCritArrayCopy.findIndex(x => {\r\n                if (originalCriterion.type === CONDITION_TYPE_OTHER) {\r\n                    if (x.type === CONDITION_TYPE_OTHER) {\r\n                        return originalCriterion.otherName === x.otherName;\r\n                    } else {\r\n                        return originalCriterion.otherName === conditionLabels[x.type];\r\n                    }\r\n                } else {\r\n                    if (x.type === CONDITION_TYPE_OTHER) {\r\n                        return conditionLabels[originalCriterion.type] === x.otherName\r\n                    } else {\r\n                        return originalCriterion.type === x.type\r\n                    }\r\n                }\r\n            })\r\n            break;\r\n        case stageValues.CRITERIONS:\r\n            oldFieldIndex = _formikCritArrayCopy.findIndex(x => {\r\n                if (originalCriterion.type === CRYTERIUM_TYPE.OTHER || originalCriterion.type === CRYTERIUM_TYPE.PRICE) {\r\n                    if (x.type === CRYTERIUM_TYPE.OTHER || x.type === CRYTERIUM_TYPE.PRICE) {\r\n                        return originalCriterion.otherName === x.otherName;\r\n                    } else {\r\n                        return originalCriterion.otherName === CRYTERIUM_TYPE_LABEL[x.type];\r\n                    }\r\n                } else {\r\n                    if (x.type === CRYTERIUM_TYPE.OTHER || x.type === CRYTERIUM_TYPE.PRICE) {\r\n                        return CRYTERIUM_TYPE_LABEL[originalCriterion.type] === x.otherName;\r\n                    } else {\r\n                        return originalCriterion.type === x.type\r\n                    }\r\n                }\r\n            });\r\n\r\n            break;\r\n        case stageValues.PARAMETERS:\r\n        case stageValues.ITEM_PARAMETERS:\r\n            oldFieldIndex = _formikCritArrayCopy.findIndex(x => x.name === originalCriterion.name);\r\n            break;\r\n        default:\r\n            break;\r\n    }\r\n\r\n    if (doDelete) {\r\n        if (oldFieldIndex >= 0) {\r\n            _formikCritArrayCopy.splice(oldFieldIndex, 1);\r\n        }\r\n    } else {\r\n        if (oldFieldIndex < 0) {\r\n            _formikCritArrayCopy.push({\r\n                ..._editedCritCopy,\r\n                dealingId,\r\n                identity: -_formikCritArrayCopy.length - 1,\r\n            })\r\n        } else {\r\n            const oldField = _formikCritArrayCopy[oldFieldIndex];\r\n            _formikCritArrayCopy[oldFieldIndex] = {\r\n                ..._editedCritCopy,\r\n                identity: oldField.identity,\r\n            }\r\n        }\r\n    }\r\n\r\n    if (stageName === stageValues.CRITERIONS) {\r\n        //aktualizacja wagi ceny\r\n        const priceIndex = _formikCritArrayCopy.findIndex(x => x.type === CRYTERIUM_TYPE.PRICE);\r\n\r\n        let sum = _formikCritArrayCopy.reduce((prev, cur) => {\r\n            if (cur.type !== CRYTERIUM_TYPE.PRICE) {\r\n                return prev + parseFloat(cur.weight);\r\n            }\r\n            return prev;\r\n        }, 0);\r\n        sum = parseFloat(sum.toFixed(2));\r\n\r\n        const priceWeight = (100 - sum) < 0 ? 0 : 100 - sum;\r\n\r\n        _formikCritArrayCopy[priceIndex].weight = priceWeight;\r\n    }\r\n\r\n    return _formikCritArrayCopy;\r\n}\r\n\r\nconst hasElement = (dealing, crit, stageName) => {\r\n    const objectValue = getObjectValue(`stages.0.${stageName}`, dealing, []);\r\n    let oldFieldIndex = 10;\r\n\r\n    const demandPzpType = getDemandPZPType();\r\n    const conditionLabels = PZPType.PZP_2021 === demandPzpType ? CONDITIONS_LABEL_PZP_2021 : CONDITIONS_LABEL;\r\n\r\n    switch (stageName) {\r\n        case stageValues.CONDITIONS:\r\n            oldFieldIndex = objectValue.findIndex(x => {\r\n                if (crit.type === CONDITION_TYPE_OTHER) {\r\n                    if (x.type === CONDITION_TYPE_OTHER) {\r\n                        return crit.otherName === x.otherName;\r\n                    }\r\n                    return crit.otherName === conditionLabels[x.type];\r\n                }\r\n                return crit.type === x.type\r\n            })\r\n            break;\r\n        case stageValues.CRITERIONS:\r\n            oldFieldIndex = objectValue.findIndex(x => {\r\n                if (crit.type === CRYTERIUM_TYPE.OTHER) {\r\n                    if (x.type === CRYTERIUM_TYPE.OTHER) {\r\n                        return crit.otherName === x.otherName;\r\n                    }\r\n                    return crit.otherName === CRYTERIUM_TYPE_LABEL[x.type];\r\n                }\r\n                return crit.type === x.type\r\n            })\r\n            break;\r\n        case stageValues.PARAMETERS:\r\n        case stageValues.ITEM_PARAMETERS:\r\n            oldFieldIndex = objectValue.findIndex(x => x.name === crit.name);\r\n            break;\r\n        default:\r\n            break;\r\n    }\r\n    if (oldFieldIndex >= 0) {\r\n        return true;\r\n    } else {\r\n        return false;\r\n    }\r\n}\r\n\r\n\r\nexport const findTemporaryDealingIds = (dealingsContains, allItems, id, crit) => {\r\n    const splitId = id.split('.');\r\n    splitId.shift();// remove index\r\n    const stageName = splitId[splitId.length - 1];\r\n\r\n    const remoteDealingIds = dealingsContains.map(x => x.identity);\r\n\r\n    const dealingIds = [];\r\n    allItems.forEach((curDeal, i) => {\r\n        if (remoteDealingIds.indexOf(curDeal.identity) > -1 || hasElement(curDeal, crit, stageName)) {\r\n            dealingIds.push(curDeal.identity);\r\n        }\r\n    });\r\n    return dealingIds;\r\n\r\n}\r\n\r\nexport const filterByCurrentLoadedDealings = (dealingsContains, allItems, id, crit) => {\r\n    const splitId = id.split('.');\r\n    splitId.shift();// remove index\r\n    const stageName = splitId[splitId.length - 1];\r\n\r\n    allItems.forEach((curDeal, i) => {\r\n        if (curDeal._touched) {\r\n            const found = dealingsContains.findIndex(el => el.identity === curDeal.identity);\r\n            if (found !== -1) {\r\n                if (!hasElement(curDeal, crit, stageName)) {\r\n                    dealingsContains.splice(found, 1);\r\n                }\r\n            }\r\n        }\r\n    });\r\n\r\n}\r\n\r\n\r\nexport const removeElementsfromParts = (formikProps, id, dealings, criterion, demandId) => {\r\n    doElementsManipulation(formikProps, id, dealings, criterion, null, demandId, true);\r\n}\r\n\r\nexport const addElementsToParts = (formikProps, id, dealings, criterion, originalCriterion, demandId) => {\r\n    doElementsManipulation(formikProps, id, dealings, criterion, originalCriterion, demandId, false);\r\n}\r\n\r\nconst doElementsManipulation = (formikProps, id, dealings, editedCriterion, originalCriterion, demandId, doDelete) => {\r\n\r\n    const splitId = id.split('.');\r\n    const rootId = splitId.shift();// remove root\r\n    splitId.shift();// remove index\r\n    const fieldId = splitId.join('.')\r\n    const partsIds = Object.keys(dealings).filter(x => dealings[x]);\r\n\r\n    const stageName = splitId[splitId.length - 1];\r\n\r\n    (async () => {\r\n        if (partsIds.length < 1) {\r\n            return;\r\n        }\r\n        reduxStore.dispatch(setSaveStatusLoading());\r\n\r\n        const {resources} = reduxStore.getState();\r\n        const currentDealingList = getObjectValue(rootId, formikProps.values)\r\n\r\n        const missingArray = [];\r\n        for (let i = 0; i < partsIds.length; i++) {\r\n            const dealingId = partsIds[i];\r\n            const dealing = resources.dealing ? resources.dealing[dealingId] : undefined;\r\n            if (!dealing) {\r\n                missingArray.push(dealingId)\r\n            }\r\n        }\r\n        let newDownloaded = {};\r\n        if (missingArray.length > 0) {\r\n            newDownloaded = await DealingsService.getFullList(demandId, missingArray);\r\n        }\r\n\r\n\r\n        const processedDealings = {};\r\n        for (let i = 0; i < partsIds.length; i++) {\r\n            const dealingId = partsIds[i];\r\n            const dealing = resources.dealing ? resources.dealing[dealingId] : undefined;\r\n            const delaingIndex = currentDealingList.findIndex(x => '' + x.identity === dealingId)\r\n            let currentDealing;\r\n            if (dealing) {\r\n                // dealing exist\r\n                currentDealing = _.cloneDeep(currentDealingList[delaingIndex]);\r\n            } else {\r\n                // need get dealing\r\n                //currentDealing = await DealingsService.get(demandId, dealingId);\r\n                currentDealing = newDownloaded[dealingId]\r\n            }\r\n\r\n            let critArray = getObjectValue(fieldId, currentDealing)\r\n            critArray = doElement(critArray, editedCriterion, originalCriterion, stageName, dealingId, doDelete)\r\n            currentDealing._touched = true;\r\n            setObjectValue(fieldId, currentDealing, critArray)\r\n            // const partId = `${rootId}.${delaingIndex}`\r\n            // formikProps.setFieldValue(partId, currentDealing);\r\n            processedDealings[currentDealing.identity] = currentDealing;\r\n        }\r\n        const newDealingList = currentDealingList.map((el) => {\r\n            const dealingId = el.identity;\r\n            const processed = processedDealings[dealingId];\r\n            if (Boolean(processed)) {\r\n                return processed\r\n            } else {\r\n                return el;\r\n            }\r\n        });\r\n        formikProps.setFieldValue(rootId, newDealingList);\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n    })();\r\n}","import React, {useEffect, useState} from 'react';\r\nimport Dialog from \"components/Dialog\";\r\nimport Tr from \"translations/Translations\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport Loading from \"components/Loading\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport {connect} from \"react-redux\";\r\nimport {filterByCurrentLoadedDealings, findTemporaryDealingIds} from \"../lib/manipulateElementsOnParts\";\r\nimport stageValues from \"../constants/stage.values\";\r\nimport {CONDITION_TYPE_OTHER, CONDITIONS_LABEL, CONDITIONS_LABEL_PZP_2021} from \"components/popup/newCondition/constants/condition.values\";\r\nimport {CRYTERIUM_TYPE, CRYTERIUM_TYPE_LABEL} from \"components/popup/newCriteria/constants/criterium.type\";\r\nimport {getDemandPZPType} from \"libs/getDemandStatus\";\r\nimport PZPType from \"constants/PZPType\";\r\nimport VS from \"constants/ValidationShema\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        minHeight: 75\r\n    }\r\n}));\r\n\r\n\r\nconst getCritDisplayName = (crit, stageName) => {\r\n\r\n    const demandPzpType = getDemandPZPType();\r\n    const conditionLabels = PZPType.PZP_2021 === demandPzpType ? CONDITIONS_LABEL_PZP_2021 : CONDITIONS_LABEL;\r\n\r\n    let name;\r\n    switch (stageName) {\r\n        case stageValues.CONDITIONS:\r\n            name = crit.type === CONDITION_TYPE_OTHER ? crit.otherName : conditionLabels[crit.type];\r\n            break;\r\n        case stageValues.CRITERIONS:\r\n            name = crit.type === CRYTERIUM_TYPE.OTHER ? crit.otherName : CRYTERIUM_TYPE_LABEL[crit.type];\r\n            break;\r\n        case stageValues.PARAMETERS:\r\n        case stageValues.ITEM_PARAMETERS:\r\n            name = crit.name;\r\n            break;\r\n        default:\r\n            name = \"\";\r\n            break;\r\n    }\r\n    return name;\r\n\r\n}\r\n\r\nconst ConfirmDeleteCriterion = (\r\n    {\r\n        onClose = () => {\r\n        },\r\n        onDelete = () => {\r\n        },\r\n        partId,\r\n        demandId,\r\n        stageId,\r\n        initCrit, //usuwane kryterium\r\n        allItems,\r\n        id,\r\n        formSubmit,\r\n    }) => {\r\n\r\n    const [elementList, setElementList] = useState(null);\r\n    const [critName, setCritName] = useState(\"\");\r\n    const classes = useStyle();\r\n\r\n    const formId = useId();\r\n\r\n    const handleClose = () => {\r\n        setElementList(null);\r\n        onClose();\r\n    };\r\n\r\n    const handleSubmit = (values) => {\r\n        onDelete(values);\r\n    };\r\n\r\n    const handleConfirm = () => {\r\n        formSubmit[formId]();\r\n    };\r\n\r\n    useEffect(() => {\r\n        if (initCrit) {\r\n\r\n            const splitId = id.split('.');\r\n            splitId.shift();// remove index\r\n            const stageName = splitId[splitId.length - 1];\r\n            const critDisplayName = getCritDisplayName(initCrit, stageName);\r\n            setCritName(critDisplayName);\r\n            if (initCrit.identity < 0) {\r\n                DealingsService.getDealingsMatchingCriterionName(demandId, stageId, stageName, critDisplayName).then((dealingsContains) => {\r\n                    const ids = findTemporaryDealingIds(dealingsContains, allItems, id, initCrit);\r\n                    const filtered = allItems.filter(x => ids.indexOf(x.identity) > -1);\r\n                    setElementList(filtered);\r\n\r\n                });\r\n\r\n            } else {\r\n                DealingsService.getDealingsMatchingCriterion(demandId, initCrit.identity).then((dealingsContains) => {\r\n\r\n                    filterByCurrentLoadedDealings(dealingsContains, allItems, id, initCrit);\r\n                    const ids = dealingsContains.map(x => x.identity);\r\n                    const filtered = allItems.filter(x => ids.indexOf(x.identity) > -1);\r\n                    setElementList(filtered);\r\n                });\r\n            }\r\n        }\r\n    }, [demandId, initCrit, allItems, id, stageId]);\r\n\r\n    return (\r\n        <Dialog\r\n            contentClassName={classes.root}\r\n            title={Tr('confirm_delete')}\r\n            open={true}\r\n            maxWidth='md'\r\n            onClose={handleClose}\r\n        >\r\n            {elementList == null && <Loading/>}\r\n\r\n            {elementList !== null &&\r\n            <>\r\n                <Form\r\n                    id={formId}\r\n                    onSubmit={handleSubmit}\r\n                    initialValues={{\r\n                        parts: {\r\n                            [partId]: true,\r\n                        },\r\n                    }}\r\n                    validationSchema={VS.any()}\r\n                >\r\n                    {(formikProps) => (\r\n                        <>\r\n\r\n                            {elementList.length >= 1 &&\r\n                            <>\r\n                                <PartsTable\r\n                                    id={'parts'}\r\n                                    formikProps={formikProps}\r\n                                    elementList={elementList}\r\n                                    label={Tr('select_dealings_to_crit_delete', {critName})}\r\n                                />\r\n                            </>\r\n                            }\r\n                        </>\r\n                    )}\r\n                </Form>\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('delete')}\r\n                    onClickFirst={handleClose}\r\n                    onClickSecond={handleConfirm}\r\n                />\r\n            </>}\r\n        </Dialog>\r\n    );\r\n};\r\n\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(ConfirmDeleteCriterion);","import React, {useEffect, useState} from 'react'\r\nimport {Divider, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ConditionElement from './ConditionElement';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport AddButton from 'components/button/AddButton';\r\nimport NewCondition from 'components/popup/newCondition/NewCondition';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {CONDITIONS_LABEL, CONDITIONS_LABEL_PZP_2021, CONDITION_TYPE_OTHER} from 'components/popup/newCondition/constants/condition.values';\r\nimport Checkbox from 'components/Checkbox';\r\nimport {withRouter} from \"react-router\";\r\nimport ConfirmDeleteCriterion from \"./ConfirmDeleteCriterion\";\r\nimport {addElementsToParts, removeElementsfromParts} from \"../lib/manipulateElementsOnParts\";\r\nimport {getDemandPZPType} from \"libs/getDemandStatus\";\r\nimport PZPType from \"constants/PZPType\";\r\nimport _ from 'lodash';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        width: '100%',\r\n        '&>*': {\r\n            width: 'inherit'\r\n        }\r\n    },\r\n    header: {\r\n        marginTop: theme.spacing(1),\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n    divider: {\r\n        marginTop: theme.spacing(1),\r\n        marginBottom: theme.spacing(1),\r\n    }\r\n})\r\n\r\nfunction ConditionsSection(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        rootId,\r\n        id,\r\n        checkboxId,\r\n        match,\r\n        partId,\r\n        stageId,\r\n        dirtyListenerSemaphore\r\n    }) {\r\n    const [openPopup, setOpenPopup] = useState(false);\r\n    const [openDeletePopup, setOpenDeletePopup] = useState(false);\r\n    const [editElement, setEditElement] = useState();\r\n\r\n    const demandId = match.params.id;\r\n\r\n    const thisId = id;\r\n\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const elements = getObjectValue(thisId, formikProps.values, []);\r\n\r\n    const demandPzpType = getDemandPZPType();\r\n    const conditionLabels = PZPType.PZP_2021 === demandPzpType ? CONDITIONS_LABEL_PZP_2021 : CONDITIONS_LABEL;\r\n\r\n    const handleAddCondition = ({parts, ...values}) => {\r\n        addElementsToParts(formikProps, id, parts, values, editElement, demandId)\r\n        setOpenPopup(false)\r\n        setEditElement()\r\n    }\r\n\r\n    const handleEdit = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenPopup(true);\r\n    }\r\n\r\n    const onClosePopup = () => {\r\n        setOpenPopup(false)\r\n        setEditElement()\r\n    }\r\n\r\n    const conditionsInSiwz = getObjectValue(checkboxId, formikProps.values);\r\n\r\n\r\n    const handleDeleteButtonPress = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenDeletePopup(true);\r\n    }\r\n\r\n    const onCloseDeletePopup = () => {\r\n        setOpenDeletePopup(false)\r\n        setEditElement();\r\n    }\r\n\r\n    const handleDeleteCondition = ({parts}) => {\r\n        removeElementsfromParts(formikProps, id, parts, editElement, demandId);\r\n        setOpenDeletePopup(false);\r\n        setEditElement();\r\n    }\r\n\r\n\r\n    useEffect(() => {\r\n        dirtyListenerSemaphore.current = true;\r\n        if (elements.length > 0) {\r\n            formikProps.setFieldValue(checkboxId, false)\r\n        } else if (elements.length === 0 && !conditionsInSiwz) {\r\n            formikProps.setFieldValue(checkboxId, true)\r\n        }\r\n        dirtyListenerSemaphore.current = false;\r\n        // eslint-disable-next-line\r\n    }, [elements.length])\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                className={classes.root}\r\n                direction='column'\r\n            >\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.header}\r\n                >\r\n                    {Tr('conditions')}\r\n                    {!conditionsInSiwz ?\r\n                        ` (${elements.length})`\r\n                        : ''\r\n                    }\r\n\r\n                </Typography>\r\n\r\n                <Checkbox\r\n                    label={Tr('conditions_specifed_in_SIWZ')}\r\n                    formikProps={formikProps}\r\n                    id={checkboxId}\r\n                    disabled={!editable}\r\n                />\r\n                <GridBlock alignItems='center'>\r\n                    {!conditionsInSiwz &&\r\n                    elements.map((item, i) => {\r\n                        const name = item.type === CONDITION_TYPE_OTHER ? item.otherName : conditionLabels[item.type];\r\n                        return (\r\n                            <ConditionElement\r\n                                id={thisId}\r\n                                index={i}\r\n                                formikProps={formikProps}\r\n                                name={name}\r\n                                key={i}\r\n                                onDelete={handleDeleteButtonPress}\r\n                                onEdit={() => handleEdit(i)}\r\n                                disabled={!editable}\r\n                            />\r\n                        )\r\n                    })\r\n                    }\r\n\r\n                    <AddButton\r\n                        onClick={() => setOpenPopup(true)}\r\n                        disabled={!editable}\r\n                    >\r\n                        {Tr('add_condition')}\r\n                    </AddButton>\r\n                </GridBlock>\r\n                <Divider className={classes.divider}/>\r\n            </GridBlock>\r\n            {openPopup && <NewCondition\r\n                onAdd={handleAddCondition}\r\n                onClose={() => onClosePopup()}\r\n                partId={partId}\r\n                initValues={editElement}\r\n                elementList={formikProps.values.form}\r\n                selectedItems={elements}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                showParts={editable}\r\n            />}\r\n            {openDeletePopup && <ConfirmDeleteCriterion\r\n                onClose={() => onCloseDeletePopup()}\r\n                onDelete={handleDeleteCondition}\r\n                partId={partId}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                initCrit={editElement}\r\n                allItems={formikProps.values.form}\r\n                id={id}\r\n            />}\r\n\r\n\r\n        </>\r\n    )\r\n}\r\n\r\nConditionsSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(withRouter(ConditionsSection));","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ConditionElement from './ConditionElement';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport {CRYTERIUM_TYPE} from \"components/popup/newCriteria/constants/criterium.type\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    weightInput: {\r\n        width: 100\r\n    }\r\n})\r\n\r\nfunction CriteriaElement(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        name,\r\n        type,\r\n        id,\r\n        index,\r\n        onEdit,\r\n        onDelete,\r\n        disabled,\r\n    }) {\r\n\r\n    const onWeightChange = (val) => {\r\n\r\n        const critArray = getObjectValue(id, formikProps.values, []);\r\n        let priceIndex = -1;\r\n        let sum = critArray.reduce((prev, cur, curIndex) => {\r\n            let newSum = prev;\r\n            if (cur.type === CRYTERIUM_TYPE.PRICE) {\r\n                priceIndex = curIndex;\r\n            } else {\r\n                if (curIndex === index) {\r\n                    newSum += parseFloat(val);\r\n                } else {\r\n                    newSum += parseFloat(cur.weight);\r\n                }\r\n            }\r\n            return newSum;\r\n        }, 0);\r\n        sum = parseFloat(sum.toFixed(2));\r\n        const priceWeight = (100 - sum) < 0 ? 0 : 100 - sum;\r\n        const priceWeightId = `${id}.${priceIndex}.weight`;\r\n        formikProps.setFieldValue(priceWeightId, priceWeight);\r\n    }\r\n\r\n    const weightId = `${id}.${index}.weight`\r\n    return (\r\n        <GridBlock\r\n            className={classes.root}\r\n            column\r\n        >\r\n            <ConditionElement\r\n                name={name}\r\n                formikProps={formikProps}\r\n                id={id}\r\n                index={index}\r\n                onEdit={onEdit}\r\n                onDelete={onDelete}\r\n                disableDelete={type === CRYTERIUM_TYPE.PRICE}\r\n                disabled={disabled}\r\n            />\r\n            <TextInput\r\n                className={classes.weightInput}\r\n                id={weightId}\r\n                label={Tr('weight')}\r\n                formikProps={formikProps}\r\n                endAdornment='%'\r\n                type={INPUT_TYPE.NUMBER_19}\r\n                step=\"0.01\"\r\n                disabled={type === CRYTERIUM_TYPE.PRICE || !isDemandPreparing()}\r\n                onChange={type === CRYTERIUM_TYPE.PRICE ? undefined : onWeightChange}\r\n            />\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nCriteriaElement.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(CriteriaElement);","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (label, value,disabled=false) => ({label, value, disabled})\r\n\r\nexport const VALUES = {\r\n\tNEW: 0,\r\n\tMY_CRITERIA: 1,\r\n}\r\n\r\nexport default [\r\n\tcreateItem(Tr('new'), VALUES.NEW),\r\n\tcreateItem(Tr('my_criteria'), VALUES.MY_CRITERIA,true)\r\n]","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (label, value) => ({\r\n\tlabel,\r\n\tvalue\r\n})\r\n\r\nexport const VARIANT_CODE = {\r\n\tRANGE: 'BETWEEN',\r\n\tSMALLER: 'SMALLER_THAN',\r\n\tBIGGER: 'BIGGER_THAN',\r\n}\r\n\r\nexport default [\r\n\tcreateItem(Tr('criteria_element_v_range'), VARIANT_CODE.RANGE),\r\n\tcreateItem(Tr('criteria_element_v_smaller'), VARIANT_CODE.SMALLER),\r\n\tcreateItem(Tr('criteria_element_v_bigger'), VARIANT_CODE.BIGGER),\r\n]","import * as Yup from 'yup'\r\nimport Tr from 'translations/Translations';\r\nimport {CRYTERIUM_TYPE as CRYTERIUM_VARIANT, CRYTERIUM_TYPE_LABEL} from './criterium.type'\r\nimport {VARIANT_CODE as CRITERIA_TYPE} from './criteria.variants'\r\nimport {VARIANT_CODE as CRITERIA_ELEMENT_TYPE} from './criteriaElement.variants'\r\nimport {VALUES as TABS} from './tabs.values'\r\nimport VS from 'constants/ValidationShema'\r\nimport InputLimits from 'constants/InputLimits';\r\nimport toFloat from 'libs/toFloat';\r\n\r\nexport default (selectedItems) => Yup.lazy(values => {\r\n\r\n    const weight =  values.weight ? parseFloat(parseFloat(values.weight).toFixed(2)) : 0;\r\n\r\n    const min0MaxWeight = VS.numberMaxMin(0, weight, null, 'v_number_max_weight', Tr('points'));\r\n\r\n    const from = VS.decimalNumber(Tr(\"from\"))\r\n    const to = VS.decimalNumber(Tr(\"to\"))\r\n\r\n    const reg = '^(?!(' + selectedItems.map(x => x.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|') + ')$).*$';\r\n    const otherNameRegExp = new RegExp(reg)\r\n    let shape = {\r\n        otherName: (values.type === CRYTERIUM_VARIANT.OTHER || values.type === CRYTERIUM_VARIANT.PRICE) ?\r\n            VS.stringExactlyMax(\r\n                otherNameRegExp,\r\n                Tr('v_criteria_exist'),\r\n                InputLimits.procedure.criteriaSection.NAME\r\n            ) : VS.any(),\r\n        isSelected: values.tab === TABS.NEW ?\r\n            VS.any() :\r\n            VS.immediatelyError(Tr('new_criteria_popup_v_choose')),\r\n        weight: VS.numberMax(100)\r\n    }\r\n    switch (values.type) {\r\n        case CRYTERIUM_VARIANT.OTHER:\r\n        case CRYTERIUM_VARIANT.PRICE:\r\n            //to jest walidowane przy pomocy otherName\r\n            break;\r\n        default:\r\n            shape['type'] = VS.string().test(\r\n                'duplicate',\r\n                Tr('v_criteria_exist'),\r\n                (formValue) => {\r\n                    return otherNameRegExp.test(CRYTERIUM_TYPE_LABEL[formValue]);\r\n                }\r\n            )\r\n    }\r\n\r\n    switch (values.uiType) {\r\n        case CRITERIA_TYPE.LIST:\r\n\r\n            shape['valuesList'] = VS.lazy(list => {\r\n                let keys = [];\r\n                let errorKeys = [];\r\n\r\n                const maxListPoints = Math.max(...list.map(o => o.value), 0);\r\n                let pointsLessThanWeight = maxListPoints === weight;\r\n\r\n                list.forEach((x, i, arr) => {\r\n                    if (keys.indexOf(x.key) === -1) {\r\n                        keys.push(x.key);\r\n                    } else {\r\n                        errorKeys.push(x.key);\r\n                    }\r\n                });\r\n                return VS.arrayOf(VS.lazy((x, y, z) => {\r\n\r\n                    return VS.object({\r\n                        value: min0MaxWeight,\r\n                        key: VS.stringMax(1000)\r\n                            .test(\r\n                                'duplicate',\r\n                                Tr('v_keys_must_be_unique'),\r\n                                (formValue) => {\r\n                                    return errorKeys.indexOf(formValue) === -1;\r\n                                }\r\n                            )\r\n                    })\r\n                })).min(2, Tr('at_least_two_values'))\r\n                    .test('weight_less_than_points', Tr('v_number_weight_less_than_points'), () => pointsLessThanWeight)\r\n            });\r\n\r\n            break;\r\n        case CRITERIA_TYPE.INTERVAL:\r\n            shape['intervalList'] = VS.lazy(list => {\r\n\r\n                const maxListPoints = Math.max(...list.map(o => o.value), 0);\r\n                const pointsLessThanWeight = maxListPoints === weight;\r\n\r\n                let validation = {};\r\n\r\n                list.forEach((x, i) => {\r\n                    let curRowValidation = {};\r\n                    validation[x.id] = curRowValidation;\r\n\r\n                    if (x.type === CRITERIA_ELEMENT_TYPE.SMALLER && i !== 0) {\r\n                        curRowValidation.smallerError = true;\r\n                    }\r\n\r\n                    if (x.type === CRITERIA_ELEMENT_TYPE.BIGGER && i !== (list.length - 1)) {\r\n                        curRowValidation.biggerError = true;\r\n                    }\r\n\r\n                    if (x.type === CRITERIA_ELEMENT_TYPE.RANGE) {\r\n\r\n                        curRowValidation.rangeSameError = x.from === x.to ? !x.fromInclusive || !x.toInclusive : false;\r\n                    }\r\n\r\n                    if (i !== 0) {\r\n                        const curFrom = toFloat(x.from);\r\n                        const prevTo = toFloat(list[i - 1].to);\r\n                        if (curFrom !== prevTo) {\r\n                            curRowValidation.inservalStartToPrevEndError = true;\r\n                        }\r\n                        if (x.type === CRITERIA_ELEMENT_TYPE.RANGE) {\r\n                            const curTo = toFloat(x.to);\r\n                            if (curTo < curFrom) {\r\n                                curRowValidation.inservalStartLesThanEndError = true;\r\n                            }\r\n                        }\r\n                    }\r\n                })\r\n\r\n                return VS.arrayOf(VS.lazy(x => {\r\n                    const elementErrors = validation[x.id];\r\n                    switch (x.type) {\r\n                        case CRITERIA_ELEMENT_TYPE.RANGE:\r\n                            return VS.object({\r\n                                value: min0MaxWeight,\r\n                                to,\r\n                                from: from\r\n                                    .test(\r\n                                        'lessPrev',\r\n                                        Tr('v_interval_contained_within'),\r\n                                        (formValue) => {\r\n                                            return !elementErrors.inservalStartToPrevEndError;\r\n                                        })\r\n                                    .test(\r\n                                        'less',\r\n                                        Tr('v_number_less_than', {from: Tr('from'), to: Tr('to')}),\r\n                                        (fromValue) => {\r\n                                            return !elementErrors.inservalStartLesThanEndError\r\n                                        }).test(\r\n                                        'rangeSameError',\r\n                                        Tr('v_interval_contained_within'),\r\n                                        (fromValue) => {\r\n                                            return !elementErrors.rangeSameError;\r\n                                        }\r\n                                    ),\r\n                            })\r\n\r\n                        case CRITERIA_ELEMENT_TYPE.SMALLER:\r\n                            return VS.object({\r\n                                value: min0MaxWeight,\r\n                                to: to\r\n                                    .test(\r\n                                        'smallerFirst',\r\n                                        Tr('v_smaller_not_first'),\r\n                                        (formValue) => {\r\n                                            return !elementErrors.smallerError;\r\n                                        }\r\n                                    ),\r\n                            })\r\n\r\n                        case CRITERIA_ELEMENT_TYPE.BIGGER:\r\n                        default:\r\n                            return VS.object({\r\n                                value: min0MaxWeight,\r\n                                from: from\r\n                                    .test(\r\n                                        'biggerLast',\r\n                                        Tr('v_bigger_not_last'),\r\n                                        (formValue) => {\r\n                                            return !elementErrors.biggerError;\r\n                                        }\r\n                                    )\r\n                                    .test(\r\n                                        'lessPrev',\r\n                                        Tr('v_interval_contained_within'),\r\n                                        (formValue) => {\r\n                                            return !elementErrors.inservalStartToPrevEndError;\r\n                                        }),\r\n                            })\r\n                    }\r\n                })).min(1, Tr('mustNotBeEmpty', {value: Tr('values')})).test('weight_less_than_points', Tr('v_number_weight_less_than_points'), () => pointsLessThanWeight)\r\n            })\r\n\r\n            break;\r\n        case CRITERIA_TYPE.NUMBER:\r\n        case CRITERIA_TYPE.PRICE:\r\n            shape['direction'] = VS.string();\r\n            break;\r\n        case CRITERIA_TYPE.TEXT:\r\n        case CRITERIA_TYPE.YESNO:\r\n        default:\r\n            break;\r\n    }\r\n\r\n    return VS.object(shape)\r\n})","import React from 'react'\r\nimport {Divider, makeStyles, Tab} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport TabsUI from '@material-ui/core/Tabs';\r\nimport Typography from \"./Typography\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    divider: {\r\n        margin: `0 ${-theme.spacing(2)}px ${theme.spacing(2)}px`\r\n    },\r\n    tab: {\r\n        flexGrow: '1'\r\n    },\r\n    tabVertical: {\r\n        display: \"flex\",\r\n        flexDirection: \"row-reverse\",\r\n        justifyContent: \"end\",\r\n        textTransform: \"none\",\r\n        \"&>.MuiSvgIcon-root\": {\r\n            marginLeft: theme.spacing(1)\r\n        },\r\n        \"&>.MuiTypography-root\": {\r\n            flexGrow: 1\r\n        }\r\n    },\r\n    tabVerticalSelected: {\r\n        backgroundColor: theme.palette.background.greyBackground,\r\n        borderRadius: `${theme.shape.borderRadius}px 0 0 ${theme.shape.borderRadius}px`,\r\n    },\r\n    tabsVertical: {\r\n        borderRight: `1px solid ${theme.palette.divider}`,\r\n        marginRight: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction Tabs(\r\n    {\r\n        tabs,\r\n        value,\r\n        onChange,\r\n        children,\r\n        vertical\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <>\r\n            <TabsUI\r\n                className={classes.root}\r\n                classes={{\r\n                    root: vertical ? classes.tabsVertical : undefined\r\n                }}\r\n                value={value}\r\n                onChange={(event, newValue) => onChange(newValue)}\r\n                indicatorColor='primary'\r\n                orientation={vertical ? \"vertical\" : undefined}\r\n            >\r\n                {tabs.map(({\r\n                               label,\r\n                               value,\r\n                               disabled,\r\n                               icon\r\n                           }) => {\r\n                    return (\r\n                        <Tab\r\n                            key={value}\r\n                            className={classes.tab}\r\n                            classes={{\r\n                                wrapper: vertical ? classes.tabVertical : null,\r\n                                selected: vertical ? classes.tabVerticalSelected : null\r\n                            }}\r\n                            label={<Typography component=\"span\">{label}</Typography>}\r\n                            value={value}\r\n                            disabled={disabled}\r\n                            icon={icon}\r\n                        />\r\n                    )\r\n                })}\r\n            </TabsUI>\r\n            {!vertical && <Divider className={classes.divider}/>}\r\n            {children}\r\n        </>\r\n    )\r\n}\r\n\r\nTabs.propTypes = {\r\n    tabs: PropTypes.arrayOf(PropTypes.shape({\r\n        label: PropTypes.string.isRequired,\r\n        value: PropTypes.any.isRequired,\r\n        icon: PropTypes.element,\r\n        disabled: PropTypes.bool\r\n    }))\r\n}\r\n\r\nexport default Tabs;","import React, { memo } from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tabs from 'components/Tabs';\r\nimport tabsValues from '../constants/tabs.values'\r\nimport getObjectValue from 'libs/getObjectValue'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction FormTabs({\r\n\tclasses,\r\n\tid,\r\n\tformikProps,\r\n\tonChange = () => {},\r\n}) {\r\n\tconst value = getObjectValue(id, formikProps.values, '')\r\n\t\r\n\tconst handleChange = (value) => {\r\n\t\tformikProps.setFieldValue(id, value)\r\n\t\tonChange(value)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Tabs\r\n\t\t\tonChange={handleChange}\r\n\t\t\ttabs={tabsValues}\r\n\t\t\tvalue={value}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nFormTabs.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(memo(FormTabs, (prevProps, nextProps) => {\r\n\tif (prevProps.id !== nextProps.id) return false;\r\n\tconst id = nextProps.id;\r\n\tif (getObjectValue(id, prevProps.formikProps.values) !== getObjectValue(id, nextProps.formikProps.values)) return false;\r\n\treturn true;\r\n}));","import React, { useEffect } from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Select from 'components/Select';\r\nimport Tr from 'translations/Translations';\r\nimport typeValues, { VARIANT_CODE } from '../constants/criteria.variants'\r\nimport TextInput from 'components/TextInput';\r\nimport criteriumVariant, { CRYTERIUM_TYPE } from '../constants/criterium.type'\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport {isDemandPreparing} from 'libs/getDemandStatus';\r\n\r\nconst limits = InputLimits.procedure\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction OtherCriteriaFields({\r\n\tclasses,\r\n\tformikProps,\r\n\tedit,\r\n\tselectedItems,\r\n\tinitValues,\r\n}) {\r\n\r\n\tconst type = getObjectValue(\"type\", formikProps.values, '')\r\n\r\n\tconst setRepeatValue = (direction, fieldValue) => {\r\n\t\tformikProps.setFieldValue(\"uiType\", VARIANT_CODE.NUMBER)\r\n\t\tformikProps.setFieldValue(\"calculation\", true)\r\n\t\tformikProps.setFieldValue(\"direction\", direction)\r\n\t\tif (fieldValue) formikProps.setFieldValue(\"uom\", fieldValue)\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!edit) {\r\n\t\t\tif (type === CRYTERIUM_TYPE.PAYMENT) setRepeatValue(\"ASCENDING\", \"TG\")\r\n\t\t\telse if (type === CRYTERIUM_TYPE.GUARANTEE) setRepeatValue(\"ASCENDING\", \"MS\")\r\n\t\t\telse if (type === CRYTERIUM_TYPE.TIME_LIMIT) setRepeatValue(\"DESCENDING\", \"TG\")\r\n\t\t\telse if (type === CRYTERIUM_TYPE.PRICE) setRepeatValue(\"DESCENDING\", \"PLN\")\r\n\t\t\telse formikProps.setFieldValue(\"uiType\", VARIANT_CODE.TEXT);\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [type])\r\n\r\n\tconst typeElements = criteriumVariant.reduce((acc, item) => {\r\n\t\tif (item.value === CRYTERIUM_TYPE.OTHER) return [...acc, item];\r\n\t\tif (initValues !== undefined) {\r\n\t\t\tif (item.value === initValues.type) {\r\n\t\t\t\treturn [...acc, item]\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (selectedItems.find(x => x.type === item.value)) {\r\n\t\t\treturn acc;\r\n\t\t}\r\n\t\treturn [...acc, item]\r\n\t}, [])\r\n\r\n\treturn (\r\n\t\t<GridBlock column>\r\n\t\t\t<Select\r\n\t\t\t\tid={'type'}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\titems={typeElements}\r\n\t\t\t\tlabel={Tr('criterium')}\r\n\t\t\t\tdisabled={formikProps.values.type === CRYTERIUM_TYPE.PRICE || (!isDemandPreparing() && !!initValues)}\r\n\t\t\t\trequired\r\n\t\t\t/>\r\n\t\t\t{(formikProps.values.type === CRYTERIUM_TYPE.OTHER ||\r\n\t\t\t\tformikProps.values.type === CRYTERIUM_TYPE.PRICE\r\n\t\t\t) &&\r\n\t\t\t\t<TextInput\r\n\t\t\t\t\tlabel={Tr('criterion_name')}\r\n\t\t\t\t\tid='otherName'\r\n\t\t\t\t\trequired={formikProps.values.type !== CRYTERIUM_TYPE.PRICE}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\tlimit={limits.criteriaSection.NAME}\r\n\t\t\t\t\tdisabled={!isDemandPreparing() && !!initValues}\r\n\t\t\t\t/>\r\n\t\t\t}\r\n\t\t\t{(formikProps.values.uiType !== undefined &&\r\n\t\t\t\tformikProps.values.type !== CRYTERIUM_TYPE.PRICE\r\n\t\t\t) &&\r\n\t\t\t\t<TextInput\r\n\t\t\t\t\tlabel={Tr('description')}\r\n\t\t\t\t\tid='description'\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\tmultiline\r\n\t\t\t\t/>\r\n\t\t\t}\r\n\t\t\t<Select\r\n\t\t\t\tid={'uiType'}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\titems={typeValues}\r\n\t\t\t\tlabel={Tr('type')}\r\n\t\t\t\tdisabled={type === CRYTERIUM_TYPE.PRICE || (!isDemandPreparing() && !!initValues)}\r\n\t\t\t\trequired\r\n\t\t\t/>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nOtherCriteriaFields.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(OtherCriteriaFields);","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (label, value) => ({\r\n\tlabel,\r\n\tvalue\r\n})\r\n\r\nexport const MEASURE_UNIT = {\r\n\tDAY: 0,\r\n\tMONTH: 1,\r\n\tWEEKS: 2,\r\n\tYEARS: 3,\r\n}\r\n\r\nexport const MEASURE_UNIT_LABEL = {\r\n\t[MEASURE_UNIT.DAY]: Tr('days'),\r\n\t[MEASURE_UNIT.MONTH]: Tr('months'),\r\n\t[MEASURE_UNIT.WEEKS]: Tr('weeks'),\r\n\t[MEASURE_UNIT.YEARS]: Tr('years'),\r\n}\r\n\r\nconst values = Object.keys(MEASURE_UNIT_LABEL).map( item => \r\n\tcreateItem(MEASURE_UNIT_LABEL[item], item)\r\n)\r\n\r\nexport default values;","import { VARIANT_CODE as CRITERIA_TYPE } from '../constants/criteria.variants'\r\nimport { MEASURE_UNIT } from '../constants/measurePeriodUnits.values'\r\nimport { VARIANT_CODE as CRITERIA_ELEMENT_TYPE } from '../constants/criteriaElement.variants'\r\n\r\nconst createItem = (name, type, description, unit, criteria) => ({\r\n\tname, type, description, unit, criteria\r\n})\r\n\r\nconst createCriteria2 = (min, max, points) => ({min, max, points, variant: CRITERIA_ELEMENT_TYPE.RANGE})\r\nconst createCriteriaSmaller = (max, points) => ({max, points, variant: CRITERIA_ELEMENT_TYPE.SMALLER})\r\nconst createCriteriaBigger = (min, points) => ({min, points, variant: CRITERIA_ELEMENT_TYPE.BIGGER})\r\nconst createCriteriaL = (units, points) => ({units, points})\r\n\r\nexport default [\r\n\tcreateItem('NAME 1', CRITERIA_TYPE.INTERVAL, 'DESCRIPTION 1', MEASURE_UNIT.MONTH, [\r\n\t\tcreateCriteriaBigger(2, 20),\r\n\t\tcreateCriteria2(3, 13, 10),\r\n\t\tcreateCriteriaSmaller(1, 25),\r\n\t\tcreateCriteriaBigger(4, 35),\r\n\t\tcreateCriteria2(1, 7, 30),\r\n\t]),\r\n\tcreateItem('NAME 2', CRITERIA_TYPE.LIST, 'DESCRIPTION 2', MEASURE_UNIT.WEEKS, [\r\n\t\tcreateCriteriaL(3,11),\r\n\t\tcreateCriteriaL(1,21),\r\n\t\tcreateCriteriaL(7,41),\r\n\t\tcreateCriteriaL(2,12),\r\n\t\tcreateCriteriaL(3,26),\r\n\t\tcreateCriteriaL(2,12),\r\n\t]),\r\n\tcreateItem('Lorem ipsum dolor sit amet consectetur', CRITERIA_TYPE.INTERVAL, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut in mi facilisis, iaculis diam ut, lobortis dolor. Morbi venenatis elementum condimentum. Donec commodo quam eget ipsum venenatis, vitae mollis turpis volutpat. Etiam sit amet ullamcorper tortor. Nulla et feugiat massa.', MEASURE_UNIT.DAY, [\r\n\t\tcreateCriteria2(3, 13, 10),\r\n\t\tcreateCriteriaSmaller(1, 25),\r\n\t\tcreateCriteriaBigger(2, 20),\r\n\t\tcreateCriteria2(1, 7, 30),\r\n\t\tcreateCriteriaBigger(4, 35),\r\n\t]),\r\n]","import React from 'react'\r\nimport { withStyles, ListItem, Grid, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport { criteriaLabels } from '../constants/criteria.variants'\r\nimport Button from 'components/Button';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tgrid: {\r\n\t\t'&>*': {\r\n\t\t\t'&:not(:first-child)': {\r\n\t\t\t\tmarginLeft: theme.spacing(1)\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tnameItem: {\r\n\t\twidth: 200,\r\n\t\tflexShrink: 0,\r\n\t},\r\n\ttypeItem: {\r\n\t\twidth: 100,\r\n\t\tflexShrink: 0,\r\n\t},\r\n\tdescriptionItem: {\r\n\t\tflexGrow: 1,\r\n\t},\r\n\ttext: {\r\n\t\t...theme.typography.cutLines(1),\r\n\t}\r\n})\r\n\r\nfunction ListElement({\r\n\tclasses,\r\n\tname,\r\n\ttype,\r\n\tdescription,\r\n\tonClick\r\n}) {\r\n\tconst text = (t) => (<Typography className={classes.text} variant='body1'>{t}</Typography>)\r\n\r\n\treturn (\r\n\t\t<ListItem>\r\n\t\t\t<Grid\r\n\t\t\t\tcontainer\r\n\t\t\t\tclassName={classes.grid}\r\n\t\t\t\twrap='nowrap'\r\n\t\t\t\talignItems='center'\r\n\t\t\t>\r\n\t\t\t\t<Grid item className={classes.nameItem}>\r\n\t\t\t\t\t{text(name)}\r\n\t\t\t\t</Grid>\r\n\t\t\t\t<Grid item className={classes.typeItem}>\r\n\t\t\t\t\t{text(criteriaLabels[type])}\r\n\t\t\t\t</Grid>\r\n\t\t\t\t<Grid item className={classes.descriptionItem}>\r\n\t\t\t\t\t{text(description)}\r\n\t\t\t\t</Grid>\r\n\t\t\t\t<Grid item>\r\n\t\t\t\t\t<Button variant='text' onClick={onClick}>\r\n\t\t\t\t\t\t{Tr('select')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</Grid>\r\n\t\t\t</Grid>\r\n\t\t</ListItem>\r\n\t)\r\n}\r\n\r\nListElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ListElement);","import React from 'react'\r\nimport { withStyles, List, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport elements from './mock.elements'\r\nimport ListElement from './ListElement';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction MyCriteriaList({\r\n\tclasses,\r\n\tformikProps,\r\n}) {\r\n\r\n\tconst handleClick = item => {\r\n\t\tformikProps.setValues({\r\n\t\t\t...formikProps.values,\r\n\t\t\t...item,\r\n\t\t\tisSelected: true,\r\n\t\t})\r\n\t}\r\n\r\n\tconst errorValue = formikProps.errors.isSelected;\r\n\tconst touched = formikProps.touched.isSelected;\r\n\tconst isError = !!errorValue && touched\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<List>\r\n\t\t\t\t{elements.map((item, i) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<ListElement {...item} key={i} onClick={() => handleClick(item)} />\r\n\t\t\t\t\t)\r\n\t\t\t\t})}\r\n\t\t\t</List>\r\n\t\t\t<Typography\r\n\t\t\t\tvariant='body1'\r\n\t\t\t\tcolor='error'\r\n\t\t\t\talign='center'\r\n\t\t\t>\r\n\t\t\t\t{isError && formikProps.errors.isSelected}\r\n\t\t\t</Typography>\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nMyCriteriaList.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(MyCriteriaList);","import React from 'react'\r\nimport { withStyles, FormHelperText } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from './GridBlock';\r\nimport getObjectValue from 'libs/getObjectValue'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ttext: {\r\n\t\tmargin: 0,\r\n\t\tmarginBottom: theme.spacing(1)\r\n\t}\r\n})\r\n\r\nfunction ErrorText({\r\n\tclasses,\r\n\tchildren,\r\n\tidList,\r\n\tformikProps,\r\n}) {\r\n\r\n\tlet errorText = undefined;\r\n\r\n\tfor (let i in idList) {\r\n\t\tconst id = idList[i];\r\n\t\tconst errorValue = getObjectValue(id, formikProps.errors, '')\r\n\t\tconst touched = getObjectValue(id, formikProps.touched, false)\r\n\t\tconst isError = !!errorValue && touched;\r\n\t\tif (isError) {\r\n\t\t\terrorText = errorValue;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<GridBlock column >\r\n\t\t\t{children}\r\n\t\t\t{errorText &&\r\n\t\t\t\t<FormHelperText className={classes.text} error>{errorText}</FormHelperText>\r\n\t\t\t}\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nErrorText.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tchildren: PropTypes.any,\r\n\tidList: PropTypes.array,\r\n\tformikProps: PropTypes.object.isRequired,\r\n}\r\n\r\nErrorText.defaultProps = {\r\n\tidList: []\r\n}\r\n\r\nexport default withStyles(style)(ErrorText);","import React, {useEffect, useState} from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport ErrorText from 'components/ErrorText';\r\nimport MeasureUnitService from 'services/MeasureUnitService';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*:last-child': {\r\n\t\t\tflexGrow: 1,\r\n\t\t\ttextAlign: 'right'\r\n\t\t}\r\n\t},\r\n\tinput: {\r\n\t\twidth: theme.components.input.criteria.width,\r\n\t\tmarginLeft: theme.spacing(1),\r\n\t\tmarginRight: theme.spacing(1),\r\n\t},\r\n\tinputkey: {\r\n\t\twidth: theme.components.input.criteriaKey.width,\r\n\t\tmarginLeft: theme.spacing(1),\r\n\t\tmarginRight: theme.spacing(1),\r\n\t},\r\n});\r\n\r\nfunction CriteriaElement({\r\n\tclasses,\r\n\tindex,\r\n\tformikProps,\r\n\tonDelete,\r\n\tdisabled\r\n}) {\r\n\tconst id = 'valuesList';\r\n\tconst [measureUnits, setMeasureUnits] = useState(null);\r\n\tconst editable = getObjectValue('_editable', formikProps.values, false);\r\n\r\n\tuseEffect(() => {\r\n\t\tMeasureUnitService.getRequired().then((resp) => setMeasureUnits(resp));\r\n\t}, []);\r\n\r\n\tconst unitId = formikProps.values.uom;\r\n\tconst unitLabel = unitId && measureUnits ? measureUnits.filter(mu => mu.value === unitId).label : '';\r\n\r\n\tconst unitsId = `${id}.${index}.key`;\r\n\tconst pointsId = `${id}.${index}.value`;\r\n\treturn (\r\n\t\t<ErrorText idList={[unitsId, pointsId]} formikProps={formikProps}>\r\n\t\t\t<GridBlock className={classes.root} alignItems='center' >\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{index + 1}. {Tr('add_criterium_e_eq')}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<TextInput className={classes.inputkey} noError id={unitsId} formikProps={formikProps} disabled={disabled} />\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{unitLabel} {Tr('admit')}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<TextInput\r\n\t\t\t\t\tclassName={classes.input}\r\n\t\t\t\t\tnoError\r\n\t\t\t\t\tid={pointsId}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\ttype={INPUT_TYPE.NUMBER_19}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t/>\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{Tr('points')}.\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<WorkableIconDeleteButton onClick={onDelete} disabled={!editable || disabled}/>\r\n\t\t\t</GridBlock>\r\n\t\t</ErrorText>\r\n\t)\r\n}\r\n\r\nCriteriaElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tonDelete: PropTypes.func,\r\n};\r\n\r\nCriteriaElement.defaultProps = {\r\n};\r\n\r\nexport default withStyles(style)(CriteriaElement);","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Button from 'components/Button';\r\nimport {FieldArray} from 'formik';\r\nimport Tr from 'translations/Translations';\r\nimport AddIcon from '@material-ui/icons/AddBoxOutlined'\r\nimport removeFormikListElement from 'libs/removeFormikListElement';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n    root: {}\r\n})\r\n\r\nfunction CriteriaListBase({\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        Element,\r\n        onAdd,\r\n        disabled\r\n    }) {\r\n\r\n    const handleDelete = index => {\r\n        removeFormikListElement(formikProps, id, index)\r\n    }\r\n    const errorValue = getObjectValue(id, formikProps.errors, null);\r\n    const errorWholeTabValue = Array.isArray(errorValue) ? null : errorValue;\r\n    const editable = getObjectValue('_editable', formikProps.values, false);\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <GridBlock justify='space-between'>\r\n                <Typography variant='body1' className={classes.title}>\r\n                    {Tr('values')}\r\n                </Typography>\r\n            </GridBlock>\r\n            <FieldArray\r\n                name='id'\r\n                render={arrayHelpers => formikProps.values[id].map(\r\n                    (item, i, arr) => {\r\n                        return (\r\n                            <Element\r\n                                key={i}\r\n                                index={i}\r\n                                formikProps={formikProps}\r\n                                onDelete={() => handleDelete(i)}\r\n                                isLast={arr.length - 1 === i}\r\n                                disabled={disabled}\r\n                            />\r\n                        )\r\n                    }\r\n                )}\r\n            />\r\n\t\t\t{!!errorWholeTabValue && <Typography\r\n\t\t\t\tvariant='body1'\r\n\t\t\t\tcolor='error'\r\n\t\t\t>\r\n\t\t\t\t{errorWholeTabValue}\r\n\t\t\t</Typography>}\r\n\r\n            {editable && !disabled &&\r\n            <Button variant='text' onClick={onAdd} Icon={AddIcon}>\r\n                {Tr('specify_value')}\r\n            </Button>\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nCriteriaListBase.propTypes = {\r\n    classes: PropTypes.any,\r\n    Element: PropTypes.object,\r\n    onDelete: PropTypes.func,\r\n    onAdd: PropTypes.func,\r\n}\r\n\r\nCriteriaListBase.defaultProps = {}\r\n\r\nexport default withStyles(style)(CriteriaListBase);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport CriteriaElement from './CriteriaElement';\r\nimport CriteriaListBase from '../components/CriteriaListBase';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ttitle: {\r\n\t\tfontWeight: theme.typography.fontWeightBold,\r\n\t}\r\n})\r\n\r\nfunction CriteriaList({\r\n\tclasses,\r\n\tformikProps,\r\n\tdisabled = false\r\n}) {\r\n\tconst id = 'valuesList';\r\n\r\n\tconst handleAdd = () => {\r\n\t\tformikProps.setFieldValue(id,\r\n\t\t\t[...formikProps.values[id], {\r\n\t\t\t\tkey: '',\r\n\t\t\t\tvalue: ''\r\n\t\t\t}])\r\n\t}\r\n\r\n\treturn (\r\n\t\t<CriteriaListBase\r\n\t\t\tid={id}\r\n\t\t\tformikProps={formikProps}\r\n\t\t\tElement={CriteriaElement}\r\n\t\t\tonAdd={handleAdd}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nCriteriaList.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nCriteriaList.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(CriteriaList);","import React, { useEffect } from 'react'\r\nimport { withStyles, Radio } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport getObjectValue from 'libs/getObjectValue';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\thideElement: {\r\n\t\twidth: 42,\r\n\t}\r\n})\r\n\r\nfunction RadioButton({\r\n\tclasses,\r\n\thide,\r\n\tformikProps,\r\n\tid,\r\n\tpairId,\r\n\tdisabled = false\r\n}) {\r\n\t\r\n\tconst value = getObjectValue(id, formikProps.values, false)\r\n\tconst pairValue = getObjectValue(pairId, formikProps.values, false)\r\n\r\n\tuseEffect(() => {\r\n\t\tif(pairId !== undefined){\r\n\t\t\tformikProps.setFieldValue(id, !pairValue)\r\n\t\t}\r\n\t// eslint-disable-next-line\r\n\t}, [pairValue])\r\n\r\n\tconst handleClick = (e) => {\r\n\t\tconst value = e.target.checked;\r\n\t\tformikProps.setFieldValue(id, value)\r\n\t\tif(pairId !== undefined){\r\n\t\t\tformikProps.setFieldValue(pairId, !value)\r\n\t\t}\r\n\t}\r\n\r\n\tif (hide) {\r\n\t\treturn <div className={classes.hideElement} />\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Radio\r\n\t\t\ttype='checkbox'\r\n\t\t\tonClick={handleClick}\r\n\t\t\tchecked={value}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nRadioButton.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(RadioButton);","import React from 'react'\r\nimport { withStyles, Typography, Tooltip } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport RadioButton from '../../components/RadioButton';\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\tmarginRight: theme.spacing(1),\r\n\t\t}\r\n\t},\r\n\tinput: {\r\n\t\twidth: theme.components.input.criteria.width,\r\n\t}\r\n});\r\n\r\nfunction BaseVariant({\r\n\tclasses,\r\n\tindex,\r\n\tformikProps,\r\n\tdisableMin = false,\r\n\tdisableMax = false,\r\n\tisLast = false,\r\n\tdisabled\r\n}) {\r\n\tconst criterionId = 'intervalList';\r\n\r\n\tconst pointsId = `${criterionId}.${index}.value`;\r\n\tconst minId = `${criterionId}.${index}.from`;\r\n\tconst maxId = `${criterionId}.${index}.to`;\r\n\tconst minRadioId = `${criterionId}.${index}.fromInclusive`;\r\n\tconst maxRadioId = `${criterionId}.${index}.toInclusive`;\r\n\tconst nextMinRadioId = `${criterionId}.${index + 1}.fromInclusive`;\r\n\tconst editable = getObjectValue('_editable', formikProps.values, false);\r\n\r\n\treturn (\r\n\t\t<GridBlock alignItems='center' className={classes.root}>\r\n\t\t\t<Tooltip title={Tr('inclusive_from')} placement='top'>\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<RadioButton\r\n\t\t\t\t\t\thide={disableMin}\r\n\t\t\t\t\t\tid={minRadioId}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tdisabled={!editable || disabled}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</Tooltip>\r\n\t\t\t<TextInput\r\n\t\t\t\tid={minId}\r\n\t\t\t\tclassName={classes.input}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tnoError\r\n\t\t\t\tdisabled={disableMin || disabled}\r\n\t\t\t\tplaceholder={Tr('from')}\r\n\t\t\t\ttype={INPUT_TYPE.NUMBER_19}\r\n\t\t\t/>\r\n\t\t\t<Tooltip title={Tr('inclusive_to')} placement='top'>\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<RadioButton\r\n\t\t\t\t\t\thide={disableMax}\r\n\t\t\t\t\t\tid={maxRadioId}\r\n\t\t\t\t\t\tpairId={isLast ? undefined : nextMinRadioId}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tdisabled={!editable || disabled}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</Tooltip>\r\n\t\t\t<TextInput\r\n\t\t\t\tid={maxId}\r\n\t\t\t\tclassName={classes.input}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tnoError\r\n\t\t\t\tdisabled={disableMax || disabled}\r\n\t\t\t\tplaceholder={Tr('to')}\r\n\t\t\t\ttype={INPUT_TYPE.NUMBER_19}\r\n\t\t\t/>\r\n\t\t\t<Typography variant='body1'>\r\n\t\t\t\t{Tr('admit')}\r\n\t\t\t</Typography>\r\n\t\t\t<TextInput\r\n\t\t\t\tid={pointsId}\r\n\t\t\t\tclassName={classes.input}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\ttype={INPUT_TYPE.NUMBER_19}\r\n\t\t\t\tnoError\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t/>\r\n\t\t\t<Typography variant='body1'>\r\n\t\t\t\t{Tr('points')}.\r\n\t\t\t</Typography>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nBaseVariant.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tchildren: PropTypes.any,\r\n};\r\n\r\nBaseVariant.defaultProps = {\r\n};\r\n\r\nexport default withStyles(style)(BaseVariant);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport BaseVariant from './BaseVariant';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t\r\n\t},\r\n})\r\n\r\nfunction RangeVariant({\r\n\tindex,\r\n\tformikProps,\r\n\tisLast,\r\n\tdisabled\r\n}) {\r\n\r\n\treturn (\r\n\t\t<BaseVariant\r\n\t\t\tindex={index}\r\n\t\t\tformikProps={formikProps}\r\n\t\t\tisLast={isLast}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nRangeVariant.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nRangeVariant.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(RangeVariant);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport BaseVariant from './BaseVariant';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tinput: {\r\n\t\twidth: theme.components.input.criteria.width,\r\n\t}\r\n})\r\n\r\nfunction SmallerVariant({\r\n\tclasses,\r\n\tindex,\r\n\tformikProps,\r\n\tisLast,\r\n\tdisabled\r\n}) {\r\n\r\n\treturn (\r\n\t\t<BaseVariant\r\n\t\t\tindex={index}\r\n\t\t\tformikProps={formikProps}\r\n\t\t\tdisableMin\r\n\t\t\tisLast={isLast}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nSmallerVariant.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nSmallerVariant.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(SmallerVariant);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport BaseVariant from './BaseVariant';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction BiggerVariant({\r\n\tclasses,\r\n\tindex,\r\n\tformikProps,\r\n\tisLast,\r\n\tdisabled\r\n}) {\r\n\treturn (\r\n\t\t<BaseVariant\r\n\t\t\tindex={index}\r\n\t\t\tformikProps={formikProps}\r\n\t\t\tdisableMax\r\n\t\t\tisLast={isLast}\r\n\t\t\tdisabled={disabled}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nBiggerVariant.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nBiggerVariant.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(BiggerVariant);","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Select from 'components/Select';\r\nimport criteriaElementVariants, { VARIANT_CODE } from '../constants/criteriaElement.variants'\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport RangeVariant from './elementVariants/RangeVariant';\r\nimport SmallerVariant from './elementVariants/SmallerVariant';\r\nimport BiggerVariant from './elementVariants/BiggerVariant';\r\nimport ErrorText from 'components/ErrorText';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\tmarginRight: theme.spacing(1),\r\n\t\t\t'&:last-child': {\r\n\t\t\t\tflexGrow: 1,\r\n\t\t\t\ttextAlign: 'right'\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tselect: {\r\n\t\twidth: 130,\r\n\t},\r\n})\r\n\r\nfunction CriteriaElement({\r\n\tclasses,\r\n\tindex,\r\n\tformikProps,\r\n\tonDelete,\r\n\tisLast,\r\n\tdisabled\r\n}) {\r\n\tconst criterionId = 'intervalList';\r\n\tconst variantId = `${criterionId}.${index}.type`;\r\n\tconst variant = getObjectValue(variantId, formikProps.values);\r\n\tconst editable = getObjectValue('_editable', formikProps.values, false);\r\n\r\n\tconst getVariant = () => {\r\n\r\n\t\tswitch (variant) {\r\n\t\t\tcase VARIANT_CODE.RANGE: return <RangeVariant isLast={isLast} index={index} formikProps={formikProps} disabled={disabled} />\r\n\t\t\tcase VARIANT_CODE.SMALLER: return <SmallerVariant isLast={isLast} index={index} formikProps={formikProps} disabled={disabled} />\r\n\t\t\tcase VARIANT_CODE.BIGGER: return <BiggerVariant isLast={isLast} index={index} formikProps={formikProps} disabled={disabled} />\r\n\t\t\tdefault: return '';\r\n\t\t}\r\n\t}\r\n\r\n\tconst getErrorIds = () => {\r\n\t\tlet arrayIds = [`${criterionId}.${index}.value`]\r\n\t\tswitch (variant) {\r\n\t\t\tcase VARIANT_CODE.RANGE:\r\n\t\t\t\tarrayIds.push(`${criterionId}.${index}.from`)\r\n\t\t\t\tarrayIds.push(`${criterionId}.${index}.to`)\r\n\t\t\t\tbreak;\r\n\t\t\tcase VARIANT_CODE.SMALLER:\r\n\t\t\t\tarrayIds.push(`${criterionId}.${index}.to`)\r\n\t\t\t\tbreak;\r\n\t\t\tcase VARIANT_CODE.BIGGER:\r\n\t\t\t\tarrayIds.push(`${criterionId}.${index}.from`)\r\n\t\t\t\tbreak;\r\n\t\t\tdefault: break;\r\n\t\t}\r\n\t\treturn arrayIds;\r\n\t}\r\n\t\r\n\treturn (\r\n\t\t<ErrorText idList={getErrorIds()} formikProps={formikProps}>\r\n\t\t\t<GridBlock className={classes.root} alignItems='center'>\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{index + 1}.\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Select\r\n\t\t\t\t\tclassName={classes.select}\r\n\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\titems={criteriaElementVariants}\r\n\t\t\t\t\tid={variantId}\r\n\t\t\t\t\tnoError\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t/>\r\n\t\t\t\t{getVariant()}\r\n\t\t\t\t<WorkableIconDeleteButton onClick={onDelete} disabled={!editable || disabled}/>\r\n\t\t\t</GridBlock>\r\n\t\t</ErrorText>\r\n\t)\r\n}\r\n\r\nCriteriaElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nCriteriaElement.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(CriteriaElement);","export default {\r\n\tlastItem: (arr) => arr[arr.length - 1]\r\n}","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport CriteriaListBase from '../components/CriteriaListBase';\r\nimport CriteriaElement from './CriteriaElement';\r\nimport {VARIANT_CODE} from '../constants/criteriaElement.variants';\r\nimport arrayExtension from 'libs/arrayExtension'\r\n\r\nconst style = theme => ({\r\n    root: {}\r\n})\r\n\r\nfunction CriteriaList({\r\n                          classes,\r\n                          formikProps,\r\n                          disabled\r\n                      }) {\r\n    const id = 'intervalList';\r\n\r\n    const handleAdd = () => {\r\n        let lastItem = arrayExtension.lastItem(formikProps.values[id]);\r\n        if (lastItem === undefined) {\r\n            lastItem = {\r\n                to: '',\r\n                id: 0,\r\n                fromInclusive: false,\r\n                toInclusive: false\r\n            }\r\n        }\r\n\r\n        formikProps.setFieldValue(id,\r\n            [...formikProps.values[id], {\r\n                type: VARIANT_CODE.RANGE,\r\n                from: lastItem.to,\r\n                to: '',\r\n                fromInclusive: !lastItem.toInclusive,\r\n                toInclusive: false,\r\n                value: '',\r\n                id: lastItem.id + 1,\r\n            }])\r\n    }\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <CriteriaListBase\r\n                id={id}\r\n                formikProps={formikProps}\r\n                Element={CriteriaElement}\r\n                onAdd={handleAdd}\r\n                disabled={disabled}\r\n            />\r\n        </div>\r\n    )\r\n}\r\n\r\nCriteriaList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nCriteriaList.defaultProps = {}\r\n\r\nexport default withStyles(style)(CriteriaList);","import React, {useEffect, useState} from 'react'\r\nimport {Box, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport FormTabs from './components/FormTabs';\r\nimport MeasureUnitService from 'services/MeasureUnitService';\r\nimport OtherCriteriaFields from './components/OtherCriteriaFields';\r\nimport MyCriteriaList from './myCriteriaList/MyCriteriaList';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport Select from 'components/Select';\r\nimport ListVariantCriteriaList from './listVariant/CriteriaList';\r\nimport AllocationVariantCriteriaList from './intervalVariant/CriteriaList';\r\nimport PartsTable from 'components/PartsTable';\r\nimport {CriterionDictionaryItems, PriceCriterionDictionaryItems} from 'constants/DirectionsItems';\r\nimport UploadFile from 'components/UploadFile';\r\nimport {VARIANT_CODE as CRITERIA_TYPE} from './constants/criteria.variants'\r\nimport {VALUES as TABS_VALUES} from './constants/tabs.values'\r\nimport {CRYTERIUM_TYPE} from './constants/criterium.type';\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport Loading from \"components/Loading\";\r\nimport {connect} from \"react-redux\";\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\n\r\nconst style = theme => ({\r\n    root: {}\r\n})\r\n\r\nfunction CriteriaFormBody(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        getInitialValues,\r\n        isEdit,\r\n        elementList,\r\n        selectedItems,\r\n        initValues,\r\n        showParts,\r\n        demandHeader\r\n    }) {\r\n\r\n    const [measureUnits, setMeasureUnits] = useState(null);\r\n\r\n    useEffect(() => {\r\n        MeasureUnitService.getWithEmptyOption().then((resp) => setMeasureUnits(resp));\r\n    }, []);\r\n\r\n    const handleTabChange = (change) => {\r\n        if (change !== formikProps.values.tab) {\r\n            if (change === TABS_VALUES.MY_CRITERIA) {\r\n                formikProps.setFieldValue('type', undefined)\r\n            } else if (formikProps.values.type === undefined) {\r\n                formikProps.setValues(getInitialValues())\r\n            }\r\n            formikProps.setTouched({})\r\n        }\r\n    }\r\n\r\n    const uiType = formikProps.values.uiType;\r\n    const type = formikProps.values.type;\r\n\r\n    if (!measureUnits) {\r\n        return (\r\n            <Loading/>\r\n        )\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <FormTabs\r\n                id='tab'\r\n                formikProps={formikProps}\r\n                onChange={handleTabChange}\r\n            />\r\n            {formikProps.values.tab === TABS_VALUES.NEW &&\r\n            <OtherCriteriaFields\r\n                formikProps={formikProps}\r\n                edit={isEdit}\r\n                selectedItems={selectedItems}\r\n                initValues={initValues}\r\n            />\r\n            }\r\n            {formikProps.values.tab === TABS_VALUES.MY_CRITERIA &&\r\n            <MyCriteriaList formikProps={formikProps}/>\r\n            }\r\n\r\n            <TextInput\r\n                id='weight'\r\n                label={Tr('weight')}\r\n                endAdornment={'%'}\r\n                formikProps={formikProps}\r\n                className={classes.weightInput}\r\n                disabled={type === CRYTERIUM_TYPE.PRICE || (!isDemandPreparing() && !!initValues)}\r\n                type={INPUT_TYPE.NUMBER_19}\r\n                step=\"0.01\"\r\n                required\r\n            />\r\n\r\n            {(uiType === CRITERIA_TYPE.LIST\r\n                || uiType === CRITERIA_TYPE.INTERVAL\r\n                || uiType === CRITERIA_TYPE.NUMBER\r\n                || uiType === CRITERIA_TYPE.PRICE) &&\r\n            <>\r\n                {(type !== CRYTERIUM_TYPE.PRICE && uiType !== CRITERIA_TYPE.PRICE) &&\r\n                <Select\r\n                    id='uom'\r\n                    label={Tr('measure_unit')}\r\n                    items={measureUnits}\r\n                    formikProps={formikProps}\r\n                />\r\n                }\r\n                {\r\n                    (uiType === CRITERIA_TYPE.NUMBER || uiType === CRITERIA_TYPE.PRICE) &&\r\n                    <Select\r\n                        id='direction'\r\n                        label={Tr('formula')}\r\n                        items={type === CRYTERIUM_TYPE.PRICE ? PriceCriterionDictionaryItems : CriterionDictionaryItems}\r\n                        formikProps={formikProps}\r\n                        required\r\n                    />\r\n                }\r\n            </>\r\n            }\r\n            {uiType === CRITERIA_TYPE.LIST &&\r\n            <ListVariantCriteriaList\r\n                formikProps={formikProps}\r\n                disabled={!isDemandPreparing() && !!initValues}\r\n            />\r\n            }\r\n            {uiType === CRITERIA_TYPE.INTERVAL &&\r\n            <AllocationVariantCriteriaList\r\n                formikProps={formikProps}\r\n                disabled={!isDemandPreparing() && !!initValues}\r\n            />\r\n            }\r\n\r\n            {!!demandHeader && demandHeader.apiVersion < 3 &&\r\n            <Box component=\"div\" className={classes.uploadFile}>\r\n                <UploadFile\r\n                    id=\"attachments\"\r\n                    formikProps={formikProps}\r\n                    label={Tr(\"attachment\")}\r\n                />\r\n            </Box>\r\n            }\r\n\r\n            {elementList.length > 1 &&\r\n            <PartsTable\r\n                id={'parts'}\r\n                formikProps={formikProps}\r\n                elementList={elementList}\r\n            />\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nCriteriaFormBody.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n}))(withStyles(style)(CriteriaFormBody));","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport {VALUES as TABS_VALUES} from './constants/tabs.values'\r\nimport {VARIANT_CODE as CRITERIA_TYPE} from './constants/criteria.variants'\r\nimport {CRYTERIUM_TYPE as CRYTERIUM_VARIANT, CRYTERIUM_TYPE, CRYTERIUM_TYPE_LABEL} from './constants/criterium.type'\r\nimport validationSheme from './constants/validation.form'\r\nimport CriteriaFormBody from './CriteriaFormBody';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    weightInput: {\r\n        width: 180,\r\n    },\r\n    uploadFile: {\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction CriteriaForm({\r\n        classes,\r\n        onSubmit = () => {\r\n        },\r\n        id,\r\n        partId,\r\n        initValues,\r\n        elementList,\r\n        selectedItems,\r\n        demandId,\r\n        stageId,\r\n        showParts = true\r\n    }) {\r\n\r\n    const handleSubmit = async (value) => {\r\n        onSubmit({\r\n            ...value,\r\n            intervalList: value.intervalList.map(({id, ...x}) => x),\r\n        });\r\n    }\r\n\r\n    const getInitialValues = () => {\r\n        if (initValues !== undefined) {\r\n            return {\r\n                tab: TABS_VALUES.NEW,\r\n                parts: {\r\n                    [partId]: true,\r\n                },\r\n                ...initValues,\r\n                intervalList: initValues.intervalList.map((x, i) => ({id: i, ...x})),\r\n            };\r\n        }\r\n        return {\r\n            tab: TABS_VALUES.NEW,\r\n            type: CRYTERIUM_VARIANT.OTHER,\r\n            uiType: CRITERIA_TYPE.TEXT,\r\n            otherName: '',\r\n            description: '',\r\n            direction: null,\r\n            isSelected: false,\r\n            uom: '',\r\n            intervalList: [],\r\n            valuesList: [],\r\n            parts: {\r\n                [partId]: true,\r\n            },\r\n            weight: '0',\r\n            attachments: null\r\n        }\r\n    }\r\n\r\n    const getNames = () => {\r\n        let selected = selectedItems.map(x => {\r\n            if (x.type === CRYTERIUM_TYPE.OTHER ||\r\n                x.type === CRYTERIUM_TYPE.PRICE) return x.otherName;\r\n            return CRYTERIUM_TYPE_LABEL[x.type];\r\n        });\r\n        if (initValues !== undefined) {\r\n            let initValuesName = CRYTERIUM_TYPE_LABEL[initValues.type];\r\n            if (initValues.type === CRYTERIUM_TYPE.OTHER || initValues.type === CRYTERIUM_TYPE.PRICE) {\r\n                initValuesName = initValues.otherName;\r\n            }\r\n            var index = selected.indexOf(initValuesName);\r\n            if (index > -1) {\r\n                selected.splice(index, 1);\r\n            }\r\n        }\r\n        return selected;\r\n    }\r\n\r\n    return (\r\n        <Form\r\n            id={id}\r\n            onSubmit={handleSubmit}\r\n            initialValues={{\r\n                ...getInitialValues(),\r\n                _editable: showParts,\r\n            }}\r\n            validationSchema={validationSheme(getNames())}\r\n        >\r\n            {(formikProps) => {\r\n                return (<CriteriaFormBody\r\n                    formikProps={formikProps}\r\n                    getInitialValues={getInitialValues}\r\n                    isEdit={Boolean(initValues)}\r\n                    initValues={initValues}\r\n                    elementList={elementList}\r\n                    selectedItems={selectedItems}\r\n                    showParts={showParts}\r\n                />)\r\n            }}\r\n        </Form>\r\n    )\r\n}\r\n\r\nCriteriaForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(CriteriaForm);\r\n","import React, {useState} from 'react'\r\nimport {Checkbox, FormControlLabel, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport {connect} from 'react-redux'\r\nimport Dialog from 'components/Dialog';\r\nimport CriteriaForm from './CriteriaForm';\r\nimport useId from 'hooks/useId';\r\n\r\nconst style = theme => ({\r\n    content: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    actions: {\r\n        marginTop: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction NewCriteria(\r\n    {\r\n        classes,\r\n        formSubmit,\r\n        onClose,\r\n        onAdd = () => {\r\n        },\r\n        initValues,\r\n        partId,\r\n        elementList,\r\n        selectedItems,\r\n        demandId,\r\n        stageId,\r\n        showParts\r\n    }) {\r\n    const [addCheckbox, setAddCheckbox] = useState(false)\r\n    const formId = useId();\r\n\r\n    const handleClose = () => {\r\n        onClose();\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        formSubmit[formId]()\r\n    }\r\n\r\n    const handleAdd = (values) => {\r\n        onAdd(values);\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={initValues ? Tr('edit_criterion') : Tr('new_criterion')}\r\n            open={true}\r\n            maxWidth={'md'}\r\n            onClose={handleClose}\r\n        >\r\n            <CriteriaForm\r\n                initValues={initValues}\r\n                onSubmit={handleAdd}\r\n                id={formId}\r\n                partId={partId}\r\n                elementList={elementList}\r\n                selectedItems={selectedItems}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                showParts={showParts}\r\n            />\r\n            <div className={classes.actions}>\r\n                {showParts && <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={initValues ? Tr('save') : Tr('add')}\r\n                    onClickFirst={handleClose}\r\n                    onClickSecond={handleSubmit}\r\n                    before={\r\n                        <FormControlLabel\r\n                            control={<Checkbox\r\n                                color='primary'\r\n                                onChange={() => setAddCheckbox(!addCheckbox)}\r\n                                checked={addCheckbox}\r\n                                disabled={true}\r\n                            />}\r\n                            label={Tr('add_to_my_criterion')}\r\n                        />\r\n                    }\r\n                />}\r\n            </div>\r\n        </Dialog>\r\n    )\r\n\r\n\r\n}\r\n\r\nNewCriteria.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nNewCriteria.defaultProps = {}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(withStyles(style)(NewCriteria));","import React, {useState} from 'react'\r\nimport {Divider, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport CriteriaElement from './CriteriaElement';\r\nimport AddButton from 'components/button/AddButton';\r\nimport NewCriteriaPopup from 'components/popup/newCriteria/NewCriteria'\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {CRYTERIUM_TYPE, CRYTERIUM_TYPE_LABEL} from 'components/popup/newCriteria/constants/criterium.type';\r\nimport {withRouter} from \"react-router\";\r\nimport {addElementsToParts, removeElementsfromParts} from \"../lib/manipulateElementsOnParts\";\r\nimport ConfirmDeleteCriterion from \"./ConfirmDeleteCriterion\";\r\nimport _ from 'lodash';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    header: {\r\n        marginTop: theme.spacing(1),\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n    divider: {\r\n        marginTop: theme.spacing(1),\r\n        marginBottom: theme.spacing(1),\r\n    }\r\n})\r\n\r\nfunction CriteriaSection(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        partId,\r\n        criteriaSumId,\r\n        match,\r\n        stageId,\r\n    }) {\r\n    const [criteriaPopup, setCriteriaPopup] = useState(false)\r\n    const [editElement, setEditElement] = useState();\r\n    const [openDeletePopup, setOpenDeletePopup] = useState(false);\r\n    const demandId = match.params.id;\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const thisId = id;\r\n\r\n    const elements = getObjectValue(thisId, formikProps.values, [])\r\n\r\n    const handleAddCriteria = ({parts, ...values}) => {\r\n        addElementsToParts(formikProps, id, parts, values, editElement, demandId);\r\n        setCriteriaPopup(false);\r\n        setEditElement();\r\n    }\r\n\r\n    const handleEdit = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setCriteriaPopup(true);\r\n    }\r\n\r\n    const criteriaSumError = getObjectValue(criteriaSumId, formikProps.errors, [])\r\n    const isError = !!criteriaSumError;\r\n\r\n    const handleDeleteButtonPress = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenDeletePopup(true);\r\n    }\r\n\r\n    const onCloseDeletePopup = () => {\r\n        setOpenDeletePopup(false)\r\n        setEditElement();\r\n    }\r\n\r\n    const handleDeleteCondition = ({parts}) => {\r\n        removeElementsfromParts(formikProps, id, parts, editElement, demandId);\r\n        setOpenDeletePopup(false);\r\n        setEditElement();\r\n    }\r\n\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                className={classes.root}\r\n                direction='column'\r\n            >\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.header}\r\n                >\r\n                    {Tr('criteria')}({elements.length})\r\n                </Typography>\r\n                <GridBlock alignItems='center'>\r\n                    {\r\n                        elements.map((item, i) => {\r\n                            let name = item.type === CRYTERIUM_TYPE.OTHER ? item.otherName : CRYTERIUM_TYPE_LABEL[item.type];\r\n                            if (item.type === CRYTERIUM_TYPE.PRICE\r\n                                && Boolean(item.otherName)) {\r\n                                name = item.otherName;\r\n                            }\r\n                            return (\r\n                                <CriteriaElement\r\n                                    key={i}\r\n                                    name={name}\r\n                                    type={item.type}\r\n                                    formikProps={formikProps}\r\n                                    onDelete={handleDeleteButtonPress}\r\n                                    id={thisId}\r\n                                    index={i}\r\n                                    onEdit={() => handleEdit(i)}\r\n                                    disabled={!editable}\r\n                                />\r\n                            )\r\n                        })\r\n                    }\r\n\r\n                    <AddButton\r\n                        disabled={!editable}\r\n                        onClick={() => {\r\n                            setEditElement()\r\n                            setCriteriaPopup(true)\r\n                        }}>\r\n                        {Tr('add_criteria')}\r\n                    </AddButton>\r\n                </GridBlock>\r\n\r\n                {(isError) &&\r\n                <Typography variant='body1' color='error'>\r\n                    {criteriaSumError}\r\n                </Typography>\r\n                }\r\n                <Divider className={classes.divider}/>\r\n            </GridBlock>\r\n            {criteriaPopup && <NewCriteriaPopup\r\n                onAdd={handleAddCriteria}\r\n                onClose={() => setCriteriaPopup(false)}\r\n                partId={partId}\r\n                selectedItems={elements}\r\n                initValues={editElement}\r\n                elementList={formikProps.values.form}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                showParts={editable}\r\n            />}\r\n            {openDeletePopup && <ConfirmDeleteCriterion\r\n                onClose={() => onCloseDeletePopup()}\r\n                onDelete={handleDeleteCondition}\r\n                partId={partId}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                initCrit={editElement}\r\n                allItems={formikProps.values.form}\r\n                id={id}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nCriteriaSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(withRouter(CriteriaSection));","import Tr from 'translations/Translations';\r\n\r\nexport const POSITION_TYPE = {\r\n\tTEXT: 'TEXT',\r\n\tYES_NO: 'YESNO',\r\n}\r\n\r\nexport const POSITION_TYPE_LABEL = {\r\n\t[POSITION_TYPE.TEXT]: Tr('text'),\r\n\t[POSITION_TYPE.YES_NO]: Tr('yes')+'/'+Tr('no'),\r\n}\r\n\r\nconst createItem = (key) => ({\r\n\tlabel: POSITION_TYPE_LABEL[key],\r\n\tvalue: key\r\n})\r\n\r\nexport default [\r\n\tcreateItem(POSITION_TYPE.TEXT),\r\n\tcreateItem(POSITION_TYPE.YES_NO),\r\n]","import * as Yup from 'yup'\r\nimport ValidationShema from 'constants/ValidationShema';\r\nimport Tr from 'translations/Translations';\r\nimport ImputLimits from 'constants/InputLimits';\r\nimport {POSITION_TYPE} from \"components/popup/addAdditionalPosition/constants/additionalPositionType.values\";\r\n\r\nconst limits = ImputLimits.procedure.parameters;\r\n\r\nexport default (selectedItems) => Yup.lazy(values => {\r\n\r\n\tconst reg = '^(?!(' + selectedItems.map(x => x.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|')+ ')$).*$';\r\n\tconst otherNameRegExp = new RegExp(reg)\r\n\r\n\tlet shapeObj = {\r\n\t\tname: ValidationShema.stringExactlyMax(\r\n\t\t\totherNameRegExp,\r\n\t\t\tTr('v_position_exist'),\r\n\t\t\tlimits.NAME\r\n\t\t)\r\n\t}\r\n\r\n\tif (values.uiType === POSITION_TYPE.YES_NO) {\r\n\t\tshapeObj = {\r\n\t\t\t...shapeObj,\r\n\t\t\tshowCommentField: ValidationShema.requiredBoolean()\r\n\t\t}\r\n\t}\r\n\r\n\treturn Yup.object().shape(shapeObj);\r\n})","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport positionTypes, {POSITION_TYPE} from './constants/additionalPositionType.values'\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport Select from 'components/Select';\r\nimport PartsTable from 'components/PartsTable';\r\nimport BooleanItems from 'constants/BooleanItems';\r\nimport validationSheme from './constants/validation.form'\r\nimport InputLimits from 'constants/InputLimits';\r\nimport getObjectValue from 'libs/getObjectValue';\r\n\r\nconst limits = InputLimits.procedure.parameters;\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tuploadFile: {\r\n\t\tmarginBottom: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction AddAdditionalPositionForm({\r\n\tclasses,\r\n\tonSubmit = () => { },\r\n\tid,\r\n\tinitValues,\r\n\tpartId,\r\n\telementList,\r\n\tshowParts = true,\r\n}) {\r\n\r\n\tconst getInitialValues = () => {\r\n\t\tif (initValues !== undefined) {\r\n\t\t\treturn {\r\n\t\t\t\t...initValues,\r\n\t\t\t\tparts: {\r\n\t\t\t\t\t[partId]: true,\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tuiType: POSITION_TYPE.TEXT,\r\n\t\t\tshowCommentField: null,\r\n\t\t\tdescription: '',\r\n\t\t\tname: '',\r\n\t\t\tparts: {\r\n\t\t\t\t[partId]: true,\r\n\t\t\t},\r\n\t\t\tattachments: null\r\n\t\t}\r\n\t}\r\n\r\n\tconst getNames = () => {\r\n\t\tlet elementId = elementList.findIndex((x) => x.identity === partId)\r\n\t\tlet selected = elementList[elementId].stages[0].parameters.map(x => {\r\n\t\t\treturn x.name;\r\n\t\t})\r\n\t\tif (initValues !== undefined) {\r\n\t\t\tlet initValuesName = initValues.name;\r\n\t\t\tvar index = selected.indexOf(initValuesName);\r\n\t\t\tif (index > -1) {\r\n\t\t\t\tselected.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Form\r\n\t\t\tid={id}\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tinitialValues={{\r\n\t\t\t\t...getInitialValues(),\r\n\t\t\t\t_editable: showParts,\r\n\t\t\t}}\r\n\t\t\tvalidationSchema={validationSheme(getNames())}\r\n\t\t>\r\n\t\t\t{(formikProps) => (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='name'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('position_name')}\r\n\t\t\t\t\t\trequired\r\n\t\t\t\t\t\tlimit={limits.NAME}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<Select\r\n\t\t\t\t\t\tid={'uiType'}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\titems={positionTypes}\r\n\t\t\t\t\t\tlabel={Tr('position_type')}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='description'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('description')}\r\n\t\t\t\t\t\tmultiline\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{getObjectValue('uiType', formikProps.values, false) === POSITION_TYPE.YES_NO &&\r\n\t\t\t\t\t<Select\r\n\t\t\t\t\t\tid='showCommentField'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\titems={BooleanItems}\r\n\t\t\t\t\t\trequired\r\n\t\t\t\t\t\tlabel={Tr('show_comment_field')}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t\t{/*<Box component=\"div\" className={classes.uploadFile}>\r\n\t\t\t\t\t\t<UploadFile\r\n\t\t\t\t\t\t\tid=\"attachments\"\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tlabel={Tr(\"attachment\")}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Box>*/}\r\n\t\t\t\t\t{elementList.length > 1 &&\r\n\t\t\t\t\t\t<PartsTable\r\n\t\t\t\t\t\t\tid={'parts'}\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\telementList={elementList}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\t\t</Form>\r\n\t)\r\n}\r\n\r\nAddAdditionalPositionForm.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(AddAdditionalPositionForm);","import React from 'react'\r\nimport useId from 'hooks/useId';\r\nimport Tr from 'translations/Translations';\r\nimport AddAdditionalPositionForm from './AddAdditionalPositionForm';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport Dialog from 'components/Dialog';\r\nimport {connect} from 'react-redux'\r\n\r\nfunction AddAdditionalPosition(\r\n    {\r\n        onClose = () => {\r\n        },\r\n        formSubmit,\r\n        onAdd,\r\n        initValues,\r\n        partId,\r\n        elementList,\r\n        showParts\r\n    }) {\r\n    const formId = useId();\r\n\r\n    const handleClose = () => {\r\n        onClose();\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        formSubmit[formId]()\r\n    }\r\n\r\n    const handleAdd = (values) => {\r\n        onAdd(values);\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={initValues ? Tr('edit_position') : Tr('add_position')}\r\n            open={true}\r\n            maxWidth='md'\r\n            onClose={handleClose}\r\n            dialogActions={showParts ? <DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={initValues ? Tr('save') : Tr('add')}\r\n                onClickFirst={handleClose}\r\n                onClickSecond={handleSubmit}\r\n            /> : undefined}\r\n        >\r\n            <AddAdditionalPositionForm\r\n                initValues={initValues}\r\n                onSubmit={handleAdd}\r\n                id={formId}\r\n                partId={partId}\r\n                elementList={elementList}\r\n            />\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddAdditionalPosition);","import React, {useState} from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport AddAdditionalPosition from 'components/popup/addAdditionalPosition/AddAdditionalPosition';\r\nimport Tr from 'translations/Translations';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport GridBlock from 'components/GridBlock';\r\nimport AddButton from 'components/button/AddButton';\r\nimport ConditionElement from './ConditionElement';\r\nimport {withRouter} from \"react-router\";\r\nimport {addElementsToParts, removeElementsfromParts} from \"../lib/manipulateElementsOnParts\";\r\nimport ConfirmDeleteCriterion from \"./ConfirmDeleteCriterion\";\r\nimport _ from 'lodash'\r\nconst style = theme => ({\r\n    root: {},\r\n    header: {\r\n        marginTop: theme.spacing(1),\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n})\r\n\r\nfunction AdditionalPositionsSection(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        partId,\r\n        stageId,\r\n        match,\r\n    }) {\r\n    const [openPopup, setOpenPopup] = useState(false)\r\n    const [editElement, setEditElement] = useState();\r\n    const [openDeletePopup, setOpenDeletePopup] = useState(false);\r\n    const demandId = match.params.id;\r\n\r\n    const thisId = id;\r\n\r\n    const elements = getObjectValue(thisId, formikProps.values, [])\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const handleAddPosition = ({parts, ...values}) => {\r\n        addElementsToParts(formikProps, thisId, parts, values, editElement, demandId);\r\n        setOpenPopup(false)\r\n        setEditElement()\r\n    }\r\n\r\n    // eslint-disable-next-line\r\n    const handleEdit = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenPopup(true);\r\n    }\r\n\r\n    const handleDeleteButtonPress = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenDeletePopup(true);\r\n    }\r\n\r\n    const onCloseDeletePopup = () => {\r\n        setOpenDeletePopup(false)\r\n        setEditElement();\r\n    }\r\n\r\n    const handleDeleteCondition = ({parts}) => {\r\n        removeElementsfromParts(formikProps, id, parts, editElement, demandId);\r\n        setOpenDeletePopup(false);\r\n        setEditElement();\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                className={classes.root}\r\n                column\r\n            >\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.header}\r\n                >\r\n                    {Tr('additional_positions')}({elements.length})\r\n                </Typography>\r\n                <GridBlock alignItems='center'>\r\n                    {elements.map((item, i) => {\r\n                        return (\r\n                            <ConditionElement\r\n                                id={thisId}\r\n                                index={i}\r\n                                formikProps={formikProps}\r\n                                name={item.name}\r\n                                key={i}\r\n                                onEdit={() => handleEdit(i)}\r\n                                onDelete={handleDeleteButtonPress}\r\n                                disabled={!editable}\r\n                            />\r\n                        )\r\n                    })}\r\n\r\n                    <AddButton\r\n                        onClick={() => {\r\n                            setEditElement()\r\n                            setOpenPopup(true)\r\n                        }}\r\n                        disabled={!editable}\r\n                    >\r\n                        {Tr('additional_form_items')}\r\n                    </AddButton>\r\n                </GridBlock>\r\n            </GridBlock>\r\n\r\n            {openPopup && <AddAdditionalPosition\r\n                onAdd={handleAddPosition}\r\n                onClose={() => setOpenPopup(false)}\r\n                initValues={editElement}\r\n                partId={partId}\r\n                elementList={formikProps.values.form}\r\n                showParts={editable}\r\n            />}\r\n            {openDeletePopup && <ConfirmDeleteCriterion\r\n                onClose={() => onCloseDeletePopup()}\r\n                onDelete={handleDeleteCondition}\r\n                partId={partId}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                initCrit={editElement}\r\n                allItems={formikProps.values.form}\r\n                id={id}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nAdditionalPositionsSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(withRouter(AdditionalPositionsSection));","import Tr from 'translations/Translations';\r\n\r\nexport const ITEM_TYPE = {\r\n\tTEXT: 'TEXT',\r\n}\r\n\r\nexport const ITEM_TYPE_LABEL = {\r\n\t[ITEM_TYPE.TEXT]: Tr('text'),\r\n}\r\n\r\nconst createItem = (key) => ({\r\n\tlabel: ITEM_TYPE_LABEL[key],\r\n\tvalue: key\r\n})\r\n\r\nexport default [\r\n\tcreateItem(ITEM_TYPE.TEXT)\r\n]","import * as Yup from 'yup'\r\nimport ValidationShema from 'constants/ValidationShema';\r\nimport Tr from 'translations/Translations';\r\nimport ImputLimits from 'constants/InputLimits';\r\n\r\nconst limits = ImputLimits.procedure.itemParameters;\r\n\r\nexport default (selectedItems) => Yup.lazy(values => {\r\n\r\n\tconst reg = '^(?!(' + selectedItems.map(x => x.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|')+ ')$).*$';\r\n\tconst otherNameRegExp = new RegExp(reg)\r\n\r\n\tlet shapeObj = {\r\n\t\tname: ValidationShema.stringExactlyMax(\r\n\t\t\totherNameRegExp,\r\n\t\t\tTr('v_position_exist'),\r\n\t\t\tlimits.NAME\r\n\t\t)\r\n\t}\r\n\r\n\treturn Yup.object().shape(shapeObj);\r\n})","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport itemTypes, {ITEM_TYPE} from './constants/itemParameterType.values'\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport Select from 'components/Select';\r\nimport PartsTable from 'components/PartsTable';\r\nimport validationSheme from './constants/validation.form'\r\nimport InputLimits from 'constants/InputLimits';\r\n\r\nconst limits = InputLimits.procedure.itemParameters;\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tuploadFile: {\r\n\t\tmarginBottom: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction AddItemParameterForm({\r\n\tclasses,\r\n\tonSubmit = () => { },\r\n\tid,\r\n\tinitValues,\r\n\tpartId,\r\n\telementList,\r\n\tshowParts = true,\r\n}) {\r\n\r\n\tconst getInitialValues = () => {\r\n\t\tif (initValues !== undefined) {\r\n\t\t\treturn {\r\n\t\t\t\t...initValues,\r\n\t\t\t\tparts: {\r\n\t\t\t\t\t[partId]: true,\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tuiType: ITEM_TYPE.TEXT,\r\n\t\t\tdescription: '',\r\n\t\t\tname: '',\r\n\t\t\tparts: {\r\n\t\t\t\t[partId]: true,\r\n\t\t\t},\r\n\t\t\tattachments: null\r\n\t\t}\r\n\t}\r\n\r\n\tconst getNames = () => {\r\n\t\tlet elementId = elementList.findIndex((x) => x.identity === partId)\r\n\t\tlet selected = elementList[elementId].stages[0].itemParameters.map(x => {\r\n\t\t\treturn x.name;\r\n\t\t})\r\n\t\tif (initValues !== undefined) {\r\n\t\t\tlet initValuesName = initValues.name;\r\n\t\t\tvar index = selected.indexOf(initValuesName);\r\n\t\t\tif (index > -1) {\r\n\t\t\t\tselected.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Form\r\n\t\t\tid={id}\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tinitialValues={{\r\n\t\t\t\t...getInitialValues(),\r\n\t\t\t\t_editable: showParts,\r\n\t\t\t}}\r\n\t\t\tvalidationSchema={validationSheme(getNames())}\r\n\t\t>\r\n\t\t\t{(formikProps) => (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='name'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('item_parameter_name')}\r\n\t\t\t\t\t\trequired\r\n\t\t\t\t\t\tlimit={limits.NAME}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<Select\r\n\t\t\t\t\t\tid={'uiType'}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\titems={itemTypes}\r\n\t\t\t\t\t\tlabel={Tr('item_parameter_type')}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='description'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('description')}\r\n\t\t\t\t\t\tmultiline\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{/*<Box component=\"div\" className={classes.uploadFile}>\r\n\t\t\t\t\t\t<UploadFile\r\n\t\t\t\t\t\t\tid=\"attachments\"\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tlabel={Tr(\"attachment\")}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Box>*/}\r\n\t\t\t\t\t{elementList.length > 1 &&\r\n\t\t\t\t\t\t<PartsTable\r\n\t\t\t\t\t\t\tid={'parts'}\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\telementList={elementList}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\t\t</Form>\r\n\t)\r\n}\r\n\r\nAddItemParameterForm.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(AddItemParameterForm);","import React from 'react'\r\nimport useId from 'hooks/useId';\r\nimport Tr from 'translations/Translations';\r\nimport AddItemParameterForm from './AddItemParameterForm';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport Dialog from 'components/Dialog';\r\nimport {connect} from 'react-redux'\r\n\r\nfunction AddItemParameter(\r\n    {\r\n        onClose = () => {\r\n        },\r\n        formSubmit,\r\n        onAdd,\r\n        initValues,\r\n        partId,\r\n        elementList,\r\n        showParts\r\n    }) {\r\n    const formId = useId();\r\n\r\n    const handleClose = () => {\r\n        onClose();\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        formSubmit[formId]()\r\n    }\r\n\r\n    const handleAdd = (values) => {\r\n        onAdd(values);\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={initValues ? Tr('item_parameters_edit') : Tr('item_parameters_add')}\r\n            open={true}\r\n            maxWidth='md'\r\n            onClose={handleClose}\r\n            dialogActions={showParts ? <DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={initValues ? Tr('save') : Tr('add')}\r\n                onClickFirst={handleClose}\r\n                onClickSecond={handleSubmit}\r\n            /> : undefined}\r\n        >\r\n            <AddItemParameterForm\r\n                initValues={initValues}\r\n                onSubmit={handleAdd}\r\n                id={formId}\r\n                partId={partId}\r\n                elementList={elementList}\r\n            />\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddItemParameter);","import React, {useState} from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport AddItemParameter from 'components/popup/addItemParameter/AddItemParameter';\r\nimport Tr from 'translations/Translations';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport GridBlock from 'components/GridBlock';\r\nimport AddButton from 'components/button/AddButton';\r\nimport ConditionElement from './ConditionElement';\r\nimport {withRouter} from \"react-router\";\r\nimport {addElementsToParts, removeElementsfromParts} from \"../lib/manipulateElementsOnParts\";\r\nimport ConfirmDeleteCriterion from \"./ConfirmDeleteCriterion\";\r\nimport _ from 'lodash';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    header: {\r\n        marginTop: theme.spacing(1),\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n})\r\n\r\nfunction PositionsParametersSection(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        id,\r\n        partId,\r\n        stageId,\r\n        match,\r\n    }) {\r\n    const [openPopup, setOpenPopup] = useState(false)\r\n    const [editElement, setEditElement] = useState();\r\n    const [openDeletePopup, setOpenDeletePopup] = useState(false);\r\n    const demandId = match.params.id;\r\n\r\n    const thisId = id;\r\n\r\n    const elements = getObjectValue(thisId, formikProps.values, [])\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const handleAddPosition = ({parts, ...values}) => {\r\n        addElementsToParts(formikProps, thisId, parts, values, editElement, demandId);\r\n        setOpenPopup(false)\r\n        setEditElement()\r\n    }\r\n\r\n    // eslint-disable-next-line\r\n    const handleEdit = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenPopup(true);\r\n    }\r\n\r\n    const handleDeleteButtonPress = (index) => {\r\n        setEditElement(_.cloneDeep(elements[index]));\r\n        setOpenDeletePopup(true);\r\n    }\r\n\r\n    const onCloseDeletePopup = () => {\r\n        setOpenDeletePopup(false)\r\n        setEditElement();\r\n    }\r\n\r\n    const handleDeleteCondition = ({parts}) => {\r\n        removeElementsfromParts(formikProps, id, parts, editElement, demandId);\r\n        setOpenDeletePopup(false);\r\n        setEditElement();\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                className={classes.root}\r\n                column\r\n            >\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.header}\r\n                >\r\n                    {Tr('item_parameters')}({elements.length})\r\n                </Typography>\r\n                <GridBlock alignItems='center'>\r\n                    {elements.map((item, i) => {\r\n                        return (\r\n                            <ConditionElement\r\n                                id={thisId}\r\n                                index={i}\r\n                                formikProps={formikProps}\r\n                                name={item.name}\r\n                                key={i}\r\n                                onEdit={() => handleEdit(i)}\r\n                                onDelete={handleDeleteButtonPress}\r\n                                disabled={!editable}\r\n                            />\r\n                        )\r\n                    })}\r\n\r\n                    <AddButton\r\n                        onClick={() => {\r\n                            setEditElement()\r\n                            setOpenPopup(true)\r\n                        }}\r\n                        disabled={!editable}\r\n                    >\r\n                        {Tr('item_parameters_add')}\r\n                    </AddButton>\r\n                </GridBlock>\r\n            </GridBlock>\r\n\r\n            {openPopup && <AddItemParameter\r\n                onAdd={handleAddPosition}\r\n                onClose={() => setOpenPopup(false)}\r\n                initValues={editElement}\r\n                partId={partId}\r\n                elementList={formikProps.values.form}\r\n                showParts={editable}\r\n            />}\r\n            {openDeletePopup && <ConfirmDeleteCriterion\r\n                onClose={() => onCloseDeletePopup()}\r\n                onDelete={handleDeleteCondition}\r\n                partId={partId}\r\n                demandId={demandId}\r\n                stageId={stageId}\r\n                initCrit={editElement}\r\n                allItems={formikProps.values.form}\r\n                id={id}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nPositionsParametersSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(withRouter(PositionsParametersSection));","import React, {useEffect, useState} from 'react'\r\nimport {Box, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport CPVInput from 'components/CPVInput';\r\nimport NetGrossField from 'components/NetGrossField';\r\nimport PositionsSection from './PositionsSection'\r\nimport ConditionsSection from './ConditionsSection'\r\nimport CriteriaSection from './CriteriaSection'\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport Loading from 'components/Loading';\r\nimport {withRouter} from \"react-router\";\r\nimport DealingsService from 'services/DealingsService';\r\nimport AdditionalPositionsSection from './AdditionalPositionsSection';\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport mergeDealing from '../lib/mergeDealing';\r\nimport RadioGroup from \"components/RadioGroup\";\r\nimport DatePicker from \"components/DatePicker\";\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport {isNonpublicProcedure} from \"libs/getDemandStatus\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport PositionsParametersSection from \"./PositionsParametersSection\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            width: 'inherit'\r\n        },\r\n        paddingLeft: theme.spacing(4)\r\n    },\r\n    grossNetGrid: {\r\n        '&>*': {\r\n            flexGrow: 1,\r\n            flexBasis: 0,\r\n\r\n            '&:not(:first-child)': {\r\n                marginLeft: theme.spacing(2),\r\n            }\r\n        }\r\n    },\r\n    cpvBox: {\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    loading: {\r\n        height: 100\r\n    }\r\n})\r\n\r\nconst limits = InputLimits.procedure.dealings;\r\n\r\nfunction PartForm(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        dirtyListenerSemaphore,\r\n        id,\r\n        match,\r\n        isDealingElement,\r\n        dealingsList,\r\n        autoSaveFormDraftActive\r\n    }) {\r\n    const createId = (key) => `${id}.${key}`;\r\n    const partId = getObjectValue(createId('identity'), formikProps.values)\r\n    const demandId = match.params.id;\r\n    const [loaded, setLoaded] = useState(isDealingElement);\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n\r\n    useEffect(() => {\r\n        if (demandId && !isDealingElement) {\r\n            DealingsService.get(demandId, partId)\r\n                .then(res => {\r\n                    dirtyListenerSemaphore.current = true;\r\n                    mergeDealing(res, formikProps, id).then(()=> {\r\n                        dirtyListenerSemaphore.current = false;\r\n                        setLoaded(true);\r\n                    });\r\n                    if (autoSaveFormDraftActive) {\r\n                        DealingsService.checkForDraft(demandId, partId).then(res => setDraftConfirm(res.result));\r\n                    }\r\n                });\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    if (!isDealingElement || !loaded || working) {\r\n        return (\r\n            <center className={classes.loading}>\r\n                <Loading/>\r\n            </center>\r\n        )\r\n    }\r\n    const stageId = getObjectValue(createId('stages.0.identity'), formikProps.values);\r\n\r\n    const loadDealingDraft = () => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        DealingsService.loadDraft(demandId, partId).then(res => {\r\n            dirtyListenerSemaphore.current = true;\r\n            mergeDealing(res.result, formikProps, id).then(()=> {\r\n                dirtyListenerSemaphore.current = false;\r\n            });\r\n        });\r\n        setWorking(false);\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                className={classes.root}\r\n                column\r\n            >\r\n                <TextInput\r\n                    formikProps={formikProps}\r\n                    label={Tr('description')}\r\n                    id={createId('description')}\r\n                    multiline\r\n                    required\r\n                />\r\n                {'Framework' === dealingsList.demandVariant &&\r\n                <TextInput\r\n                    id={createId('plannedContractorNumberForAgreement')}\r\n                    label={Tr('planned_contractor_number_for_agreement')}\r\n                    formikProps={formikProps}\r\n                    required\r\n                    limit={limits.PLANNED_CONTRACTOR_NUMBER}\r\n                    type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n                    showErrorImmediately\r\n                />\r\n                }\r\n                { !!dealingsList.planRequired &&\r\n                    <Select\r\n                        id={createId('planItemIdentity')}\r\n                        label={Tr('dealing_plan_item')}\r\n                        required\r\n                        formikProps={formikProps}\r\n                        items={dealingsList.planItems.map(x => createSelectItem(x.identity, x.name, x.number))}\r\n                        />\r\n                }\r\n\r\n                <Box component=\"div\" className={classes.cpvBox}>\r\n                    <CPVInput\r\n                        formikProps={formikProps}\r\n                        id={createId('categoryItemCpv')}\r\n                        label={Tr(isNonpublicProcedure() ? 'cpv_code_nonpublic' : 'cpv_code')}\r\n                        required\r\n                    />\r\n                </Box>\r\n                <RadioGroup\r\n                    id={createId('termOption')}\r\n                    label={Tr('term_deadline')}\r\n                    formikProps={formikProps}\r\n                    items={[\r\n                        { label: Tr('date'), value: \"date\" },\r\n                        { label: Tr('description'), value: \"text\" },\r\n                    ]}\r\n                />\r\n                {getObjectValue(createId('termOption'), formikProps.values) === 'date' ?\r\n                    <DatePicker\r\n                        id={createId('termDate')}\r\n                        label={Tr('choose_date')}\r\n                        formikProps={formikProps}\r\n                        minDate={new Date()}\r\n                    />\r\n                    :\r\n                    <TextInput\r\n                        id={createId('termDescription')}\r\n                        label={Tr('description')}\r\n                        formikProps={formikProps}\r\n                        limit={InputLimits.procedure.basicInformation.TERM_DESCRIPTION}\r\n                        multiline\r\n                    />\r\n                }\r\n                <GridBlock\r\n                    className={classes.grossNetGrid}\r\n                    wrap='nowrap'\r\n                >\r\n                    <NetGrossField\r\n                        required\r\n                        formikProps={formikProps}\r\n                        title={Tr('estimated_value')}\r\n                        id={createId('amount')}\r\n                    />\r\n                    <TitledComponent\r\n                        title={Tr('realization_value')}\r\n                    >\r\n                        <GridBlock>\r\n                            <TextInput\r\n                                id={createId('realizationBeforeOfferAmount.grossValue')}\r\n                                formikProps={formikProps}\r\n                                label={Tr('gross')}\r\n                                type={INPUT_TYPE.NUMBER_19}\r\n                                step=\"0.01\"\r\n                            />\r\n                            <div/>\r\n                        </GridBlock>\r\n                    </TitledComponent>\r\n                </GridBlock>\r\n\r\n                <PositionsSection\r\n                    formikProps={formikProps}\r\n                    id={createId('items')}\r\n                    dealingId={id}\r\n                    priceType={dealingsList.priceType}\r\n                />\r\n                <PositionsParametersSection\r\n                    formikProps={formikProps}\r\n                    partId={partId}\r\n                    stageId={stageId}\r\n                    id={createId('stages.0.itemParameters')}\r\n                />\r\n                <ConditionsSection\r\n                    formikProps={formikProps}\r\n                    rootId={id}\r\n                    partId={partId}\r\n                    id={createId('stages.0.conditions')}\r\n                    checkboxId={createId('stages.0.conditionsInSiwz')}\r\n                    stageId={stageId}\r\n                    dirtyListenerSemaphore={dirtyListenerSemaphore}\r\n                />\r\n                <CriteriaSection\r\n                    formikProps={formikProps}\r\n                    id={createId('stages.0.criterions')}\r\n                    criteriaSumId={createId('stages.0._criteriaSum')}\r\n                    stageId={stageId}\r\n                    partId={partId}\r\n                />\r\n                <AdditionalPositionsSection\r\n                    formikProps={formikProps}\r\n                    partId={partId}\r\n                    stageId={stageId}\r\n                    id={createId('stages.0.parameters')}\r\n                />\r\n            </GridBlock>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={() => loadDealingDraft()}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nPartForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(withRouter(PartForm));","import React, {memo, useMemo} from 'react'\r\nimport {Collapse} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ElementTitle from './ElementTitle';\r\nimport PartForm from './PartForm'\r\nimport removeFormikListElement from 'libs/removeFormikListElement';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from 'react-redux'\r\nimport {addObjectResource, setResource} from 'redux/actions'\r\nimport {wasEverPublished, isNationalProcedure, isEuropeProcedure} from \"libs/getDemandStatus\";\r\n\r\nfunction Element({\r\n                     index,\r\n                     id,\r\n                     formikProps,\r\n                     match,\r\n                     dealing,\r\n                     addObjectResource,\r\n                     dealingsList,\r\n                     dirtyListenerSemaphore,\r\n                     demandHeader,\r\n                     autoSaveFormDraftActive\r\n                 }) {\r\n    const partId = `${id}.${index}`\r\n    const createId = key => `${partId}.${key}`\r\n\r\n    const elements = getObjectValue(id, formikProps.values, []);\r\n    const elementsLength = elements.length;\r\n    const isPublished = useMemo(() => demandHeader ? wasEverPublished() : undefined, [demandHeader]);\r\n    const isPublic = useMemo(() => demandHeader ? isNationalProcedure() || isEuropeProcedure() : undefined, [demandHeader]);\r\n\r\n    const open = getObjectValue(createId('_open'), formikProps.values)\r\n    const setOpen = (value) => {\r\n        dirtyListenerSemaphore.current = true;\r\n        formikProps.setFieldValue(createId('_open'), value)\r\n        if (value === true) {\r\n            formikProps.setFieldValue(createId('_touched'), true)\r\n        }\r\n        dirtyListenerSemaphore.current = false;\r\n    }\r\n    const elementId = getObjectValue(createId('identity'), formikProps.values)\r\n\r\n    const handleDelete = () => {\r\n        //DealingsService.autoSaveDeleteSingle(demendId, index).then(() => {\r\n        addObjectResource('dealing', elementId)\r\n        removeFormikListElement(formikProps, id, index)\r\n        //})\r\n    }\r\n\r\n    let isDealingElement = dealing ? dealing[elementId] ? true : false : false;\r\n\r\n    // const stageCriterions = getObjectValue(createId('stages.0.criterions'), formikProps.values)\r\n    // useEffect(() => {\r\n    // \tlet value = sumCriteria(stageCriterions)\r\n    // \t//formikProps.setFieldValue(createId('_criteriaSum'), value.toFixed(2))\r\n    // \t// formikProps.setFieldTouched(createId('_criteriaSum'), false)\r\n    // \t//eslint-disable-next-line\r\n    // }, [stageCriterions])\r\n\r\n    const renderForm = () => {\r\n        if (open) {\r\n            return (\r\n                <PartForm\r\n                    id={partId}\r\n                    formikProps={formikProps}\r\n                    isDealingElement={isDealingElement}\r\n                    dealingsList={dealingsList}\r\n                    dirtyListenerSemaphore={dirtyListenerSemaphore}\r\n                    autoSaveFormDraftActive={autoSaveFormDraftActive}\r\n                />\r\n            )\r\n        }\r\n        return ''\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <ElementTitle\r\n                id={partId}\r\n                index={index}\r\n                formikProps={formikProps}\r\n                open={open}\r\n                onOpen={() => setOpen(!open)}\r\n                onDelete={handleDelete}\r\n                disableDelete={elementsLength < 2 || (isPublic && isPublished)}\r\n            />\r\n\r\n            <Collapse in={open}>\r\n                {renderForm()}\r\n            </Collapse>\r\n        </>\r\n    )\r\n}\r\n\r\nElement.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    dealing: state.resources.dealing,\r\n    dealingsList: state.resources.dealingsList,\r\n    demandHeader: state.resources.demandHeader\r\n}), {\r\n    setResource,\r\n    addObjectResource,\r\n})(withRouter(memo(Element, (prevProps, nextProps) => {\r\n    if (prevProps.id !== nextProps.id) return false;\r\n    if (prevProps.index !== nextProps.index) return false;\r\n    if (JSON.stringify(prevProps.classes) !== JSON.stringify(nextProps.classes)) return false;\r\n    const partId = nextProps.id + '.' + nextProps.index;\r\n    if (JSON.stringify(prevProps.formikProps.values) !==\r\n        JSON.stringify(nextProps.formikProps.values)\r\n    ) return false;\r\n    if (JSON.stringify(getObjectValue(partId, prevProps.formikProps.errors)) !==\r\n        JSON.stringify(getObjectValue(partId, nextProps.formikProps.errors))\r\n    ) return false;\r\n    if (JSON.stringify(getObjectValue(partId, prevProps.formikProps.touched)) !==\r\n        JSON.stringify(getObjectValue(partId, nextProps.formikProps.touched))\r\n    ) return false;\r\n    if (prevProps.dealing !== nextProps.dealing)\r\n        return false;\r\n    if (prevProps.dealing &&\r\n        nextProps.dealing &&\r\n        JSON.stringify(Object.keys(prevProps.dealing)) !==\r\n        JSON.stringify(Object.keys(nextProps.dealing))\r\n    ) return false;\r\n    // history\r\n    // staticContextx\r\n    // location\r\n    // match\r\n    return true;\r\n})));","import { useEffect } from 'react';\r\n\r\nfunction ExecuteFunction({\r\n\tfunc,\r\n\tshouldExecute = true,\r\n\tconditions = [],\r\n}) {\r\n\tuseEffect(() => {\r\n\t\tif (shouldExecute) {\r\n\t\t\tfunc()\r\n\t\t}\r\n\t}, [func, shouldExecute, conditions])\r\n\treturn ''\r\n}\r\n\r\nexport default ExecuteFunction;","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    }\r\n}))\r\n\r\nfunction DemandValidationMessages(\r\n    {\r\n        section,\r\n        editable\r\n    }) {\r\n    const classes = useStyle();\r\n    const show = editable && section && (section.messages || section.infoMessages);\r\n    return (show && <div className={classes.root}>\r\n        {\r\n            !!section?.messages && section.messages.map((x, i) => <Typography key={i} color=\"error\">{x}</Typography>)\r\n        }\r\n        {\r\n            !!section?.infoMessages && section.infoMessages.map((x, i) => <Typography key={i} color=\"primary\" className={classes.italic}>{x}</Typography>)\r\n        }\r\n    </div>)\r\n}\r\n\r\nDemandValidationMessages.propTypes = {\r\n    section: PropTypes.object,\r\n    editable: PropTypes.bool,\r\n}\r\n\r\nexport default DemandValidationMessages;","import React, {useEffect, useRef, useState} from 'react'\r\nimport {Divider, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport initialValues from './constants/initialValues'\r\nimport AdditionalButtons from './components/AdditionalButtons';\r\nimport {connect} from 'react-redux'\r\nimport Loading from 'components/Loading';\r\nimport {withRouter} from \"react-router\";\r\nimport SaveFormikValues from 'components/SaveFormikValues';\r\nimport SortableContainer from 'components/complex/sortable/SortableContainer';\r\nimport validationSchema from './constants/validationSchema'\r\nimport DealingsService from 'services/DealingsService';\r\nimport Element from './components/Element';\r\nimport setFormikValuesTouched from 'libs/setFormikValuesTouched';\r\nimport ExecuteFunction from 'components/ExecuteFunction';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport {\r\n    clearStepperStateCloseValidator,\r\n    setStepperStateCloseValidator,\r\n    setStepperStateDeleteFormDraftFunction,\r\n    clearStepperStateDeleteFormDraftFunction,\r\n    setStepperStateSaveFormDraftFunction,\r\n    clearStepperStateSaveFormDraftFunction\r\n} from \"redux/actions\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        width: '100%',\r\n        '&>*:last-child': {\r\n            marginTop: theme.spacing()\r\n        }\r\n    },\r\n    error: {\r\n        color: theme.palette.error.main\r\n    }\r\n})\r\n\r\nfunction PositionAndPartsForm(\r\n    {\r\n        classes,\r\n        match,\r\n        expanded,\r\n        section,\r\n        formId,\r\n        dealingsList,\r\n        dealing,\r\n        setStepperStateCloseValidator,\r\n        clearStepperStateCloseValidator,\r\n        setStepperStateDeleteFormDraftFunction,\r\n        clearStepperStateDeleteFormDraftFunction,\r\n        setStepperStateSaveFormDraftFunction,\r\n        clearStepperStateSaveFormDraftFunction,\r\n        saveSuccessCallback,\r\n        saveErrorCallback,\r\n        demandHeader\r\n    }) {\r\n    const [afterSave, setAfterSave] = useState(false);\r\n    const editable = section ? section.editable : true;\r\n\r\n    const realDirty = useRef(\"nie\");\r\n    const dirtyListenerSemaphore = useRef(false);\r\n\r\n    const id = match.params.id;\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active && dealingsList?.dealings?.length <= 30;\r\n\r\n    const [dealingValuesAndActionsForSave, setDealingValuesAndActionsForSave] = useState(null);\r\n    const [getDraftsAndSaveDealingsConfirm, setGetDraftsAndSaveDealingsConfirm] = useState(false);\r\n\r\n    useEffect(() => {\r\n        if (expanded) {\r\n            setStepperStateCloseValidator(() => {\r\n                return realDirty.current !== \"tak\"\r\n            });\r\n            if (autoSaveFormDraftActive) {\r\n                setStepperStateDeleteFormDraftFunction(() => DealingsService.deleteDraft(id));\r\n                setStepperStateSaveFormDraftFunction(() => saveFormDraft(id, DealingsService.saveDraft, formId));\r\n            }\r\n        } else {\r\n            dirtyListenerSemaphore.current = false;\r\n            realDirty.current = \"nie\";\r\n        }\r\n        return () => {\r\n            clearStepperStateCloseValidator();\r\n            clearStepperStateDeleteFormDraftFunction();\r\n            clearStepperStateSaveFormDraftFunction();\r\n        }\r\n\r\n    }, [id, formId, expanded, autoSaveFormDraftActive, setStepperStateCloseValidator, clearStepperStateCloseValidator,\r\n        setStepperStateDeleteFormDraftFunction, clearStepperStateDeleteFormDraftFunction, setStepperStateSaveFormDraftFunction, clearStepperStateSaveFormDraftFunction])\r\n\r\n    const handleSubmit = (values, actions) => {\r\n        if (autoSaveFormDraftActive && dealingsList.dealings.length > (!!dealing ? Object.keys(dealing).length : 0)) {\r\n            const draftPromises = [];\r\n            dealingsList.dealings.filter(d => !!dealing ? !dealing[d.identity] : true).forEach(d => draftPromises.push(DealingsService.checkForDraft(id, d.identity)));\r\n            Promise.all(draftPromises).then(promisesValues => {\r\n                if (promisesValues.some(v => v.result === true)) {\r\n                    setDealingValuesAndActionsForSave([values, actions]);\r\n                    setGetDraftsAndSaveDealingsConfirm(true);\r\n                } else {\r\n                    doSaveDealings(values, actions);\r\n                }\r\n            });\r\n        } else {\r\n            doSaveDealings(values, actions);\r\n        }\r\n    }\r\n\r\n    const getAndInitializeDraftsThenSaveDealings = () => {\r\n        const values = dealingValuesAndActionsForSave[0];\r\n        const actions = dealingValuesAndActionsForSave[1];\r\n        const draftPromises = [];\r\n        dealingsList.dealings.filter(d => !!dealing ? !dealing[d.identity] : true).forEach(d => draftPromises.push(DealingsService.loadDraft(id, d.identity)));\r\n        Promise.all(draftPromises).then(promisesValues => {\r\n            promisesValues.forEach(v => {\r\n                if (v.success) {\r\n                    const dealingDraft = v.result;\r\n                    dealingDraft._touched = true;\r\n                    const tmpArr = values.form.filter(i => i.identity !== dealingDraft.identity);\r\n                    values.form = [\r\n                        ...tmpArr,\r\n                        dealingDraft\r\n                    ]\r\n\r\n                }\r\n            });\r\n            setDealingValuesAndActionsForSave(null);\r\n            doSaveDealings(values, actions);\r\n        });\r\n    }\r\n\r\n    const doNotInitializeDraftsThenSaveDealings = () => {\r\n        const values = dealingValuesAndActionsForSave[0];\r\n        const actions = dealingValuesAndActionsForSave[1];\r\n        setDealingValuesAndActionsForSave(null);\r\n        doSaveDealings(values, actions);\r\n    }\r\n\r\n    const doSaveDealings = (values, actions) => {\r\n        DealingsService.save(id, values)\r\n            .then((success) => {\r\n\r\n                if(success) {\r\n                    realDirty.current = \"nie\";\r\n                    saveSuccessCallback();\r\n                    actions.setValues({\r\n                        form: values.form.map(element => ({\r\n                            ...element,\r\n                            _touched: false,\r\n                            _open: false,\r\n                            _edit: false,\r\n                        }))\r\n                    })\r\n                } else {\r\n                    saveErrorCallback();\r\n                }\r\n\r\n            })\r\n    }\r\n\r\n    if (!dealingsList && id) {\r\n        return <Loading/>\r\n    }\r\n\r\n    const formatDealingList = (list = []) => {\r\n        const _openTouched = list.length === 1;\r\n        return list.map(item => ({\r\n            _open: _openTouched,\r\n            _touched: _openTouched,\r\n            _edit: false,\r\n            ...item,\r\n            stages: [{\r\n                conditions: [],\r\n                criterions: [],\r\n                parameters: [],\r\n            }],\r\n        }));\r\n    }\r\n\r\n    const getInitialValues = () => {\r\n        if (id) {\r\n            return formatDealingList(dealingsList.dealings)\r\n        }\r\n        return initialValues\r\n    }\r\n\r\n    const handleChange = (e) => {\r\n        if (dirtyListenerSemaphore.current === false) {\r\n            realDirty.current = \"tak\";\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <Form\r\n                className={classes.root}\r\n                onSubmit={handleSubmit}\r\n                initialValues={{\r\n                    form: getInitialValues(),\r\n                    _editable: editable,\r\n                }}\r\n                id={formId}\r\n                validationSchema={validationSchema(dealingsList)}\r\n                afterSubmitFunc={() => {\r\n                    setAfterSave(true);\r\n                    if (isDemandModification()) {\r\n                        ModificationService.isDemandChanged(match.params.id);\r\n                    }\r\n                }}\r\n            >\r\n                {(_formikProps) => {\r\n                    const formikProps = {\r\n                        ..._formikProps,\r\n                        setValues: (values, validate) => {\r\n                            handleChange();\r\n                            return _formikProps.setValues(values, validate)\r\n                        },\r\n                        setFieldValue: (field, value, validate) => {\r\n                            handleChange();\r\n                            return _formikProps.setFieldValue(field, value, validate)\r\n                        },\r\n                        handleChange: (e) => {\r\n                            handleChange();\r\n                            return _formikProps.handleChange(e);\r\n                        }\r\n                    }\r\n                    return (\r\n                        <>\r\n\r\n                            <DemandValidationMessages editable={editable} section={section}/>\r\n                            <ExecuteFunction\r\n                                func={() => {\r\n                                    setFormikValuesTouched(formikProps)\r\n                                    setAfterSave(false)\r\n                                }}\r\n                                shouldExecute={afterSave === true}\r\n                            />\r\n                            <SaveFormikValues\r\n                                formikProps={formikProps}\r\n                                id={formId}\r\n                            />\r\n                            {autoSaveFormDraftActive &&\r\n                            <AutoSaveFormValues\r\n                                formikProps={formikProps}\r\n                                id={id}\r\n                                formId={formId}\r\n                                saveFunc={(formValues) => {\r\n                                    DealingsService.saveDraft(id, formValues)\r\n                                }}\r\n                                customDirtyRef={realDirty}\r\n                            />\r\n                            }\r\n                            <SortableContainer\r\n                                formikProps={formikProps}\r\n                                id=\"form\"\r\n                            >\r\n                                {(formikProps, id, index) => {\r\n                                    return (\r\n                                        <div>\r\n                                            <Element\r\n                                                id={id}\r\n                                                formikProps={formikProps}\r\n                                                index={index}\r\n                                                dirtyListenerSemaphore={dirtyListenerSemaphore}\r\n                                                autoSaveFormDraftActive={autoSaveFormDraftActive}\r\n                                            />\r\n                                            <Divider className={classes.divider}/>\r\n                                        </div>\r\n                                    )\r\n                                }}\r\n                            </SortableContainer>\r\n\r\n                            <AdditionalButtons\r\n                                id=\"form\"\r\n                                formikProps={formikProps}\r\n                            />\r\n\r\n                        </>\r\n                    )\r\n                }}\r\n            </Form>\r\n            <Confirm confirmText='dealings_save_found_unloaded_drafts'\r\n                     onCancel={() => {\r\n                         setGetDraftsAndSaveDealingsConfirm(false);\r\n                         doNotInitializeDraftsThenSaveDealings();\r\n                     }}\r\n                     onConfirm={() => {\r\n                         setGetDraftsAndSaveDealingsConfirm(false);\r\n                         getAndInitializeDraftsThenSaveDealings();\r\n                     }}\r\n                     open={getDraftsAndSaveDealingsConfirm}\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nPositionAndPartsForm.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        editable: PropTypes.bool,\r\n        messages: PropTypes.arrayOf(PropTypes.string),\r\n        infoMessages: PropTypes.arrayOf(PropTypes.string),\r\n    }),\r\n    formId: PropTypes.string.isRequired,\r\n    saveSuccessCallback: PropTypes.func.isRequired,\r\n    saveErrorCallback: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    dealingsList: state.resources.dealingsList,\r\n    dealing: state.resources.dealing,\r\n    demandHeader: state.resources.demandHeader\r\n}), {setStepperStateCloseValidator, clearStepperStateCloseValidator,\r\n    setStepperStateDeleteFormDraftFunction, clearStepperStateDeleteFormDraftFunction,\r\n    setStepperStateSaveFormDraftFunction, clearStepperStateSaveFormDraftFunction\r\n})(withStyles(style)(withRouter(PositionAndPartsForm)));","\r\nexport default (formikProps) => {\r\n\tconst getTouchedKeys = (values) => {\r\n\t\tconst obj = Array.isArray(values) ? [] : {}\r\n\r\n\t\tfor (let key in values) {\r\n\t\t\tconst value = values[key];\r\n\t\t\tif (typeof value === 'object') {\r\n\r\n\t\t\t\tobj[key] = getTouchedKeys(value);\r\n\t\t\t} else {\r\n\t\t\t\tobj[key] = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tconst newTouchedObject = getTouchedKeys(formikProps.values);\r\n\tformikProps.setTouched(newTouchedObject)\r\n}","import React, {useState} from 'react';\r\nimport Button from \"components/Button\";\r\nimport Tr from \"translations/Translations\";\r\nimport {Typography, withStyles} from \"@material-ui/core\";\r\nimport DownloadIcon from '@material-ui/icons/GetApp';\r\nimport UploadImportFile from \"./components/UploadImportFile\";\r\nimport {downloadImportTemplate} from \"./lib/downloadImportTemplate\";\r\nimport ImporterForm from \"./components/ImporterForm\";\r\nimport GridBlock from \"components/GridBlock\";\r\n\r\nexport const style = theme => {\r\n    return {\r\n        root: {\r\n            marginTop: theme.spacing(2)\r\n        },\r\n        button: {\r\n            width: 400,\r\n            height: 60,\r\n            marginBottom: theme.spacing(6),\r\n        },\r\n        text: {\r\n            marginBottom: theme.spacing(1),\r\n        }\r\n    }\r\n}\r\n\r\n\r\nconst ImportScreen = (\r\n    {\r\n        classes,\r\n        id\r\n    }\r\n) => {\r\n\r\n    const hideDownloadingTemplate = () => {\r\n        setDownloadingInProgress(false);\r\n    }\r\n    const downloadImportTemplateClick = async () => {\r\n        setDownloadingInProgress(true);\r\n        await downloadImportTemplate(id, hideDownloadingTemplate, hideDownloadingTemplate);\r\n    }\r\n    const [downloadingInProgress, setDownloadingInProgress] = useState(false);\r\n\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                direction=\"column\"\r\n            >\r\n                <Typography\r\n                    className={classes.text}\r\n                >\r\n                    {Tr('dealings_import_step_one_download')}\r\n                </Typography>\r\n\r\n                <Button\r\n                    color={'secondary'}\r\n                    className={classes.button}\r\n                    onClick={downloadImportTemplateClick}\r\n                    Icon={DownloadIcon}\r\n                >\r\n                    {Tr('dealings_import_form')}\r\n                </Button>\r\n\r\n                <Typography\r\n                    className={classes.text}\r\n                >\r\n                    {Tr('dealings_import_step_two_upload')}\r\n                </Typography>\r\n                <UploadImportFile id={id}/>\r\n            </GridBlock>\r\n            <ImporterForm downloadingInProgress={downloadingInProgress}/>\r\n        </>\r\n    );\r\n};\r\n\r\nexport default withStyles(style)(ImportScreen)","import {clearResource, setResource, setSaveStatusError} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestBLOB, RestRequestGET} from \"../libs/RestRequest\";\r\nimport Endpoints from \"../constants/Endpoints\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst PAPERS_GENERATOR_LIST_RESOURCE_ID = 'papersGeneratorList';\r\n\r\nconst getAvailablePapers = async (id) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.PAPERS_GENERATOR(id));\r\n\r\n        reduxStore.dispatch(\r\n            setResource(PAPERS_GENERATOR_LIST_RESOURCE_ID, res)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\n\r\nconst getRfxRequestPosition = async (id) => {\r\n    return await RestRequestGET(Endpoints.RFX_REQUEST_POSITION(id));\r\n}\r\n\r\nconst getSwzParams = async (id) => {\r\n    return await RestRequestGET(Endpoints.SWZ_PARAMS(id));\r\n}\r\n\r\nconst getRfxInvitedSupplierWithOffer = async (id) => {\r\n    return await RestRequestGET(Endpoints.RFX_INVITED_SUPPLIER_WITH_OFFER(id));\r\n}\r\n\r\nconst getRfxInvitedSupplierPosition = async (id, supplierId) => {\r\n    return await RestRequestGET(Endpoints.RFX_INVITED_SUPPLIER_POSITION(id, supplierId));\r\n}\r\n\r\n\r\nconst getSwzGeneratorParams = async (demandId) => {\r\n    const swzGeneratorParams = await RestRequestGET(Endpoints.SIWZ_GET_GENERATOR_PARAMS(demandId));\r\n    return swzGeneratorParams;\r\n}\r\nconst getRfxSupplierAttachmentsVerification = async (demandId, supplierId) => {\r\n    const swzGeneratorParams = await RestRequestGET(Endpoints.GET_SUPPLIER_ATTACHMENTS_VERIFICATION(demandId, supplierId));\r\n    return swzGeneratorParams;\r\n}\r\n\r\nconst downloadPaper = async (url, successCallback = () => {\r\n}, errorCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(url)\r\n            .then(successCallback)\r\n            .catch(errorCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst sharePaperByUrl = async (url, shareSystem) => {\r\n    let params = {\r\n        shareSystem\r\n    }\r\n    try {\r\n        const resp = await RestRequestGET(url, {params});\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return resp.success;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n    return false;\r\n}\r\n\r\n\r\n\r\nconst sharePaper = async (id, paper, shareSystem) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.PAPERS_GENERATOR_PRINT_SHARE(id, paper, shareSystem));\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return resp.success;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n    return false;\r\n}\r\n\r\nconst clearResources = (resource) => reduxStore.dispatch(clearResource(resource));\r\n\r\nexport default {\r\n    getAvailablePapers,\r\n    clearResources,\r\n    getRfxRequestPosition,\r\n    getSwzParams,\r\n    getRfxInvitedSupplierWithOffer,\r\n    getRfxInvitedSupplierPosition,\r\n    getRfxSupplierAttachmentsVerification,\r\n    getSwzGeneratorParams,\r\n    downloadPaper,\r\n    sharePaper,\r\n    sharePaperByUrl,\r\n    PAPERS_GENERATOR_LIST_RESOURCE_ID\r\n}","import React from 'react'\r\nimport {CircularProgress, makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    wrapper: {\r\n        position: \"relative\"\r\n    },\r\n    fabProgress: {\r\n        position: 'absolute',\r\n        left: -4,\r\n        top: -4\r\n    }\r\n}))\r\n\r\nfunction WorkableIcon(\r\n    {\r\n        working,\r\n        Icon,\r\n        ...props\r\n    }) {\r\n    const classes = useStyles();\r\n    return (\r\n        <span className={classes.wrapper}>\r\n            <Icon {...props}/>\r\n            {working && <CircularProgress size={32} className={classes.fabProgress}/>}\r\n        </span>\r\n    )\r\n}\r\n\r\nWorkableIcon.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    Icon: PropTypes.elementType,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIcon;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport ShareIcon from '@material-ui/icons/Share'\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconShareButton(\r\n    {\r\n        tooltip = Tr(\"send\"),\r\n        ...props\r\n    }) {\r\n\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={ShareIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconShareButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.elementType]),\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconShareButton;","import React from \"react\";\r\nimport {ListItem, ListItemIcon, ListItemSecondaryAction, ListItemText} from \"@material-ui/core\";\r\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\r\nimport PrintIcon from \"@material-ui/icons/Print\";\r\nimport WorkableIcon from \"components/button/WorkableIcon\";\r\nimport Tr from \"translations/Translations\";\r\nimport Typography from \"components/Typography\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    italic: {\r\n        fontStyle: 'italic',\r\n        fontSize: '0.75rem'\r\n    }\r\n}))\r\n\r\nconst PaperLink = (\r\n    {\r\n        paper,\r\n        paperWorking,\r\n        editable,\r\n        paperClick,\r\n        showShare,\r\n        shareClick\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <>\r\n            <ListItem button onClick={() => paperClick(paper)} disabled={!editable || (paper.available && paper.waiting) || (!paper.available && !paper.salesModule)}>\r\n                <ListItemIcon>\r\n                    <WorkableIcon\r\n                        Icon={(!paper.waiting && paper.available && !!paper.customPopup) ? ExitToAppIcon : PrintIcon}\r\n                        working={paperWorking === paper.paperId}/>\r\n                </ListItemIcon>\r\n                <ListItemText>\r\n                    {paper.name}\r\n                    {(paper.available && paper.waiting) &&\r\n                        <Typography component='span' className={classes.italic}> {\" (\" + Tr('papers_generator_paper_waiting') + \")\"}</Typography>}\r\n                </ListItemText>\r\n                {showShare &&\r\n                    <ListItemSecondaryAction>\r\n                        <WorkableIconShareButton\r\n                            edge=\"end\"\r\n                            disabled={paper.waiting || !paper.available || !!paperWorking}\r\n                            onClick={() => shareClick(paper)}\r\n                        />\r\n                    </ListItemSecondaryAction>\r\n                }\r\n            </ListItem>\r\n\r\n        </>)\r\n}\r\n\r\nPaperLink.propTypes = {\r\n    paper: PropTypes.shape({\r\n        paperId: PropTypes.string.isRequired,\r\n        name: PropTypes.string.isRequired,\r\n        customPopup: PropTypes.string,\r\n        available: PropTypes.bool.isRequired,\r\n        waiting: PropTypes.bool.isRequired,\r\n    }),\r\n    paperWorking: PropTypes.string,\r\n    paperClick: PropTypes.func.isRequired,\r\n    showShare: PropTypes.bool.isRequired,\r\n    shareClick: PropTypes.func.isRequired,\r\n\r\n}\r\n\r\nexport default PaperLink;","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from \"clsx\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tfontWeight: theme.typography.fontWeightBold,\r\n\t}\r\n})\r\n\r\nfunction BoldTypography({\r\n\tclassName,\r\n\tclasses,\r\n\tchildren,\r\n\t...other\r\n}) {\r\n\treturn (\r\n\t\t<Typography\r\n\t\t\tclassName={clsx(classes.root, className)}\r\n\t\t\t{...other}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</Typography>\r\n\t)\r\n}\r\n\r\nBoldTypography.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tvariant: PropTypes.string\r\n}\r\n\r\nexport default withStyles(style)(BoldTypography);","import {useSnackbar as useSnackbarNotistack} from \"notistack\";\r\n\r\nexport default function useSnackbar() {\r\n\r\n    const {closeSnackbar, enqueueSnackbar} = useSnackbarNotistack();\r\n\r\n    function enqueueDefaultSnackbar(message, options) {\r\n        return doSnackbar(message, options, 'default')\r\n    }\r\n\r\n    function enqueueInfoSnackbar(message, options) {\r\n        return doSnackbar(message, options, 'info')\r\n    }\r\n\r\n    function enqueueSuccessSnackbar(message, options) {\r\n        return doSnackbar(message, options, 'success')\r\n    }\r\n\r\n    function enqueueWarningSnackbar(message, options) {\r\n        return doSnackbar(message, options, 'warning')\r\n    }\r\n\r\n    function enqueueErrorSnackbar(message, options) {\r\n        return doSnackbar(message, options, 'error')\r\n    }\r\n\r\n    function doSnackbar(message, options, variant) {\r\n        const key = enqueueSnackbar(message, {variant, onClick: () => closeSnackbar(key), ...options})\r\n        return key;\r\n    }\r\n\r\n    return {enqueueSnackbar: enqueueDefaultSnackbar, enqueueInfoSnackbar, enqueueSuccessSnackbar, enqueueWarningSnackbar, enqueueErrorSnackbar}\r\n}","import {List, ListItem, ListItemIcon, ListItemText, Typography} from \"@material-ui/core\";\r\nimport PrintIcon from \"@material-ui/icons/Print\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport React, {useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Loading from \"components/Loading\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport WorkableIcon from \"components/button/WorkableIcon\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    loading: {\r\n        width: '92%'\r\n    },\r\n}))\r\nconst PapersGeneratorSelectPopup = (\r\n    {\r\n        paperId,\r\n        list,\r\n        title,\r\n        onClose,\r\n        onSelect,\r\n        onBack,\r\n        selectGeneratesDocument,\r\n        working,\r\n        shareSystem\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n    const [workingSupplier, setWorkingSupplier] = useState(0);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const paperClick = (supplier) => {\r\n        if (workingSupplier > 0)\r\n            return;\r\n\r\n        setWorkingSupplier(supplier.id);\r\n\r\n        if(!!shareSystem) {\r\n            PapersGeneratorService.sharePaper(supplier.id, paperId, shareSystem).then(resp => resp ? enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: shareSystem}, true)) : null).finally(onClose)\r\n        } else {\r\n            PapersGeneratorService.downloadPaper(Endpoints.PAPERS_GENERATOR_PRINT(supplier.id, paperId), () => setWorkingSupplier(0), () => setWorkingSupplier(0))\r\n\r\n        }\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (!!onBack) {\r\n            buttons.push(createButton(Tr('back'), onBack, 'outlined'));\r\n        }\r\n        buttons.push(createButton(Tr('close'), onClose, undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n    const rowClick = (supplier) => {\r\n        if (working)\r\n            return;\r\n        onSelect ? onSelect(supplier) : paperClick(supplier)\r\n    }\r\n\r\n    return (<Dialog\r\n        title={title}\r\n        open\r\n        maxWidth='md'\r\n        onClose={onClose}\r\n        dialogActions={<MultiButton buttons={getButtons()}/>}\r\n    >\r\n        {(working || !list) && <Loading className={classes.loading}/>}\r\n        {(!!list && list.length > 0) && <List dense>\r\n            {list.map((supplier) =>\r\n                <ListItem disabled={working} key={supplier.id} button onClick={() => rowClick(supplier)}>\r\n                    <ListItemIcon>\r\n                        <WorkableIcon\r\n                            Icon={!!onSelect && !selectGeneratesDocument ? ExitToAppIcon : PrintIcon}\r\n                            working={workingSupplier === supplier.id}/>\r\n                    </ListItemIcon>\r\n                    <ListItemText primary={supplier.name}/>\r\n                </ListItem>)}\r\n        </List>}\r\n        {(!!list && list.length === 0) && <Typography>{Tr('no_options')}</Typography>}\r\n    </Dialog>)\r\n}\r\n\r\nexport default PapersGeneratorSelectPopup;","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorSelectPopup from \"./PapersGeneratorSelectPopup\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst PapersGeneratorRfxInvitedSupplierWithOfferPopup = (\r\n    {\r\n        demandId,\r\n        paper,\r\n        onClose,\r\n        shareSystem\r\n    }) => {\r\n\r\n    const [invitedSuppliers, setInvitedSuppliers] = useState(null);\r\n\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getRfxInvitedSupplierWithOffer(demandId).then(resp => setInvitedSuppliers(resp));\r\n    }, [demandId])\r\n\r\n    return (\r\n        <PapersGeneratorSelectPopup shareSystem={shareSystem} onClose={onClose} paperId={paper.paperId} title={Tr('choose_supplier')} list={invitedSuppliers}/>\r\n    )\r\n}\r\nPapersGeneratorRfxInvitedSupplierWithOfferPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\nexport default PapersGeneratorRfxInvitedSupplierWithOfferPopup;","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorSelectPopup from \"./PapersGeneratorSelectPopup\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst PapersGeneratorRfxRequestPosition = (\r\n    {\r\n        demandId,\r\n        paper,\r\n        onClose,\r\n        shareSystem\r\n    }) => {\r\n\r\n    const [requestPositions, setRequestPositions] = useState(null);\r\n\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getRfxRequestPosition(demandId).then(resp => setRequestPositions(resp));\r\n    }, [demandId])\r\n\r\n    return (\r\n        <PapersGeneratorSelectPopup shareSystem={shareSystem} onClose={onClose} paperId={paper.paperId} title={Tr('choose_position')} list={requestPositions}/>\r\n    )\r\n}\r\nPapersGeneratorRfxRequestPosition.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\nexport default PapersGeneratorRfxRequestPosition;","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorSelectPopup from \"./PapersGeneratorSelectPopup\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst PapersGeneratorRfxInvitedSupplierPosition = (\r\n    {\r\n        demandId,\r\n        paper,\r\n        onClose,\r\n        shareSystem\r\n    }) => {\r\n\r\n    const [invitedSuppliers, setInvitedSuppliers] = useState(null);\r\n    const [chosenSupplier, setChosenSupplier] = useState(null);\r\n    const [requestPositions, setRequestPositions] = useState(null);\r\n\r\n    const onSelectSupplier = (supplier) => {\r\n        setChosenSupplier(supplier);\r\n        PapersGeneratorService.getRfxInvitedSupplierPosition(demandId, supplier.id).then(resp => setRequestPositions(resp));\r\n    }\r\n\r\n    const onBack = () => {\r\n        setChosenSupplier(null);\r\n        setRequestPositions(null);\r\n    }\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getRfxInvitedSupplierWithOffer(demandId).then(resp => setInvitedSuppliers(resp));\r\n    }, [demandId])\r\n\r\n    return (<>\r\n        {!chosenSupplier ?\r\n            <PapersGeneratorSelectPopup shareSystem={shareSystem} onClose={onClose} paperId={paper.paperId} title={Tr('choose_supplier')}\r\n                                        list={invitedSuppliers} onSelect={onSelectSupplier}/>\r\n            : <PapersGeneratorSelectPopup shareSystem={shareSystem} onClose={onClose} paperId={paper.paperId} title={Tr('choose_position')}\r\n                                          list={requestPositions} onBack={onBack}/>\r\n        }\r\n    </>)\r\n}\r\nPapersGeneratorRfxInvitedSupplierPosition.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\nexport default PapersGeneratorRfxInvitedSupplierPosition;","export default ({url, name}) => {\r\n\tlet a = document.createElement('a');\r\n\ta.href=url;\r\n\ta.target='_blank'\r\n\ta.click();\r\n}","import {RestRequestGET} from \"./RestRequest\";\r\nimport downloadFile from \"./downloadFile\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\nimport previewFile from \"./previewFile\";\r\n\r\n\r\nconst downloadFileWithPreloadUrl = async (preloadUrl, openInBrowser, params) => {\r\n    try {\r\n        const resp = await RestRequestGET(preloadUrl, {params});\r\n        if (resp?.success) {\r\n            openInBrowser ?\r\n                previewFile({url: resp.result}) :\r\n                downloadFile({url: resp.result})\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nexport default downloadFileWithPreloadUrl;","export const SiwzSourceType = {\r\n    REPO: \"REPO\",\r\n    SIWZ: \"SIWZ\"\r\n}\r\n","import {isMoment} from \"libs/moment\";\r\n\r\nexport default (potentiallyValidMomentObject, defaultValue) => {\r\n    return isMoment(potentiallyValidMomentObject) ? (potentiallyValidMomentObject.isValid() ? potentiallyValidMomentObject : defaultValue) : defaultValue\r\n}","export default {\r\n    /**\r\n     * Kosz\r\n     */\r\n    Z_TRASH: \"z.trash\",\r\n    /**\r\n     * Publiczna Sesja Otwarcia Ofert\r\n     */\r\n    X_OPEN_OFFERS_PUBLIC_SESSION: \"x.openOffersPublicSession\",\r\n    /**\r\n     * Informacje z otwarcia ofert\r\n     */\r\n    X_OPEN_OFFERS: \"x.openOffers\",\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport Tr from 'translations/Translations';\r\nimport {clearResource, setResource, setSaveStatusError} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport getOnlyValidMomentObjectOrDefault from \"libs/getOnlyValidMomentObjectOrDefault\";\r\nimport RepoFolderTypes from \"constants/RepoFolderTypes\";\r\nimport downloadFileWithPreloadUrl from \"libs/downloadFileWithPreloadUrl\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\n\r\nconst VISIBILITY_TYPES_RESOURCE_ID = \"repoVisibilityTypes\";\r\nconst FOLDER_LIST_RESOURCE_ID = \"folderList\";\r\nconst REPO_EDITABLE_RESOURCE_ID = \"repoEditable\";\r\n\r\nconst __get = async (url, resourcesName) => {\r\n    try {\r\n        let res = await RestRequestGET(url)\r\n        reduxStore.dispatch(setResource(resourcesName, res))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getList = async (demandId) => {\r\n    await __get(Endpoints.REPO(demandId), FOLDER_LIST_RESOURCE_ID)\r\n}\r\n\r\nconst getVisibilityTypes = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.REPO_VISIBILITY_TYPES(demandId));\r\n    const types = {};\r\n    Object.keys(resp).forEach(x => types[x] = Tr(`repo.visibility.${x}`));\r\n    reduxStore.dispatch(setResource(VISIBILITY_TYPES_RESOURCE_ID, types));\r\n}\r\n\r\n\r\nconst addFolder = async (demandId, values) => {\r\n    const {resources} = reduxStore.getState();\r\n    const {folderList} = resources\r\n\r\n    let res = await RestRequestPOST(Endpoints.REPO(demandId), values);\r\n\r\n    const insertIndex = folderList.findIndex((el) => !(el.type.startsWith('x')));\r\n    let temp = [...folderList];\r\n    temp.splice(insertIndex < 0 ? 0 : insertIndex, 0, res);\r\n    reduxStore.dispatch(setResource(FOLDER_LIST_RESOURCE_ID, temp))\r\n\r\n}\r\n\r\nconst updateDescription = async (demandId, {fileId, folderId}, description) => {\r\n    const resp = await RestRequestPUT(Endpoints.REPO_FILE_UPDATE_DESCRIPTION(demandId, fileId), {description});\r\n    updateFileRowInStore(resp, folderId);\r\n}\r\n\r\nconst updateFileRowInStore = (resp, folderId) => {\r\n\r\n    const {resources} = reduxStore.getState();\r\n    const {folderList} = resources;\r\n    const folderIndex = folderList.findIndex((x) => {\r\n        return x.identity === folderId;\r\n    })\r\n    const folder = folderList[folderIndex];\r\n    const fileIndex = folder.files.findIndex(f => f.identity === resp.identity)\r\n    folder.files[fileIndex] = resp;\r\n    let newFolderList = [...folderList]\r\n\r\n    reduxStore.dispatch(setResource(FOLDER_LIST_RESOURCE_ID, newFolderList))\r\n}\r\n\r\nconst changeFileVisibility = async (demandId, folderId, fileId, values) => {\r\n    const visibilityEndDate = getOnlyValidMomentObjectOrDefault(values.visibilityEndDate, null);\r\n    const data = {\r\n        visibility: values.visibility,\r\n        visibilityEndDate: visibilityEndDate ? visibilityEndDate.format() : null,\r\n    }\r\n    try {\r\n        const respFolder = await RestRequestPUT(Endpoints.REPO_FILE_VISIBILITY(demandId, fileId), data);\r\n        await _updateFolderInStore(demandId, respFolder, false);\r\n    } catch (error) {\r\n    }\r\n\r\n}\r\n\r\nconst changeFolderFilesVisibility = async (demandId, folderId, values) => {\r\n    const visibilityEndDate = getOnlyValidMomentObjectOrDefault(values.visibilityEndDate, null);\r\n    const data = {\r\n        visibility: values.visibility,\r\n        visibilityEndDate: visibilityEndDate ? visibilityEndDate.format() : null,\r\n    }\r\n\r\n    try {\r\n        let res = await RestRequestPUT(Endpoints.REPO_FILES_VISIBILITY(demandId, folderId), data);\r\n        await _updateFolderInStore(demandId, res, false);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst updateFolderName = async (demandId, folderId, name) => {\r\n    try {\r\n        let respFolder = await RestRequestPUT(Endpoints.REPO_FOLDER(demandId, folderId), {name})\r\n        await _updateFolderInStore(demandId, respFolder, false);\r\n\r\n    } catch (error) {\r\n    }\r\n}\r\nconst updateFolderDescription = async (demandId, folderId, description) => {\r\n    try {\r\n        let respFolder = await RestRequestPUT(Endpoints.REPO_FOLDER(demandId, folderId), {description})\r\n        await _updateFolderInStore(demandId, respFolder, false);\r\n\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst addFiles = async (demandId, folderId, values) => {\r\n    let data = {\r\n        \"list\": [...values],\r\n    }\r\n    try {\r\n        let respFolder = await RestRequestPOST(Endpoints.REPO_FOLDER(demandId, folderId), data)\r\n        await _updateFolderInStore(demandId, respFolder, false);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst refreshFolder = async (demandId, folderId) => {\r\n    try {\r\n        let respFolder = await RestRequestGET(Endpoints.REPO_FOLDER(demandId, folderId))\r\n        await _updateFolderInStore(demandId, respFolder, false);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst _updateFolderInStore = async (demandId, respFolder, updateTrash) => {\r\n    const {resources} = reduxStore.getState();\r\n    const {folderList} = resources;\r\n\r\n    const newFolderList = folderList.map((el, i) => {\r\n        if (el.identity === respFolder.identity) {\r\n            return respFolder\r\n        }\r\n        return el;\r\n    });\r\n    if(updateTrash) {\r\n        await _doUpdateTrash(demandId, newFolderList, respFolder.identity)\r\n    }\r\n    reduxStore.dispatch(setResource(FOLDER_LIST_RESOURCE_ID, newFolderList))\r\n}\r\n\r\nconst updateTrash = async (demandId) => {\r\n    const {resources} = reduxStore.getState();\r\n    const {folderList} = resources;\r\n    const modified = await _doUpdateTrash(demandId, folderList);\r\n    if(modified) {\r\n        reduxStore.dispatch(setResource(FOLDER_LIST_RESOURCE_ID, [...folderList]))\r\n    }\r\n\r\n}\r\n\r\nconst _doUpdateTrash = async (demandId, newFolderList, workingFolderIdentity) => {\r\n    if (updateTrash) {\r\n        let trashIndex = newFolderList.findIndex(el =>  el.identity !== workingFolderIdentity && el.type === RepoFolderTypes.Z_TRASH);\r\n        if (trashIndex > -1) {\r\n            const trash = await RestRequestGET(Endpoints.REPO_FOLDER(demandId, newFolderList[trashIndex].identity));\r\n            newFolderList[trashIndex] = trash;\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\n\r\n\r\nconst deleteItem = async (demandId, fileId) => {\r\n    try {\r\n        const respFolder = await RestRequestDELETE(Endpoints.REPO_FILE(demandId, fileId));\r\n        await _updateFolderInStore(demandId, respFolder, true);\r\n    } catch (error) {\r\n        console.error(error);\r\n    }\r\n}\r\n\r\nconst deleteFolder = async (demandId, folderId) => {\r\n    const {resources} = reduxStore.getState();\r\n    const {folderList} = resources;\r\n    try {\r\n        const res = await RestRequestDELETE(Endpoints.REPO_FOLDER(demandId, folderId));\r\n        if (res.success) {\r\n\r\n            let newFolderList = folderList.filter(x => x.identity !== folderId);\r\n\r\n            const trashIndex = newFolderList.findIndex(x => x.type === RepoFolderTypes.Z_TRASH && x.identity !== folderId);\r\n\r\n            if (trashIndex > -1) {\r\n                const trash = await RestRequestGET(Endpoints.REPO_FOLDER(demandId, newFolderList[trashIndex].identity));\r\n                newFolderList[trashIndex] = trash;\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(FOLDER_LIST_RESOURCE_ID, newFolderList))\r\n        }\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\n\r\nconst deleteAll = async (demandId, folderId) => {\r\n    try {\r\n        const respFolder = await RestRequestDELETE(Endpoints.REPO_DELETE_ALL_FOLDER_FILES(demandId, folderId))\r\n        await _updateFolderInStore(demandId, respFolder, true);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst downloadAll = async (demandId, folderId) => {\r\n    try {\r\n        await RestRequestBLOB(Endpoints.REPO_DOWNLOAD_ALL(demandId, folderId));\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getDownloadHistory = async (demandId, fileId, pagination) => {\r\n\r\n    const params = {\r\n        ...pagination\r\n    }\r\n\r\n    const url = Endpoints.REPO_FILE_DOWNLOAD_HISTORY(demandId, fileId);\r\n    try {\r\n        const repoDownloadHistory = await RestRequestGET(url, {params});\r\n        return repoDownloadHistory;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst isRepoEditable = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.REPO_EDITABLE(demandId));\r\n    reduxStore.dispatch(setResource(REPO_EDITABLE_RESOURCE_ID, resp));\r\n}\r\n\r\nconst clearResources = (id) => {\r\n    reduxStore.dispatch(clearResource(id));\r\n}\r\n\r\nconst getDownloadFile = async (demandId, fileId, openInBrowser) => {\r\n    await downloadFileWithPreloadUrl(Endpoints.REPO_FILE_GET_DOWNLOAD_URL(demandId, fileId, openInBrowser), openInBrowser);\r\n}\r\n\r\nconst shareRepo = async (demandId, fileId, system) => {\r\n    const resp = await RestRequestPOST(Endpoints.REPO_FILE_SHARE(demandId, fileId), {system});\r\n    try {\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n    return false;\r\n}\r\n\r\nconst shareRepoFolder = async (demandId, folderId, system) => {\r\n    const resp = await RestRequestPOST(Endpoints.REPO_FOLDER_SHARE(demandId, folderId), {system});\r\n    try {\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n    return false;\r\n}\r\n\r\nconst buildIdentity = (fileId, folderId) => ({fileId, folderId});\r\n\r\nexport default {\r\n    addFolder,\r\n    getList,\r\n    addFiles,\r\n    refreshFolder,\r\n    deleteItem,\r\n    deleteAll,\r\n    deleteFolder,\r\n    downloadAll,\r\n    updateFolderName,\r\n    updateFolderDescription,\r\n    getDownloadHistory,\r\n    getVisibilityTypes,\r\n    changeFileVisibility,\r\n    changeFolderFilesVisibility,\r\n    updateDescription,\r\n    updateFileRowInStore,\r\n    clearResources,\r\n    getDownloadFile,\r\n    shareRepo,\r\n    shareRepoFolder,\r\n    isRepoEditable,\r\n    buildIdentity,\r\n    updateTrash,\r\n    FOLDER_LIST_RESOURCE_ID,\r\n    VISIBILITY_TYPES_RESOURCE_ID,\r\n    REPO_EDITABLE_RESOURCE_ID\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {clearResource, setResource, setSaveStatusDialog, setSaveStatusError, setSaveStatusLoading} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport validateSection from './helpers/validateSection'\r\nimport Tr from \"../translations/Translations\";\r\nimport downloadFileWithPreloadUrl from \"libs/downloadFileWithPreloadUrl\";\r\nimport {SiwzSourceType} from \"../components/complex/documentsTables/swz/constants/SiwzSourceType\";\r\nimport RepoService from \"./RepoService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\n\r\nconst __get = async (url, resourcesName) => {\r\n    try {\r\n        const res = await RestRequestGET(url);\r\n\r\n        reduxStore.dispatch(\r\n            setResource(resourcesName, res)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst SIWZ_TYPE_LIST_RESOURCE_ID = \"typeSiwzList\";\r\nconst SIWZ_LIST_RESOURCE_ID = \"siwzList\";\r\nconst SIWZ_EDITABLE_RESOURCE_ID = \"siwzEditable\";\r\n\r\n\r\nconst send = async (demandId, files, demandValidationSectionId) => {\r\n\r\n    let list = []\r\n    files.forEach(x => {\r\n        list.push({\r\n            repositoryId: x.identity,\r\n            type: x.type,\r\n            description: \"\",\r\n            parentSiwzId: x.parent,\r\n            publish: x.autopublish\r\n        })\r\n    });\r\n\r\n    const data = {\r\n        \"list\": list\r\n    }\r\n\r\n    const addResp = await RestRequestPOST(Endpoints.SIWZ(demandId), data);\r\n    await updateAfterAdd(demandId, addResp, demandValidationSectionId);\r\n}\r\n\r\nconst moveFromRepo = async (demandId, files, demandValidationSectionId) => {\r\n    const list = []\r\n    files.forEach(x => {\r\n        list.push({\r\n            repositoryId: x.identity,\r\n            type: x.type,\r\n            description: \"\",\r\n            parentSiwzId: x.parent,\r\n            publish: x.autopublish\r\n        });\r\n    });\r\n    const data = {\r\n        \"list\": list\r\n    }\r\n\r\n    const addResp = await RestRequestPOST(Endpoints.SIWZ_MOVE_FROM_REPO(demandId), data);\r\n    await updateAfterAdd(demandId, addResp, demandValidationSectionId);\r\n}\r\n\r\nconst updateAfterAdd = async (demandId, addResp, demandValidationSectionId) => {\r\n    //jeśli któryś z dodanych plików miał wyższą wersję musze przeładowac wszystko\r\n    if (addResp.findIndex(x => x.version > 1) > -1) {\r\n        await getList(demandId);\r\n    } else {\r\n        const {resources} = reduxStore.getState();\r\n        const newList = [...addResp.reverse(), ...resources[SIWZ_LIST_RESOURCE_ID]];\r\n        reduxStore.dispatch(setResource(SIWZ_LIST_RESOURCE_ID, newList));\r\n    }\r\n\r\n    if (demandValidationSectionId)\r\n        await validateSection(demandValidationSectionId, demandId, false);\r\n}\r\n\r\n\r\nconst addBzpNotice = async (demandId, bzpNoticeId, siwzType) => {\r\n    const url = Endpoints.SIWZ_ADD_BZP_NOTICE(demandId)\r\n\r\n    const data = {\r\n        bzpNoticeId,\r\n        siwzType\r\n    }\r\n\r\n    return await RestRequestPOST(url, data);\r\n}\r\n\r\nconst deleteItem = async (demandId, {identity, source, rootIdentity}, demandValidationSectionId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.SIWZ_ID(demandId, identity, source));\r\n    try {\r\n        if (resp.success) {\r\n\r\n            const {resources} = reduxStore.getState();\r\n            const curList = resources[SIWZ_LIST_RESOURCE_ID];\r\n            const itemToRemove = curList.find(siwz => siwz.identity === identity && siwz.source === source);\r\n\r\n            if (itemToRemove.version === 1) {\r\n                reduxStore.dispatch(setResource(SIWZ_LIST_RESOURCE_ID, curList.filter(siwz => !(siwz.identity === identity && siwz.source === source))));\r\n            } else {\r\n                await getList(demandId);\r\n            }\r\n\r\n            if (source === SiwzSourceType.REPO) {\r\n                RepoService.updateTrash(demandId)\r\n            }\r\n\r\n            if (demandValidationSectionId)\r\n                await validateSection(demandValidationSectionId, demandId, false);\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nconst publish = async (demandId, {identity, source, rootIdentity}, demandValidationSectionId) => {\r\n    const resp = await RestRequestPUT(Endpoints.SIWZ_ID_PUBLISH(demandId, identity, source));\r\n    try {\r\n        if (resp.success) {\r\n            updateSiwzRowInStore(resp.result, true, rootIdentity);\r\n            if (demandValidationSectionId)\r\n                await validateSection(demandValidationSectionId, demandId, false);\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nconst unpublish = async (demandId, {identity, source, rootIdentity}, demandValidationSectionId) => {\r\n    const resp = await RestRequestPUT(Endpoints.SIWZ_ID_UNPUBLISH(demandId, identity, source));\r\n    try {\r\n        if (resp.success) {\r\n            updateSiwzRowInStore(resp.result, true, rootIdentity)\r\n            if (demandValidationSectionId)\r\n                await validateSection(demandValidationSectionId, demandId, false);\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nconst getDownloadHistory = async (demandId, {identity, source, rootIdentity}, pagination) => {\r\n\r\n    const params = {\r\n        ...pagination\r\n    }\r\n\r\n    const url = Endpoints.SIWZ_ID_DOWNLOAD_HISTORY(demandId, identity, source);\r\n    const siwzDownloadHistory = await RestRequestGET(url, {params});\r\n    return siwzDownloadHistory;\r\n}\r\n\r\nconst getVersions = async (demandId, {identity, source}) => {\r\n    const url = Endpoints.SIWZ_ID_VERSIONS(demandId, identity, source);\r\n    const resp = await RestRequestGET(url);\r\n\r\n    const {resources} = reduxStore.getState();\r\n    const siwzList = resources[SIWZ_LIST_RESOURCE_ID].map((x) => {\r\n        if (x.identity === identity) {\r\n            return {...x, versions: resp.filter(x => x.identity !== identity)};\r\n        } else {\r\n            return x;\r\n        }\r\n    });\r\n    reduxStore.dispatch(setResource(SIWZ_LIST_RESOURCE_ID, siwzList));\r\n}\r\n\r\nconst clearVersions = async (demandId, {identity, source}) => {\r\n    const {resources} = reduxStore.getState();\r\n    const siwzList = resources[SIWZ_LIST_RESOURCE_ID].map((x) => {\r\n        if (x.identity === identity) {\r\n            return {...x, versions: undefined};\r\n        } else {\r\n            return x;\r\n        }\r\n    });\r\n    reduxStore.dispatch(setResource(SIWZ_LIST_RESOURCE_ID, siwzList));\r\n}\r\n\r\nconst deleteAll = async (demandId, demandValidationSectionId) => {\r\n    const url = Endpoints.SIWZ(demandId);\r\n    await RestRequestDELETE(url);\r\n    reduxStore.dispatch(setResource(SIWZ_LIST_RESOURCE_ID, []));\r\n    if (demandValidationSectionId)\r\n        await validateSection(demandValidationSectionId, demandId);\r\n}\r\n\r\nconst getList = async (demandId) => {\r\n    await __get(Endpoints.SIWZ(demandId), SIWZ_LIST_RESOURCE_ID)\r\n}\r\n\r\nconst getTypes = async (demandId) => {\r\n    await __get(Endpoints.SIWZ_TYPES(demandId), SIWZ_TYPE_LIST_RESOURCE_ID)\r\n}\r\n\r\nconst downloadAll = async (demandId) => {\r\n    await RestRequestBLOB(Endpoints.SIWZ_DOWNLOAD_ALL(demandId))\r\n}\r\n\r\n\r\nconst save = async (demandId, demandValidationSectionId) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    if (demandValidationSectionId)\r\n        await validateSection(demandValidationSectionId, demandId);\r\n    reduxStore.dispatch(setSaveStatusDialog());\r\n}\r\n\r\nconst validateSIWZ = async (demandId) => {\r\n    return RestRequestGET(Endpoints.SIWZ_VALIDATE(demandId));\r\n}\r\n\r\nconst validateDocuments = async (demandId) => {\r\n    return RestRequestGET(Endpoints.SIWZ_VALIDATE_DOCUMENTS(demandId));\r\n}\r\n\r\nconst updateSiwzRowInStore = (siwzRow, preserveVersions, rootRowIdentity) => {\r\n    const {resources} = reduxStore.getState();\r\n\r\n    const rootRowId = rootRowIdentity ? rootRowIdentity : siwzRow.identity;\r\n    const versionRowId = rootRowIdentity ? siwzRow.identity : null;\r\n\r\n    const siwzList = resources[SIWZ_LIST_RESOURCE_ID].map((x) => {\r\n        if (x.identity === rootRowId) {\r\n            if (versionRowId) {\r\n                if (x.versions) {\r\n                    const versions = x.versions.map((r) => {\r\n                        if (r.identity === versionRowId)\r\n                            return siwzRow\r\n                        else\r\n                            return r\r\n                    });\r\n                    return {...x, versions}\r\n                } else {\r\n                    return {...x};\r\n                }\r\n            } else {\r\n                if (preserveVersions) {\r\n                    siwzRow.versions = x.versions;\r\n                }\r\n                return siwzRow;\r\n            }\r\n        } else {\r\n            return x;\r\n        }\r\n\r\n    });\r\n    reduxStore.dispatch(setResource(SIWZ_LIST_RESOURCE_ID, siwzList));\r\n}\r\n\r\nconst updateDescription = async (demandId, {identity, source, rootIdentity}, description) => {\r\n    const resp = await RestRequestPUT(Endpoints.SIWZ_ID_UPDATE_DESCRIPTION(demandId, identity, source), {description});\r\n    try {\r\n        if (resp.success) {\r\n            updateSiwzRowInStore(resp.result, true, rootIdentity)\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\nconst updateNoticeReferenceNumber = async (demandId, {identity, source, rootIdentity}, noticeReferenceNumber) => {\r\n    const resp = await RestRequestPUT(Endpoints.SIWZ_ID_UPDATE_NOTICE_REFERENCE_NUMBER(demandId, identity, source), {noticeReferenceNumber});\r\n    try {\r\n        if (resp.success) {\r\n            updateSiwzRowInStore(resp.result, true, rootIdentity)\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\nconst shareSiwz = async (demandId, {identity, source, rootIdentity}, system) => {\r\n    const resp = await RestRequestPOST(Endpoints.SIWZ_ID_UPDATE_SHARE(demandId, identity, source), {system});\r\n    try {\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n    return false;\r\n}\r\n\r\nconst getDownloadFile = async (demandId, {identity, source, rootIdentity}, openInBrowser) => {\r\n    await downloadFileWithPreloadUrl(\r\n        Endpoints.SIWZ_ID_GET_DOWNLOAD_URL(demandId, identity, source, openInBrowser),\r\n        openInBrowser);\r\n}\r\n\r\nconst generateSWZ = (demandId, arr, finallyCallback = () => {\r\n}) => {\r\n    const data = {\r\n        list: arr\r\n    }\r\n    RestRequestBLOB(Endpoints.SIWZ_POST_PRINT_SWZ(demandId), {method: 'post', data: data})\r\n        .finally(finallyCallback);\r\n}\r\n\r\nconst shareGenerateSWZ = async (demandId, arr, shareSystem) => {\r\n    const data = {\r\n        list: arr\r\n    }\r\n    const params = {\r\n        shareSystem\r\n    }\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.SIWZ_POST_SHARE_SWZ(demandId), data, {params})\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return resp.success;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n    return false;\r\n\r\n\r\n}\r\n\r\nconst isSiwzEditable = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.SIWZ_EDITABLE(demandId));\r\n    reduxStore.dispatch(setResource(SIWZ_EDITABLE_RESOURCE_ID, resp));\r\n}\r\n\r\nconst buildSiwzIdentity = (identity, source, rootIdentity = null) => {\r\n    return {identity, source, rootIdentity};\r\n}\r\nconst clearResources = (id) => {\r\n    reduxStore.dispatch(clearResource(id));\r\n}\r\n\r\nexport default {\r\n    save,\r\n    validateSIWZ,\r\n    validateDocuments,\r\n    getList,\r\n    getTypes,\r\n    send,\r\n    moveFromRepo,\r\n    deleteItem,\r\n    deleteAll,\r\n    downloadAll,\r\n    unpublish,\r\n    publish,\r\n    getDownloadHistory,\r\n    getVersions,\r\n    clearVersions,\r\n    updateDescription,\r\n    updateNoticeReferenceNumber,\r\n    addBzpNotice,\r\n    generateSWZ,\r\n    shareGenerateSWZ,\r\n    shareSiwz,\r\n    getDownloadFile,\r\n    isSiwzEditable,\r\n    buildSiwzIdentity,\r\n    clearResources,\r\n    SIWZ_LIST_RESOURCE_ID,\r\n    SIWZ_TYPE_LIST_RESOURCE_ID,\r\n    SIWZ_EDITABLE_RESOURCE_ID\r\n}","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Select from \"components/Select\";\r\n\r\nfunction SwzGeneratorQuestionSelect(\r\n    {\r\n        id,\r\n        question,\r\n        formikProps\r\n    }) {\r\n    return (\r\n        <Select\r\n            key={question.key}\r\n            id={question.key.replace(/\\./g, '#')}\r\n            formikProps={formikProps}\r\n            items={question.options.map(x => ({label: x.text, value: x.selectValue}))}\r\n        />\r\n    )\r\n}\r\n\r\nSwzGeneratorQuestionSelect.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default SwzGeneratorQuestionSelect;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Checkbox from \"components/Checkbox\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    wrap: {\r\n        marginLeft: theme.spacing(4)\r\n    }\r\n}));\r\n\r\n\r\nfunction SwzGeneratorQuestionCheckbox(\r\n    {\r\n        id,\r\n        question,\r\n        formikProps\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const changeMain = (e) => {\r\n        const fPName = e.target.name;\r\n        const qKey = fPName.replace(/#/g, '.');\r\n        const opt = question.options.find((x) => x.key === qKey && x.subOptions)\r\n        if(opt) {\r\n            const checked = e.target.checked;\r\n            const sub = opt.subOptions.reduce((prev, curr) => {\r\n                return {\r\n                    ...prev,\r\n                    [curr.key.replace(/\\./g, '#')]: checked\r\n                }\r\n            }, {})\r\n            sub[fPName] = checked;\r\n            formikProps.setValues({\r\n                ...formikProps.values,\r\n                ...sub\r\n            })\r\n        }\r\n    }\r\n\r\n    const changeSub = (e) => {\r\n        const fPName = e.target.name;\r\n        const qKey = fPName.replace(/#/g, '.');\r\n        const opt = question.options.find((x) => !!x.subOptions && x.subOptions.find(y => y.key === qKey))\r\n        const checked = e.target.checked;\r\n        if(opt) {\r\n            if(checked) {\r\n                formikProps.setFieldValue(opt.key.replace(/\\./g, '#'), checked);\r\n            } else {\r\n                const otherChecked = opt.subOptions.find(y => y.key !== qKey && getObjectValue(y.key.replace(/\\./g, '#'), formikProps.values, false));\r\n                if(!otherChecked) {\r\n                    formikProps.setFieldValue(opt.key.replace(/\\./g, '#'), checked);\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    return (question.options.map(x => (\r\n        <div key={x.key}>\r\n            <Checkbox id={x.key.replace(/\\./g, '#')} label={x.text} formikProps={formikProps} onChange={changeMain}/>\r\n            <br/>\r\n            {!!x.subOptions ?\r\n                x.subOptions.map(so => (\r\n                    <div className={classes.wrap} key={so.key}>\r\n                        <Checkbox id={so.key.replace(/\\./g, '#')} label={so.text} formikProps={formikProps} onChange={changeSub}/>\r\n                    </div>\r\n                )) : null}\r\n        </div>\r\n    )))\r\n}\r\n\r\nSwzGeneratorQuestionCheckbox.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default SwzGeneratorQuestionCheckbox;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport SwzGeneratorQuestionSelect from \"./SwzGeneratorQuestionSelect\";\r\nimport SwzGeneratorQuestionCheckbox from \"./SwzGeneratorQuestionCheckbox\";\r\n\r\nfunction SwzGeneratorQuestion(\r\n    {\r\n        id,\r\n        question,\r\n        formikProps\r\n    }) {\r\n    return (<div>\r\n            <BoldTypography>\r\n                {question.text}\r\n                {!!question.helpMessage && <HelpTooltip text={\r\n                    new DOMParser().parseFromString(question.helpMessage, \"text/html\").documentElement.textContent}/>}\r\n            </BoldTypography>\r\n            {question.type === \"checkbox\" ?\r\n                <SwzGeneratorQuestionCheckbox question={question} formikProps={formikProps}/>\r\n                :\r\n                <SwzGeneratorQuestionSelect question={question} formikProps={formikProps}/>\r\n            }\r\n\r\n\r\n        </div>\r\n    )\r\n}\r\n\r\nSwzGeneratorQuestion.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default SwzGeneratorQuestion;","import React from 'react'\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport Title from \"components/Title\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport SwzGeneratorQuestion from \"./SwzGeneratorQuestion\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    title: {\r\n        background: theme.palette.background.greyBackground,\r\n        padding: theme.spacing(1),\r\n        borderRadius: theme.shape.borderRadius,\r\n        display: \"flex\",\r\n        justifyContent: \"space-between\",\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    wrap: {\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    helpText: {\r\n        textIndent: -1 * theme.spacing(2),\r\n        marginLeft: theme.spacing(2),\r\n        marginBottom: theme.spacing()\r\n\r\n    }\r\n}));\r\n\r\nfunction SwzGeneratorSection(\r\n    {\r\n        id,\r\n        section,\r\n        formikProps\r\n    }) {\r\n    const classes = useStyle();\r\n    return (\r\n        <div>\r\n            <Title align=\"left\" className={classes.title}>\r\n                {section.text}\r\n                {!!section.helpMessage && <HelpTooltip text={\r\n                    new DOMParser().parseFromString(section.helpMessage, \"text/html\").documentElement.textContent}/>}\r\n            </Title>\r\n            <div className={classes.wrap}>\r\n                {section.questions.map(x => (\r\n                    <SwzGeneratorQuestion key={x.key} question={x} formikProps={formikProps}/>\r\n                ))}\r\n            </div>\r\n            {\r\n                !!section?.helpTexts.length && <div className={classes.wrap}>\r\n                    {section.helpTexts.map(x => (\r\n                        <Typography key={x.key} className={classes.helpText}>{x.message}</Typography>\r\n                    ))}\r\n                </div>\r\n            }\r\n\r\n        </div>\r\n    )\r\n}\r\n\r\nexport default SwzGeneratorSection;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport SiwzService from \"services/SiwzService\";\r\nimport Loading from \"components/Loading\";\r\nimport SwzGeneratorSection from \"./SwzGeneratorSection\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport {connect} from \"react-redux\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    wrap: {\r\n        minWidth: 600,\r\n        minHeight: 40\r\n    }\r\n}));\r\n\r\n\r\nfunction ChooseSwzGeneratorOptions(\r\n    {\r\n        id,\r\n        onClose,\r\n        formSubmit,\r\n        shareSystem\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [sections, setSections] = useState(null);\r\n    const [working, setWorking] = useState(true);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getSwzGeneratorParams(id).then(resp => {\r\n            setSections(resp);\r\n            setWorking(false);\r\n        });\r\n    }, [id])\r\n\r\n    const getInitialValues = (sections) => {\r\n        const inits = {};\r\n        sections.result.forEach(s => {\r\n            s.questions.forEach(q => {\r\n                q.type === 'select' ?\r\n                    inits[q.key.replace(/\\./g, '#')] = \"\" + !q.options[0].value\r\n                    :\r\n                    q.options.forEach(o => {\r\n                        inits[o.key.replace(/\\./g, '#')] = o.value;\r\n                        if (o.subOptions) {\r\n                            o.subOptions.forEach(so => {\r\n                                inits[so.key.replace(/\\./g, '#')] = so.value;\r\n                            })\r\n                        }\r\n                    })\r\n            })\r\n        })\r\n        return inits\r\n    }\r\n    const formId = useId();\r\n    const onSubmit = (values) => {\r\n        setWorking(true);\r\n        const selected = [];\r\n        for (const [key, value] of Object.entries(values)) {\r\n            if (value === true || value === 'true') {\r\n                selected.push(key.replace(/#/g, '.'))\r\n            }\r\n        }\r\n\r\n        if (shareSystem) {\r\n            SiwzService.shareGenerateSWZ(id, selected, shareSystem).then(resp => resp ? enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: shareSystem}, true)) : null).finally(onClose);\r\n        } else {\r\n            SiwzService.generateSWZ(id, selected, onClose)\r\n        }\r\n\r\n    }\r\n\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined'));\r\n        buttons.push(createButton(Tr('swz.button.generate'), () => formSubmit[formId](), undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('swz.generator.popup.title')}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            fullWidth={false}\r\n            onClose={onClose}\r\n            dialogActions={getActions()}\r\n        >\r\n            <div className={classes.wrap}>\r\n                {\r\n                    !sections ?\r\n                        <Loading/> :\r\n                        <>\r\n                            <Form\r\n                                initialValues={getInitialValues(sections)}\r\n                                validationSchema={ValidationShema.any()}\r\n                                onSubmit={onSubmit}\r\n                                id={formId}\r\n                            >\r\n                                {(formikProps) => (\r\n                                    sections.result.map(x => (\r\n                                        <SwzGeneratorSection formikProps={formikProps} key={x.key} section={x}/>))\r\n                                )}\r\n                            </Form>\r\n\r\n                        </>\r\n                }\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nChooseSwzGeneratorOptions.propTypes = {\r\n    id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(ChooseSwzGeneratorOptions);","import {List, ListItem, ListItemIcon, ListItemText, Typography} from \"@material-ui/core\";\r\nimport React, {useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Loading from \"components/Loading\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Checkbox from \"components/Checkbox\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    loading: {\r\n        width: '92%'\r\n    },\r\n}))\r\n\r\nconst PapersGeneratorSelectFilesPopup = (\r\n    {\r\n        list,\r\n        title,\r\n        onClose,\r\n        onBack,\r\n        onGenerate,\r\n        working\r\n    }) => {\r\n    const classes = useStyle();\r\n    const [selectedPos, setSelectedPos] = useState([]);\r\n\r\n    const generateClick = () => onGenerate(selectedPos);\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if(!!onBack) {\r\n            buttons.push(createButton(Tr('back'), onBack, 'outlined'));\r\n        }\r\n        buttons.push(createButton(Tr('close'), onClose, 'outlined'));\r\n        buttons.push(createButton(Tr('generate_report'), generateClick, undefined, working || selectedPos.length === 0));\r\n        return buttons;\r\n    }\r\n\r\n    const onSelect = (supplier) => {\r\n        if(working)\r\n            return;\r\n        const added = selectedPos.indexOf(supplier.id) === -1;\r\n        if (added) {\r\n            setSelectedPos(x => [...x, supplier.id]);\r\n        } else {\r\n            setSelectedPos(x => x.filter(x => x !== supplier.id));\r\n        }\r\n    }\r\n\r\n    return (<Dialog\r\n        title={title}\r\n        open\r\n        maxWidth='md'\r\n        onClose={onClose}\r\n        dialogActions={<MultiButton buttons={getButtons()} />}\r\n    >\r\n        {(working || !list) && <Loading  className={classes.loading}/>}\r\n        {(!!list && list.length > 0) && <List dense>\r\n            {list.map((position) =>\r\n                <ListItem key={position.id} button onClick={() => onSelect(position)}>\r\n                    <ListItemIcon>\r\n                        <Checkbox\r\n                            color='primary'\r\n                            checked={selectedPos.indexOf(position.id) > -1}\r\n                            onChange={() => onSelect(position)}\r\n                            disabled={working}\r\n                        />\r\n                    </ListItemIcon>\r\n                    <ListItemText primary={position.name}/>\r\n                </ListItem>)}\r\n        </List>}\r\n        {(!!list && list.length === 0) && <Typography>{Tr('no_options')}</Typography>}\r\n    </Dialog>)\r\n}\r\n\r\nexport default PapersGeneratorSelectFilesPopup;","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorSelectPopup from \"./PapersGeneratorSelectPopup\";\r\nimport PapersGeneratorSelectFilesPopup from \"./PapersGeneratorSelectFilesPopup\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport PropTypes from \"prop-types\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst PapersGeneratOfferFilesVerification = (\r\n    {\r\n        demandId,\r\n        paper,\r\n        onClose,\r\n        shareSystem\r\n    }) => {\r\n\r\n    const [invitedSuppliers, setInvitedSuppliers] = useState(null);\r\n    const [chosenSupplier, setChosenSupplier] = useState(null);\r\n    const [requestPositions, setRequestPositions] = useState(null);\r\n    const [working, setWorking] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const onSelectSupplier = (supplier) => {\r\n        setChosenSupplier(supplier);\r\n        PapersGeneratorService.getRfxSupplierAttachmentsVerification(demandId, supplier.id).then(resp => setRequestPositions(resp));\r\n    }\r\n\r\n    const onBack = () => {\r\n        setChosenSupplier(null);\r\n        setRequestPositions(null);\r\n    }\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getRfxInvitedSupplierWithOffer(demandId).then(resp => setInvitedSuppliers(resp));\r\n    }, [demandId])\r\n\r\n\r\n    const generateClick = (selectedPos) => {\r\n        setWorking(true);\r\n        const url = Endpoints.PAPERS_GENERATOR_DEMAND_ATTACHMENT_VERIFICATION_REPORT(demandId) + `?supplierId=${chosenSupplier.id}&positionIds=${selectedPos.join(\",\")}`;\r\n\r\n        if (shareSystem) {\r\n            PapersGeneratorService.sharePaperByUrl(url, shareSystem).then(resp => resp ? enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: shareSystem}, true)) : null).finally(() => setWorking(false));;\r\n        } else {\r\n            PapersGeneratorService.downloadPaper(url, () => setWorking(false), () => setWorking(false))\r\n        }\r\n\r\n    }\r\n\r\n    return (<>\r\n        {!chosenSupplier ?\r\n            <PapersGeneratorSelectPopup onClose={onClose} paperId={paper.paperId} title={Tr('choose_supplier')} list={invitedSuppliers}\r\n                                        onSelect={onSelectSupplier}/>\r\n            : <PapersGeneratorSelectFilesPopup\r\n                onClose={onClose}\r\n                onGenerate={generateClick}\r\n                paperId={paper.paperId}\r\n                title={Tr('choose_position')}\r\n                list={requestPositions} onBack={onBack}\r\n                working={working}\r\n            />\r\n        }\r\n    </>)\r\n}\r\n\r\n\r\nPapersGeneratOfferFilesVerification.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\n\r\nexport default PapersGeneratOfferFilesVerification;","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorSelectPopup from \"./PapersGeneratorSelectPopup\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport PropTypes from \"prop-types\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst PapersGeneratorMessageFilesVerification = (\r\n    {\r\n        demandId,\r\n        paper,\r\n        onClose,\r\n        shareSystem\r\n    }) => {\r\n\r\n    const [invitedSuppliers, setInvitedSuppliers] = useState(null);\r\n    const [working, setWorking] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getRfxInvitedSupplierWithOffer(demandId).then(resp => setInvitedSuppliers(resp));\r\n    }, [demandId])\r\n\r\n    const generateClick = (supplier) => {\r\n        setWorking(true);\r\n        const url = Endpoints.PAPERS_GENERATOR_CORRESPONDENCE_ATTACHMENT_VERIFICATION_REPORT(demandId) + `?cdId=ris_${supplier.id}`;\r\n\r\n        if (shareSystem) {\r\n            PapersGeneratorService.sharePaperByUrl(url, shareSystem).then(resp => resp ? enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: shareSystem}, true)) : null).finally(() => setWorking(false));\r\n        } else {\r\n            PapersGeneratorService.downloadPaper(url, () => setWorking(false), () => setWorking(false))\r\n        }\r\n    }\r\n    return (\r\n        <PapersGeneratorSelectPopup\r\n                onClose={onClose}\r\n                paperId={paper.paperId}\r\n                title={Tr('choose_supplier')}\r\n                list={invitedSuppliers}\r\n                onSelect={generateClick}\r\n                selectGeneratesDocument\r\n                working={working}\r\n        />\r\n    )\r\n}\r\nPapersGeneratorMessageFilesVerification.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\nexport default PapersGeneratorMessageFilesVerification;","import {snakeCase} from \"lodash\";\r\nimport {isMoment} from \"libs/moment\";\r\n\r\nconst getJavaKey = (jsKey) => {\r\n    return snakeCase(jsKey).toUpperCase();\r\n}\r\n\r\nconst getParamSerializedValue = (value) => {\r\n\r\n    if (isMoment(value)) {\r\n        return value.format()\r\n    }\r\n    return value;\r\n}\r\n\r\n\r\nconst applySearchParams = (search = {}, curParams = {}) => {\r\n    let searchIndex = 0;\r\n    Object.keys(search).reduce((prev, cur) => {\r\n        const val = search[cur];\r\n        if (val === 0 || val === false || !!val) {\r\n            prev['filters[' + searchIndex + '].column'] = getJavaKey(cur);\r\n            prev['filters[' + searchIndex + '].value'] = getParamSerializedValue(search[cur]);\r\n            searchIndex++;\r\n        }\r\n        return prev;\r\n    }, curParams);\r\n\r\n    return curParams;\r\n}\r\n\r\nexport default applySearchParams;","const applySortParams = (sort = {}, curParams = {}) => {\r\n    curParams['sort[0].column'] = sort.column;\r\n    curParams['sort[0].direction'] = sort.direction.toUpperCase();\r\n    return curParams;\r\n\r\n}\r\nexport default applySortParams;","import Endpoints from 'constants/Endpoints';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestGET} from 'libs/RestRequest';\r\n\r\nconst PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID = \"purchasingGroupStageSections\";\r\n\r\nconst __get = async (url, resourcesName, transformer) => {\r\n    try {\r\n        let res = await RestRequestGET(url)\r\n        if (transformer) {\r\n            res = transformer(res);\r\n        }\r\n        reduxStore.dispatch(setResource(resourcesName, res))\r\n        return res;\r\n    } catch (error) {\r\n        console.error(error)\r\n    }\r\n}\r\n\r\nconst __sectionResponseTranformer = (resp) => {\r\n    return resp.reduce((prev, curr) => {\r\n        prev[curr.section] = curr;\r\n        return prev;\r\n    }, {})\r\n}\r\n\r\nconst getStage1Sections = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_SECTIONS_PREPARING(groupId ? groupId : -1), PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID, __sectionResponseTranformer)\r\n}\r\n\r\nconst getStage2Sections = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_SECTIONS_COLLECTING_DATA(groupId), PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID, __sectionResponseTranformer)\r\n}\r\n\r\nconst getSections = async (groupId, sections) => {\r\n    const params = {sections: Array.isArray(sections) ? sections.join(\",\") : sections}\r\n    const resp = await RestRequestGET(Endpoints.PURCHASING_GROUP_SECTIONS_SECTION(groupId), {params})\r\n    const respTransformed = __sectionResponseTranformer(resp);\r\n    const {resources} = reduxStore.getState();\r\n    const curSections = resources[PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID] || {};\r\n    const newSections = {...curSections, ...respTransformed}\r\n    reduxStore.dispatch(setResource(PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID, newSections));\r\n}\r\n\r\nconst clearResources = (resourceId) => reduxStore.dispatch(clearResource(resourceId))\r\n\r\nexport default {\r\n    getStage1Sections,\r\n    getStage2Sections,\r\n    getSections,\r\n\r\n    clearResources,\r\n    PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID\r\n}","export const DemandValidationSectionStatus = {\r\n    OK: \"OK\",\r\n    EMPTY: \"EMPTY\",\r\n    ERROR: \"ERROR\",\r\n    DISABLED: \"DISABLED\",\r\n    UNAVAILABLE: \"UNAVAILABLE\"\r\n}\r\n","export default (querySelector, extraOffset = 0, scrollElement = window) => {\r\n    if (!querySelector) {\r\n        return;\r\n    }\r\n\r\n    const element = querySelector instanceof Element ? querySelector : document.querySelector(querySelector);\r\n    if (!element) {\r\n        return;\r\n    }\r\n\r\n    const boundingClientRect = element.getBoundingClientRect();\r\n\r\n    const stageBar = document.querySelector('#stageBar');\r\n    const toolBar = document.querySelector('#toolBar');\r\n\r\n    let offsetTop = boundingClientRect.top + window.scrollY;\r\n\r\n    if (stageBar) {\r\n        offsetTop -= stageBar.clientHeight;\r\n    }\r\n\r\n    if (toolBar) {\r\n        offsetTop -= toolBar.clientHeight;\r\n    }\r\n    offsetTop -= 20;\r\n    offsetTop -= extraOffset\r\n\r\n\r\n    if(scrollElement !== window) {\r\n        scrollElement = document.querySelector(scrollElement)\r\n    }\r\n\r\n    scrollElement.scrollTo({behavior: 'smooth', top: offsetTop});\r\n}\r\n","import Tr from \"translations/Translations\";\r\n\r\nexport default {\r\n    number: {\r\n        id: 'number',\r\n        label: Tr('purchase_group_number')\r\n    },\r\n    organization: {\r\n        id: 'organization',\r\n        label: Tr('organizational_unit'),\r\n        transform: (org) => org ? org.name : \"\"\r\n    },\r\n    name: {\r\n        id: 'name',\r\n        label: Tr('purchase_group_name')\r\n    },\r\n    description: {\r\n        id: 'description',\r\n        label: Tr('purchase_group_description')\r\n    }\r\n}","import React from 'react'\r\nimport GridBlock from \"components/GridBlock\";\r\nimport TextInput from \"components/TextInput\";\r\nimport OrganizationInput from \"components/OrganizationInput\";\r\nimport PropTypes from \"prop-types\";\r\nimport propertyTransformer from \"./history/propertyTransformer\";\r\n\r\nfunction PurchasingGroupStage1BasicDataForm(\r\n    {\r\n        formikProps,\r\n        basicData,\r\n        disabled,\r\n    }) {\r\n\r\n\r\n    return (<GridBlock\r\n        column\r\n    >\r\n        <TextInput\r\n            formikProps={formikProps}\r\n            id=\"number\"\r\n            label={propertyTransformer.number.label}\r\n            required={!basicData.numberingAutomated}\r\n            limit={basicData.numberingAutomated ? undefined : 50}\r\n            disabled={disabled || basicData.numberingAutomated}\r\n        />\r\n        <OrganizationInput\r\n            id='organization'\r\n            formikProps={formikProps}\r\n            required\r\n            disabled={disabled || basicData.availableOrganizations.length < 2}\r\n            availableOrganizations={basicData.availableOrganizations}\r\n        />\r\n        <TextInput\r\n            formikProps={formikProps}\r\n            id=\"name\"\r\n            label={propertyTransformer.name.label}\r\n            required\r\n            limit={400}\r\n            disabled={disabled}\r\n            multiline\r\n        />\r\n        <TextInput\r\n            formikProps={formikProps}\r\n            id=\"description\"\r\n            label={propertyTransformer.description.label}\r\n            required\r\n            multiline\r\n            limit={4000}\r\n            disabled={disabled}\r\n        />\r\n    </GridBlock>)\r\n}\r\n\r\nPurchasingGroupStage1BasicDataForm.propTypes = {\r\n    basicData: PropTypes.shape({\r\n        purchasingGroup: PropTypes.object.isRequired,\r\n        numberingAutomated: PropTypes.bool.isRequired,\r\n        availableOrganizations: PropTypes.arrayOf(PropTypes.shape({\r\n            externalId: PropTypes.string.isRequired,\r\n            name: PropTypes.string.isRequired,\r\n            orgId: PropTypes.string.isRequired,\r\n        })).isRequired\r\n    })\r\n}\r\n\r\nexport default PurchasingGroupStage1BasicDataForm;","import React from 'react'\r\nimport HistoryIcon from '@material-ui/icons/History';\r\nimport Button from 'components/Button';\r\nimport Tr from 'translations/Translations';\r\n\r\n\r\nfunction HistoryButton({\r\n\tclasses,\r\n\tonClick,\r\n\tvariant = 'outlined',\r\n\tIcon = HistoryIcon,\r\n\tchildren = Tr('history'),\r\n\t...other\r\n}) {\r\n\treturn (\r\n\t\t<Button\r\n\t\t\tvariant={variant}\r\n\t\t\tIcon={Icon}\r\n\t\t\tonClick={onClick}\r\n\t\t\t{...other}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</Button>\r\n\t)\r\n}\r\n\r\nexport default HistoryButton;","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations'\r\nimport GridBlock from 'components/GridBlock';\r\nimport Loading from \"components/Loading\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport moment from \"moment\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: theme.components.table.lpColumn,\r\n    dateColumn: theme.components.table.dateTimeColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n}))\r\n\r\nfunction HistoryListPopup(\r\n    {\r\n        historyList,\r\n        selectElem,\r\n        selectedElem\r\n    }) {\r\n    const classes = useStyle();\r\n    return (\r\n        <>\r\n            {!historyList ?\r\n                <Loading/>\r\n                :\r\n                <GridBlock\r\n                    column\r\n                    alignItems='center'\r\n                >\r\n                    <SimpleTable\r\n                        headers={\r\n                            [\r\n                                Tr('column_lp'),\r\n                                Tr('last_save_date'),\r\n                                Tr('changing_person'),\r\n                                ''\r\n                            ]\r\n                        }\r\n                        items={\r\n                            historyList.map((elem, i, arr) => ([\r\n                                `${arr.length - i}`,\r\n                                moment(elem.dateInserted).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT),\r\n                                `${elem.user.firstName} ${elem.user.lastName}` + (elem.user.replacedUser ? ` (${Tr('in_deputy_of')} ${elem.user.replacedUser.firstName} ${elem.user.replacedUser.lastName})` : \"\"),\r\n                                <WorkableIconPreviewButton onClick={() => selectElem(elem)} disabled={!!selectedElem}\r\n                                                           working={elem.identity === selectedElem?.identity}/>\r\n                            ]))\r\n                        }\r\n                        columnClasses={[\r\n                            classes.lpColumn,\r\n                            classes.dateColumn,\r\n                            undefined,\r\n                            classes.buttonColumn\r\n                        ]}\r\n                    />\r\n\r\n                    {historyList.length === 0 && <Typography>{Tr('empty_history')}</Typography>}\r\n\r\n                </GridBlock>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nHistoryListPopup.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default HistoryListPopup;\r\n","import Tr from 'translations/Translations'\r\n\r\nexport const getUserFullNameWithEmailAndDeputy = (apiUser) => {\r\n    let name = getUserFullNameWithEmail(apiUser);\r\n    if (apiUser?.replacedUser) {\r\n        name += Tr('in_deputy_of') + apiUser.replacedUser.firstName + \" \" + apiUser.replacedUser.lastName;\r\n    }\r\n    return name;\r\n}\r\nexport const getUserFullNameWithDeputy = (apiUser) => {\r\n    let name = getUserFullName(apiUser);\r\n    if (apiUser?.replacedUser) {\r\n        name += Tr('in_deputy_of') + apiUser.replacedUser.firstName + \" \" + apiUser.replacedUser.lastName;\r\n    }\r\n    return name;\r\n}\r\n\r\nexport const getUserFullNameWithEmail = (apiUser) => {\r\n    let name = getUserFullName(apiUser);\r\n    if (apiUser && apiUser.email) {\r\n        name += \" (\" + apiUser.email + \")\";\r\n    }\r\n    return name;\r\n}\r\nexport const getUserFullName = (apiUser) => {\r\n    let name = '';\r\n    if (apiUser) {\r\n        name += apiUser.firstName + \" \" + apiUser.lastName;\r\n    }\r\n    return name;\r\n}\r\n\r\n","import React, {useMemo, useState} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations'\r\nimport GridBlock from 'components/GridBlock';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Button from \"components/Button\";\r\nimport ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {getUserFullNameWithDeputy} from \"libs/userNameGetter\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    column: {\r\n        width: '30%'\r\n    },\r\n    change: {\r\n        \"&> td\": {\r\n            fontWeight: \"bold\",\r\n            backgroundColor: theme.palette.primary.light\r\n        }\r\n    },\r\n    noChanges: {\r\n        textAlign: \"center\",\r\n        marginTop: theme.spacing(2),\r\n        fontSize: \"1.2rem\"\r\n    },\r\n    buttonShow: {\r\n        position: \"absolute\",\r\n        bottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction HistoryElementComparator(\r\n    {\r\n        selectedElemLoaded,\r\n        selectedElem,\r\n        clearSelectedElem,\r\n        propertyTransformer,\r\n        customParamTransformer\r\n    }) {\r\n    const classes = useStyle();\r\n    const [showTheSame, setShowTheSame] = useState(false)\r\n\r\n\r\n    const content = useMemo(() => {\r\n        const rows = [];\r\n        const rowClasses = [];\r\n        let changesCount = 0;\r\n        let fieldsCount = 0;\r\n\r\n        const {left, right} = selectedElemLoaded;\r\n        const leftContent = left?.content || {};\r\n        const rightContent = right.content;\r\n\r\n        Object.keys(propertyTransformer).forEach((prop, i, arr) => {\r\n\r\n            const tr = propertyTransformer[prop];\r\n            const leftVal = tr.transform ? tr.transform(getObjectValue(tr.id, leftContent, null)) : getObjectValue(tr.id, leftContent, null)\r\n            const rightVal = tr.transform ? tr.transform(getObjectValue(tr.id, rightContent, null)) : getObjectValue(tr.id, rightContent, null);\r\n            const theSame = rightVal === leftVal;\r\n            fieldsCount++;\r\n            if (left === null || !theSame || showTheSame) {\r\n                rows.push([tr.label, leftVal, rightVal])\r\n                rowClasses.push(showTheSame && leftVal !== rightVal ? classes.change : undefined)\r\n                if (!theSame)\r\n                    changesCount++;\r\n            }\r\n        })\r\n        return {rows, rowClasses, changesCount, fieldsCount, user: right.user, dateInserted: right.dateInserted}\r\n    }, [selectedElemLoaded, showTheSame, propertyTransformer, classes.change])\r\n\r\n\r\n    return (\r\n        <GridBlock\r\n            column\r\n            alignItems='center'\r\n        >\r\n            <GridBlock justify=\"space-between\">\r\n                <>\r\n                    <BoldTypography component='span'>{Tr('changing_person')}</BoldTypography>\r\n                    <Typography\r\n                        component='span'>{`: ${getUserFullNameWithDeputy(selectedElem.user)}`}\r\n                    </Typography>\r\n                    <br/>\r\n                    <BoldTypography component='span'>{Tr('last_save_date')}</BoldTypography>\r\n                    <Typography component='span'>{`: ${moment(selectedElem.dateInserted).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}`}</Typography>\r\n                    {\r\n                        !!customParamTransformer && Object.keys(customParamTransformer).map(x => (<>\r\n                            <br/>\r\n                            <BoldTypography component='span'>{customParamTransformer[x].label}</BoldTypography>\r\n                            <Typography component='span'>{`: ${customParamTransformer[x].transform ? customParamTransformer[x].transform(selectedElem.params[x]) : (selectedElem.params[x] || null) }`}</Typography>\r\n                        </>\r\n                        ))\r\n\r\n                    }\r\n                </>\r\n                <Button Icon={ArrowBackIosIcon} onClick={clearSelectedElem}>{Tr('back')}</Button>\r\n            </GridBlock>\r\n\r\n\r\n            <SimpleTable\r\n                headers={\r\n                    [\r\n                        Tr('prop_name'),\r\n                        Tr('change_before'),\r\n                        Tr('change_after')\r\n                    ]\r\n                }\r\n                items={content.rows}\r\n                columnClasses={[\r\n                    undefined,\r\n                    classes.column,\r\n                    classes.column,\r\n                ]}\r\n                rowClasses={content.rowClasses}\r\n            />\r\n\r\n            {!showTheSame && content.changesCount < content.fieldsCount && <Button\r\n                className={classes.buttonShow}\r\n                variant={'outlined'}\r\n                size={'small'}\r\n                onClick={() => setShowTheSame(true)}\r\n            >\r\n                {Tr('no_changes_fields_show')}\r\n            </Button>}\r\n\r\n            {\r\n                content.changesCount === 0 && <BoldTypography className={classes.noChanges}>{Tr(\"no_changes\")}</BoldTypography>\r\n            }\r\n\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nHistoryElementComparator.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default HistoryElementComparator;\r\n","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations'\r\nimport SingleButton from \"../components/SingleButton\";\r\nimport HistoryList from \"./HistoryList\";\r\nimport HistoryElementComparator from \"./HistoryElementComparator\";\r\n\r\n\r\nfunction HistoryListPopup(\r\n    {\r\n        onClose,\r\n        loadHistoryList,\r\n        loadHistoryElement,\r\n        propertyTransformer,\r\n        customParamTransformer\r\n    }) {\r\n\r\n    const [historyList, setHistoryList] = useState(null);\r\n    const [selectedElem, setSelectedElem] = useState(null);\r\n    const [selectedElemLoaded, setSelectedElemLoaded] = useState(null);\r\n\r\n    useEffect(() => {\r\n        loadHistoryList().then(resp => setHistoryList(resp))\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const clearSelectedElem = () => {\r\n        setSelectedElem(null);\r\n        setSelectedElemLoaded(null);\r\n    }\r\n    const selectElem = (elem) => {\r\n        setSelectedElem(elem);\r\n        loadHistoryElement(elem.identity).then((resp) => setSelectedElemLoaded(resp)).catch((e) => {\r\n            console.error(e);\r\n            clearSelectedElem();\r\n        })\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('change_history')}\r\n            titleCentered\r\n            maxWidth='lg'\r\n            onClose={onClose}\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={Tr('close')}\r\n                onClick={onClose}/>}\r\n        >\r\n            {\r\n                !selectedElemLoaded ? <HistoryList historyList={historyList} selectedElem={selectedElem} selectElem={selectElem}/> :\r\n                    <HistoryElementComparator clearSelectedElem={clearSelectedElem} selectedElem={selectedElem} selectedElemLoaded={selectedElemLoaded}\r\n                                              propertyTransformer={propertyTransformer} customParamTransformer={customParamTransformer}/>\r\n\r\n            }\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nHistoryListPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    loadHistoryList: PropTypes.func.isRequired,\r\n    loadHistoryElement: PropTypes.func.isRequired,\r\n    propertyTransformer: PropTypes.object.isRequired,\r\n    customParamTransformer: PropTypes.object\r\n}\r\n\r\nexport default HistoryListPopup;\r\n","import React, {useEffect, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport PurchasingGroupStage1BasicDataForm from \"./PurchasingGroupStage1BasicDataForm\";\r\nimport Form from \"components/Form\";\r\nimport VS from 'constants/ValidationShema';\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\"\r\nimport GridBlock from \"components/GridBlock\";\r\nimport HistoryButton from \"components/button/HistoryButton\";\r\nimport HistoryListPopup from \"components/popup/historyListPopup/HistoryListPopup\";\r\nimport propertyTransformer from \"./history/propertyTransformer\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\n\r\nfunction PurchasingGroupStage1BasicData(\r\n    {\r\n        panelRef,\r\n        validationSection,\r\n        purchasingGroupHeader\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const formId = params.section;\r\n    const disabled = !validationSection.editable;\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const [basicData, setBasicData] = useState();\r\n    const [history, setHistory] = useState();\r\n\r\n    useStepperStateCloseValidator(formId);\r\n\r\n    useEffect(() => {\r\n        if (!!basicData) {\r\n            setTimeout((elem) => scrollTo(elem, 30), 100, panelRef.current);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [basicData]);\r\n\r\n    useEffect(() => {\r\n        if (groupId > 0)\r\n            PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n\r\n        PurchasingGroupStage1Service.getBasicData(groupId).then((resp) => {\r\n            if (resp)\r\n                setBasicData(resp);\r\n            else\r\n                closeSection(groupId);\r\n        });\r\n    }, [groupId, validationSection.section]);\r\n\r\n    const closeSection = (id) => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n        id: id,\r\n        stage: 1\r\n    }))\r\n\r\n    const handleSubmit = (values) => {\r\n        PurchasingGroupStage1Service.saveBasicData(groupId, values).then((result) => {\r\n            if (result) {\r\n                enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + validationSection.name);\r\n                closeSection(result);\r\n            }\r\n        })\r\n    }\r\n\r\n    const loadHistoryList = async () => {\r\n        try {\r\n            return await PurchasingGroupStage1Service.getArchiveList(groupId, validationSection.section)\r\n        } catch (e) {\r\n            setHistory(false);\r\n        }\r\n    }\r\n\r\n    const loadHistoryElement = async (archiveId) => {\r\n        return await PurchasingGroupStage1Service.getArchiveElement(groupId, validationSection.section, archiveId);\r\n    }\r\n\r\n\r\n    if (!basicData) return <Loading/>;\r\n\r\n    return (<>\r\n        <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>\r\n        <Form\r\n            id={formId}\r\n            initialValues={basicData.purchasingGroup}\r\n            validationSchema={VS.object({\r\n                name: VS.stringMax(400).nullable(),\r\n                description: VS.stringMax(4000).nullable(),\r\n                number: basicData.numberingAutomated ? VS.any() : VS.stringMax(50).nullable(),\r\n                organization: VS.anyRequired()\r\n            })}\r\n            onSubmit={handleSubmit}\r\n        >\r\n            {(formikProps) => (\r\n                <>\r\n                    {\r\n                        (!disabled && groupId > 0) && <GridBlock justify=\"flex-end\">\r\n                            <HistoryButton onClick={() => setHistory(true)}>\r\n                                {Tr('change_history')}\r\n                            </HistoryButton>\r\n                        </GridBlock>\r\n                    }\r\n\r\n                    <SaveFormikValues\r\n                        formikProps={formikProps}\r\n                        id={formId}\r\n                    />\r\n                    <PurchasingGroupStage1BasicDataForm basicData={basicData} formikProps={formikProps} disabled={disabled}/>\r\n                </>)}\r\n        </Form>\r\n\r\n        {!!history && <HistoryListPopup loadHistoryElement={loadHistoryElement} loadHistoryList={loadHistoryList} onClose={() => setHistory(false)}\r\n                                        propertyTransformer={propertyTransformer}/>}\r\n    </>)\r\n}\r\n\r\nPurchasingGroupStage1BasicData.propTypes = {}\r\n\r\nexport default PurchasingGroupStage1BasicData;","import React from 'react'\r\nimport { withStyles, Grid } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\twidth: `calc(50% - ${theme.spacing(2)}px)`\r\n\t\t},\r\n\t}\r\n})\r\n\r\nfunction TransferList({\r\n\tclasses,\r\n\tleftColumn,\r\n\trightColumn\r\n}) {\r\n\treturn (\r\n\t\t<Grid\r\n\t\t\tclassName={classes.root}\r\n\t\t\tcontainer\r\n\t\t\tjustifyContent='space-between'\r\n\t\t>\r\n\t\t\t<Grid item>\r\n\t\t\t\t{leftColumn}\r\n\t\t\t</Grid>\r\n\t\t\t<Grid item>\r\n\t\t\t\t{rightColumn}\r\n\t\t\t</Grid>\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nTransferList.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tleftColumn: PropTypes.object,\r\n\trightColumn: PropTypes.object,\r\n}\r\n\r\nTransferList.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(TransferList);","import React from 'react'\r\nimport { withStyles, Grid } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\theight: '100%',\r\n\t\t'&>*':{\r\n\t\t\twidth: '100%'\r\n\t\t}\r\n\t},\r\n\tgrow: {\r\n\t\tflexGrow: 1,\r\n\t}\r\n})\r\n\r\nfunction Column({\r\n\tclasses,\r\n\tchildren\r\n}) {\r\n\treturn (\r\n\t\t<Grid\r\n\t\t\tcontainer\r\n\t\t\tdirection='column'\r\n\t\t\tclassName={classes.root}\r\n\t\t>\r\n\t\t\t{React.Children.map( children, child => {\r\n\t\t\t\tif(child === null) return child;\r\n\t\t\t\tconst props = child.props;\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<Grid\r\n\t\t\t\t\t\titem\r\n\t\t\t\t\t\tclassName={clsx({\r\n\t\t\t\t\t\t\t[classes.grow]: props && props.grow,\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{child}\r\n\t\t\t\t\t</Grid>\r\n\t\t\t\t)\r\n\t\t\t})}\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nColumn.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tchildren: PropTypes.any,\r\n}\r\n\r\nColumn.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(Column);","import React from 'react'\r\nimport { withStyles, Grid, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\theight: theme.components.transferList.row.height,\r\n\t},\r\n\tlabelItem:{\r\n\t\tmarginRight: theme.spacing(2),\r\n\t},\r\n\tchildrenItem:{\r\n\t\tflexGrow: '1'\r\n\t}\r\n})\r\n\r\nfunction Header({\r\n\tclasses,\r\n\tchildren,\r\n\ttitle,\r\n\tclassName,\r\n\tchildClassName,\r\n}) {\r\n\tconst getLabel = () => {\r\n\t\tif(typeof title === 'string'){\r\n\t\t\treturn (\r\n\t\t\t\t<Typography variant='subtitle1'>\r\n\t\t\t\t\t{title}\r\n\t\t\t\t</Typography>\r\n\t\t\t)\r\n\t\t}\r\n\t\treturn children;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Grid\r\n\t\t\tcontainer\r\n\t\t\tclassName={clsx(\r\n\t\t\t\tclasses.root,\r\n\t\t\t\tclassName\r\n\t\t\t)}\r\n\t\t\talignItems='center'\r\n\t\t>\r\n\t\t\t<Grid item className={classes.labelItem}>\r\n\t\t\t\t{getLabel()}\r\n\t\t\t</Grid>\r\n\t\t\t<Grid item className={clsx(\r\n\t\t\t\tclasses.childrenItem,\r\n\t\t\t\tchildClassName,\r\n\t\t\t)}>\r\n\t\t\t\t{children}\r\n\t\t\t</Grid>\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nHeader.propTypes = {\r\n\tclassName: PropTypes.string,\r\n\tclasses: PropTypes.any,\r\n\ttitle: PropTypes.oneOfType([\r\n\t\tPropTypes.string,\r\n\t\tPropTypes.func,\r\n\t]),\r\n\tchildren: PropTypes.any,\r\n}\r\n\r\nHeader.defaultProps = {\r\n\tclassName: '',\r\n\tchildClassName: '',\r\n}\r\n\r\nexport default withStyles(style)(Header);","import React from 'react'\r\nimport { withStyles, TextField } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Header from './Header';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t},\r\n})\r\n\r\nfunction SearchHeader({\r\n\tclasses,\r\n\ttitle,\r\n\tplaceholder,\r\n\tonChange,\r\n\tvalue\r\n}) {\r\n\r\n\treturn (\r\n\t\t<Header\r\n\t\t\tclassName={classes.root}\r\n\t\t\ttitle={title}\r\n\t\t>\r\n\t\t\t<TextField\r\n\t\t\t\tfullWidth\r\n\t\t\t\tid='list-search'\r\n\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\tonChange={onChange}\r\n\t\t\t\tvalue={value}\r\n\t\t\t/>\r\n\t\t</Header>\r\n\r\n\t)\r\n}\r\n\r\nSearchHeader.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\ttitle: PropTypes.oneOfType([\r\n\t\tPropTypes.string,\r\n\t\tPropTypes.func,\r\n\t]),\r\n\tplaceholder: PropTypes.string,\r\n\tonChange: PropTypes.func,\r\n\tvalue: PropTypes.string,\r\n}\r\n\r\nSearchHeader.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(SearchHeader);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ListUI from '@material-ui/core/List'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tborder: `1px solid ${theme.palette.divider}`,\r\n\t\theight: '100%',\r\n\t\t\"overflow-y\": 'auto',\r\n    \t'box-sizing': 'border-box',\r\n    \t'max-height': '360px',\r\n\t}\r\n})\r\n\r\nfunction List({\r\n\tclasses,\r\n\tItemComponent,\r\n\titems,\r\n\titemProps,\r\n}) {\r\n\treturn (\r\n\t\t<ListUI\r\n\t\t\tdense\r\n\t\t\tclassName={classes.root}\r\n\t\t\tdisablePadding\r\n\t\t>\r\n\t\t\t{items.map( (item, i) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<ItemComponent\r\n\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\tindex={i}\r\n\t\t\t\t\t\titem={item}\r\n\t\t\t\t\t\t{...itemProps}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)\r\n\t\t\t})}\r\n\t\t</ListUI>\r\n\t)\r\n}\r\n\r\nList.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tItemComponent: PropTypes.object,\r\n\titems: PropTypes.array,\r\n}\r\n\r\nList.defaultProps = {\r\n\titems: [],\r\n}\r\n\r\nexport default withStyles(style)(List);","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value = Tr(trKey)) => ({\r\n\tlabel: Tr(trKey),\r\n\tvalue,\r\n})\r\n\r\nexport const POSITION_VALUE = {\r\n\t// DEFAULT: '1',\r\n\t// OTHER: '6',\r\n\r\n\tCHAIRMAN: 'CHAIRMAN',\r\n\tVICECHAIRMAN: 'VICECHAIRMAN',\r\n\tSECRETARY: 'SECRETARY',\r\n\tVICESECRETARY: 'VICESECRETARY',\r\n\tSUPERVISOR: 'SUPERVISOR',\r\n\tMEMBER: 'MEMBER',\r\n\tBUYER_SUPERVISOR: 'BUYER_SUPERVISOR',\r\n\tEXPERT: 'EXPERT',\r\n\tOTHER: 'OTHER'\r\n}\r\n\r\nexport default [\r\n\tcreateItem('position_1', POSITION_VALUE.CHAIRMAN),\r\n\tcreateItem('position_2', POSITION_VALUE.VICECHAIRMAN),\r\n\tcreateItem('position_3', POSITION_VALUE.SECRETARY),\r\n\tcreateItem('position_3a', POSITION_VALUE.VICESECRETARY),\r\n\tcreateItem('position_3b', POSITION_VALUE.SUPERVISOR),\r\n\tcreateItem('position_4', POSITION_VALUE.MEMBER),\r\n\tcreateItem('position_4a', POSITION_VALUE.BUYER_SUPERVISOR),\r\n\tcreateItem('position_5', POSITION_VALUE.EXPERT),\r\n\tcreateItem('position_6', POSITION_VALUE.OTHER),\r\n]","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value = Tr(trKey)) => ({\r\n\tlabel: Tr(trKey),\r\n\tvalue,\r\n})\r\n\r\nexport const POSITION_VALUE = {\r\n\t// DEFAULT: '1',\r\n\t// OTHER: '6',\r\n\tCHAIRMAN: 'CHAIRMAN',\r\n\tEXPERT: 'EXPERT',\r\n\tOTHER: 'OTHER'\r\n}\r\n\r\nexport default [\r\n\tcreateItem('pg_position_1', POSITION_VALUE.CHAIRMAN),\r\n\tcreateItem('pg_position_5', POSITION_VALUE.EXPERT),\r\n\tcreateItem('position_6', POSITION_VALUE.OTHER),\r\n]","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport IconButton from './IconButton';\r\nimport AddIcon from '@material-ui/icons/AddBoxOutlined'\r\n\r\nfunction IconAddButton({\r\n\ttooltip = Tr('add'),\r\n\t...props\r\n}) {\r\n\treturn <IconButton\r\n\t\ttooltip={tooltip}\r\n\t\tIcon={AddIcon}\r\n\t\t{...props}\r\n\t/>\r\n}\r\n\r\nexport default IconAddButton;","export default {\r\n\tSYSTEM_USER: 'SYSTEM_USER',\r\n\tEXTERNAL_USER: 'EXTERNAL_USER',\r\n}","import React from 'react'\r\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconHighlightOffButton(\r\n    {\r\n        tooltip = Tr('delete'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={HighlightOffIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconHighlightOffButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconHighlightOffButton;","import React from 'react'\r\nimport {ListItem, ListItemSecondaryAction, ListItemText, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {POSITION_VALUE as demandPositionValue} from 'constants/PositionItems'\r\nimport {POSITION_VALUE as pgPositionValue} from 'constants/PurchasingGroupPositionItems'\r\nimport Tr from 'translations/Translations';\r\nimport IconAddButton from 'components/button/IconAddButton';\r\nimport CommissionUserType from \"constants/CommissionUserType\";\r\nimport reduxStore from \"redux/store\";\r\nimport WorkableIconHighlightOffButton from \"../../../../button/WorkableIconHighlightOffButton\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    iconButton: {\r\n        padding: theme.spacing(1) / 2,\r\n    },\r\n    email: {\r\n        fontStyle: 'italic',\r\n        fontWeight: theme.typography.fontWeightBold,\r\n        fontSize: '0.75rem'\r\n    }\r\n})\r\n\r\nfunction FullNameItem(\r\n    {\r\n        classes,\r\n        marked = false,\r\n        formikProps,\r\n        addedId,\r\n        item,\r\n        markHistorical\r\n    }) {\r\n    const elementsCount = getObjectValue(addedId, formikProps.values, []).length;\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const addPerson = () => {\r\n        const {resources} = reduxStore.getState();\r\n        const pgMode = !!resources.purchasingGroupHeader;\r\n\r\n        const nextId = `${addedId}.${elementsCount}`\r\n        formikProps.setFieldValue(nextId, {\r\n            ...item,\r\n            role: pgMode ? (item.userType === CommissionUserType.EXTERNAL_USER ? pgPositionValue.OTHER : pgPositionValue.CHAIRMAN) : demandPositionValue.MEMBER,\r\n            otherRole: \"\"\r\n        })\r\n    }\r\n    const externalUser = item.userType === CommissionUserType.EXTERNAL_USER;\r\n    const getPrimaryText = () => (<>\r\n        <Typography variant='body2' component='span'>{item.firstName} {item.lastName}</Typography>\r\n        {externalUser && <Typography variant='body2' component='span' className={classes.email}>{' (' + (item.email ? item.email : Tr('email_empty')) + ')'}</Typography>}\r\n    </>)\r\n\r\n    const secondaryText = externalUser ? Tr('external') : item.organizationName;\r\n\r\n    return (\r\n        <ListItem role=\"listitem\">\r\n            <ListItemText primary={getPrimaryText()} secondary={secondaryText}/>\r\n            <ListItemSecondaryAction>\r\n                {\r\n                    (!!markHistorical && editable && externalUser) &&\r\n                    <WorkableIconHighlightOffButton\r\n                        className={classes.iconButton}\r\n                        tooltip={Tr(\"archive\")}\r\n                        onClick={()=> markHistorical(item.id)}\r\n                        disabled={!editable}\r\n                    />\r\n                }\r\n\r\n                <IconAddButton\r\n                    className={classes.iconButton}\r\n                    color='primary'\r\n                    onClick={addPerson}\r\n                    disabled={!editable}\r\n                />\r\n            </ListItemSecondaryAction>\r\n        </ListItem>\r\n    )\r\n}\r\n\r\nFullNameItem.propTypes = {\r\n    classes: PropTypes.any,\r\n    name: PropTypes.string,\r\n}\r\n\r\nFullNameItem.defaultProps = {}\r\n\r\nexport default withStyles(style)(FullNameItem);","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        display: 'flex'\r\n    },\r\n    icon: {\r\n        marginRight: theme.spacing(1)\r\n    }\r\n}));\r\n\r\nfunction TypographyWithIcon(\r\n    {\r\n        className,\r\n        children,\r\n        Icon,\r\n        ...other\r\n    }) {\r\n\r\n\r\n    const classes = useStyles();\r\n    return (\r\n        <Typography\r\n            className={clsx(classes.root, className)}\r\n            {...other}\r\n        >\r\n            {!!Icon && <Icon className={classes.icon}/>}\r\n            {children}\r\n        </Typography>\r\n    )\r\n}\r\n\r\nTypographyWithIcon.propTypes = {\r\n    classes: PropTypes.any,\r\n    variant: PropTypes.string\r\n}\r\n\r\nexport default TypographyWithIcon;","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport GridBlock from 'components/GridBlock';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport Tr from 'translations/Translations';\r\nimport TextInput from 'components/TextInput';\r\nimport * as Yup from 'yup';\r\nimport VS from 'constants/ValidationShema';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport InputLimits from \"constants/InputLimits\";\r\nimport Loading from \"../../Loading\";\r\nimport TypographyWithIcon from \"../../TypographyWithIcon\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\n\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\twidth: '100%'\r\n\t\t}\r\n\t},\r\n\tactions:{\r\n\t\tmarginTop: theme.spacing(),\r\n\t}\r\n})\r\nconst limits = InputLimits.procedure.contractor;\r\nfunction PopupForm({\r\n\tclasses,\r\n\tonSubmit,\r\n\tonClose,\r\n\tformSubmit,\r\n\tuserList,\r\n\terror,\r\n\tworking\r\n}) {\r\n\tconst formId = useId();\r\n\r\n\tconst handleSubmit = () => {\r\n\t\tformSubmit[formId]()\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Form\r\n\t\t\tinitialValues={{\r\n\t\t\t\tfirstName: '',\r\n\t\t\t\tlastName: '',\r\n\t\t\t\temail: '',\r\n\t\t\t}}\r\n\t\t\tvalidationSchema={\r\n\t\t\t\tYup.lazy((value) => {\r\n\t\t\t\t\tconst validateObj = {\r\n\t\t\t\t\t\tfirstName: VS.string(),\r\n\t\t\t\t\t\tlastName: VS.string()\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet email\r\n\t\t\t\t\tconst found = Boolean(userList.find(element => element.email === value.email))\r\n\t\t\t\t\tif (found) email = VS.immediatelyError(Tr(\"email_exist\"))\r\n\t\t\t\t\telse email = VS.email(limits.EMAIL)\r\n\r\n\t\t\t\t\treturn Yup.object().shape({\r\n\t\t\t\t\t\t...validateObj,\r\n\t\t\t\t\t\temail\r\n\t\t\t\t\t})\r\n\t\t\t\t})}\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tid={formId}\r\n\t\t>\r\n\t\t\t{(formikProps) => (\r\n\t\t\t\t<GridBlock direction='column' className={classes.root}>\r\n\t\t\t\t\t{working && <Loading/>}\r\n\t\t\t\t\t{!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='firstName'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('firstName')}\r\n\t\t\t\t\t\trequired\r\n\t\t\t\t\t\tdisabled={working}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='lastName'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('lastName')}\r\n\t\t\t\t\t\trequired\r\n\t\t\t\t\t\tdisabled={working}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\tid='email'\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={Tr('email')}\r\n\t\t\t\t\t\tdisabled={working}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t<div className={classes.actions}>\r\n\t\t\t\t\t\t<DoubleButton\r\n\t\t\t\t\t\t\tjustify='flex-end'\r\n\t\t\t\t\t\t\tlabelFirst={Tr('cancel')}\r\n\t\t\t\t\t\t\tlabelSecond={Tr('add')}\r\n\t\t\t\t\t\t\tonClickFirst={onClose}\r\n\t\t\t\t\t\t\tonClickSecond={handleSubmit}\r\n\t\t\t\t\t\t\tdisabledFirst={working}\r\n\t\t\t\t\t\t\tdisabledSecond={working}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</GridBlock>\r\n\t\t\t)}\r\n\t\t</Form>\r\n\t)\r\n}\r\n\r\nPopupForm.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tformSubmit: state.form\r\n}), {\r\n\r\n\t})(withStyles(style)(PopupForm));","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store'\r\nimport {clearResource, setResource, setSaveStatusDialog, setSaveStatusError, setSaveStatusLoading} from 'redux/actions'\r\nimport validateSection from './helpers/validateSection';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport Tr from 'translations/Translations';\r\nimport objectExtension from 'libs/objectExtension';\r\nimport CommissionUserType from \"../constants/CommissionUserType\";\r\n\r\nconst COMMISSION_USER_LIST_RESOURCE_ID = 'commissionUserList';\r\nconst COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID = 'commissionUserListAvailable';\r\nconst COMMISSION_ESTABLISHMENT_RESOURCE_ID = 'commissionEstablishmentDate';\r\nconst getUsers = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.COMMISSION(demandId))\r\n        reduxStore.dispatch(setResource(COMMISSION_USER_LIST_RESOURCE_ID, res.users))\r\n        reduxStore.dispatch(setResource(COMMISSION_ESTABLISHMENT_RESOURCE_ID, res.establishmentDate))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getAvailableUsers = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.COMMISSION_AVAILABLE(demandId))\r\n        reduxStore.dispatch(setResource(COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID, res))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst _save = async (url, data) => {\r\n    const {resources} = reduxStore.getState()\r\n    const {commissionUserList} = resources;\r\n    const diff = objectExtension.diff(data, {users: commissionUserList}, true);\r\n\r\n    if (diff === null) return null;\r\n\r\n    try {\r\n        return await RestRequestPOST(url, data)\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst saveUserList = async (demandId, data) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const res = await _save(Endpoints.COMMISSION(demandId), data)\r\n        if (res === null) {\r\n            reduxStore.dispatch(setSaveStatusDialog());\r\n        } else if (res.success) {\r\n            reduxStore.dispatch(setSaveStatusDialog());\r\n            await validateSection(DemandValidation.COMMISSION, demandId);\r\n        } else {\r\n            reduxStore.dispatch(setSaveStatusError(Tr(res.errors.users)));\r\n            await validateSection(DemandValidation.COMMISSION, demandId, false);\r\n        }\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst addExternal = async (values) => {\r\n    return await RestRequestPOST(Endpoints.COMMISSION_EXTERNAL, values);\r\n}\r\n\r\nconst getHistory = async (demandId) => {\r\n    try {\r\n        return await RestRequestGET(Endpoints.COMMISSION_HISTORY(demandId))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst deleteCommissionMember = async (demandId, id) => {\r\n    try {\r\n        await RestRequestDELETE(Endpoints.COMMISSION_DELETE_COMMISION_MEMBER(demandId, id))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst markHistorical = async (demandId, id) => {\r\n    try {\r\n        await RestRequestPUT(Endpoints.COMMISSION_MARK_HISTORICAL_MEMBER(demandId, id))\r\n        const {resources} = reduxStore.getState();\r\n        reduxStore.dispatch(setResource(COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID,\r\n            resources[COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID].filter(x => !(x.userType === CommissionUserType.EXTERNAL_USER && x.id === id))))\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst validate = async (demandId) => {\r\n    return RestRequestGET(Endpoints.COMMISSION_VALIDATE(demandId));\r\n}\r\nconst clearResources = async (id) => {\r\n    reduxStore.dispatch(clearResource(id));\r\n}\r\n\r\nconst checkForDraft = async (id) => {\r\n    return await RestRequestGET(Endpoints.COMMISSION_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraft = async (id) => {\r\n    const res = await RestRequestGET(Endpoints.COMMISSION_AUTOSAVE(id));\r\n    reduxStore.dispatch(setResource(COMMISSION_USER_LIST_RESOURCE_ID, res.result.users));\r\n    reduxStore.dispatch(setResource(COMMISSION_ESTABLISHMENT_RESOURCE_ID, res.result.establishmentDate));\r\n    return res;\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n    await RestRequestPOST(Endpoints.COMMISSION_AUTOSAVE(id), formValues)\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n    await RestRequestDELETE(Endpoints.COMMISSION_AUTOSAVE(id));\r\n}\r\n\r\nexport default {\r\n    saveUserList,\r\n    addExternal,\r\n    getHistory,\r\n    getUsers,\r\n    getAvailableUsers,\r\n    deleteCommissionMember,\r\n    markHistorical,\r\n    validate,\r\n    clearResources,\r\n    checkForDraft,\r\n    loadDraft,\r\n    saveDraft,\r\n    deleteDraft,\r\n    COMMISSION_USER_LIST_RESOURCE_ID,\r\n    COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID,\r\n    COMMISSION_ESTABLISHMENT_RESOURCE_ID\r\n    // autoSave,\r\n    // autoSaveCheck,\r\n    // autoSaveDelete,\r\n    // autoSaveLoad,\r\n    // restoreAutosave,\r\n}","import React, {useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport PopupForm from './PopupForm';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport {POSITION_VALUE as demandPositionValue} from 'constants/PositionItems'\r\nimport {POSITION_VALUE as pgPositionValue} from \"constants/PurchasingGroupPositionItems\";\r\nimport CommissionService from 'services/CommissionService';\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport reduxStore from \"redux/store\";\r\nimport {setResource} from \"../../../redux/actions\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tactions: {\r\n\t\tmarginTop: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction AddCandidate({\r\n\tclasses,\r\n\tonClose = () => { },\r\n\tformikProps\r\n}) {\r\n\r\n\tconst elementsCount = getObjectValue(\"users\", formikProps.values, []).length;\r\n\tconst [working, setWorking] = useState(false);\r\n\tconst [error, setError] = useState(null);\r\n\r\n\tconst handleAdd = (values) => {\r\n\t\tsetError(null);\r\n\t\tsetWorking(true);\r\n\t\tCommissionService.addExternal(values).then((res) => {\r\n\t\t\tif(isResponseValid(res, setError)) {\r\n\t\t\t\tconst {resources} = reduxStore.getState();\r\n\t\t\t\tconst pgMode = !!resources.purchasingGroupHeader;\r\n\r\n\t\t\t\tformikProps.setFieldValue(`users.${elementsCount}`, {\r\n\t\t\t\t\t...res,\r\n\t\t\t\t\trole: pgMode ? pgPositionValue.OTHER : demandPositionValue.MEMBER,\r\n\t\t\t\t})\r\n\r\n\t\t\t\tif(!pgMode) {\r\n\t\t\t\t\tconst newList = [...resources[CommissionService.COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID], res];\r\n\t\t\t\t\treduxStore.dispatch(setResource(CommissionService.COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID, newList))\r\n\t\t\t\t}\r\n\r\n\t\t\t\tonClose();\r\n\t\t\t} else {\r\n\t\t\t\tsetWorking(false);\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\ttitle={Tr('new_external_candidate')}\r\n\t\t\topen={true}\r\n\t\t\tmaxWidth='xs'\r\n\t\t\tonClose={onClose}\r\n\t\t>\r\n\t\t\t<PopupForm\r\n\t\t\t\tonSubmit={handleAdd}\r\n\t\t\t\tonClose={onClose}\r\n\t\t\t\tuserList={formikProps.values[\"users\"]}\r\n\t\t\t\tworking={working}\r\n\t\t\t\terror={error}\r\n\t\t\t/>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nAddCandidate.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(AddCandidate);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\theight: theme.components.transferList.row.height,\r\n\t}\r\n})\r\n\r\nfunction EmptyOptions({\r\n\tclasses,\r\n\tchildren,\r\n}) {\r\n\treturn (\r\n\t\t<div className={classes.root}>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nEmptyOptions.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tchildren: PropTypes.any,\r\n}\r\n\r\nEmptyOptions.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(EmptyOptions);","import React, {useState, useEffect} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Column from 'components/complex/transferList/Column';\r\nimport SearchHeader from 'components/complex/transferList/headers/SearchHeader';\r\nimport List from 'components/complex/transferList/List';\r\nimport FullNameItem from './listItems/FullNameItem';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport AddIcon from '@material-ui/icons/AddBoxOutlined'\r\nimport AddCandidate from 'components/popup/addCandidate/AddCandidate';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport EmptyOptions from 'components/complex/transferList/options/EmptyOptions';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    button: {\r\n        marginTop: theme.spacing(1)\r\n    }\r\n});\r\n\r\nfunction CandidateColumn({\r\n                             classes,\r\n                             items,\r\n                             formikProps,\r\n                             addedId,\r\n                             markHistorical\r\n                         }) {\r\n\r\n    const [filteredItems, setFilteredItems] = useState([]);\r\n    const [searchFilter, setSearchFilter] = useState('');\r\n    const [addPopup, setAddPopup] = useState(false);\r\n\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const addedItems = getObjectValue(addedId, formikProps.values, []);\r\n\r\n    useEffect(() => {\r\n\r\n        let filter = items.filter(x => {\r\n            const isAdded = addedItems.findIndex(z => z.id === x.id);\r\n            if (isAdded >= 0) return false;\r\n\r\n            let search = searchFilter.trim().toLowerCase();\r\n            if (search.length <= 0) return true;\r\n\r\n            let name = `${x.firstName} ${x.lastName}`;\r\n            name = name.toLowerCase();\r\n            return name.includes(search)\r\n        });\r\n\r\n        filter.sort((a, b) => a.firstName.localeCompare(b.firstName));\r\n\r\n        setFilteredItems(filter)\r\n        // eslint-disable-next-line\r\n    }, [searchFilter, addedItems.length, items]);\r\n\r\n    const handleSearchChange = (event) => {\r\n        setSearchFilter(event.target.value);\r\n    };\r\n\r\n    return (\r\n        <Column>\r\n            <SearchHeader\r\n                placeholder={Tr('search_placeholder_fullname')}\r\n                title={Tr('candidates')}\r\n                onChange={handleSearchChange}\r\n                value={searchFilter}\r\n            />\r\n            <EmptyOptions/>\r\n            <List\r\n                grow\r\n                ItemComponent={FullNameItem}\r\n                items={filteredItems}\r\n                itemProps={{\r\n                    formikProps,\r\n                    addedId,\r\n                    markHistorical\r\n                }}\r\n            />\r\n            <Button\r\n                variant='text'\r\n                onClick={() => setAddPopup(true)}\r\n                Icon={AddIcon}\r\n                className={classes.button}\r\n                disabled={!editable}\r\n            >\r\n                {Tr('add_commission_candidate')}\r\n            </Button>\r\n            {addPopup && <AddCandidate\r\n                onClose={() => setAddPopup(false)}\r\n                formikProps={formikProps}\r\n            />}\r\n        </Column>\r\n    )\r\n}\r\n\r\nCandidateColumn.propTypes = {\r\n    classes: PropTypes.any,\r\n    items: PropTypes.array,\r\n};\r\n\r\nCandidateColumn.defaultProps = {};\r\n\r\nexport default withStyles(style)(CandidateColumn);","import React, {useEffect} from 'react'\r\nimport {IconButton, InputAdornment, ListItem, ListItemSecondaryAction, ListItemText, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport positionsItems, {POSITION_VALUE} from 'constants/PositionItems'\r\nimport pgPositionsItems from 'constants/PurchasingGroupPositionItems'\r\nimport GridBlock from 'components/GridBlock';\r\nimport Select from 'components/Select';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport TextInput from 'components/TextInput';\r\nimport CloseIcon from '@material-ui/icons/Close'\r\nimport removeFormikListElement from 'libs/removeFormikListElement';\r\nimport Tr from 'translations/Translations';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport CommissionUserType from \"constants/CommissionUserType\";\r\nimport {connect} from \"react-redux\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        paddingRight: theme.spacing(2),\r\n    },\r\n    primaryAction: {\r\n        width: \"calc(100% - 260px)\",\r\n    },\r\n    secondaryAction: {\r\n        width: 250,\r\n    },\r\n    iconButton: {\r\n        padding: theme.spacing(1) / 2,\r\n    },\r\n    grid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1\r\n        }\r\n    },\r\n    email: {\r\n        fontStyle: 'italic',\r\n        fontWeight: theme.typography.fontWeightBold,\r\n        fontSize: '0.75rem'\r\n    }\r\n})\r\n\r\nfunction FullNamePositionItem(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        index,\r\n        id,\r\n        item,\r\n        purchasingGroupHeader\r\n    }) {\r\n    const selectTextId = `${id}.${index}.otherRole`\r\n    const otherValue = getObjectValue(selectTextId, formikProps.values, \"\");\r\n\r\n    useEffect(() => {\r\n        if (role === POSITION_VALUE.OTHER) formikProps.setFieldValue(selectTextId, otherValue)\r\n        // eslint-disable-next-line\r\n    }, [role])\r\n\r\n    const selectId = `${id}.${index}.role`\r\n    const otherRole = `${id}.${index}.otherRole`\r\n    const role = getObjectValue(selectId, formikProps.values);\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const closeTextInput = () => {\r\n        formikProps.setFieldValue(selectId, POSITION_VALUE.CHAIRMAN)\r\n        formikProps.setFieldValue(otherRole, undefined)\r\n    }\r\n\r\n    const handleDelete = () => {\r\n        removeFormikListElement(formikProps, id, index)\r\n    }\r\n    const externalUser = item.userType === CommissionUserType.EXTERNAL_USER;\r\n    const getPrimaryText = () => (<>\r\n        <Typography variant='body2' component='span'>{item.firstName} {item.lastName}</Typography>\r\n        {externalUser &&\r\n        <Typography variant='body2' component='span' className={classes.email}>{' (' + (item.email ? item.email : Tr('email_empty')) + ')'}</Typography>}\r\n    </>)\r\n\r\n    const secondaryText = externalUser ? Tr('external') : item.organizationName;\r\n\r\n    return (\r\n        <ListItem role=\"listitem\" className={classes.root}>\r\n            <ListItemText classes={{primary: classes.primaryAction, secondary: classes.primaryAction}} primary={getPrimaryText()} secondary={secondaryText}/>\r\n            <ListItemSecondaryAction className={classes.secondaryAction}>\r\n                <GridBlock\r\n                    wrap='nowrap'\r\n                    justify='space-between'\r\n                    className={classes.grid}\r\n                >\r\n                    {role === POSITION_VALUE.OTHER ?\r\n                        <TextInput\r\n                            id={selectTextId}\r\n                            formikProps={formikProps}\r\n                            // noError\r\n                            endAdornment={\r\n                                <InputAdornment position='end'>\r\n                                    <IconButton\r\n                                        onClick={closeTextInput}\r\n                                        className={classes.iconButton}\r\n                                        disabled={!editable}\r\n                                    >\r\n                                        <CloseIcon/>\r\n                                    </IconButton>\r\n                                </InputAdornment>\r\n                            }\r\n                        />\r\n                        :\r\n                        <Select\r\n                            id={selectId}\r\n                            formikProps={formikProps}\r\n                            items={!purchasingGroupHeader ? positionsItems : pgPositionsItems}\r\n                            noError\r\n                        />\r\n                    }\r\n                    <WorkableIconDeleteButton\r\n                        className={classes.iconButton}\r\n                        onClick={handleDelete}\r\n                        disabled={!editable}\r\n                    />\r\n                </GridBlock>\r\n            </ListItemSecondaryAction>\r\n        </ListItem>\r\n    )\r\n}\r\n\r\nFullNamePositionItem.propTypes = {\r\n    classes: PropTypes.any,\r\n    name: PropTypes.string,\r\n}\r\n\r\nFullNamePositionItem.defaultProps = {}\r\n\r\nexport default connect((state) => ({\r\n    purchasingGroupHeader: state.resources.purchasingGroupHeader\r\n}), {\r\n\r\n})(withStyles(style)(FullNamePositionItem));","import React, {useEffect, useState} from 'react'\r\nimport ChangeHistory from 'components/popup/changeHistory/ChangeHistory';\r\nimport PropTypes from 'prop-types';\r\nimport EmptyOptions from 'components/complex/transferList/options/EmptyOptions';\r\nimport Column from 'components/complex/transferList/Column';\r\nimport List from 'components/complex/transferList/List';\r\nimport FullNamePositionItem from './listItems/FullNamePositionItem';\r\nimport Tr from 'translations/Translations';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport Header from 'components/complex/transferList/headers/Header';\r\nimport HistoryButton from 'components/button/HistoryButton';\r\nimport GridBlock from 'components/GridBlock';\r\nimport DatePicker from \"components/DatePicker\";\r\nimport {withStyles} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\n\r\nconst style = theme => ({\r\n    helperTextHidden: {\r\n        '&>*.MuiFormHelperText-root': {\r\n            display: \"none\"\r\n        }\r\n    }\r\n})\r\n\r\nfunction CommissionColumn(\r\n    {\r\n        doLoadHistory,\r\n        formikProps,\r\n        id,\r\n        establishmentId,\r\n        classes,\r\n    }) {\r\n    const [history, setHistory] = useState(false);\r\n    const [commissionHistoryList, setCommissionHistoryList] = useState(null);\r\n\r\n    useEffect(() => {\r\n        if (history) {\r\n            doLoadHistory().then((resp => setCommissionHistoryList(resp)));\r\n        } else {\r\n            setCommissionHistoryList(null)\r\n        }\r\n    }, [history, doLoadHistory]);\r\n\r\n    let items = getObjectValue(id, formikProps.values, [])\r\n\r\n    items = items.sort((a, b) => a.firstName.localeCompare(b.firstName))\r\n\r\n    return (\r\n        <Column>\r\n            <GridBlock justify=\"space-between\">\r\n                <Header\r\n                    title={Tr('commission_members')}\r\n                ></Header>\r\n                {\r\n                    !!doLoadHistory && <HistoryButton onClick={() => setHistory(true)}>\r\n                        {Tr('history')}\r\n                    </HistoryButton>\r\n                }\r\n            </GridBlock>\r\n            <EmptyOptions/>\r\n            <List\r\n                grow\r\n                ItemComponent={FullNamePositionItem}\r\n                items={items}\r\n                itemProps={{\r\n                    formikProps,\r\n                    id\r\n                }}\r\n            />\r\n            <GridBlock justify=\"flex-start\">\r\n                <Header\r\n                    title={Tr('commission_establishment')}\r\n                ></Header>\r\n                <DatePicker\r\n                    formikProps={formikProps}\r\n                    id={establishmentId}\r\n                    className={clsx(classes.helperTextHidden)}\r\n                />\r\n            </GridBlock>\r\n            <ChangeHistory historyTab={commissionHistoryList} open={history} onClose={() => setHistory(false)}/>\r\n        </Column>\r\n    )\r\n}\r\n\r\nCommissionColumn.propTypes = {\r\n    classes: PropTypes.any,\r\n    items: PropTypes.array,\r\n}\r\n\r\nCommissionColumn.defaultProps = {}\r\n\r\nexport default withStyles(style)(CommissionColumn);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport TransferListBase from 'components/complex/transferList/TransferList'\r\nimport CandidateColumn from './CandidateColumn';\r\nimport CommissionColumn from './CommissionColumn';\r\n\r\n\r\nfunction TransferList(\r\n    {\r\n        formikProps,\r\n        userListAvailable,\r\n        doLoadHistory,\r\n        markHistorical\r\n    }) {\r\n\r\n    return (\r\n        <TransferListBase\r\n            leftColumn={\r\n                <CandidateColumn\r\n                    items={userListAvailable}\r\n                    formikProps={formikProps}\r\n                    addedId='users'\r\n                    markHistorical={markHistorical}\r\n                />\r\n            }\r\n            rightColumn={\r\n                <CommissionColumn\r\n                    doLoadHistory={doLoadHistory}\r\n                    id='users'\r\n                    establishmentId='establishmentDate'\r\n                    formikProps={formikProps}\r\n                />\r\n            }\r\n        />\r\n    )\r\n}\r\n\r\nTransferList.propTypes = {\r\n    classes: PropTypes.any,\r\n    markHistorical: PropTypes.func\r\n};\r\n\r\nexport default TransferList;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport TransferList from './transferList/TransferList';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup'\r\nimport ValidationShema from 'constants/ValidationShema';\r\nimport {POSITION_VALUE} from 'constants/PositionItems'\r\nimport Loading from \"components/Loading\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\n\r\nfunction CommissionForm(\r\n    {\r\n        formId,\r\n        demandId,\r\n        commissionUserList,\r\n        userListAvailable,\r\n        establishmentDate,\r\n        handleSubmit,\r\n        afterSubmitFunc = () => {\r\n        },\r\n        editable,\r\n        doLoadHistory,\r\n        markHistorical,\r\n        saveDraftFunc,\r\n        autoSaveFormDraftActive\r\n    }) {\r\n\r\n    const validationSchema = () => {\r\n        return Yup.object().shape({\r\n            users: Yup.array().of(\r\n                Yup.lazy((value) => {\r\n                    if (value.role === POSITION_VALUE.OTHER) {\r\n                        return Yup.object().shape({\r\n                            otherRole: ValidationShema.string().nullable()\r\n                        })\r\n                    }\r\n                    return Yup.object().shape({})\r\n                })\r\n            ),\r\n            establishmentDate: ValidationShema.any()\r\n        })\r\n    }\r\n\r\n    const getInitValues = () => {\r\n        return {\r\n            _editable: editable,\r\n            users: [...commissionUserList],\r\n            establishmentDate: establishmentDate,\r\n        }\r\n    }\r\n\r\n    if (!userListAvailable || !commissionUserList) return <Loading/>\r\n    return (\r\n        <Form\r\n            initialValues={getInitValues()}\r\n            id={formId}\r\n            validationSchema={validationSchema()}\r\n            onSubmit={handleSubmit}\r\n            afterSubmitFunc={afterSubmitFunc}\r\n        >\r\n            {(formikProps) => (\r\n                <>\r\n                    <SaveFormikValues\r\n                        formikProps={formikProps}\r\n                        id={formId}\r\n                    />\r\n\r\n                    {!!saveDraftFunc && !!autoSaveFormDraftActive &&\r\n                    <AutoSaveFormValues\r\n                        formikProps={formikProps}\r\n                        id={demandId}\r\n                        formId={formId}\r\n                        saveFunc={(formValues) => {\r\n                            saveDraftFunc(demandId, formValues)\r\n                        }}\r\n                    />\r\n                    }\r\n\r\n                    <TransferList\r\n                        doLoadHistory={doLoadHistory}\r\n                        formikProps={formikProps}\r\n                        userListAvailable={userListAvailable}\r\n                        markHistorical={markHistorical}\r\n                    />\r\n                </>\r\n            )}\r\n        </Form>\r\n    )\r\n}\r\n\r\nCommissionForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default CommissionForm;\r\n","import React, {useCallback, useEffect, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\"\r\nimport CommissionForm from \"components/complex/commissionForm/CommissionForm\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\n\r\nfunction PurchasingGroupStage1Commission(\r\n    {\r\n        panelRef,\r\n        validationSection\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const formId = params.section;\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const [commission, setCommission] = useState({});\r\n\r\n    useStepperStateCloseValidator(formId);\r\n\r\n    const closeSection = useCallback(() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n        id: groupId,\r\n        stage: 1\r\n    })), [groupId]);\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n        PurchasingGroupStage1Service.getCommission(groupId).then((resp) => {\r\n            if (resp)\r\n                setCommission(resp)\r\n            else\r\n                closeSection();\r\n        });\r\n    }, [groupId, closeSection, validationSection.section]);\r\n\r\n\r\n    const handleSubmit = (values) => {\r\n        PurchasingGroupStage1Service.saveCommission(groupId, values).then(() => {\r\n            enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + validationSection.name);\r\n            PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n            closeSection();\r\n        })\r\n    }\r\n\r\n    const doLoadHistory = async () => {\r\n        return await PurchasingGroupStage1Service.getCommissionHistory(groupId);\r\n    }\r\n\r\n    return (\r\n        <CommissionForm\r\n            formId={formId}\r\n            handleSubmit={handleSubmit}\r\n            commissionUserList={commission.commissionUserList}\r\n            userListAvailable={commission.userListAvailable}\r\n            editable={validationSection.editable}\r\n            doLoadHistory={doLoadHistory}\r\n        />\r\n    )\r\n}\r\n\r\nPurchasingGroupStage1Commission.propTypes = {}\r\n\r\nexport default PurchasingGroupStage1Commission;","import React, {useEffect} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {KeyboardDateTimePicker} from '@material-ui/pickers';\r\nimport Tr from 'translations/Translations';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment from \"libs/moment\";\r\n\r\nfunction DateTimePicker(\r\n    {\r\n        formikProps,\r\n        id,\r\n        label,\r\n        minDate,\r\n        maxDate,\r\n        required = false,\r\n        onChange = () => {\r\n        },\r\n        disabled = false,\r\n        className,\r\n        skipCheckTouched\r\n    }) {\r\n\r\n    const editable = disabled ? false : getObjectValue('_editable', formikProps.values, true);\r\n    const errorValue = getObjectValue(id, formikProps.errors, null);\r\n    const value = getObjectValue(id, formikProps.values, null);\r\n    const touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched);\r\n\r\n    useEffect(()=> {\r\n        if( typeof value === 'string' || value instanceof String) {\r\n            const momentVal = moment(value);\r\n            if(momentVal.isValid()) {\r\n                formikProps.setFieldValue(id, momentVal);\r\n                formikProps.validateField(id);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    },[])\r\n\r\n    const handleChange = (date) => {\r\n        const value = date ? date : null;\r\n        formikProps.setFieldValue(id, value);\r\n        formikProps.setFieldTouched(id, true);\r\n        setTimeout((id) => {try {formikProps.validateField(id)} catch (e){}}, 1, id);\r\n        onChange(value ? value.clone() : null)\r\n    };\r\n\r\n    const handleError = (err) => {\r\n        if (!Boolean(errorValue)) {\r\n            if (errorValue !== err && err.length > 0) {\r\n                formikProps.setFieldError(id, err)\r\n            }\r\n        }\r\n    };\r\n    const isError = editable && !!errorValue && Boolean(touched);\r\n    const helperText = errorValue || ' ';\r\n\r\n    return (\r\n        <KeyboardDateTimePicker\r\n            className={className}\r\n            disabled={!editable}\r\n            ampm={false}\r\n            label={required ? label + '*' : label}\r\n            name={id}\r\n            value={value}\r\n            format={DateFormats.DATETIME_FORMAT}\r\n            onChange={handleChange}\r\n            onBlur={formikProps.handleBlur}\r\n            error={isError}\r\n            helperText={isError ? helperText : ' '}\r\n            minDate={minDate}\r\n            maxDate={maxDate}\r\n            onError={handleError}\r\n            invalidDateMessage={Tr('invalid_date_format')}\r\n            minDateMessage={Tr(\"v_data_can_not_be_past\")}\r\n            maxDateMessage={Tr(\"v_data_can_not_be_future\")}\r\n            variant='dialog'\r\n            cancelLabel={Tr('cancel')}\r\n            inputProps={{\r\n                \"data-id\": id\r\n            }}\r\n            //onOpen={formikProps.handleBlur}\r\n        />\r\n    )\r\n}\r\n\r\nDateTimePicker.propTypes = {\r\n    classes: PropTypes.any,\r\n    required: PropTypes.bool\r\n}\r\n\r\nexport default DateTimePicker;","import React from 'react'\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PropTypes from \"prop-types\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    picker: {\r\n        width: 400,\r\n        marginRight: theme.spacing(3)\r\n    },\r\n    stageHead: {\r\n        marginTop: theme.spacing(4)\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage1ScheduleForm(\r\n    {\r\n        formikProps,\r\n        schedule,\r\n        editable\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (<GridBlock\r\n        column\r\n    >\r\n\r\n        <BoldTypography>{Tr('purchasing_group_joining_stage')}</BoldTypography>\r\n        <GridBlock>\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"joiningStartDate\"\r\n                label={Tr('purchase_group_stage_start_date')}\r\n                required={schedule.joiningStartDateEditable}\r\n                disabled={!editable || !schedule.joiningStartDateEditable}\r\n            />\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"joiningEndDate\"\r\n                label={Tr('purchase_group_stage_end_date')}\r\n                required={schedule.joiningEndDateEditable}\r\n                disabled={!editable || !schedule.joiningEndDateEditable}\r\n            />\r\n        </GridBlock>\r\n\r\n        <BoldTypography className={classes.stageHead}>{Tr('purchasing_group_opinion_stage')}</BoldTypography>\r\n        <GridBlock>\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"opinionStartDate\"\r\n                label={Tr('purchase_group_stage_start_date')}\r\n                required={schedule.opinionStartDateEditable}\r\n                disabled={!editable || !schedule.opinionStartDateEditable}\r\n            />\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"opinionEndDate\"\r\n                label={Tr('purchase_group_stage_end_date')}\r\n                required={schedule.opinionEndDateEditable}\r\n                disabled={!editable || !schedule.opinionEndDateEditable}\r\n            />\r\n        </GridBlock>\r\n\r\n        <BoldTypography className={classes.stageHead}>{Tr('purchasing_group_submission_stage')}</BoldTypography>\r\n        <GridBlock>\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"submissionStartDate\"\r\n                label={Tr('purchase_group_stage_start_date')}\r\n                required={schedule.submissionStartDateEditable}\r\n                disabled={!editable || !schedule.submissionStartDateEditable}\r\n            />\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"submissionEndDate\"\r\n                label={Tr('purchase_group_stage_end_date')}\r\n                required={schedule.submissionEndDateEditable}\r\n                disabled={!editable || !schedule.submissionEndDateEditable}\r\n            />\r\n        </GridBlock>\r\n\r\n    </GridBlock>)\r\n}\r\n\r\nPurchasingGroupStage1ScheduleForm.propTypes = {\r\n    schedule: PropTypes.shape({\r\n        joiningStartDateEditable: PropTypes.bool.isRequired,\r\n        joiningEndDateEditable: PropTypes.bool.isRequired,\r\n        opinionStartDateEditable: PropTypes.bool.isRequired,\r\n        opinionEndDateEditable: PropTypes.bool.isRequired,\r\n        submissionStartDateEditable: PropTypes.bool.isRequired,\r\n        submissionEndDateEditable: PropTypes.bool.isRequired,\r\n    }).isRequired\r\n}\r\n\r\nexport default PurchasingGroupStage1ScheduleForm;","import moment from \"moment\";\r\n\r\nconst scheduleReloadTimeout = (schedule, serverTime) => {\r\n\r\n    let reloadTimeout = null;\r\n    const nowServerTime = moment(serverTime);\r\n    const {\r\n        joiningStartDate,\r\n        joiningEndDate,\r\n        opinionStartDate,\r\n        opinionEndDate,\r\n        submissionStartDate,\r\n        submissionEndDate,\r\n        swzOpinionStartDate,\r\n        swzOpinionEndDate,\r\n        collectingDataStartDate,\r\n        collectingDataEndDate\r\n    } = schedule;\r\n    const dates = [joiningStartDate, joiningEndDate, opinionStartDate, opinionEndDate, submissionStartDate, submissionEndDate];\r\n    for (let date of dates) {\r\n        if (date && moment(date).isAfter(nowServerTime)) {\r\n            reloadTimeout = moment(date).diff(nowServerTime) + 500;\r\n            break;\r\n        }\r\n    }\r\n\r\n    if(!reloadTimeout) {\r\n        const dates2 = [swzOpinionStartDate, swzOpinionEndDate, collectingDataStartDate, collectingDataEndDate];\r\n        for (let date of dates2) {\r\n            if (date && moment(date).isAfter(nowServerTime)) {\r\n                if(!reloadTimeout ||  (moment(date).diff(nowServerTime) + 500) < reloadTimeout) {\r\n                    reloadTimeout = moment(date).diff(nowServerTime) + 500;\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n\r\n    if (reloadTimeout && reloadTimeout > 3600000) {\r\n        reloadTimeout = null;\r\n    }\r\n    return reloadTimeout;\r\n\r\n}\r\n\r\nexport default scheduleReloadTimeout;","import React, {useCallback, useEffect, useRef, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\"\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport PurchasingGroupStage1ScheduleForm from \"./PurchasingGroupStage1ScheduleForm\";\r\nimport moment from \"moment\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport scheduleReloadTimeout from \"../../../utils/scheduleReloadTimeout\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\n\r\nfunction PurchasingGroupStage1Schedule(\r\n    {\r\n        panelRef,\r\n        validationSection\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const formId = params.section;\r\n    const editable = validationSection.editable;\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n    const [schedule, setSchedule] = useState(null);\r\n    const timeout = useRef(0);\r\n\r\n    useStepperStateCloseValidator(formId);\r\n\r\n    const closeSection = useCallback(() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n        id: groupId,\r\n        stage: 1\r\n    })), [groupId]);\r\n\r\n    const getSchedule = () => {\r\n        setSchedule(null);\r\n        if (timeout.current) {\r\n            clearTimeout(timeout.current);\r\n            timeout.current = 0;\r\n        }\r\n        PurchasingGroupStage1Service.getSchedule(groupId).then((resp) => {\r\n            if (resp) {\r\n                setSchedule(resp);\r\n                let reloadTimeout = scheduleReloadTimeout(resp.schedule, resp.serverTime);\r\n                if (reloadTimeout) {\r\n                    timeout.current = setTimeout(() => {\r\n                        getSchedule();\r\n                    }, reloadTimeout)\r\n                }\r\n\r\n            } else\r\n                closeSection();\r\n        });\r\n    }\r\n\r\n    useEffect(() => {\r\n        getSchedule();\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section);\r\n        return () => {\r\n            if (timeout.current) {\r\n                clearTimeout(timeout.current);\r\n                timeout.current = 0;\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n\r\n    const handleSubmit = (values) => {\r\n        PurchasingGroupStage1Service.saveSchedule(groupId, values).then((resp) => {\r\n            if (resp && resp.success === false) {\r\n                Object.keys(resp.errors).forEach((field) => {\r\n                    let error;\r\n                    switch (field) {\r\n                        case \"joiningStartDate\":\r\n                            error = `${Tr('purchasing_group_joining_stage')} ${Tr('purchase_group_stage_end_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"joiningEndDate\":\r\n                            error = `${Tr('purchasing_group_joining_stage')}: ${Tr('purchase_group_stage_start_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"opinionStartDate\":\r\n                            error = `${Tr('purchasing_group_opinion_stage')}: ${Tr('purchase_group_stage_end_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"opinionEndDate\":\r\n                            error = `${Tr('purchasing_group_opinion_stage')}: ${Tr('purchase_group_stage_start_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"submissionStartDate\":\r\n                            error = `${Tr('purchasing_group_submission_stage')}: ${Tr('purchase_group_stage_start_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"submissionEndDate\":\r\n                            error = `${Tr('purchasing_group_submission_stage')}: ${Tr('purchase_group_stage_start_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        default:\r\n                            error = `${resp.errors[field].join(\", \")}`\r\n                    }\r\n                    enqueueErrorSnackbar(error)\r\n                })\r\n            } else if(resp) {\r\n                enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + validationSection.name);\r\n                PurchasingGroupSectionService.getSections(groupId, [validationSection.section, PurchasingGroupStageSections.STAGE_1_SECTION])\r\n                closeSection();\r\n            }\r\n        }).catch((e) => enqueueErrorSnackbar(e.message))\r\n    }\r\n\r\n    if (!schedule) return <Loading/>\r\n\r\n    return (<>\r\n            <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>\r\n            <Form\r\n                id={formId}\r\n                initialValues={{\r\n                    joiningStartDate: schedule.schedule.joiningStartDate ? moment(schedule.schedule.joiningStartDate) : null,\r\n                    joiningEndDate: schedule.schedule.joiningEndDate ? moment(schedule.schedule.joiningEndDate) : null,\r\n                    opinionStartDate: schedule.schedule.opinionStartDate ? moment(schedule.schedule.opinionStartDate) : null,\r\n                    opinionEndDate: schedule.schedule.opinionEndDate ? moment(schedule.schedule.opinionEndDate) : null,\r\n                    submissionStartDate: schedule.schedule.submissionStartDate ? moment(schedule.schedule.submissionStartDate) : null,\r\n                    submissionEndDate: schedule.schedule.submissionEndDate ? moment(schedule.schedule.submissionEndDate) : null\r\n                }}\r\n                validationSchema={VS.lazy((form) => {\r\n\r\n                    const shape = {}\r\n                    if (schedule.joiningStartDateEditable) {\r\n                        shape.joiningStartDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n                    }\r\n                    if (schedule.joiningEndDateEditable) {\r\n                        const joiningStartDate = form.joiningStartDate ? form.joiningStartDate.clone() : moment();\r\n                        joiningStartDate.add(1, \"minute\")\r\n                        shape.joiningEndDate = VS.dateTimeMin(joiningStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                    }\r\n\r\n                    if (schedule.opinionStartDateEditable) {\r\n                        if (schedule.joiningEndDateEditable) {\r\n                            shape.opinionStartDate = VS.dateTimeMinNoRq(new Date(), Tr('v_time_can_not_be_past'))\r\n                        } else {\r\n                            shape.opinionStartDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n                        }\r\n                    }\r\n                    if (schedule.opinionEndDateEditable) {\r\n                        const opinionStartDate = form.opinionStartDate ? form.opinionStartDate.clone() : moment();\r\n                        opinionStartDate.add(1, \"minute\")\r\n\r\n                        if (schedule.joiningEndDateEditable && !form.opinionStartDate) {\r\n                            shape.opinionEndDate = VS.dateTimeMinNoRq(opinionStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        } else {\r\n                            shape.opinionEndDate = VS.dateTimeMin(opinionStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        }\r\n                    }\r\n\r\n                    if (schedule.submissionStartDateEditable) {\r\n                        if (schedule.opinionEndDateEditable) {\r\n                            shape.submissionStartDate = VS.dateTimeMinNoRq(new Date(), Tr('v_time_can_not_be_past'))\r\n                        } else {\r\n                            shape.submissionStartDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n                        }\r\n                    }\r\n                    if (schedule.submissionEndDateEditable) {\r\n                        const submissionStartDate = form.submissionStartDate ? form.submissionStartDate.clone() : moment();\r\n                        submissionStartDate.add(1, \"minute\")\r\n\r\n                        if (schedule.opinionEndDateEditable && !form.submissionStartDate) {\r\n                            shape.submissionEndDate = VS.dateTimeMinNoRq(submissionStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        } else {\r\n                            shape.submissionEndDate = VS.dateTimeMin(submissionStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        }\r\n                    }\r\n\r\n                    return VS.object(shape)\r\n                })}\r\n                onSubmit={handleSubmit}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={formId}\r\n                        />\r\n                        <PurchasingGroupStage1ScheduleForm editable={editable} schedule={schedule} formikProps={formikProps}/>\r\n                        {/*<Typography style={{lineBreak: \"anywhere\"}}>{JSON.stringify(schedule)}</Typography>*/}\r\n                    </>)}\r\n            </Form>\r\n        </>\r\n    )\r\n}\r\n\r\nPurchasingGroupStage1Schedule.propTypes = {}\r\n\r\nexport default PurchasingGroupStage1Schedule;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport clsx from \"clsx\";\r\nimport {useDidUpdateEffect} from \"../hooks/useDidUpdateEffect\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    search: {\r\n        width: 400,\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {search: ''}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nfunction BasicSearch(\r\n    {\r\n        className,\r\n        label,\r\n        searchInProgress,\r\n        doSearch,\r\n        clearSearch\r\n    }) {\r\n\r\n\r\n    const getInitValue = () => {\r\n        return {...EMPTY_SEARCH_OBJECT};\r\n    }\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState(getInitValue());\r\n    const [submitState, setSubmitState] = useState(0);\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => value[k])\r\n                .reduce((a, k) => ({...a, [k]: value[k]}), {});\r\n            doSearch(valueFiltered);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        doClearSearch();\r\n    },[clearSearch]);\r\n\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        setSubmitState(x => x + 1)\r\n    };\r\n\r\n    const doClearSearch = () => {\r\n        setValue(EMPTY_SEARCH_OBJECT);\r\n        handleSubmit()\r\n    }\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (e.key === 'Enter') {\r\n            e.preventDefault();\r\n            handleSubmit()\r\n        }\r\n    };\r\n\r\n    return (\r\n        <>\r\n            <GridBlock className={clsx(classes.root, className)}>\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={label}\r\n                    onChange={e => handleChange('search', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.search}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={doClearSearch}/>\r\n                </div>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nBasicSearch.propTypes = {\r\n    classes: PropTypes.any,\r\n    className: PropTypes.string,\r\n    label: PropTypes.string,\r\n    searchInProgress:PropTypes.bool,\r\n    doSearch: PropTypes.func.isRequired,\r\n    clearSearch: PropTypes.any\r\n}\r\n\r\n\r\nexport default BasicSearch;","const iconWorksReducer = (state, action) => {\r\n    if (Object.keys(state).indexOf(action.type) < 0)\r\n        throw new Error(`Unsupported type: '${action.type}, did you add it in initial state?`);\r\n    let newState = {...state, [action.type]: action.works};\r\n    const index = Object.keys(newState).findIndex(x => x !== 'anyWorks' && newState[x] === true);\r\n    newState.anyWorks = index > -1;\r\n    return newState;\r\n}\r\nexport default iconWorksReducer;","import reduxStore from 'redux/store'\r\nimport {setConfirmNotifications} from \"../redux/actions\";\r\n\r\nexport const simpleConfirm = (confirmText, onConfirm, onCancel) =>\r\n    confirmComplex({confirmText, onConfirm, onCancel})\r\n\r\nexport const simpleConfirmNoTranslate = (confirmText, onConfirm, onCancel) =>\r\n    confirmComplex({confirmText, onConfirm, onCancel, translateConfirmTexts: false})\r\n\r\nexport const confirmComplex = ({onConfirm, onCancel, confirmText, confirmText2, labelConfirm, labelCancel, translateConfirmTexts}) => {\r\n    reduxStore.dispatch(setConfirmNotifications({\r\n        confirmText,\r\n        confirmText2,\r\n        onConfirm,\r\n        onCancel,\r\n        labelConfirm,\r\n        labelCancel,\r\n        translateConfirmTexts\r\n    }))\r\n}\r\n\r\n","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\n\r\nfunction WorkableIconMailButton(\r\n    {\r\n        tooltip = Tr('send'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={MailIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconMailButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconMailButton;","import React, {useReducer, useState} from 'react'\r\nimport {Box, Tooltip, Typography} from '@material-ui/core';\r\nimport GridBlock from 'components/GridBlock';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport clsx from 'clsx';\r\nimport InputLimits from 'constants/InputLimits';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport WorkableIconConfirmButton from \"components/button/WorkableIconConfirmButton\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport Form from \"components/Form\";\r\nimport VS from 'constants/ValidationShema';\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport {confirmComplex, simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport WarningIcon from \"@material-ui/icons/Warning\";\r\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\r\nimport RestoreIcon from '@material-ui/icons/Restore';\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {PurchasingGroupStageSections} from \"../../../../constants/PurchasingGroupStageSections\";\r\nimport WorkableIconMailButton from \"components/button/WorkableIconMailButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport WorkableIconEditButton from \"../../../../../../../../components/button/WorkableIconEditButton\";\r\n\r\nconst limits = InputLimits.procedure.organization;\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        '&>*:nth-child(2)': {\r\n            flexGrow: 1,\r\n        }\r\n    },\r\n    rootEdit: {\r\n        '&>*:nth-child(2)': {\r\n            flexGrow: 1,\r\n            paddingLeft: theme.spacing(2),\r\n        }\r\n    },\r\n    editInput: {},\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2),\r\n    },\r\n    title: {\r\n        marginLeft: theme.spacing()\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    cursorPointer: {\r\n        cursor: 'pointer'\r\n    },\r\n    buttonReject: {\r\n        marginTop: theme.spacing()\r\n    },\r\n    rejected: {\r\n        color: theme.palette.text.disabled\r\n    }\r\n}))\r\n\r\nfunction MembersElementTitle(\r\n    {\r\n        groupId,\r\n        index,\r\n        member,\r\n        open,\r\n        onOpen,\r\n        editable,\r\n        coordinatorView,\r\n        validationSection,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = 'memberTitleElement_' + member.identity\r\n    const [editName, setEditName] = useState(false)\r\n    const rejected = member.rejectionDate !== null;\r\n    const canReject = member.actions['reject'] != null;\r\n    const canRestore = member.actions['restore'] != null;\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        name: false,\r\n        delete: false,\r\n        reject: false,\r\n        restore: false,\r\n        resend: false\r\n    });\r\n\r\n\r\n    const handleEdit = () => {\r\n        if (editName) {\r\n            formSubmit[formId]()\r\n        } else {\r\n            setEditName(true)\r\n        }\r\n    }\r\n\r\n    const submitName = (values) => {\r\n        dispatchIconWorks({type: 'name', works: true});\r\n        PurchasingGroupStage1Service.updateMemberName(groupId, member.identity, values).then(() => setEditName(false)).finally(() => dispatchIconWorks({\r\n                type: 'name',\r\n                works: false\r\n            })\r\n        );\r\n    }\r\n\r\n    const doDelete = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        PurchasingGroupStage1Service.deleteMember(groupId, member.identity).then(() => {\r\n            PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n        }).catch(() => dispatchIconWorks({type: 'delete', works: false}))\r\n    }\r\n\r\n    const onReject = () => {\r\n        setEditName(false);\r\n        dispatchIconWorks({type: 'reject', works: true});\r\n        PurchasingGroupStage1Service.rejectMember(groupId, member.identity).finally(() => dispatchIconWorks({type: 'reject', works: false}))\r\n    }\r\n\r\n    const onRestore = () => {\r\n        dispatchIconWorks({type: 'restore', works: true});\r\n        PurchasingGroupStage1Service.restoreMember(groupId, member.identity).finally(() => dispatchIconWorks({type: 'restore', works: false}))\r\n    }\r\n\r\n\r\n    const showTitleComponent = () => (\r\n        <Typography\r\n            variant='body1'\r\n            className={clsx(classes.cursorPointer, classes.title)}\r\n            onClick={onOpen}\r\n        >\r\n            <Box\r\n                component='span'\r\n                fontWeight='fontWeightBold'\r\n\r\n            >\r\n                {member.name}\r\n            </Box>\r\n        </Typography>\r\n    )\r\n\r\n\r\n    const editNameComponent = () => (\r\n        <Form\r\n            id={formId}\r\n            initialValues={{\r\n                name: member.name\r\n            }}\r\n            validationSchema={VS.object({\r\n                name: VS.stringMax(limits.NAME)\r\n            })\r\n            }\r\n            onSubmit={submitName}>\r\n            {(formikProps) => (\r\n                <TextInput\r\n                    limit={limits.NAME}\r\n                    className={classes.editInput}\r\n                    label={Tr('name')}\r\n                    id='name'\r\n                    formikProps={formikProps}\r\n                />\r\n            )}\r\n        </Form>\r\n    )\r\n\r\n\r\n    const onResend = () => {\r\n        dispatchIconWorks({type: 'resend', works: true});\r\n        PurchasingGroupStage1Service.resendInviteNotification(groupId, member.identity).then(() => enqueueSuccessSnackbar(Tr('purchase_group_member_resend_success'))).finally(() => dispatchIconWorks({type: 'resend', works: false}))\r\n    }\r\n\r\n\r\n    return (\r\n        <GridBlock\r\n            alignItems='center'\r\n            className={clsx({\r\n                [classes.root]: !editName,\r\n                [classes.rootEdit]: editName,\r\n                [classes.rejected]: rejected\r\n            })}\r\n            wrap='nowrap'\r\n        >\r\n            {!coordinatorView ? <GridBlock wrap='nowrap'>\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.title}\r\n                >\r\n                    {index + 1}.\r\n                </Typography>\r\n                {!rejected && !member.complete && <Tooltip className={classes.title} title={Tr('complete_missing_data')} placement=\"top\">\r\n                    <WarningIcon className={classes.cursorPointer} onClick={onOpen} color='error'/>\r\n                </Tooltip>}\r\n            </GridBlock> : <Typography> </Typography>\r\n            }\r\n\r\n            {editName ? editNameComponent() : showTitleComponent()}\r\n\r\n            <GridBlock wrap='nowrap'>\r\n                {!coordinatorView && <>\r\n                    {editName ? <>\r\n                            <WorkableIconConfirmButton\r\n                                onClick={handleEdit}\r\n                                color='primary'\r\n                                working={iconWorks.name}\r\n                                disabled={iconWorks.anyWorks}\r\n                            />\r\n                            <IconButton\r\n                                onClick={() => setEditName(false)}\r\n                                tooltip={Tr('cancel')}\r\n                                Icon={ClearIcon}\r\n                                disabled={iconWorks.anyWorks}\r\n                            />\r\n                        </> :\r\n                        <WorkableIconEditButton\r\n                            onClick={handleEdit}\r\n                            color='primary'\r\n                            disabled={!editable || rejected || member.primary || iconWorks.anyWorks}\r\n                        />\r\n                    }\r\n                    <WorkableIconDeleteButton\r\n                        color='primary'\r\n                        onClick={() => confirmComplex({\r\n                            onConfirm: doDelete,\r\n                            confirmText: Tr('confirm_delete'),\r\n                            confirmText2: member.name,\r\n                            translateConfirmTexts: false\r\n                        })}\r\n                        working={iconWorks.delete}\r\n                        disabled={!editable || !member.actions['delete'] || iconWorks.anyWorks}\r\n                    />\r\n                    {\r\n                        canReject ?\r\n                            <WorkableButton\r\n                                className={classes.buttonReject}\r\n                                working={iconWorks.reject}\r\n                                disabled={!editable || iconWorks.reject}\r\n                                variant=\"text\"\r\n                                Icon={HighlightOffIcon}\r\n                                onClick={() => simpleConfirm(\"purchase_groups_exclude_confirm\", onReject)}>{Tr('purchase_groups_exclude')}\r\n                            </WorkableButton>\r\n                            : (canRestore &&\r\n                                <WorkableButton\r\n                                    className={classes.buttonReject}\r\n                                    working={iconWorks.restore}\r\n                                    disabled={!editable || iconWorks.restore}\r\n                                    variant=\"text\" Icon={RestoreIcon}\r\n                                    onClick={() => simpleConfirm(\"purchase_groups_restore_confirm\", onRestore)}>{Tr('purchase_groups_restore')}\r\n                                </WorkableButton>\r\n                            )\r\n                    }\r\n                </>}\r\n\r\n                {!coordinatorView && editable && validationSection.activeStage === 1 &&\r\n                    <WorkableIconMailButton disabled={iconWorks.anyWorks} tooltip={Tr('purchase_group_member_resend')} onClick={onResend}\r\n                                            working={iconWorks.resend} color='primary'/>}\r\n\r\n                {!coordinatorView && <WorkableIconExpandButton\r\n                    color='primary'\r\n                    onClick={onOpen}\r\n                    expanded={open}\r\n                    disabled={iconWorks.delete}\r\n                />}\r\n            </GridBlock>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nMembersElementTitle.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(MembersElementTitle);","import React, {useState} from 'react'\r\nimport clsx from 'clsx';\r\nimport {connect} from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport DescriptionIcon from '@material-ui/icons/Description';\r\nimport FolderIcon from \"@material-ui/icons/Folder\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport PropTypes from 'prop-types'\r\nimport Typography from \"components/Typography\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport MultiButton, {createButton} from \"./components/MultiButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    disabledEmpty: {\r\n        fontStyle: 'italic'\r\n    },\r\n    disabled: {\r\n        '& textarea': {\r\n            color: theme.palette.text.primary\r\n        }\r\n    },\r\n    textField: {\r\n        wordBreak: \"break-word\",\r\n        whiteSpace: 'pre-line',\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nexport const createEditDescriptionFile = (demandId, identity, name, description, disabled, required = false, isFolder = false) => ({demandId, identity, name, description, disabled, required, isFolder});\r\n\r\nfunction EditDescriptionPopup(\r\n    {\r\n        editDescriptionFile,\r\n        onClose,\r\n        onUpdated,\r\n        service,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const {demandId, identity, name, description, disabled, required, isFolder} = editDescriptionFile;\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const [working, setWorking] = useState(false);\r\n\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = ({description}) => {\r\n        setWorking(true);\r\n        service.updateDescription(demandId, identity, description).then(onUpdated).finally(()=> setWorking(false))\r\n    }\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr(disabled ? 'close': 'cancel'), onClose, disabled ? undefined :'outlined', false));\r\n        if(!disabled)\r\n            buttons.push(createButton(Tr('confirm'), handleSubmit, undefined, working, undefined, working));\r\n\r\n\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(isFolder ? 'change_folder_description' : (disabled ? 'description' : 'change_file_description'))}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n            dialogActions={getActions()}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    description: description || !disabled ? description : Tr('no_description'),\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    description: required ? VS.string() : VS.stringNoRq(),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <TypographyWithIcon Icon={isFolder ? FolderIcon : DescriptionIcon} className={classes.margin}>\r\n                            {name}\r\n                        </TypographyWithIcon>\r\n\r\n                        {\r\n                            disabled ?\r\n                                <Typography className={clsx(classes.textField, {[classes.disabledEmpty]: (!description && disabled)})}>\r\n                                    {getObjectValue('description', formikProps.values, null)}\r\n                                </Typography>\r\n                                :\r\n                                <TextInput\r\n                                    id='description'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('description')}\r\n                                    multiline\r\n                                    disabled={disabled}\r\n                                />\r\n                        }\r\n\r\n\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEditDescriptionPopup.propTypes = {\r\n    editDescriptionFile: PropTypes.shape({\r\n        demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n        identity: PropTypes.oneOfType([PropTypes.number, PropTypes.object]).isRequired,\r\n        name: PropTypes.string.isRequired,\r\n        description: PropTypes.string,\r\n        disabled: PropTypes.bool.isRequired,\r\n        required: PropTypes.bool.isRequired\r\n    }).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    onUpdated: PropTypes.func.isRequired,\r\n    service: PropTypes.shape({\r\n        updateDescription: PropTypes.func.isRequired\r\n    })\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(EditDescriptionPopup);","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport SearchIcon from '@material-ui/icons/Search'\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconSearchButton(\r\n    {\r\n        tooltip = Tr('search2'),\r\n        ...props\r\n    }) {\r\n\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={SearchIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconSearchButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.elementType]),\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconSearchButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport GetAppIcon from '@material-ui/icons/GetApp';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconDownloadButton(\r\n    {\r\n        tooltip = Tr('download'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={GetAppIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconDownloadButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconDownloadButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport LaunchIcon from '@material-ui/icons/Launch';\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction WorkableIconPublishButton(\r\n    {\r\n        tooltip = Tr('publish'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        Icon={LaunchIcon}\r\n        tooltip={tooltip}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconPublishButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconPublishButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport LaunchIcon from '@material-ui/icons/Launch';\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport clsx from 'clsx';\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    rotate: {\r\n        transform: \"rotate(90deg)\"\r\n    }\r\n}));\r\n\r\nfunction WorkableIconUnpublishButton(\r\n    {\r\n        tooltip = Tr('unpublish'),\r\n        className,\r\n        ...props\r\n    }) {\r\n    const classes = useStyle();\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={LaunchIcon}\r\n        className={clsx(className, classes.rotate)}\r\n        {...props}\r\n    />\r\n\r\n}\r\n\r\nWorkableIconUnpublishButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconUnpublishButton;","import React, {useReducer} from 'react'\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles, TableCell, TableRow} from \"@material-ui/core\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconDownloadButton from \"components/button/WorkableIconDownloadButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport WorkableIconUnpublishButton from \"components/button/WorkableIconUnpublishButton\";\r\nimport {PurchasingGroupDocumentStatusLabel} from \"../constants/PurchasingGroupDocumentStatus\";\r\nimport PropTypes from \"prop-types\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    warnIcon: {\r\n        padding: 0,\r\n        color: `${theme.palette.secondary.main} !important`\r\n    },\r\n    descriptionTooltip: {\r\n        whiteSpace: 'pre-line'\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    versionsCell: {\r\n        background: theme.palette.background.default,\r\n        paddingLeft: 0,\r\n        paddingRight: 0\r\n    }\r\n}));\r\n\r\nfunction MembersDocumentsListTableRow(\r\n    {\r\n        groupId,\r\n        mainDocs,\r\n        editable,\r\n        coordinatorView,\r\n        memberId,\r\n        row,\r\n        index,\r\n        onEditDescriptionFile,\r\n        validationSection,\r\n        allMemberDocumentsApiPath\r\n    }) {\r\n    const classes = useStyle();\r\n    const memberMode = !!memberId;\r\n    const {enqueueErrorSnackbar} = useSnackbar();\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        delete: false,\r\n        publish: false,\r\n        unpublish: false\r\n    });\r\n\r\n    const doDelete = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        let promise;\r\n        if (!!memberId) {\r\n            promise = PurchasingGroupStage1Service.deleteMemberDocument(groupId, memberId, row.identity)\r\n        } else {\r\n            promise = PurchasingGroupStage1Service.deleteAllMembersDocument(groupId, allMemberDocumentsApiPath, row.identity)\r\n        }\r\n        promise.then(() => PurchasingGroupSectionService.getSections(groupId, validationSection.section)).catch(() => dispatchIconWorks({\r\n            type: 'delete',\r\n            works: false\r\n        }));\r\n    }\r\n    const handleDelete = () => {\r\n        simpleConfirm('confirm_delete_file', doDelete)\r\n    }\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        let promise;\r\n        if (!!memberId) {\r\n            promise = PurchasingGroupStage1Service.downloadMemberDocument(groupId, memberId, row.identity, false)\r\n        } else {\r\n            promise = PurchasingGroupStage1Service.downloadAllMembersDocument(groupId, allMemberDocumentsApiPath, row.identity, false)\r\n        }\r\n        promise.finally(() => dispatchIconWorks({type: 'download', works: false}));\r\n    }\r\n\r\n    const onUnpublish = () => {\r\n        dispatchIconWorks({type: 'unpublish', works: true});\r\n        PurchasingGroupStage1Service.unpublishAllMembersDocument(groupId, allMemberDocumentsApiPath, row.identity).catch((e) => {\r\n            enqueueErrorSnackbar(`${row.name} - ${row.typeTranslated}: ${e.message}`)\r\n        }).finally(() => dispatchIconWorks({type: 'unpublish', works: false}));\r\n    }\r\n    const onPublish = () => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        PurchasingGroupStage1Service.publishAllMembersDocument(groupId, allMemberDocumentsApiPath, row.identity)\r\n            .catch((e) => {\r\n                enqueueErrorSnackbar(`${row.name} - ${row.typeTranslated}: ${e.message}`)\r\n            })\r\n            .finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    }\r\n\r\n    return (<TableRow>\r\n        <TableCell>{index}</TableCell>\r\n        <TableCell>{row.name}</TableCell>\r\n        <TableCell className={classes.buttonColumn}>\r\n            <WorkableIconSearchButton\r\n\r\n                onClick={() => onEditDescriptionFile(row)}\r\n                tooltip={row.description ? <p className={classes.descriptionTooltip}>{row.description}</p> : <i>{Tr('no_description')}</i>}\r\n            />\r\n        </TableCell>\r\n        <TableCell>{row.typeTranslated}</TableCell>\r\n        {!mainDocs && <TableCell>{moment(row.createDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>}\r\n        {mainDocs && <TableCell>{row.publishDate ? moment(row.publishDate).format(DateFormats.DATETIME_FORMAT) : null}</TableCell>}\r\n        {mainDocs && !coordinatorView && <TableCell>{PurchasingGroupDocumentStatusLabel(row.status)}</TableCell>}\r\n        <TableCell className={classes.buttonColumn}>\r\n            <WorkableIconDownloadButton\r\n                onClick={() => onDownload(row.actions.download, row.name)}\r\n                hideTooltip={!row.actions.download}\r\n                disabled={iconWorks.anyWorks || !row.actions.download}\r\n                working={iconWorks.download}\r\n            />\r\n        </TableCell>\r\n        {!coordinatorView && mainDocs && <TableCell className={classes.buttonColumn}>\r\n            {\r\n                row.actions.unpublish ?\r\n                    <WorkableIconUnpublishButton\r\n                        onClick={() => onUnpublish(row.actions.download, row.name)}\r\n                        hideTooltip={!row.actions.unpublish}\r\n                        disabled={!editable || iconWorks.anyWorks || !row.actions.unpublish}\r\n                        working={iconWorks.unpublish}\r\n                    />\r\n                    :\r\n                    <WorkableIconPublishButton\r\n                        onClick={() => onPublish(row.actions.download, row.name)}\r\n                        hideTooltip={!row.actions.publish}\r\n                        disabled={!editable || iconWorks.anyWorks || !row.actions.publish}\r\n                        working={iconWorks.publish}\r\n                    />\r\n            }\r\n        </TableCell>}\r\n        {(!coordinatorView || (coordinatorView && memberMode)) && <TableCell className={classes.buttonColumn}>\r\n            <WorkableIconDeleteButton\r\n                tooltip={row.actions.delete ? Tr('delete') : Tr('delete_repo_disabled')}\r\n                onClick={handleDelete}\r\n                disabled={!editable || iconWorks.anyWorks || !row.actions.delete}\r\n                working={iconWorks.delete}\r\n            />\r\n        </TableCell>}\r\n    </TableRow>)\r\n}\r\n\r\nMembersDocumentsListTableRow.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    mainDocs: PropTypes.bool,\r\n    editable: PropTypes.bool.isRequired,\r\n    coordinatorView: PropTypes.bool.isRequired,\r\n    memberId: PropTypes.number,\r\n    row: PropTypes.shape({\r\n        identity: PropTypes.number,\r\n        actions: PropTypes.object.isRequired,\r\n        publishDate: PropTypes.string,\r\n        createDate: PropTypes.string,\r\n        description: PropTypes.string,\r\n    }).isRequired,\r\n    index: PropTypes.number.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default MembersDocumentsListTableRow;","import Tr from 'translations/Translations';\r\n\r\n\r\nexport const PurchasingGroupDocumentStatus = {\r\n    NEW: \"NEW\",\r\n    PUBLISHED: \"PUBLISHED\",\r\n    WITHDRAWN: \"WITHDRAWN\"\r\n}\r\nconst _TR_PREFIX = 'purchasing_group_document_status_';\r\n\r\nexport const PurchasingGroupDocumentStatusLabel = (status) => status ? Tr(_TR_PREFIX + status.toLowerCase()) : null;","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport Select from 'components/Select';\r\nimport VS from 'constants/ValidationShema';\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    gridContainer: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    fileName: {\r\n        width: 400\r\n    },\r\n    select: {\r\n        width: 350,\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n\r\n}));\r\n\r\nfunction SelectMembersDocumentType(\r\n    {\r\n        items,\r\n        types,\r\n        onCancel,\r\n        onSubmit,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const formId = useId();\r\n    const selectId = 'item';\r\n\r\n    const createSelectTab = () => {\r\n        if (types === undefined) return '';\r\n        return Object.keys(types).map(x => ({value: x, label: types[x]}));\r\n    }\r\n\r\n    const generateItems = (formikProps) => {\r\n        if (items.length === 0) {\r\n            return <Typography>{Tr(\"file_extension_error\")}</Typography>\r\n        }\r\n        return items.map((item, i) => {\r\n            return (\r\n                <GridBlock key={i} justify=\"space-between\" alignItems=\"center\">\r\n                    <Typography className={classes.fileName}> {item.name}</Typography>\r\n\r\n                    <Select\r\n                        id={selectId + i}\r\n                        formikProps={formikProps}\r\n                        items={createSelectTab()}\r\n                        label={Tr('document_type')}\r\n                        className={classes.select}\r\n                    />\r\n\r\n                </GridBlock>\r\n            )\r\n        })\r\n    };\r\n\r\n    const submitForm = () => {\r\n        formSubmit[formId]()\r\n    };\r\n\r\n    const generateInitialValues = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[selectId + i] = \"\";\r\n        }\r\n        return obj\r\n    };\r\n\r\n    const generateValidationSchema = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[selectId + i] = VS.string();\r\n        }\r\n\r\n        return VS.object(obj)\r\n    };\r\n\r\n    const handleSubmit = (values) => onSubmit(values, items)\r\n\r\n    if (items === undefined) return '';\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('select_document_type')}\r\n            titleCentered\r\n\r\n            maxWidth={'xl'}\r\n            fullWidth={false}\r\n            paperClassName={classes.paperClassName}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr('add')}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={submitForm}\r\n            />}\r\n        >\r\n            <Form\r\n                onSubmit={handleSubmit}\r\n                id={formId}\r\n                initialValues={generateInitialValues()}\r\n                validationSchema={generateValidationSchema()}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <GridBlock column className={classes.gridContainer}>\r\n                            {generateItems(formikProps)}\r\n                        </GridBlock>\r\n                    </>\r\n                )}\r\n            </Form>\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSelectMembersDocumentType.propTypes = {\r\n    items: PropTypes.arrayOf(PropTypes.shape({\r\n        name: PropTypes.string.isRequired\r\n    })).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(SelectMembersDocumentType);","import React, {useMemo, useState} from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport EditDescriptionPopup, {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport MembersDocumentsListTableRow from \"./MembersDocumentsListTableRow\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport SelectMembersDocumentType from \"./SelectMembersDocumentType\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport clsx from \"clsx\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: theme.components.table.lpColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    typeColumn: {\r\n        width: 180\r\n    },\r\n    marginTop: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(3)\r\n    }\r\n\r\n}));\r\n\r\n\r\nfunction MembersDocumentsList(\r\n    {\r\n        groupId,\r\n        mainDocs,\r\n        editable,\r\n        coordinatorView,\r\n        membersDocs,\r\n        memberId,\r\n        validationSection,\r\n        allMemberDocumentsApiPath\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const {documents, availableTypes} = membersDocs;\r\n    const memberMode = !!memberId;\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(false);\r\n    const [generateWorking, setGenerateWorking] = useState(false);\r\n    const [addFilesWorking, setAddFilesWorking] = useState(false);\r\n    const [selectedFiles, setSelectedFiles] = useState(null);\r\n    const [configuredFiles, setConfiguredFiles] = useState(null);\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n\r\n    const hasUpload = useMemo(() => {\r\n        return editable && availableTypes && Object.keys(availableTypes).length > 0\r\n    }, [availableTypes, editable])\r\n\r\n    const openEditDescription = (file) => {\r\n        if (memberMode) {\r\n            setEditDescriptionFile(createEditDescriptionFile(groupId, {\r\n                memberId,\r\n                documentId: file.identity\r\n            }, file.name, file.description || \"\", !editable || !file.actions.editDescription, false, false))\r\n        } else {\r\n            setEditDescriptionFile(createEditDescriptionFile(groupId, {\r\n                documentId: file.identity,\r\n                documentsApiPathType: allMemberDocumentsApiPath,\r\n                }, file.name, file.description || \"\", !editable || !file.actions.editDescription, false, false))\r\n        }\r\n    }\r\n\r\n    const generateGroupAgreementDocument = () => {\r\n        setGenerateWorking(true);\r\n        PurchasingGroupStage1Service.generateGroupAgreementDocument(groupId).then((resp) => {\r\n            PurchasingGroupSectionService.getSections(groupId, validationSection.section);\r\n            enqueueSuccessSnackbar(availableTypes.group_agreement);\r\n        }).catch((e) => {\r\n            enqueueErrorSnackbar(e.message)\r\n        }).finally(() => {\r\n            setGenerateWorking(false)\r\n        })\r\n    }\r\n\r\n    const afterDocumentAdd = (docs) => {\r\n        docs.filter(d => d.error !== null).forEach( d => enqueueErrorSnackbar(`${d.name} - ${d.typeTranslated}: ${d.error}`));\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section);\r\n    }\r\n\r\n    const handleSendFiles = (uploadedFiles, config) => {\r\n        if (uploadedFiles.length) {\r\n            const tab = uploadedFiles.map((x) => ({\r\n                repositoryId: x.identity,\r\n                type: config[`item${x.originalIndex}`]\r\n            }));\r\n            if (memberMode) {\r\n                setAddFilesWorking(true);\r\n                PurchasingGroupStage1Service.addMemberDocuments(groupId, memberId, tab).then(afterDocumentAdd).catch((e) => {\r\n                    enqueueErrorSnackbar(e.message)\r\n                }).finally(()=> setAddFilesWorking(false));\r\n            } else {\r\n                setAddFilesWorking(true);\r\n                PurchasingGroupStage1Service.addAllMembersDocuments(groupId, allMemberDocumentsApiPath, tab).then(afterDocumentAdd).catch((e) => {\r\n                    enqueueErrorSnackbar(e.message)\r\n                }).finally(()=> setAddFilesWorking(false));\r\n            }\r\n        }\r\n    }\r\n\r\n\r\n    const handleSubmitSelectDocumentTypes = (values) => {\r\n        setConfiguredFiles({files: selectedFiles, config: values})\r\n        setSelectedFiles(null);\r\n    };\r\n\r\n    return (<>\r\n        {!!documents && <div>\r\n\r\n            <>\r\n                <TitledComponent className={clsx(classes.marginTop, {\r\n                    [classes.marginBottom]: coordinatorView\r\n                })} title={Tr(memberMode ? 'documents' : 'purchasing_group_documents')}>\r\n                    {!memberMode && !coordinatorView && !!availableTypes && !!availableTypes.group_agreement &&\r\n                        <WorkableButton working={generateWorking} disabled={generateWorking} onClick={generateGroupAgreementDocument}>{`${Tr('create')} ${availableTypes.group_agreement}`}</WorkableButton>}\r\n\r\n                    {!documents.length ?\r\n                        <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                        :\r\n                        <Table>\r\n                            <TableHead>\r\n                                <TableRow>\r\n                                    <TableCell className={classes.lpColumn}>{Tr(\"column_lp\")}</TableCell>\r\n                                    <TableCell>{Tr(\"name\")}</TableCell>\r\n                                    <TableCell className={classes.buttonColumn}>{Tr(\"description\")}</TableCell>\r\n                                    <TableCell className={classes.typeColumn}>{Tr(\"type\")}</TableCell>\r\n                                    {!mainDocs && <TableCell className={classes.dateColumn}>{Tr(\"add_data\")}</TableCell>}\r\n                                    {mainDocs && <TableCell className={classes.dateColumn}>{Tr(\"publish_data\")}</TableCell>}\r\n                                    {mainDocs && !coordinatorView && <TableCell className={classes.dateColumn}>{Tr(\"status\")}</TableCell>}\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                    {!coordinatorView && mainDocs && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                    {(!coordinatorView || (coordinatorView && memberMode)) && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                </TableRow>\r\n                            </TableHead>\r\n                            <TableBody>\r\n                                {\r\n                                    documents.map((doc, index) => (\r\n                                        <MembersDocumentsListTableRow\r\n                                            key={doc.identity}\r\n                                            groupId={groupId}\r\n                                            mainDocs={mainDocs}\r\n                                            editable={editable}\r\n                                            coordinatorView={coordinatorView}\r\n                                            memberId={memberId}\r\n                                            row={doc}\r\n                                            index={index + 1}\r\n                                            onEditDescriptionFile={openEditDescription}\r\n                                            validationSection={validationSection}\r\n                                            allMemberDocumentsApiPath={allMemberDocumentsApiPath}\r\n                                        />))\r\n                                }\r\n                            </TableBody>\r\n                        </Table>\r\n                    }\r\n                    {hasUpload &&\r\n                        <UploadFile\r\n                            onUploadPopupClosed={handleSendFiles}\r\n                            onOpenConfigureFiles={(files) => setSelectedFiles(files)}\r\n                            configuredFiles={configuredFiles}\r\n                            working={addFilesWorking}\r\n                        />\r\n                    }\r\n                </TitledComponent>\r\n                {Boolean(editDescriptionFile) &&\r\n                    <EditDescriptionPopup\r\n                        editDescriptionFile={editDescriptionFile}\r\n                        onUpdated={() => setEditDescriptionFile(null)}\r\n                        onClose={() => setEditDescriptionFile(null)}\r\n                        service={{updateDescription: memberMode ? PurchasingGroupStage1Service.updateMemberDocument : PurchasingGroupStage1Service.updateAllMembersDocument}}\r\n                    />\r\n                }\r\n\r\n                {!!selectedFiles && <SelectMembersDocumentType\r\n                    items={selectedFiles}\r\n                    types={availableTypes}\r\n                    onCancel={() => setSelectedFiles(null)}\r\n                    onSubmit={handleSubmitSelectDocumentTypes}\r\n                />}\r\n            </>\r\n\r\n\r\n        </div>\r\n        }\r\n    </>)\r\n}\r\n\r\nMembersDocumentsList.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    mainDocs: PropTypes.bool,\r\n    editable: PropTypes.bool.isRequired,\r\n    coordinatorView: PropTypes.bool.isRequired,\r\n    membersDocs: PropTypes.shape({\r\n        documents: PropTypes.array.isRequired,\r\n        availableTypes: PropTypes.object.isRequired,\r\n    }).isRequired,\r\n    memberId: PropTypes.number,\r\n}\r\n\r\nexport default MembersDocumentsList;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport Form from 'components/Form';\r\nimport useId from 'hooks/useId';\r\nimport VS from \"constants/ValidationShema\";\r\nimport Loading from \"components/Loading\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport {connect} from \"react-redux\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {PurchasingGroupStageSections} from \"../../../../constants/PurchasingGroupStageSections\";\r\n\r\nfunction AddMemberUserPopup(\r\n    {\r\n        groupId,\r\n        memberId,\r\n        onClose,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [membersList, setMembersList] = useState(null);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getAvailableMemberUsers(groupId, memberId).then((resp) => {\r\n            const respMapped = resp.map(x => ({identity: \"_\" + x.identity, name: `${x.firstName} ${x.lastName}`}));\r\n            setMembersList(respMapped);\r\n        }).catch(() => onClose());\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    const onSubmit = ({users}) => {\r\n        const selectedUsers = Object.keys(users).filter(key => !!users[key]).map(key => parseInt(key.substring(1)))\r\n        setWorking(true);\r\n        PurchasingGroupStage1Service.addMemberUser(groupId, memberId, selectedUsers).then((resp) => {\r\n            PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n            onClose();\r\n        }).catch(() => {\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('confirm'), handleSubmit, undefined, working || !membersList || membersList.length === 0, undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"purchasing_group_users_add\")}\r\n            open={true}\r\n            dialogActions={getActions()}\r\n        >\r\n            {\r\n                !membersList ? <Loading/> :\r\n                    <Form\r\n                        initialValues={{\r\n                            users: membersList.reduce((prev, cur) => {\r\n                                prev[cur.identity] = false;\r\n                                return prev;\r\n                            }, {}),\r\n                        }}\r\n                        validationSchema={\r\n                            VS.object({\r\n                                users: VS.any().test('partSelected', Tr('choose_at_least_one'), (e) => {\r\n                                    const selected = Object.keys(e).filter(x => e[x] === true).length;\r\n                                    return selected > 0;\r\n                                })\r\n                            })\r\n                        }\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            membersList.length === 0 ?\r\n                                <BoldTypography>{Tr('purchasing_group_users_add_no_users')}</BoldTypography>\r\n                                :\r\n                                <PartsTable\r\n                                    label={Tr('purchasing_group_users_add_label')}\r\n                                    id=\"users\"\r\n                                    formikProps={formikProps}\r\n                                    elementList={membersList}\r\n                                    disabled={working}\r\n                                />)}\r\n                    </Form>\r\n            }\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAddMemberUserPopup.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddMemberUserPopup);","import {RestRequestGET} from 'libs/RestRequest'\r\nimport Endpoints from 'constants/Endpoints'\r\nimport reduxStore from 'redux/store'\r\nimport {setResource} from 'redux/actions'\r\nimport moment from 'moment'\r\n\r\nconst profile = async () => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(Endpoints.USER_PROFILE);\r\n\t\treduxStore.dispatch(\r\n\t\t\tsetResource('userProfile', res)\r\n\t\t)\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst data = async () => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(Endpoints.USER_DATA);\r\n\t\treduxStore.dispatch(\r\n\t\t\tsetResource('userData', res)\r\n\t\t)\r\n\t\treturn res;\r\n\t} catch (error) {\r\n\t}\r\n\r\n}\r\n\r\nconst sessionTime = async () => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(Endpoints.USER_SESSION_TIME);\r\n\t\tconst value = res.result;\r\n\t\tconst endTime = moment().add(value,'s')\r\n\t\treduxStore.dispatch(setResource('sessionTime', {\r\n\t\t\ttime: value,\r\n\t\t\tendTime\r\n\t\t}))\r\n\t} catch (error) { }\r\n}\r\n\r\nconst serverTime = async () => {\r\n\tconst res = await RestRequestGET(Endpoints.USER_SERVER_TIME);\r\n\treturn res.result\r\n}\r\n\r\nexport default {\r\n\tdata,\r\n\tprofile,\r\n\tsessionTime,\r\n\tserverTime,\r\n};\r\n\r\n","import React, {useEffect, useRef, useState} from 'react'\r\nimport Loading from \"components/Loading\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport MembersDocumentsList from \"./MembersDocumentsList\";\r\nimport {connect} from \"react-redux\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport TitledComponent from \"components/TitledComponent\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport Button from \"components/Button\";\r\nimport AddIcon from \"@material-ui/icons/AddBoxOutlined\";\r\nimport AddMemberUserPopup from \"./AddMemberUserPopup\";\r\nimport {confirmComplex} from \"libs/ConfirmNotification\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {getUserFullNameWithEmail} from \"libs/userNameGetter\";\r\nimport {PurchasingGroupStageSections} from \"../../../../constants/PurchasingGroupStageSections\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';\r\nimport CancelIcon from '@material-ui/icons/Cancel';\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport UserService from \"services/UserService\";\r\nimport scheduleReloadTimeout from \"../../../../utils/scheduleReloadTimeout\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"components/Typography\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: theme.components.table.lpColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    addButton: {\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    section: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    success: {\r\n        color: theme.palette.success.dark,\r\n        marginLeft: theme.spacing()\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    }\r\n\r\n}))\r\n\r\nfunction MembersElementContent(\r\n    {\r\n        groupId,\r\n        member,\r\n        coordinatorView,\r\n        editable,\r\n        memberData,\r\n        validationSection,\r\n        stage1Sections\r\n    }) {\r\n    const classes = useStyle();\r\n    const [addPopup, setAddPopup] = useState(false);\r\n    const [deleteWorkingId, setDeleteWorkingId] = useState(0);\r\n    const [participationWorking, setParticipationWorking] = useState(false);\r\n    const rejected = member.rejectionDate !== null;\r\n    const timeout = useRef(0)\r\n\r\n\r\n    const getMember = () => {\r\n        if (timeout.current) {\r\n            clearTimeout(timeout.current);\r\n            timeout.current = 0;\r\n        }\r\n        PurchasingGroupStage1Service.getMember(groupId, member.identity)\r\n\r\n        const mainSection = stage1Sections[PurchasingGroupStageSections.STAGE_1_SECTION];\r\n        if (mainSection && mainSection.schedule) {\r\n            UserService.serverTime().then(serverTime => {\r\n                let reloadTimeout = scheduleReloadTimeout(mainSection.schedule, serverTime);\r\n                if (reloadTimeout) {\r\n                    timeout.current = setTimeout(() => {\r\n                        getMember();\r\n                    }, reloadTimeout)\r\n                }\r\n            })\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        getMember();\r\n        return () => {\r\n            if (timeout.current) {\r\n                clearTimeout(timeout.current);\r\n                timeout.current = 0;\r\n            }\r\n            PurchasingGroupStage1Service.clearResources(PurchasingGroupStage1Service.PURCHASING_GROUP_MEMBER_RESOURCE_ID(member.identity))\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const doDelete = (user) => {\r\n        setDeleteWorkingId(user.identity)\r\n        PurchasingGroupStage1Service.deleteMemberUser(groupId, member.identity, user.identity).finally(() => {\r\n            PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n            setDeleteWorkingId(0);\r\n        });\r\n    }\r\n\r\n    const withdrawParticipation = () => {\r\n        setParticipationWorking(true);\r\n        PurchasingGroupStage1Service.withdrawParticipationMember(groupId, member.identity).then(\r\n            ()=> PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n        ).finally(() => setParticipationWorking(false));\r\n    }\r\n\r\n    const confirmParticipation = () => {\r\n        setParticipationWorking(true);\r\n        PurchasingGroupStage1Service.confirmParticipationMember(groupId, member.identity).then(\r\n            ()=> PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n        ).finally(() => setParticipationWorking(false));\r\n    }\r\n\r\n    if (!memberData)\r\n        return <Loading/>\r\n    return (<div>\r\n        {coordinatorView && <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>}\r\n        <TitledComponent\r\n            className={classes.section}\r\n            title={Tr('purchasing_group_users')}\r\n            additionalElement={coordinatorView ? undefined :\r\n                <Button disabled={!editable} onClick={() => setAddPopup(true)} className={classes.addButton} Icon={AddIcon}\r\n                        variant=\"outlined\">{Tr('purchasing_group_users_add')}</Button>}>\r\n            {\r\n                memberData.users.length === 0 ?\r\n                    <>\r\n                        <Typography className={classes.italic} color=\"primary\">{Tr('purchasing_group_users_not_added')}</Typography>\r\n                    </>\r\n                    :\r\n                    <SimpleTable\r\n                        columnClasses={[\r\n                            classes.lpColumn,\r\n                            undefined,\r\n                            classes.buttonColumn,\r\n                        ]}\r\n                        headers={[Tr('column_lp'), Tr('user_data'), \"\"]}\r\n                        items={memberData.users.map((item, index) => [\r\n                            (index + 1),\r\n                            getUserFullNameWithEmail(item),\r\n                            coordinatorView ? '' : <WorkableIconDeleteButton\r\n                                disabled={rejected}\r\n                                working={deleteWorkingId === item.identity}\r\n                                onClick={() => confirmComplex({\r\n                                    onConfirm: () => doDelete(item),\r\n                                    confirmText: Tr('confirm_delete'),\r\n                                    confirmText2: `${item.firstName} ${item.lastName}`,\r\n                                    translateConfirmTexts: false\r\n                                })}/>\r\n                        ])}\r\n                    />\r\n            }\r\n            {\r\n                addPopup && <AddMemberUserPopup groupId={groupId} memberId={member.identity} onClose={() => setAddPopup(false)}/>\r\n            }\r\n            <div className={classes.section}>\r\n                <GridBlock alignItems=\"center\">\r\n                    {\r\n                        memberData.canConfirm && <>\r\n                            {\r\n                                !memberData.confirmationDate ?\r\n                                    <WorkableButton disabled={!editable || participationWorking} working={participationWorking} Icon={CheckCircleOutlineIcon}\r\n                                                    onClick={confirmParticipation}>{Tr(\"purchase_group_member_confirm_participation\")}</WorkableButton> :\r\n\r\n                                    <WorkableButton disabled={!editable || participationWorking} working={participationWorking} Icon={CancelIcon}\r\n                                                    variant=\"outlined\"\r\n                                                    onClick={withdrawParticipation}>{Tr(\"purchase_group_member_withdraw_participation\")}</WorkableButton>\r\n                            }\r\n                        </>\r\n                    }\r\n                    {\r\n                        !!memberData.confirmationDate && <BoldTypography className={classes.success}>{Tr(\"purchase_group_member_participation_confirmed\")}</BoldTypography>\r\n                    }\r\n                </GridBlock>\r\n            </div>\r\n\r\n        </TitledComponent>\r\n\r\n        <MembersDocumentsList\r\n            groupId={groupId}\r\n            editable={editable && !rejected}\r\n            coordinatorView={coordinatorView}\r\n            membersDocs={memberData.memberDocuments}\r\n            memberId={member.identity}\r\n            validationSection={validationSection}\r\n        />\r\n\r\n    </div>)\r\n}\r\n\r\nMembersElementContent.propTypes = {}\r\n\r\nexport default connect((state, {member}) => ({\r\n    memberData: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_MEMBER_RESOURCE_ID(member.identity)],\r\n    stage1Sections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n}), {})(MembersElementContent);","import React, {useState} from 'react'\r\nimport {Collapse, makeStyles} from \"@material-ui/core\";\r\nimport MembersElementTitle from \"./MembersElementTitle\";\r\nimport MembersElementContent from \"./MembersElementContent\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        padding: `${theme.spacing()}px ${theme.spacing(2)}px`,\r\n        marginBottom: theme.spacing()\r\n    }\r\n}))\r\n\r\nfunction MembersElement(\r\n    {\r\n        index,\r\n        groupId,\r\n        member,\r\n        coordinatorView,\r\n        editable,\r\n        search,\r\n        validationSection\r\n    }) {\r\n    const classes = useStyle();\r\n    const [open, setOpen] = useState(false);\r\n\r\n\r\n    return (<Collapse in={!search.search || member.name.toLowerCase().indexOf(search.search.toLowerCase()) > -1} unmountOnExit={false}>\r\n        <div className={classes.root}>\r\n            <MembersElementTitle\r\n                groupId={groupId}\r\n                editable={editable}\r\n                index={index}\r\n                member={member}\r\n                open={open}\r\n                onOpen={() => setOpen(!open)}\r\n                coordinatorView={coordinatorView}\r\n                validationSection={validationSection}\r\n            />\r\n            <Collapse in={coordinatorView || open} unmountOnExit>\r\n                <MembersElementContent\r\n                    groupId={groupId}\r\n                    member={member}\r\n                    coordinatorView={coordinatorView}\r\n                    editable={editable}\r\n                    validationSection={validationSection}\r\n                />\r\n            </Collapse>\r\n        </div>\r\n    </Collapse>)\r\n}\r\n\r\nMembersElement.propTypes = {}\r\n\r\nexport default MembersElement;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport Form from 'components/Form';\r\nimport useId from 'hooks/useId';\r\nimport VS from \"constants/ValidationShema\";\r\nimport Loading from \"components/Loading\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport {connect} from \"react-redux\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {PurchasingGroupStageSections} from \"../../../../constants/PurchasingGroupStageSections\";\r\n\r\nfunction AddPurchasingGroupMemberPopup(\r\n    {\r\n        groupId,\r\n        onClose,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [membersList, setMembersList] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getMembersAvailableConcerns(groupId).then((resp) => {\r\n            const respMapped = resp.map(x => ({identity: x.orgId, name: x.name}));\r\n            setMembersList(respMapped);\r\n        }).catch(() => onClose());\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    const onSubmit = ({concerns}) => {\r\n        const selectedOrgs = Object.keys(concerns).filter(key => !!concerns[key])\r\n\r\n        setWorking(true);\r\n        PurchasingGroupStage1Service.addMembers(groupId, selectedOrgs).then((resp) => {\r\n            enqueueSuccessSnackbar(Tr('purchase_group_members_added', {x: resp.length}))\r\n            PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n            onClose();\r\n        }).catch(() => {\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('confirm'), handleSubmit, undefined, working || !membersList || membersList.length === 0, undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"purchase_group_member_add\")}\r\n            open={true}\r\n            dialogActions={getActions()}\r\n        >\r\n            {\r\n                !membersList ? <Loading/> :\r\n                    <Form\r\n                        initialValues={{\r\n                            concerns: membersList.reduce((prev, cur) => {\r\n                                prev[cur.identity] = false;\r\n                                return prev;\r\n                            }, {}),\r\n                        }}\r\n                        validationSchema={\r\n                            VS.object({\r\n                                concerns: VS.any().test('partSelected', Tr('choose_at_least_one'), (e) => {\r\n                                    const selected = Object.keys(e).filter(x => e[x] === true).length;\r\n                                    return selected > 0;\r\n                                })\r\n                            })\r\n                        }\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            membersList.length === 0 ?\r\n                                <BoldTypography>{Tr('purchase_group_member_add_no_concerns')}</BoldTypography>\r\n                                :\r\n                                <PartsTable\r\n                                    label={Tr('purchase_group_member_add_label')}\r\n                                    id=\"concerns\"\r\n                                    formikProps={formikProps}\r\n                                    elementList={membersList}\r\n                                    disabled={working}\r\n                                />)}\r\n                    </Form>\r\n            }\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAddPurchasingGroupMemberPopup.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddPurchasingGroupMemberPopup);","import React, {useState} from 'react'\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport MembersElement from \"./MembersElement\";\r\nimport Tr from \"translations/Translations\";\r\nimport AddIcon from '@material-ui/icons/AddBoxOutlined'\r\nimport Button from \"components/Button\";\r\nimport AddPurchasingGroupMemberPopup from \"./AddPurchasingGroupMemberPopup\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    search: {\r\n        marginTop: theme.spacing(3),\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction MembersList(\r\n    {\r\n        groupId,\r\n        members,\r\n        coordinatorView,\r\n        editable,\r\n        validationSection\r\n    }) {\r\n    const classes = useStyle();\r\n    const [addWindowOpen, setAddWindowOpen] = useState(false);\r\n    const [search, setSearch] = useState({});\r\n\r\n    return (<div className={classes.root}>\r\n        {!coordinatorView && <BasicSearch className={classes.search} doSearch={setSearch} label={Tr('search_member')}/>}\r\n        {\r\n            members.map((x, i) => (<MembersElement\r\n                key={x.identity}\r\n                index={i}\r\n                groupId={groupId}\r\n                member={x}\r\n                search={search}\r\n                coordinatorView={coordinatorView}\r\n                editable={editable}\r\n                validationSection={validationSection}\r\n            />))\r\n        }\r\n        {\r\n            !coordinatorView && <Button disabled={!editable} Icon={AddIcon} variant=\"outlined\" onClick={() => setAddWindowOpen(true)}>{Tr('purchase_group_member_add')}</Button>\r\n        }\r\n        {(!coordinatorView && addWindowOpen) && <AddPurchasingGroupMemberPopup groupId={groupId} onClose={() => setAddWindowOpen(false)}/>}\r\n    </div>)\r\n}\r\n\r\nMembersList.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    members: PropTypes.array.isRequired,\r\n    coordinatorView: PropTypes.bool.isRequired,\r\n    editable: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default MembersList;","export const PurchasingGroupRole = {\r\n    AUTHOR: \"AUTHOR\",\r\n    ADMIN: \"ADMIN\",\r\n    EXPERT: \"EXPERT\",\r\n    MEMBER: \"MEMBER\"\r\n}\r\n","import React, {useEffect, useRef} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport Loading from \"components/Loading\";\r\nimport MembersList from \"./components/MembersList\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {connect} from \"react-redux\";\r\nimport MembersDocumentsList from \"./components/MembersDocumentsList\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport scheduleReloadTimeout from \"../../../utils/scheduleReloadTimeout\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\nimport UserService from \"services/UserService\";\r\nimport {PurchasingGroupRole} from \"../../../constants/PurchasingGroupRole\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage1Members(\r\n    {\r\n        panelRef,\r\n        validationSection,\r\n        members,\r\n        membersDocs,\r\n        purchasingGroupHeader,\r\n        stageSections\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const stage = params.stage;\r\n    const formId = params.section;\r\n    const timeout = useRef(0);\r\n    const documentsApiPathType = stage === \"1\" ? \"members\" : \"swz\"\r\n    const coordinatorView = purchasingGroupHeader.userRole === PurchasingGroupRole.MEMBER;\r\n    const editable = validationSection.editable;\r\n    useStepperStateCloseValidator(formId);\r\n\r\n\r\n    const getMembers = () => {\r\n        if (timeout.current) {\r\n            clearTimeout(timeout.current);\r\n            timeout.current = 0;\r\n        }\r\n        if (stage === \"1\")\r\n            PurchasingGroupStage1Service.getMembers(groupId);\r\n        PurchasingGroupStage1Service.getAllMembersDocuments(groupId, documentsApiPathType);\r\n\r\n        const mainSection = stageSections[stage === \"1\" ? PurchasingGroupStageSections.STAGE_1_SECTION : PurchasingGroupStageSections.STAGE_2_SECTION];\r\n        if (mainSection && mainSection.schedule) {\r\n            UserService.serverTime().then(serverTime => {\r\n                let reloadTimeout = scheduleReloadTimeout(mainSection.schedule, serverTime);\r\n                if (reloadTimeout) {\r\n                    timeout.current = setTimeout(() => {\r\n                        getMembers();\r\n                    }, reloadTimeout)\r\n                }\r\n            })\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        getMembers();\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n        return () => {\r\n            if (timeout.current) {\r\n                clearTimeout(timeout.current);\r\n                timeout.current = 0;\r\n            }\r\n            if (stage === \"1\")\r\n                PurchasingGroupStage1Service.clearResources(PurchasingGroupStage1Service.PURCHASING_GROUP_MEMBERS_RESOURCE_ID);\r\n            PurchasingGroupStage1Service.clearResources(PurchasingGroupStage1Service.PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    if ((stage === \"1\" && !members) || !membersDocs) return <Loading/>\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            {!coordinatorView && <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>}\r\n            <MembersDocumentsList\r\n                groupId={groupId}\r\n                mainDocs\r\n                editable={editable}\r\n                coordinatorView={coordinatorView}\r\n                membersDocs={membersDocs}\r\n                validationSection={validationSection}\r\n                allMemberDocumentsApiPath={documentsApiPathType}\r\n            />\r\n            {stage === \"1\" &&\r\n                <MembersList\r\n                    groupId={groupId}\r\n                    members={members}\r\n                    coordinatorView={coordinatorView}\r\n                    editable={editable}\r\n                    validationSection={validationSection}\r\n                />\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nPurchasingGroupStage1Members.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n    members: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_MEMBERS_RESOURCE_ID],\r\n    membersDocs: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n    purchasingGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID]\r\n}), {})(PurchasingGroupStage1Members);","import React, {useEffect} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorList from \"components/complex/papersGenerator/PapersGeneratorList\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage1PapersGenerator(\r\n    {\r\n        panelRef,\r\n        validationSection\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const formId = params.section;\r\n    const editable = validationSection.editable;\r\n\r\n    useStepperStateCloseValidator(formId);\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n        PapersGeneratorService.getAvailablePapers(groupId);\r\n        return () => {\r\n            PapersGeneratorService.clearResources(PapersGeneratorService.PAPERS_GENERATOR_LIST_RESOURCE_ID);\r\n        }\r\n    }, [groupId, validationSection.section])\r\n\r\n    return (<div className={classes.root}>\r\n        <PapersGeneratorList editable={editable} id={groupId}/>\r\n    </div>)\r\n}\r\n\r\nPurchasingGroupStage1PapersGenerator.propTypes = {}\r\n\r\nexport default PurchasingGroupStage1PapersGenerator;","import React, {useEffect, useRef, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Loading from \"components/Loading\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport Select from \"components/Select\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    },\r\n    uploadFile: {\r\n        marginBottom: 20\r\n    }\r\n}));\r\n\r\nfunction AddNewOpinionMemberPopup(\r\n    {\r\n        groupId,\r\n        onClose,\r\n        apiPathType,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const sendType = useRef('');\r\n    const [working, setWorking] = useState(true);\r\n    const [contractorList, setContractorList] = useState([]);\r\n    const formId = useId();\r\n\r\n\r\n    const handleSubmit = (type) => {\r\n        sendType.current = type;\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getOpinionAvailableMembers(groupId, apiPathType).then((resp) => {\r\n            if(resp) {\r\n                setContractorList(resp.map(x => ({label: x.name, value: x.identity})));\r\n                setWorking(false)\r\n            } else {\r\n                onClose()\r\n            }\r\n\r\n        });\r\n        // eslint-disable-next-line\r\n    }, [groupId, apiPathType]);\r\n\r\n\r\n    const onSubmit = (opinion) => {\r\n        setWorking(true);\r\n        const send = sendType.current === 'send';\r\n        sendType.current = \"\";\r\n\r\n        PurchasingGroupStage1Service.addOpinionForMember(groupId, apiPathType, opinion.memberId).then((newOpinion) => {\r\n            if (newOpinion) {\r\n                PurchasingGroupStage1Service.saveOpinionMessage(groupId, apiPathType, newOpinion.identity, {\r\n                    identity: 0,\r\n                    contents: opinion.contents,\r\n                    send: send\r\n                }).then(() => onClose(newOpinion.identity))\r\n            } else {\r\n                onClose();\r\n            }\r\n        }).catch(() => setWorking(false));\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('save'), () => handleSubmit('save'), 'outlined', working));\r\n        buttons.push(createButton(Tr('send'), () => handleSubmit('send'), undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"purchasing_group_add_new_opinion\")}\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    memberId: null,\r\n                    contents: \"\"\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    memberId: VS.anyRequired(),\r\n                    contents: VS.string(),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        {working && <Loading className={classes.loading}/>}\r\n\r\n                        <Select\r\n                            id=\"memberId\"\r\n                            formikProps={formikProps}\r\n                            label={Tr('choose_recipients')}\r\n                            disabled={working}\r\n                            items={contractorList}\r\n                            required\r\n                        />\r\n\r\n\r\n                        <TextInput\r\n                            id='contents'\r\n                            formikProps={formikProps}\r\n                            label={Tr('contents')}\r\n                            disabled={working}\r\n                            multiline\r\n                            required\r\n                        />\r\n\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddNewOpinionMemberPopup);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {Badge, makeStyles, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from 'clsx';\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\nimport {getUserFullNameWithDeputy} from \"../../../../../../../../libs/userNameGetter\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '80%',\r\n        margin: 5,\r\n    },\r\n    rootMine: {\r\n        marginLeft: '20%'\r\n    },\r\n    contentWrapper: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        position: 'relative'\r\n    },\r\n    contentWrapperUnread: {\r\n        borderWidth: 3\r\n    },\r\n    contentWrapperMine: {\r\n        backgroundColor: theme.palette.background.default\r\n    },\r\n    content: {\r\n        padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`\r\n    },\r\n    sendDate: {\r\n        margin: `0 ${theme.spacing(1)}px`,\r\n        minWidth: 110\r\n    },\r\n    message: {\r\n        whiteSpace: 'pre-line',\r\n        margin: `${theme.spacing(2)}px 0`\r\n    },\r\n    newBadge: {\r\n        position: 'absolute',\r\n        right: 0,\r\n        top: 3\r\n    },\r\n}));\r\n\r\n\r\nfunction OpinionMessage(\r\n    {\r\n        coordinatorView,\r\n        message\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const mine = !!(coordinatorView ? message.memberMessage : !message.memberMessage);\r\n    const unread = !mine && !message.read;\r\n\r\n    return (\r\n        <div className={clsx(classes.root, {[classes.rootMine]: mine, 'new-message-scroll-to': unread})}>\r\n\r\n            <div className={clsx(classes.contentWrapper, {[classes.contentWrapperMine]: mine, [classes.contentWrapperUnread]: unread})}>\r\n                <div className={classes.content}>\r\n                    {unread && <Badge className={clsx(classes.newBadge)} badgeContent='NOWA' color=\"error\">\r\n                        <MailIcon color='primary'/>\r\n                    </Badge>}\r\n                    <GridBlock justify=\"space-between\">\r\n                        <GridBlock>\r\n                            <BoldTypography variant='caption'>{Tr(\"author\")}</BoldTypography>\r\n                            <Typography variant='caption' component='p' className={classes.sendDate}>\r\n                                {getUserFullNameWithDeputy(message.author)}\r\n                            </Typography>\r\n                        </GridBlock>\r\n                        <GridBlock>\r\n                            <BoldTypography variant='caption'>{Tr(\"send_date\")}</BoldTypography>\r\n                            <Typography variant='caption' component='p' className={classes.sendDate}>\r\n                                {message.sendDate ? moment(message.sendDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT) : ''}\r\n                            </Typography>\r\n                        </GridBlock>\r\n                    </GridBlock>\r\n\r\n                    <Typography variant='body1' className={classes.message}>{message.contents}</Typography>\r\n\r\n                </div>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n\r\nOpinionMessage.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default OpinionMessage;","import React, {useReducer, useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport clsx from 'clsx';\r\nimport * as Yup from \"yup\";\r\nimport {connect} from \"react-redux\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Tr from \"translations/Translations\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '80%',\r\n        margin: 5,\r\n        marginLeft: '20%',\r\n    },\r\n    contentWrapper: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper\r\n    },\r\n    content: {\r\n        padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`\r\n    },\r\n    sendDate: {\r\n        margin: `0 ${theme.spacing(1)}px`,\r\n        minWidth: 110\r\n    },\r\n    message: {\r\n        whiteSpace: 'pre-line',\r\n        margin: `${theme.spacing(2)}px 0`\r\n    }\r\n}));\r\n\r\n\r\nfunction NewOpinionMessage(\r\n    {\r\n        groupId,\r\n        coordinatorView,\r\n        editable,\r\n        message,\r\n        opinion,\r\n        apiPathType,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const formId = useId();\r\n    // eslint-disable-next-line\r\n    const [error, setError] = useState('');\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        remove: false,\r\n        send: false,\r\n        save: false,\r\n        other: false\r\n    });\r\n    const sendMode = useRef(\"\");\r\n\r\n\r\n    const onSubmit = ({contents}) => {\r\n        const type = sendMode.current;\r\n        dispatchIconWorks({type: type, works: true});\r\n        PurchasingGroupStage1Service.saveOpinionMessage(groupId, apiPathType, opinion.identity, {\r\n            identity: message.identity,\r\n            contents: contents,\r\n            send:  type === 'send'\r\n        }).then(() => {\r\n            if (opinion.identity === 0)\r\n                PurchasingGroupStage1Service.getOpinions(groupId, apiPathType).then(() => dispatchIconWorks({type: type, works: false}))\r\n            else\r\n                dispatchIconWorks({type: type, works: false})\r\n        })\r\n\r\n    }\r\n    const handleSubmit = (type) => {\r\n        sendMode.current = type;\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const handleDelete = () => {\r\n        dispatchIconWorks({type: \"remove\", works: true});\r\n        PurchasingGroupStage1Service.deleteOpinionMessage(groupId, apiPathType, opinion.identity, message.identity).catch(() => dispatchIconWorks({type: \"remove\", works: false}))\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (opinion.identity > 0)\r\n            buttons.push(createButton(Tr('delete'), handleDelete, 'outlined', !editable || iconWorks.anyWorks, undefined, iconWorks.remove ));\r\n        buttons.push(createButton(Tr('save'), () => handleSubmit('save'), 'outlined', !editable || iconWorks.anyWorks, undefined, iconWorks.save ));\r\n        buttons.push(createButton(Tr('send'), () => handleSubmit('send'), undefined, !editable || iconWorks.anyWorks, undefined, iconWorks.send ));\r\n        return buttons;\r\n    }\r\n    return (\r\n        <div className={clsx(classes.root)}>\r\n\r\n            <div className={clsx(classes.contentWrapper)}>\r\n                <div className={classes.content}>\r\n                    <Form\r\n                        initialValues={{\r\n                            contents: message.contents\r\n                        }}\r\n                        initialTouched={{\r\n                            contents: true\r\n                        }}\r\n                        onSubmit={onSubmit}\r\n                        validationSchema={Yup.object().shape({\r\n                            contents: VS.string(),\r\n                        })}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (<>\r\n                                {error && <Typography color='error'>{error}</Typography>}\r\n\r\n\r\n                                <TextInput\r\n                                    id='contents'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('contents')}\r\n                                    disabled={iconWorks.anyWorks}\r\n                                    multiline\r\n                                    required\r\n                                />\r\n                                <MultiButton className={classes.buttons} buttons={getButtons()}/>\r\n                            </>\r\n\r\n\r\n                        )}\r\n                    </Form>\r\n                </div>\r\n            </div>\r\n\r\n        </div>\r\n    )\r\n}\r\n\r\nNewOpinionMessage.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(NewOpinionMessage);","import React, {useEffect, useState} from 'react'\r\nimport Loading from \"components/Loading\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport {connect} from \"react-redux\";\r\nimport OpinionMessage from \"./OpinionMessage\";\r\nimport NewOpinionMessage from \"./NewOpinionMessage\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport AddIcon from \"@material-ui/icons/AddBoxOutlined\";\r\nimport Tr from \"translations/Translations\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\n\r\nfunction OpinionElementContent(\r\n    {\r\n        groupId,\r\n        opinion,\r\n        coordinatorView,\r\n        opinionMessages,\r\n        editable,\r\n        apiPathType\r\n    }) {\r\n\r\n    const [addWorking, setAddWorking] = useState(false);\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getOpinionMessages(groupId, apiPathType, opinion.identity, editable)\r\n        return () => {\r\n            PurchasingGroupStage1Service.clearResources(PurchasingGroupStage1Service.PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID(opinion.identity))\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    if (!opinionMessages)\r\n        return <Loading/>\r\n    return (<div>\r\n\r\n        {(opinionMessages.length === 0) && <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>}\r\n\r\n        {\r\n            opinionMessages.map(x => x.status === 'SENT' ? <OpinionMessage key={x.identity} message={x} coordinatorView={coordinatorView}/> :\r\n                <NewOpinionMessage key={x.identity} editable={editable} groupId={groupId} message={x} coordinatorView={coordinatorView} opinion={opinion} apiPathType={apiPathType}/>\r\n            )\r\n        }\r\n        {\r\n            opinion.identity > 0 && <GridBlock justify=\"flex-end\">\r\n                <WorkableButton\r\n                    Icon={AddIcon}\r\n                    variant=\"outlined\" working={addWorking} disabled={!editable || addWorking}\r\n                    onClick={() => {\r\n                        setAddWorking(true);\r\n                        PurchasingGroupStage1Service.addEmptyOpinionMessage(groupId, apiPathType, opinion.identity, editable).finally(() => setAddWorking(false))\r\n                    }}>{Tr(\"new_message\")}\r\n                </WorkableButton>\r\n            </GridBlock>\r\n        }\r\n\r\n\r\n    </div>)\r\n}\r\n\r\nOpinionElementContent.propTypes = {}\r\n\r\nexport default connect((state, {opinion}) => ({\r\n    opinionMessages: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID(opinion.identity)]\r\n}), {})(OpinionElementContent);","import React from 'react'\r\nimport {Badge, Box, Typography} from '@material-ui/core';\r\nimport GridBlock from 'components/GridBlock';\r\nimport clsx from 'clsx';\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        '&>*:nth-child(2)': {\r\n            flexGrow: 1,\r\n        }\r\n    },\r\n    title: {\r\n        marginLeft: theme.spacing()\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    cursorPointer: {\r\n        cursor: 'pointer'\r\n    }\r\n}))\r\n\r\nfunction OpinionElementTitle(\r\n    {\r\n        index,\r\n        opinion,\r\n        open,\r\n        onOpen,\r\n        coordinatorView,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <GridBlock\r\n            alignItems='center'\r\n            className={classes.root}\r\n            wrap='nowrap'\r\n        >\r\n            { coordinatorView ? <Typography></Typography> :\r\n            <Typography\r\n                variant='body1'\r\n                className={classes.title}\r\n            >\r\n                {index + 1}.\r\n            </Typography>\r\n            }\r\n\r\n\r\n            <Typography\r\n                variant='body1'\r\n                className={clsx(classes.cursorPointer, classes.title)}\r\n                onClick={onOpen}\r\n            >\r\n                <Box\r\n                    component='span'\r\n                    fontWeight='fontWeightBold'\r\n\r\n                >\r\n                    {opinion.memberName}\r\n                </Box>\r\n            </Typography>\r\n\r\n            {!coordinatorView && !!opinion.unreadCount && <Badge badgeContent={opinion.unreadCount} max={9} color=\"error\">\r\n                <MailIcon color='primary' onClick={onOpen}/>\r\n            </Badge>}\r\n            {!coordinatorView && <WorkableIconExpandButton\r\n                color='primary'\r\n                onClick={onOpen}\r\n                expanded={open}\r\n            />}\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nOpinionElementTitle.propTypes = {}\r\n\r\nexport default OpinionElementTitle;","import React, {useState} from 'react'\r\nimport {Collapse, makeStyles} from \"@material-ui/core\";\r\nimport OpinionElementContent from \"./OpinionElementContent\";\r\nimport OpinionElementTitle from \"./OpinionElementTitle\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        padding: `${theme.spacing()}px ${theme.spacing(2)}px`,\r\n        marginBottom: theme.spacing()\r\n    }\r\n}))\r\n\r\nfunction OpinionElement(\r\n    {\r\n        index,\r\n        groupId,\r\n        opinion,\r\n        coordinatorView,\r\n        search,\r\n        editable,\r\n        apiPathType\r\n    }) {\r\n    const classes = useStyle();\r\n    const [open, setOpen] = useState(false);\r\n\r\n\r\n    return (<Collapse in={!search.search || opinion.memberName.toLowerCase().indexOf(search.search.toLowerCase()) > -1} unmountOnExit={false}>\r\n        <div className={classes.root}>\r\n            <OpinionElementTitle\r\n                index={index}\r\n                opinion={opinion}\r\n                open={open}\r\n                onOpen={() => setOpen(!open)}\r\n                coordinatorView={coordinatorView}\r\n                editable={editable}\r\n            />\r\n            <Collapse in={coordinatorView || open} unmountOnExit>\r\n                <OpinionElementContent\r\n                    groupId={groupId}\r\n                    opinion={opinion}\r\n                    index={index}\r\n                    coordinatorView={coordinatorView}\r\n                    editable={editable}\r\n                    apiPathType={apiPathType}\r\n                />\r\n            </Collapse>\r\n        </div>\r\n    </Collapse>)\r\n}\r\n\r\nOpinionElement.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    index: PropTypes.number.isRequired,\r\n    opinion: PropTypes.object.isRequired,\r\n    coordinatorView: PropTypes.bool.isRequired,\r\n    search: PropTypes.shape({\r\n        search: PropTypes.string\r\n    }),\r\n    editable: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default OpinionElement;","import React, {useCallback, useEffect, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport Button from \"components/Button\";\r\nimport Tr from \"translations/Translations\";\r\nimport AddNewOpinionMemberPopup from \"./components/AddNewOpinionMemberPopup\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport OpinionElement from \"./components/OpinionElement\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport AddIcon from \"@material-ui/icons/AddBoxOutlined\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {PurchasingGroupRole} from \"../../../constants/PurchasingGroupRole\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    },\r\n    search: {\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage1Opinion(\r\n    {\r\n        panelRef,\r\n        validationSection,\r\n        purchasingGroupHeader,\r\n        opinions\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const stage = params.stage;\r\n    const formId = params.section;\r\n    const editable = validationSection.editable;\r\n    const apiPathType = stage === \"1\" ? \"AGREEMENT\" : \"SWZ\"\r\n    const coordinatorView = purchasingGroupHeader.userRole === PurchasingGroupRole.MEMBER;\r\n    const [newOpinionPopup, setNewOpinionPopup] = useState(false);\r\n    const [search, setSearch] = useState({});\r\n\r\n    useStepperStateCloseValidator(formId);\r\n\r\n    const closeSection = useCallback(() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n        id: groupId,\r\n        stage: stage\r\n    })), [groupId, stage]);\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n        PurchasingGroupStage1Service.getOpinions(groupId, apiPathType).then((resp) => {\r\n            if(!resp) closeSection();\r\n        })\r\n        return () => {\r\n            PurchasingGroupStage1Service.clearResources(PurchasingGroupStage1Service.PURCHASING_GROUP_OPINIONS_RESOURCE_ID);\r\n        }\r\n    }, [groupId, closeSection, apiPathType, validationSection.section])\r\n\r\n    if (!opinions) return <Loading/>\r\n\r\n    return (<div className={classes.root}>\r\n        <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>\r\n        {!coordinatorView && <GridBlock className={classes.search} justify=\"space-between\">\r\n            <BasicSearch className={classes.search} doSearch={setSearch} label={Tr('search_member')}/>\r\n            <Button Icon={AddIcon} disabled={!editable} onClick={() => setNewOpinionPopup(true)}>{Tr(\"purchasing_group_add_new_opinion\")}</Button>\r\n\r\n        </GridBlock>\r\n        }\r\n\r\n        {\r\n            opinions.map((x, i) => (\r\n                <OpinionElement\r\n                    key={x.identity}\r\n                    groupId={groupId}\r\n                    index={i}\r\n                    opinion={x}\r\n                    search={search}\r\n                    coordinatorView={coordinatorView}\r\n                    editable={editable}\r\n                    apiPathType={apiPathType}\r\n                />))\r\n        }\r\n\r\n        {(newOpinionPopup) && <AddNewOpinionMemberPopup groupId={groupId} onClose={() => setNewOpinionPopup(false)} apiPathType={apiPathType}/>}\r\n    </div>)\r\n}\r\n\r\nPurchasingGroupStage1Opinion.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    opinions: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_OPINIONS_RESOURCE_ID],\r\n    purchasingGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID]\r\n}), {})(PurchasingGroupStage1Opinion);","import React, {useEffect, useState} from 'react'\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport Button from \"components/Button\";\r\nimport Tr from \"translations/Translations\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport {useParams} from \"react-router\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {confirmComplex} from \"libs/ConfirmNotification\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage1FinishPreparing(\r\n    {\r\n        panelRef,\r\n        validationSection\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const editable = validationSection.editable;\r\n\r\n    const [canFinish, setCanFinish] = useState(false)\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.FINISH_PREPARING)\r\n        PurchasingGroupStage1Service.canFinishPreparing(groupId).then(resp => {\r\n            if (resp) {\r\n                setCanFinish(resp.result);\r\n            } else {\r\n                setCanFinish(false);\r\n            }\r\n        });\r\n    }, [groupId]);\r\n\r\n    const finishPreparingState = () => {\r\n        PurchasingGroupStage1Service.finishPreparingStage(groupId).then(resp => {\r\n            if (resp) {\r\n                PurchasingGroupStage1Service.getHeader(groupId);\r\n                const path = RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {id: groupId, stage: 2});\r\n                RouterPath.redirect(path);\r\n            } else {\r\n            }\r\n        });\r\n    }\r\n\r\n    return (<div className={classes.root}>\r\n        <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>\r\n        <GridBlock\r\n            direction='column'\r\n            alignItems='center'\r\n        >\r\n            <Button\r\n                disabled={!editable || !canFinish}\r\n                onClick={() => confirmComplex({\r\n                    onConfirm: () => finishPreparingState(),\r\n                    confirmText: Tr('purchasing_group_finish_preparing_confirm1'),\r\n                    confirmText2: Tr('purchasing_group_finish_preparing_confirm2'),\r\n                    translateConfirmTexts: false\r\n                })}\r\n            >\r\n                {Tr('purchasing_group_finish_preparing_action')}\r\n            </Button>\r\n        </GridBlock>\r\n    </div>)\r\n}\r\n\r\nPurchasingGroupStage1FinishPreparing.propTypes = {}\r\n\r\nexport default PurchasingGroupStage1FinishPreparing;","import React from 'react'\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PropTypes from \"prop-types\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    picker: {\r\n        width: 400,\r\n        marginRight: theme.spacing(3)\r\n    },\r\n    stageHead: {\r\n        marginTop: theme.spacing(4)\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage2ScheduleForm(\r\n    {\r\n        formikProps,\r\n        schedule,\r\n        editable\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (<GridBlock\r\n        column\r\n    >\r\n\r\n        <BoldTypography>{Tr('purchasing_group_opinion_swz_stage')}</BoldTypography>\r\n        <GridBlock>\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"swzOpinionStartDate\"\r\n                label={Tr('purchase_group_stage_start_date')}\r\n                required={schedule.swzOpinionStartDateEditable}\r\n                disabled={!editable || !schedule.swzOpinionStartDateEditable}\r\n            />\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"swzOpinionEndDate\"\r\n                label={Tr('purchase_group_stage_end_date')}\r\n                required={schedule.swzOpinionEndDateEditable}\r\n                disabled={!editable || !schedule.swzOpinionEndDateEditable}\r\n            />\r\n        </GridBlock>\r\n\r\n        <BoldTypography className={classes.stageHead}>{Tr('purchasing_group_collecting_data_stage')}</BoldTypography>\r\n        <GridBlock>\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"collectingDataStartDate\"\r\n                label={Tr('purchase_group_stage_start_date')}\r\n                required={schedule.collectingDataStartDateEditable}\r\n                disabled={!editable || !schedule.collectingDataStartDateEditable}\r\n            />\r\n            <DateTimePicker\r\n                className={classes.picker}\r\n                formikProps={formikProps}\r\n                id=\"collectingDataEndDate\"\r\n                label={Tr('purchase_group_stage_end_date')}\r\n                required={schedule.collectingDataEndDateEditable}\r\n                disabled={!editable || !schedule.collectingDataEndDateEditable}\r\n            />\r\n        </GridBlock>\r\n\r\n    </GridBlock>)\r\n}\r\n\r\nPurchasingGroupStage2ScheduleForm.propTypes = {\r\n    schedule: PropTypes.shape({\r\n        swzOpinionStartDateEditable: PropTypes.bool.isRequired,\r\n        swzOpinionEndDateEditable: PropTypes.bool.isRequired,\r\n        collectingDataStartDateEditable: PropTypes.bool.isRequired,\r\n        collectingDataEndDateEditable: PropTypes.bool.isRequired,\r\n    }).isRequired\r\n}\r\n\r\nexport default PurchasingGroupStage2ScheduleForm;","import Endpoints from 'constants/Endpoints';\r\nimport {clearResource, setResource, setSaveStatusClosed, setSaveStatusError, setSaveStatusLoading} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst PURCHASING_GROUP_TEMPLATE_RESOURCE_ID = \"purchasingGroupTemplate\"\r\nconst PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID = (memberId) => `purchasingGroupTemplateMember_${memberId}`;\r\n\r\nconst __get = async (url, resourcesName) => {\r\n    try {\r\n        let res = await RestRequestGET(url)\r\n        if (resourcesName) {\r\n            reduxStore.dispatch(setResource(resourcesName, res))\r\n        }\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst __save = async (url, values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const resp = await RestRequestPOST(url, values)\r\n        isResponseValid(resp, (e) => {\r\n            throw new Error(e);\r\n        })\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\n\r\nconst getCollectingSchedule = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COLLECTING_SCHEDULE(groupId))\r\n}\r\nconst saveCollectingSchedule = async (groupId, values) => {\r\n    try {\r\n        reduxStore.dispatch(setSaveStatusLoading());\r\n        const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_COLLECTING_SCHEDULE(groupId), values)\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n        return resp;\r\n    } catch (e) {\r\n    }\r\n}\r\n\r\nconst getTemplate = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE(groupId), PURCHASING_GROUP_TEMPLATE_RESOURCE_ID)\r\n}\r\nconst saveTemplate = async (groupId, values) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE(groupId), values);\r\n    if (resp) {\r\n        const {resources} = reduxStore.getState();\r\n        const newRes = {...resources[PURCHASING_GROUP_TEMPLATE_RESOURCE_ID], ...resp}\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_TEMPLATE_RESOURCE_ID, newRes))\r\n    }\r\n    return resp;\r\n\r\n}\r\nconst getAvailableTemplates = async (groupId) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    const resp = await __get(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_AVAILABLE(groupId))\r\n    reduxStore.dispatch(setSaveStatusClosed());\r\n    return resp;\r\n}\r\n\r\nconst getTemplateMember = async (groupId, memberId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_ID(groupId, memberId), PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID(memberId))\r\n}\r\n\r\nconst getTemplateMemberForm = async (groupId, memberId, formId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID(groupId, memberId, formId))\r\n}\r\n\r\nconst updateReduxLists = (memberId, formId, resp) => {\r\n    if (resp) {\r\n        const {formListElement, formWrapper, memberListElement} = resp;\r\n        const {resources} = reduxStore.getState();\r\n        const curTemplate = resources[PURCHASING_GROUP_TEMPLATE_RESOURCE_ID];\r\n        if (curTemplate) {\r\n            const newTemplate = {...curTemplate, memberList: curTemplate.memberList.map(x => x.memberId === memberListElement.memberId ? memberListElement : x)}\r\n            reduxStore.dispatch(setResource(PURCHASING_GROUP_TEMPLATE_RESOURCE_ID, newTemplate))\r\n        }\r\n        const curMember = resources[PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID(memberId)];\r\n        if (curMember) {\r\n            const newMember = {...curMember, formList: curMember.formList.map(x => x.formId === formListElement.formId ? formListElement : x)}\r\n            reduxStore.dispatch(setResource(PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID(memberId), newMember))\r\n        }\r\n        return formWrapper;\r\n    }\r\n}\r\n\r\n\r\nconst saveTemplateMemberForm = async (groupId, memberId, formId, values) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID(groupId, memberId, formId), values);\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\n\r\nconst saveTemplateMemberFormDraft = async (groupId, memberId, formId, values) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_DRAFT(groupId, memberId, formId), values);\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\n\r\nconst saveTemplateMemberFormClearDraft = async (groupId, memberId, formId) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_CLEAR_DRAFT(groupId, memberId, formId));\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\n\r\nconst saveTemplateMemberFormAccept = async (groupId, memberId, formId) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ACCEPT(groupId, memberId, formId));\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\nconst saveTemplateMemberFormReject = async (groupId, memberId, formId) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_REJECT(groupId, memberId, formId));\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\n\r\nconst saveTemplateMemberFormAskForEdit = async (groupId, memberId, formId) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ASK_FOR_EDIT(groupId, memberId, formId));\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\nconst saveTemplateMemberFormAllowEdit = async (groupId, memberId, formId) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ALLOW_EDIT(groupId, memberId, formId));\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\nconst saveTemplateMemberFormRejectEdit = async (groupId, memberId, formId) => {\r\n    const resp = await __save(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_REJECT_EDIT(groupId, memberId, formId));\r\n    return updateReduxLists(memberId, formId, resp);\r\n}\r\n\r\n\r\nconst getArchiveList = async (groupId, memberId, formId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ARCHIVE_LIST(groupId, memberId, formId))\r\n}\r\nconst getArchiveElement = async (groupId, memberId, formId, archiveId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COLLECTING_TEMPLATE_MEMBER_FORM_ID_ARCHIVE_ID(groupId, memberId, formId, archiveId))\r\n}\r\n\r\nconst getFinish = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_FINISH(groupId))\r\n}\r\nconst saveFinish = async (groupId, values) => {\r\n    return await __save(Endpoints.PURCHASING_GROUP_FINISH(groupId), values)\r\n}\r\nconst createDemand = async (url) => {\r\n    return await RestRequestPOST(url + \"&CSRFToken=\" + reduxStore.getState().resources.userData.csrf, null, {maxRedirects: 0})\r\n}\r\n\r\nconst sendDealingsChangedNotification = async (groupId) => {\r\n    return await RestRequestPOST(Endpoints.PURCHASING_GROUP_FINISH_DEALINGS_CHANGED(groupId));\r\n}\r\n\r\n\r\nconst clearResources = (resourceId) => reduxStore.dispatch(clearResource(resourceId))\r\n\r\n\r\nexport default {\r\n\r\n    //collecting schedule\r\n    getCollectingSchedule,\r\n    saveCollectingSchedule,\r\n\r\n    //template\r\n    getTemplate,\r\n    saveTemplate,\r\n    getAvailableTemplates,\r\n    getTemplateMember,\r\n    getTemplateMemberForm,\r\n    saveTemplateMemberForm,\r\n    saveTemplateMemberFormDraft,\r\n    saveTemplateMemberFormClearDraft,\r\n    saveTemplateMemberFormAccept,\r\n    saveTemplateMemberFormReject,\r\n    saveTemplateMemberFormAskForEdit,\r\n    saveTemplateMemberFormAllowEdit,\r\n    saveTemplateMemberFormRejectEdit,\r\n    getArchiveList,\r\n    getArchiveElement,\r\n    getFinish,\r\n    saveFinish,\r\n    createDemand,\r\n\r\n    clearResources,\r\n    PURCHASING_GROUP_TEMPLATE_RESOURCE_ID,\r\n    PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID,\r\n    sendDealingsChangedNotification\r\n}","import React, {useCallback, useEffect, useRef, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\"\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport PurchasingGroupStage2ScheduleForm from \"./PurchasingGroupStage2ScheduleForm\";\r\nimport moment from \"moment\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\nimport PurchasingGroupStage2Service from \"services/PurchasingGroupStage2Service\";\r\nimport scheduleReloadTimeout from \"../../../utils/scheduleReloadTimeout\";\r\n\r\nfunction PurchasingGroupStage2Schedule(\r\n    {\r\n        panelRef,\r\n        validationSection\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const formId = params.section;\r\n    const editable = validationSection.editable;\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n    const [schedule, setSchedule] = useState(null);\r\n    const timeout = useRef(0);\r\n\r\n    useStepperStateCloseValidator(formId);\r\n\r\n    const closeSection = useCallback(() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n        id: groupId,\r\n        stage: 2\r\n    })), [groupId]);\r\n\r\n    const getSchedule = () => {\r\n        setSchedule(null);\r\n        if (timeout.current) {\r\n            clearTimeout(timeout.current);\r\n            timeout.current = 0;\r\n        }\r\n        PurchasingGroupStage2Service.getCollectingSchedule(groupId).then((resp) => {\r\n            if (resp) {\r\n                setSchedule(resp);\r\n                let reloadTimeout = scheduleReloadTimeout(resp.schedule, resp.serverTime);\r\n                if (reloadTimeout) {\r\n                    timeout.current = setTimeout(() => {\r\n                        getSchedule();\r\n                    }, reloadTimeout)\r\n                }\r\n\r\n            } else\r\n                closeSection();\r\n        });\r\n    }\r\n\r\n    useEffect(() => {\r\n        getSchedule();\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section);\r\n        return () => {\r\n            if (timeout.current) {\r\n                clearTimeout(timeout.current);\r\n                timeout.current = 0;\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n\r\n    const handleSubmit = (values) => {\r\n        PurchasingGroupStage2Service.saveCollectingSchedule(groupId, values).then((resp) => {\r\n            if (resp && resp.success === false) {\r\n                Object.keys(resp.errors).forEach((field) => {\r\n                    let error;\r\n                    switch (field) {\r\n                        case \"swzOpinionEndDate\":\r\n                            error = `${Tr('purchasing_group_opinion_swz_stage')} ${Tr('purchase_group_stage_end_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"swzOpinionStartDate\":\r\n                            error = `${Tr('purchasing_group_opinion_swz_stage')}: ${Tr('purchase_group_stage_start_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"collectingDataEndDate\":\r\n                            error = `${Tr('purchasing_group_collecting_data_stage')}: ${Tr('purchase_group_stage_end_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        case \"collectingDataStartDate\":\r\n                            error = `${Tr('purchasing_group_collecting_data_stage')}: ${Tr('purchase_group_stage_start_date')}: ${resp.errors[field].join(\", \")}`;\r\n                            break;\r\n                        default:\r\n                            error = `${resp.errors[field].join(\", \")}`\r\n                    }\r\n                    enqueueErrorSnackbar(error)\r\n                })\r\n\r\n            } else if (resp) {\r\n                enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + validationSection.name);\r\n                PurchasingGroupSectionService.getSections(groupId, [validationSection.section, PurchasingGroupStageSections.STAGE_2_SECTION])\r\n                closeSection();\r\n            }\r\n\r\n        })\r\n    }\r\n\r\n    if (!schedule) return <Loading/>\r\n\r\n    return (<div>\r\n            <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>\r\n            <Form\r\n                id={formId}\r\n                initialValues={{\r\n                    swzOpinionStartDate: schedule.schedule.swzOpinionStartDate ? moment(schedule.schedule.swzOpinionStartDate) : null,\r\n                    swzOpinionEndDate: schedule.schedule.swzOpinionEndDate ? moment(schedule.schedule.swzOpinionEndDate) : null,\r\n                    collectingDataStartDate: schedule.schedule.collectingDataStartDate ? moment(schedule.schedule.collectingDataStartDate) : null,\r\n                    collectingDataEndDate: schedule.schedule.collectingDataEndDate ? moment(schedule.schedule.collectingDataEndDate) : null,\r\n                }}\r\n                validationSchema={VS.lazy((form) => {\r\n                    const shape = {}\r\n                    if (schedule.swzOpinionStartDateEditable) {\r\n                        if (!form.swzOpinionEndDate)\r\n                            shape.swzOpinionStartDate = VS.dateTimeMinNoRq(new Date(), Tr('v_time_can_not_be_past'))\r\n                        else\r\n                            shape.swzOpinionStartDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n                    }\r\n                    if (schedule.swzOpinionEndDateEditable) {\r\n                        const swzOpinionStartDate = form.swzOpinionStartDate ? form.swzOpinionStartDate.clone() : moment();\r\n                        swzOpinionStartDate.add(1, \"minute\")\r\n\r\n                        if (!form.swzOpinionStartDate)\r\n                            shape.swzOpinionEndDate = VS.dateTimeMinNoRq(swzOpinionStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        else\r\n                            shape.swzOpinionEndDate = VS.dateTimeMin(swzOpinionStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                    }\r\n\r\n                    if (schedule.collectingDataStartDateEditable) {\r\n                        if(!form.collectingDataEndDate)\r\n                            shape.collectingDataStartDate = VS.dateTimeMinNoRq(new Date(), Tr('v_time_can_not_be_past'))\r\n                        else\r\n                            shape.collectingDataStartDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n                    }\r\n                    if (schedule.collectingDataEndDateEditable) {\r\n                        const collectingDataStartDate = form.collectingDataStartDate ? form.collectingDataStartDate.clone() : moment();\r\n                        collectingDataStartDate.add(1, \"minute\")\r\n\r\n                        if (!form.collectingDataStartDate) {\r\n                            shape.collectingDataEndDate = VS.dateTimeMinNoRq(collectingDataStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        } else {\r\n                            shape.collectingDataEndDate = VS.dateTimeMin(collectingDataStartDate, Tr('v_end_time_can_not_be_before_start'))\r\n                        }\r\n                    }\r\n\r\n                    return VS.object(shape)\r\n                })}\r\n                onSubmit={handleSubmit}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={formId}\r\n                        />\r\n                        <PurchasingGroupStage2ScheduleForm editable={editable} schedule={schedule} formikProps={formikProps}/>\r\n                        {/*<Typography style={{lineBreak: \"anywhere\"}}>{JSON.stringify(schedule)}</Typography>*/}\r\n                    </>)}\r\n            </Form>\r\n        </div>\r\n    )\r\n}\r\n\r\nPurchasingGroupStage2Schedule.propTypes = {}\r\n\r\nexport default PurchasingGroupStage2Schedule;","import React from 'react'\r\nimport {Tooltip, Typography} from '@material-ui/core';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport clsx from 'clsx';\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport ErrorIcon from '@material-ui/icons/Error';\r\nimport HourglassFullIcon from '@material-ui/icons/HourglassFull';\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        '&>*:nth-child(2)': {\r\n            flexGrow: 1,\r\n        }\r\n    },\r\n    cursorPointer: {\r\n        cursor: 'pointer'\r\n    },\r\n    marginRight: {\r\n        marginRight: theme.spacing()\r\n    }\r\n\r\n}))\r\n\r\nfunction TemplateMembersElementTitle(\r\n    {\r\n        groupId,\r\n        index,\r\n        member,\r\n        open,\r\n        onOpen,\r\n        editable,\r\n        coordinatorView,\r\n        validationSection,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n\r\n    return (\r\n        <GridBlock\r\n            alignItems='center'\r\n            wrap='nowrap'\r\n            className={classes.root}\r\n        >\r\n            {!coordinatorView ?\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.marginRight}\r\n                >\r\n                    {index + 1}.\r\n                </Typography>\r\n                : <Typography> </Typography>\r\n            }\r\n\r\n            <BoldTypography\r\n                variant='body1'\r\n                className={clsx({[classes.cursorPointer]: editable})}\r\n                onClick={editable ? onOpen : undefined}\r\n            >\r\n                {member.memberName}\r\n            </BoldTypography>\r\n            {editable && !coordinatorView && !member.allFormsAccepted &&\r\n                <Tooltip title={Tr('purchase_groups_form_waiting_for_accept_exist')} placement=\"top\">\r\n                    <ErrorIcon className={classes.cursorPointer} onClick={onOpen} color='error'/>\r\n                </Tooltip>\r\n            }\r\n            {editable && !coordinatorView && member.askForEditPending &&\r\n                <Tooltip title={Tr('purchase_groups_form_ask_edit_exist')} placement=\"top\">\r\n                    <HourglassFullIcon className={classes.cursorPointer} onClick={onOpen} color='error'/>\r\n                </Tooltip>\r\n            }\r\n            {editable && !coordinatorView && <WorkableIconExpandButton\r\n                color='primary'\r\n                onClick={onOpen}\r\n                expanded={open}\r\n                disabled={!editable}\r\n            />}\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nTemplateMembersElementTitle.propTypes = {}\r\n\r\nexport default TemplateMembersElementTitle;","import Tr from \"translations/Translations\"\r\nexport const PurchasingGroupTemplateFieldType = {\r\n    TEXT: \"TEXT\",\r\n    DATE: \"DATE\",\r\n    NUMBER: \"NUMBER\",\r\n    PERCENTAGE: \"PERCENTAGE\",\r\n    AGGREGATE: \"AGGREGATE\"\r\n}\r\nconst TR_PREFIX = \"template_field_\"\r\nexport const PurchasingGroupTemplateFieldTypeLabel = (type) => Tr(TR_PREFIX + type.toLowerCase());\r\n","import React from 'react'\r\nimport TextInput from \"components/TextInput\";\r\nimport {PurchasingGroupTemplateFieldType} from \"../../../../../templates/constants/PurchasingGroupTemplateFieldType\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"components/Typography\";\r\nimport {Box} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Tr from \"translations/Translations\";\r\nimport DatePicker from \"components/DatePicker\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\n\r\nfunction TemplateMemberFormField(\r\n    {\r\n        formikProps,\r\n        id,\r\n        enabled,\r\n        lastArchiveField,\r\n        classes\r\n    }) {\r\n    const field = getObjectValue(id, formikProps.values, null);\r\n    const createId = (key) => `${id}.${key}`\r\n\r\n    const getInputType = () => {\r\n        switch (field.type) {\r\n            case PurchasingGroupTemplateFieldType.NUMBER:\r\n            case PurchasingGroupTemplateFieldType.AGGREGATE:\r\n                return INPUT_TYPE.NUMBER_DECIMAL\r\n            case PurchasingGroupTemplateFieldType.PERCENTAGE:\r\n                return INPUT_TYPE.NUMBER_POSITIVE_AMOUNT\r\n            default:\r\n                return undefined;\r\n        }\r\n    }\r\n\r\n    const getReadonlyField = () => {\r\n        const difference = !lastArchiveField ? false : (field.type === PurchasingGroupTemplateFieldType.TEXT || field.type === PurchasingGroupTemplateFieldType.DATE ?\r\n            field.textValue !== lastArchiveField.textValue : field.decimalValue !== lastArchiveField.decimalValue)\r\n\r\n        return (<GridBlock className={clsx(classes.fieldGrid, {[classes.gridFieldComparing]: !!lastArchiveField, [classes.difference]: difference})}>\r\n            {!!lastArchiveField && getViewField(lastArchiveField)}\r\n            {getViewField(field)}\r\n        </GridBlock>)\r\n    }\r\n\r\n    const getViewField = (field) => {\r\n        return <Box className={classes.fieldBox}>\r\n            <Typography className={classes.fieldName}>{field.name}</Typography>\r\n            {\r\n                field.type === PurchasingGroupTemplateFieldType.TEXT || field.type === PurchasingGroupTemplateFieldType.DATE ?\r\n                    <Typography\r\n                        className={clsx({[classes.emptyValue]: !field.textValue})}>{!field.textValue ? Tr(\"empty_value\") :\r\n                        field.type === PurchasingGroupTemplateFieldType.DATE ? moment(field.textValue).format(DateFormats.DATE_FORMAT) : \"\"+field.textValue}</Typography> :\r\n                    <Typography className={clsx({[classes.emptyValue]: field.decimalValue === null})}>\r\n                        {field.decimalValue != null ? ((\"\" + field.decimalValue).replaceAll(\".\", \",\") +\r\n                                (field.type === PurchasingGroupTemplateFieldType.PERCENTAGE ? \" %\" : \"\"))\r\n                            : Tr(\"empty_value\")}\r\n                    </Typography>\r\n            }\r\n        </Box>\r\n    }\r\n\r\n    return (\r\n        enabled ?\r\n            (field.type !== PurchasingGroupTemplateFieldType.AGGREGATE) &&\r\n            <>\r\n                {field.type === PurchasingGroupTemplateFieldType.DATE ?\r\n                    <div>\r\n                        <DatePicker\r\n                            label={field.name}\r\n                            formikProps={formikProps}\r\n                            id={createId(\"textValue\")}\r\n                            disabled={!enabled}\r\n                            required={field.required}\r\n                        />\r\n                    </div> :\r\n                    <TextInput\r\n                        label={field.name}\r\n                        formikProps={formikProps}\r\n                        id={createId(PurchasingGroupTemplateFieldType.TEXT === field.type ? \"textValue\" : \"decimalValue\")}\r\n                        disabled={!enabled}\r\n                        type={getInputType()}\r\n                        required={field.required}\r\n                        endAdornment={PurchasingGroupTemplateFieldType.PERCENTAGE === field.type ? \"%\" : undefined}\r\n                        multiline={PurchasingGroupTemplateFieldType.TEXT === field.type}\r\n                    />\r\n                }\r\n            </> :\r\n            getReadonlyField()\r\n    )\r\n}\r\n\r\nTemplateMemberFormField.propTypes = {}\r\n\r\nexport default TemplateMemberFormField;","export const PurchasingGroupTemplateFormState = {\r\n    NEW: \"NEW\",\r\n    SENT: \"SENT\",\r\n    VERIFIED: \"VERIFIED\",\r\n    ASK_FOR_EDIT: \"ASK_FOR_EDIT\",\r\n    EDIT: \"EDIT\"\r\n}","import Tr from \"translations/Translations\";\r\nimport {PurchasingGroupTemplateFieldType} from \"../../../../../templates/constants/PurchasingGroupTemplateFieldType\";\r\nimport moment from \"../../../../../../../../libs/moment\";\r\nimport DateFormats from \"../../../../../../../../constants/DateFormats\";\r\n\r\nexport default (form) => {\r\n    const transformer = {\r\n        purchaserName: {\r\n            id: 'purchaserName',\r\n            label: Tr('name')\r\n        },\r\n    }\r\n\r\n    form.fieldValues.forEach((x, i) => {\r\n        transformer[\"fieldValue_\" + x.identity] = {\r\n            id: `fieldValues.${i}`,\r\n            label: x.name,\r\n            transform: (field) => {\r\n                if (!field)\r\n                    return \"\";\r\n                if (field.type === PurchasingGroupTemplateFieldType.TEXT) {\r\n                    return field.textValue || \"\";\r\n                } else if(field.type === PurchasingGroupTemplateFieldType.DATE){\r\n                    return !!field.textValue ? moment(field.textValue).format(DateFormats.DATE_FORMAT) : \"\";\r\n                } else {\r\n                    if (field.decimalValue != null) {\r\n                        return (\"\" + field.decimalValue).replace(\".\", \",\") + (field.type === PurchasingGroupTemplateFieldType.PERCENTAGE ? \" %\" : \"\")\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    })\r\n    return transformer;\r\n}\r\n\r\nexport const customParamTransformer = {\r\n    decisionType: {\r\n        id: \"decisionType\",\r\n        label: Tr('decision'),\r\n        showOnGrid: true,\r\n        transform: (field) => {\r\n            return field ? Tr(\"decision_type_\" + field.toLowerCase()) : null\r\n        }\r\n    }\r\n}\r\n","import React, {useEffect, useRef, useState} from 'react'\r\nimport {Box, makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Tr from \"translations/Translations\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Form from \"components/Form\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport TemplateMemberFormField from \"./TemplateMemberFormField\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport {PurchasingGroupTemplateFieldType} from \"../../../../../templates/constants/PurchasingGroupTemplateFieldType\";\r\nimport {connect} from \"react-redux\";\r\nimport {PurchasingGroupTemplateFormState} from \"../constants/PurchasingGroupTemplateFormState\";\r\nimport clsx from \"clsx\";\r\nimport Typography from \"components/Typography\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport {PurchasingGroupRole} from \"../../../../constants/PurchasingGroupRole\";\r\nimport HistoryListPopup from \"components/popup/historyListPopup/HistoryListPopup\";\r\nimport HistoryButton from \"components/button/HistoryButton\";\r\nimport PurchasingGroupStage2Service from \"services/PurchasingGroupStage2Service\";\r\nimport propertyTransformer, {customParamTransformer} from \"../history/propertyTransformer\";\r\nimport moment from \"moment\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing()\r\n    },\r\n\r\n\r\n    fieldGrid: {\r\n        paddingBottom: theme.spacing(),\r\n        paddingTop: theme.spacing(2),\r\n        borderBottom: \"solid 1px \" + theme.palette.border.dark\r\n    },\r\n    fieldBox: {\r\n        paddingLeft: theme.spacing(),\r\n        paddingRight: theme.spacing(),\r\n    },\r\n    fieldName: {\r\n        fontSize: '0.75rem'\r\n    },\r\n    gridFieldComparing: {\r\n        '&>.MuiGrid-item': {\r\n            width: \"50%\"\r\n        }\r\n    },\r\n    difference: {\r\n        backgroundColor: theme.palette.warning.light\r\n    },\r\n    emptyValue: {\r\n        color: theme.palette.action.disabled,\r\n        fontStyle: \"italic\"\r\n    }\r\n}))\r\n\r\nfunction TemplateMemberForm(\r\n    {\r\n        groupId,\r\n        member,\r\n        uxFormId,\r\n        editable,\r\n        coordinatorView,\r\n        formWrapper,\r\n        onDiscardChanges,\r\n        onSubmit,\r\n        formSubmit,\r\n        purchasingGroupHeader\r\n    }) {\r\n    const classes = useStyle();\r\n    const newForm = formWrapper.formId === 0;\r\n    const formEditable = formWrapper.editable;\r\n    const [submitter, setSubmitter] = useState(0);\r\n    const [historyPopup, setHistoryPopup] = useState(false);\r\n    const draftMode = useRef(false);\r\n\r\n    const validationSchema = (allOptional) => {\r\n        const getFieldVS = (field) => {\r\n            switch (field.type) {\r\n                case PurchasingGroupTemplateFieldType.NUMBER:\r\n                    return VS.object({decimalValue: allOptional || !field.required ? VS.bigDecimalOptional() : VS.bigDecimal()})\r\n                case PurchasingGroupTemplateFieldType.PERCENTAGE:\r\n                    return VS.object({decimalValue: allOptional || !field.required ? VS.amountMax100Optional() : VS.amountMax100()})\r\n                case PurchasingGroupTemplateFieldType.DATE:\r\n                    return VS.object({textValue: allOptional || !field.required ? VS.dateTimeNoReq() : VS.dateTimeValid()})\r\n                case PurchasingGroupTemplateFieldType.TEXT:\r\n                    return VS.object({textValue: allOptional || !field.required ? VS.stringMaxNoRq(500) : VS.stringMax(500)})\r\n                default:\r\n                    return VS.any();\r\n            }\r\n        }\r\n        return VS.object({\r\n            purchaserName: VS.stringMax(250),\r\n            fieldValues: VS.arrayOf(VS.lazy((value) => {\r\n                return getFieldVS(value)\r\n            }))\r\n        })\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (submitter > 0)\r\n            formSubmit[uxFormId]();\r\n        // eslint-disable-next-line\r\n    }, [submitter])\r\n\r\n    const saveDraft = () => {\r\n        draftMode.current = true;\r\n        setSubmitter(submitter + 1);\r\n    }\r\n\r\n    const saveForm = () => {\r\n        draftMode.current = false;\r\n        setSubmitter(submitter + 1);\r\n    }\r\n\r\n    const getReadonlyNameField = () => {\r\n        const difference = formWrapper.lastArchive ? formWrapper.form.purchaserName !== formWrapper.lastArchive.purchaserName : false;\r\n\r\n        return (\r\n            <>\r\n                {\r\n                    formWrapper.lastArchive &&\r\n                    <GridBlock className={clsx(classes.fieldGrid, classes.gridFieldComparing)}>\r\n                        <Box className={classes.fieldBox}>\r\n                            <BoldTypography>{Tr(\"change_before\")}</BoldTypography>\r\n                        </Box>\r\n                        <Box className={classes.fieldBox}>\r\n                            <BoldTypography>{Tr(\"change_after\")}</BoldTypography>\r\n                        </Box>\r\n                    </GridBlock>\r\n                }\r\n                <GridBlock className={clsx(classes.fieldGrid, {[classes.gridFieldComparing]: !!formWrapper.lastArchive, [classes.difference]: difference})}>\r\n                    {!!formWrapper.lastArchive && getViewNameField(formWrapper.lastArchive.purchaserName)}\r\n                    {getViewNameField(formWrapper.form.purchaserName)}\r\n                </GridBlock>\r\n            </>)\r\n    }\r\n\r\n    const getViewNameField = (value) => {\r\n        return <Box className={classes.fieldBox}>\r\n            <Typography className={classes.fieldName}>{Tr(\"name\")}</Typography>\r\n            <Typography>{value}</Typography>\r\n        </Box>\r\n    }\r\n    const loadHistoryList = async () => {\r\n        try {\r\n            return await PurchasingGroupStage2Service.getArchiveList(groupId, member.memberId, formWrapper.formId)\r\n        } catch (e) {\r\n            setHistoryPopup(false);\r\n        }\r\n    }\r\n\r\n    const loadHistoryElement = async (archiveId) => {\r\n        return await PurchasingGroupStage2Service.getArchiveElement(groupId, member.memberId, formWrapper.formId, archiveId);\r\n    }\r\n\r\n    return (<div className={classes.root}>\r\n        <Form\r\n            id={uxFormId}\r\n            initialValues={{\r\n                purchaserName: formWrapper.form.purchaserName,\r\n                fieldValues: formWrapper.form.fieldValues.map(field => field.type === PurchasingGroupTemplateFieldType.DATE ? {\r\n                ...field,\r\n                textValue: !field.textValue ? null : moment(field.textValue)\r\n            } : field)\r\n            }}\r\n            validationSchema={validationSchema(draftMode.current)}\r\n            onSubmit={(values) => onSubmit(draftMode.current ? \"draft\" : \"save\", values)}>\r\n            {(formikProps) => (<>\r\n                <SaveFormikValues\r\n                    formikProps={formikProps}\r\n                    id={uxFormId}\r\n                />\r\n                {\r\n                    (formWrapper.hasAskedForEdit && !formWrapper.editable) && <BoldTypography>{Tr(\"purchase_groups_form_ask_edit\")}</BoldTypography>\r\n                }\r\n                <GridBlock justify=\"space-between\">\r\n                    {newForm ? <BoldTypography variant=\"h6\">Nowy formularz</BoldTypography> : <div></div>}\r\n                    <div>\r\n                        {\r\n                            !newForm &&  <HistoryButton onClick={() => setHistoryPopup(true)}>\r\n                                {Tr('change_history')}\r\n                            </HistoryButton>\r\n                        }\r\n\r\n                        {\r\n                            formWrapper.canAskForEdit && <Button className={classes.marginLeft}\r\n                                                                 onClick={() => onSubmit(\"askForEdit\")}\r\n                                                                 variant=\"outlined\">{Tr(\"purchasing_group_form_ask_for_edit\")}</Button>\r\n                        }\r\n\r\n                        {\r\n                            (purchasingGroupHeader.userRole === PurchasingGroupRole.ADMIN && formWrapper.form.state === PurchasingGroupTemplateFormState.ASK_FOR_EDIT) && <>\r\n                                <Button className={classes.marginLeft} onClick={() => onSubmit(\"allowEdit\")}>{Tr(\"purchasing_group_form_edit_allow_edit\")}</Button>\r\n                                <Button className={classes.marginLeft} onClick={() => onSubmit(\"rejectEdit\")} variant=\"outlined\">{Tr(\"purchasing_group_form_edit_reject_edit\")}</Button>\r\n                            </>\r\n                        }\r\n\r\n                        {\r\n                            formEditable &&\r\n                            <Button className={classes.marginLeft} disabled={!(newForm || formikProps.dirty)} onClick={onDiscardChanges}\r\n                                    variant=\"outlined\">{Tr(\"discard_changes\")}</Button>\r\n                        }\r\n                        {\r\n                            !coordinatorView && editable && formWrapper.form.state === PurchasingGroupTemplateFormState.SENT && <>\r\n                                <Button className={classes.marginLeft} onClick={() => onSubmit(\"accept\")}>{Tr(\"accept\")}</Button>\r\n                                <Button className={classes.marginLeft} onClick={() => onSubmit(\"reject\")} variant=\"outlined\">{Tr(\"reject\")}</Button>\r\n                            </>\r\n                        }\r\n\r\n                        {(coordinatorView && formEditable && formWrapper.form.state !== PurchasingGroupTemplateFormState.EDIT) && <Button className={classes.marginLeft} disabled={!(newForm || formikProps.dirty)}\r\n                                                    onClick={() => saveDraft(formikProps)} variant=\"outlined\">{Tr(\"save_draft_version\")}</Button>\r\n                        }\r\n                        {(coordinatorView && formEditable) && formWrapper.hasDraftSaved &&\r\n                            <Button className={classes.marginLeft} onClick={() => onSubmit(\"clearDraft\")}\r\n                                    variant=\"outlined\">{Tr(\"delete_draft_version\")}</Button>\r\n                        }\r\n                        {formEditable &&\r\n                            <Button onClick={() => saveForm(formikProps)} className={classes.marginLeft}>{Tr(coordinatorView ? \"send\" : \"save\")}</Button>}\r\n                    </div>\r\n                </GridBlock>\r\n\r\n\r\n\r\n                {\r\n                    formEditable ?\r\n                        <TextInput\r\n                            id=\"purchaserName\"\r\n                            formikProps={formikProps}\r\n                            required\r\n                            multiline\r\n                            label={Tr(\"name\")}\r\n                            disabled={!formEditable}\r\n                        /> : getReadonlyNameField()\r\n                }\r\n\r\n\r\n                {\r\n                    formWrapper.form.fieldValues.map((field, i) =>\r\n                        <TemplateMemberFormField\r\n                            key={field.identity}\r\n                            id={`fieldValues.${i}`}\r\n                            formikProps={formikProps}\r\n                            enabled={formEditable}\r\n                            lastArchiveField={formWrapper.lastArchive ? formWrapper.lastArchive.fieldValues.find(x => x.identity === field.identity) : undefined}\r\n                            classes={classes}\r\n                        />)\r\n                }\r\n\r\n            </>)}\r\n        </Form>\r\n        {historyPopup && <HistoryListPopup loadHistoryElement={loadHistoryElement} loadHistoryList={loadHistoryList} onClose={() => setHistoryPopup(false)}\r\n                                        propertyTransformer={propertyTransformer(formWrapper.form)} customParamTransformer={customParamTransformer}/>}\r\n    </div>)\r\n}\r\n\r\nTemplateMemberForm.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    purchasingGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID],\r\n    formSubmit: state.form\r\n}), {})(TemplateMemberForm);","import React, {useEffect, useState} from 'react'\r\nimport Loading from \"components/Loading\";\r\nimport {connect} from \"react-redux\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport PurchasingGroupStage2Service from \"services/PurchasingGroupStage2Service\";\r\nimport Tabs from \"components/Tabs\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport AddIcon from '@material-ui/icons/AddBoxOutlined'\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport TemplateMemberForm from \"./TemplateMemberForm\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';\r\nimport {Tooltip} from \"@material-ui/core\";\r\nimport {PurchasingGroupTemplateFormState} from \"../constants/PurchasingGroupTemplateFormState\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    },\r\n    grid: {\r\n        flexWrap: \"nowrap\",\r\n        \"&>*:nth-child(2)\": {\r\n            flexGrow: 1\r\n        }\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction TemplateMembersElementContent(\r\n    {\r\n        groupId,\r\n        member,\r\n        coordinatorView,\r\n        editable,\r\n        memberData,\r\n        validationSection,\r\n        stageSections,\r\n        groupHeader,\r\n        uxFormId,\r\n        formValues,\r\n    }) {\r\n    const classes = useStyle();\r\n    const [selectedFormId, setSelectedFormId] = useState(0);\r\n    const [addFormWorking, setAddFormWorking] = useState(false);\r\n    const [formWrapper, setFormWrapper] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage2Service.getTemplateMember(groupId, member.memberId).then((resp) => {\r\n            if (resp && resp.formList.length > 0) {\r\n                setSelectedFormId(resp.formList[0].formId)\r\n                loadForm(resp.formList[0].formId)\r\n            }\r\n        });\r\n\r\n        return () => {\r\n            PurchasingGroupStage2Service.clearResources(PurchasingGroupStage2Service.PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID(member.memberId))\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const loadForm = (formId) => {\r\n        setSelectedFormId(formId)\r\n        setAddFormWorking(true);\r\n        PurchasingGroupStage2Service.getTemplateMemberForm(groupId, member.memberId, formId).then(resp => {\r\n            setFormWrapper(resp)\r\n        }).finally(() => setAddFormWorking(false))\r\n    }\r\n\r\n    const checkFormDirty = (func) => {\r\n        if (!!formValues[uxFormId + \"_dirty\"]) {\r\n            simpleConfirm(\"modification_cancel_popup_text\", () => {\r\n                func();\r\n            })\r\n        } else {\r\n            func();\r\n        }\r\n    }\r\n\r\n    const chooseForm = (formId) => {\r\n        checkFormDirty(() => loadForm(formId))\r\n    }\r\n\r\n    const addForm = () => {\r\n        checkFormDirty(() => loadForm(0))\r\n    }\r\n\r\n    const discardChanges = () => {\r\n        checkFormDirty(() => doDiscardChanges())\r\n    }\r\n\r\n    const doDiscardChanges = () => {\r\n        if (selectedFormId === 0) {\r\n            if (memberData.formList.length > 0) {\r\n\r\n                loadForm(memberData.formList[0].formId);\r\n            } else {\r\n                setFormWrapper(null)\r\n            }\r\n        } else {\r\n            setFormWrapper(null);\r\n            loadForm(selectedFormId);\r\n        }\r\n    }\r\n\r\n\r\n    const onSubmit = (mode, values) => {\r\n        let func;\r\n\r\n        switch (mode) {\r\n            case \"save\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberForm\r\n                break;\r\n            case \"draft\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormDraft\r\n                break;\r\n            case \"clearDraft\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormClearDraft\r\n                break;\r\n            case \"accept\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormAccept\r\n                break;\r\n            case \"reject\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormReject\r\n                break;\r\n            case \"askForEdit\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormAskForEdit\r\n                break;\r\n            case \"allowEdit\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormAllowEdit\r\n                break;\r\n            case \"rejectEdit\":\r\n                func = PurchasingGroupStage2Service.saveTemplateMemberFormRejectEdit\r\n                break;\r\n            default:\r\n                throw new Error(`Not supported mode: ${mode}`)\r\n        }\r\n\r\n        func(groupId, member.memberId, formWrapper.formId, values)\r\n            .then(resp => {\r\n                if (resp) {\r\n                    setFormWrapper(null);\r\n                    if (formWrapper.formId === 0) {\r\n                        setAddFormWorking(true)\r\n                        PurchasingGroupStage2Service.getTemplateMember(groupId, member.memberId).then(() => {\r\n                            loadForm(resp.formId)\r\n                        });\r\n                    } else {\r\n                        setTimeout(setFormWrapper, 100, resp)\r\n                    }\r\n                    if(\"accept\" === mode || \"allowEdit\" === mode) {\r\n                        enqueueSuccessSnackbar(\"😀 \" + Tr(\"confirmed\"))\r\n                    } else if(\"rejectEdit\" === mode || \"reject\" === mode) {\r\n                        enqueueSuccessSnackbar(\"😒 \" + Tr(\"rejected\") )\r\n                    } else if(\"askForEdit\" === mode) {\r\n                        enqueueSuccessSnackbar(\"🙏 \" + Tr(\"purchase_groups_form_ask_edit\") )\r\n                    } else  {\r\n                        enqueueSuccessSnackbar(\"🫡 \" + Tr(\"saved\"))\r\n                    }\r\n                    PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n                }\r\n            })\r\n    }\r\n\r\n    const getIcon = (formListElement) => {\r\n        switch (formListElement.state) {\r\n            case PurchasingGroupTemplateFormState.ASK_FOR_EDIT:\r\n                return <Tooltip title={Tr('purchase_groups_form_ask_edit')} placement=\"top\">\r\n                    <HourglassEmptyIcon color='error'/>\r\n                </Tooltip>\r\n            case PurchasingGroupTemplateFormState.SENT:\r\n                return <Tooltip title={Tr('purchase_groups_form_waiting_for_accept')} placement=\"top\">\r\n                    <ErrorOutlineIcon color='error'/>\r\n                </Tooltip>\r\n            default :\r\n                return undefined;\r\n        }\r\n    }\r\n\r\n\r\n    if (!memberData)\r\n        return <Loading/>\r\n    return (<div className={classes.root}>\r\n        {coordinatorView && <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>}\r\n        {editable && validationSection.addTplAvailable && (!formWrapper || formWrapper.formId > 0) &&\r\n            <WorkableButton disabled={addFormWorking} className={classes.marginBottom} Icon={AddIcon} variant=\"outlined\"\r\n                            onClick={addForm}>{Tr(\"purchase_groups_form_add\")}</WorkableButton>}\r\n\r\n        {\r\n\r\n            <GridBlock className={classes.grid}>\r\n                {\r\n                    !!selectedFormId && memberData.formList.length > 1 && (!formWrapper || formWrapper.formId > 0) ?\r\n                        <Tabs\r\n                            tabs={memberData.formList.map(x => ({\r\n                                label: x.purchaserName,\r\n                                value: x.formId,\r\n                                disabled: addFormWorking,\r\n                                icon: getIcon(x)\r\n                            }))}\r\n                            value={selectedFormId}\r\n                            onChange={chooseForm}\r\n                            vertical\r\n                        /> : <div></div>\r\n                }\r\n                {addFormWorking && <Loading/>}\r\n                {!addFormWorking && !!formWrapper &&\r\n                    <TemplateMemberForm\r\n                        groupId={groupId}\r\n                        member={memberData}\r\n                        formWrapper={formWrapper}\r\n                        uxFormId={uxFormId}\r\n                        onDiscardChanges={discardChanges}\r\n                        onSubmit={onSubmit}\r\n                        editable={editable}\r\n                        coordinatorView={coordinatorView}\r\n                    />\r\n                }\r\n            </GridBlock>\r\n        }\r\n\r\n    </div>)\r\n}\r\n\r\nTemplateMembersElementContent.propTypes = {}\r\n\r\nexport default connect((state, {member}) => ({\r\n    memberData: state.resources[PurchasingGroupStage2Service.PURCHASING_GROUP_TEMPLATE_MEMBER_RESOURCE_ID(member.memberId)],\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n    groupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID],\r\n    formValues: state.formValues\r\n}), {})(TemplateMembersElementContent);","import React, {useState} from 'react'\r\nimport {Collapse, makeStyles} from \"@material-ui/core\";\r\nimport MembersElementTitle from \"./TemplateMembersElementTitle\";\r\nimport TemplateMembersElementContent from \"./TemplateMembersElementContent\";\r\nimport PropTypes from \"prop-types\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport {connect} from \"react-redux\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        padding: `${theme.spacing()}px ${theme.spacing(2)}px`,\r\n        marginBottom: theme.spacing()\r\n    }\r\n}))\r\n\r\nfunction TemplateMembersElement(\r\n    {\r\n        index,\r\n        groupId,\r\n        member,\r\n        coordinatorView,\r\n        editable,\r\n        search,\r\n        validationSection,\r\n        formIdPrefix,\r\n        formValues\r\n    }) {\r\n    const classes = useStyle();\r\n    const [open, setOpen] = useState(false);\r\n    const FORM_ID = formIdPrefix + member.memberId;\r\n\r\n    const toggleMember = () => {\r\n        if (open && !!formValues[FORM_ID + \"_dirty\"]) {\r\n            simpleConfirm(\"modification_cancel_popup_text\", () => {\r\n                setOpen(!open)\r\n            })\r\n        } else {\r\n            setOpen(!open)\r\n        }\r\n    }\r\n\r\n\r\n    return (<Collapse in={!search.search || member.memberName.toLowerCase().indexOf(search.search.toLowerCase()) > -1} unmountOnExit={false}>\r\n        <div className={classes.root}>\r\n            <MembersElementTitle\r\n                groupId={groupId}\r\n                editable={editable}\r\n                index={index}\r\n                member={member}\r\n                open={open}\r\n                onOpen={toggleMember}\r\n                coordinatorView={coordinatorView}\r\n                validationSection={validationSection}\r\n            />\r\n            <Collapse in={coordinatorView || open} unmountOnExit>\r\n                <TemplateMembersElementContent\r\n                    groupId={groupId}\r\n                    member={member}\r\n                    coordinatorView={coordinatorView}\r\n                    editable={editable}\r\n                    validationSection={validationSection}\r\n                    uxFormId={FORM_ID}\r\n\r\n                />\r\n            </Collapse>\r\n        </div>\r\n    </Collapse>)\r\n}\r\n\r\nTemplateMembersElement.propTypes = {\r\n    index: PropTypes.number,\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    member: PropTypes.shape({\r\n        allFormsAccepted: PropTypes.bool.isRequired,\r\n        memberId: PropTypes.number.isRequired,\r\n        memberName: PropTypes.string.isRequired\r\n    }),\r\n    coordinatorView: PropTypes.bool.isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    search: PropTypes.shape({\r\n        search: PropTypes.string\r\n    }).isRequired,\r\n    validationSection: PropTypes.object.isRequired,\r\n    formIdPrefix: PropTypes.string.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formValues: state.formValues\r\n}), {})(TemplateMembersElement);","import React, {useState} from 'react'\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport TemplateMembersElement from \"./TemplateMembersElement\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    search: {\r\n        marginTop: theme.spacing(3),\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction TemplateMembersList(\r\n    {\r\n        groupId,\r\n        members,\r\n        coordinatorView,\r\n        editable,\r\n        validationSection,\r\n        formIdPrefix\r\n    }) {\r\n    const classes = useStyle();\r\n    const [search, setSearch] = useState({});\r\n\r\n    return (<div className={classes.root}>\r\n        {!coordinatorView && <BasicSearch className={classes.search} doSearch={setSearch} label={Tr('search_member')}/>}\r\n        {\r\n            members.map((x, i) => (<TemplateMembersElement\r\n                key={x.memberId}\r\n                index={i}\r\n                groupId={groupId}\r\n                member={x}\r\n                search={search}\r\n                coordinatorView={coordinatorView}\r\n                editable={editable}\r\n                validationSection={validationSection}\r\n                formIdPrefix={formIdPrefix}\r\n            />))\r\n        }\r\n    </div>)\r\n}\r\n\r\nTemplateMembersList.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    members: PropTypes.array.isRequired,\r\n    coordinatorView: PropTypes.bool.isRequired,\r\n    editable: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default TemplateMembersList;","import React, {useEffect, useRef, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport Loading from \"components/Loading\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport scheduleReloadTimeout from \"../../../utils/scheduleReloadTimeout\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\nimport UserService from \"services/UserService\";\r\nimport PurchasingGroupStage2Service from \"services/PurchasingGroupStage2Service\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Tr from \"translations/Translations\";\r\nimport SelectOrganization from \"components/popup/selectOrganization/SelectOrganization\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport TemplateMembersList from \"./components/TemplateMembersList\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport reduxStore from \"redux/store\"\r\nimport {PurchasingGroupRole} from \"../../../constants/PurchasingGroupRole\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage2Template(\r\n    {\r\n        panelRef,\r\n        validationSection,\r\n        template,\r\n        purchasingGroupHeader,\r\n        stageSections\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const formIdPrefix = params.section;\r\n    const [availableTemplates, setAvailableTemplates] = useState(null);\r\n    const timeout = useRef(0);\r\n    const coordinatorView = purchasingGroupHeader.userRole === PurchasingGroupRole.MEMBER;\r\n    const editable = validationSection.editable;\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    useStepperStateCloseValidator(formIdPrefix, () => {\r\n        const formValues = reduxStore.getState()?.formValues;\r\n        const index = Object.keys(formValues).findIndex(formId => formId.startsWith(formIdPrefix) && formId.endsWith(\"_dirty\") && formValues[formId] === true);\r\n        return index === -1;\r\n    });\r\n\r\n\r\n    const getTemplate = () => {\r\n        if (timeout.current) {\r\n            clearTimeout(timeout.current);\r\n            timeout.current = 0;\r\n        }\r\n        PurchasingGroupStage2Service.getTemplate(groupId);\r\n\r\n        const mainSection = stageSections[PurchasingGroupStageSections.STAGE_2_SECTION];\r\n        if (mainSection && mainSection.schedule) {\r\n            UserService.serverTime().then(serverTime => {\r\n                let reloadTimeout = scheduleReloadTimeout(mainSection.schedule, serverTime);\r\n                if (reloadTimeout) {\r\n                    timeout.current = setTimeout(() => {\r\n                        getTemplate();\r\n                    }, reloadTimeout)\r\n                }\r\n            })\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        getTemplate();\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n        return () => {\r\n            if (timeout.current) {\r\n                clearTimeout(timeout.current);\r\n                timeout.current = 0;\r\n            }\r\n            PurchasingGroupStage2Service.clearResources(PurchasingGroupStage2Service.PURCHASING_GROUP_TEMPLATE_RESOURCE_ID)\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    const loadAvailableTemplates = () => {\r\n        PurchasingGroupStage2Service.getAvailableTemplates(groupId).then((resp) => setAvailableTemplates(resp))\r\n    }\r\n    const onTemplateSelect = (value) => {\r\n        setAvailableTemplates(null);\r\n        PurchasingGroupStage2Service.saveTemplate(groupId, {templateId: value.orgId, templateName: value.name})\r\n            .then((resp) => {\r\n                if (resp) {\r\n                    enqueueSuccessSnackbar(Tr(\"saved\"));\r\n                    PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n                }\r\n            });\r\n    }\r\n\r\n    if (!template) return <Loading/>\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            {!coordinatorView && <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>}\r\n            {!coordinatorView && <GridBlock alignItems=\"center\">\r\n                {template.canChooseTemplate &&\r\n                    <WorkableButton onClick={loadAvailableTemplates}>{Tr(\"choose_template\")}</WorkableButton>\r\n                }\r\n                {template.templateId > 0 &&\r\n                    <BoldTypography className={classes.marginLeft}>{Tr(\"chosen_template\")}: {template.templateName}</BoldTypography>\r\n                }\r\n            </GridBlock>}\r\n\r\n            <TemplateMembersList\r\n                validationSection={validationSection}\r\n                editable={editable && template.canFillForm}\r\n                members={template.memberList}\r\n                coordinatorView={coordinatorView}\r\n                groupId={groupId}\r\n                formIdPrefix={formIdPrefix}\r\n            />\r\n\r\n\r\n            {!!availableTemplates &&\r\n                <SelectOrganization\r\n                    initOrganization={{orgId: null, name: null}}\r\n                    availableOrganizations={availableTemplates.map(x => ({orgId: \"\" + x.templateId, name: x.templateName}))}\r\n                    onCancel={() => setAvailableTemplates(null)}\r\n                    onConfirm={onTemplateSelect}\r\n                    open\r\n                    title=\"choose_template\"\r\n                />\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nPurchasingGroupStage2Template.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n    template: state.resources[PurchasingGroupStage2Service.PURCHASING_GROUP_TEMPLATE_RESOURCE_ID],\r\n    purchasingGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID]\r\n}), {})(PurchasingGroupStage2Template);","import React, {useEffect} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport PositionAndPartsForm from \"../../../../../MyProcedure/scenes/part1/panels/dealings/PositionAndPartsForm\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\n\r\nfunction PurchasingGroupStage2Dealing(\r\n    {\r\n        panelRef,\r\n        validationSection,\r\n        purchasingGroupHeader,\r\n    }) {\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const section = params.section;\r\n\r\n    useEffect(() => {\r\n        DealingsService.getList(groupId);\r\n        PurchasingGroupSectionService.getSections(groupId, validationSection.section)\r\n        return () => {\r\n            DealingsService.clearResources('dealing');\r\n            DealingsService.clearResources('dealingsList');\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    const saveSuccessCallback = () => {\r\n        PurchasingGroupSectionService.getSections(groupId, [validationSection.section, PurchasingGroupStageSections.FINISH]);\r\n        RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n            id: groupId,\r\n            stage: 2\r\n        }))\r\n    }\r\n\r\n    const saveErrorCallback = () => {\r\n\r\n    }\r\n\r\n\r\n    return (<PositionAndPartsForm\r\n        expanded\r\n        section={validationSection}\r\n        formId={section}\r\n        saveErrorCallback={saveErrorCallback}\r\n        saveSuccessCallback={saveSuccessCallback}\r\n    />)\r\n}\r\n\r\nPurchasingGroupStage2Dealing.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n    purchasingGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID]\r\n}), {})(PurchasingGroupStage2Dealing);","import React, {useRef, useState} from 'react'\r\nimport ButtonGroup from '@material-ui/core/ButtonGroup';\r\nimport ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';\r\nimport ClickAwayListener from '@material-ui/core/ClickAwayListener';\r\nimport Paper from '@material-ui/core/Paper';\r\nimport Popper from '@material-ui/core/Popper';\r\nimport MenuItem from '@material-ui/core/MenuItem';\r\nimport MenuList from '@material-ui/core/MenuList';\r\nimport PropTypes from 'prop-types';\r\nimport Button from 'components/Button';\r\nimport {CircularProgress, withStyles} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    zindex: {\r\n        zIndex: 100\r\n    }\r\n})\r\n\r\nfunction SplitButton(\r\n    {\r\n        className,\r\n        buttonClassName,\r\n        classes,\r\n        label= Tr('additional_actions'),\r\n        variant = 'contained',\r\n        color = 'primary',\r\n        working,\r\n        disabled,\r\n        buttons,//created by createButton\r\n        hideEmpty\r\n    }) {\r\n\r\n    const [open, setOpen] = useState(false);\r\n    const anchorRef = useRef(null);\r\n\r\n    const handleClick = (event, index) => {\r\n        setOpen(false);\r\n        buttons[index].onClick();\r\n    };\r\n\r\n    const handleToggle = () => {\r\n        setOpen((prevOpen) => !prevOpen);\r\n    };\r\n\r\n    const handleClose = (event) => {\r\n        if (anchorRef.current && anchorRef.current.contains(event.target)) {\r\n            return;\r\n        }\r\n        setOpen(false);\r\n    };\r\n\r\n\r\n    return (\r\n        buttons.length === 0 && !!hideEmpty ?\r\n            null\r\n            : <>\r\n            <ButtonGroup className={className} variant={variant} color={color} ref={anchorRef} >\r\n                <Button className={buttonClassName} onClick={handleToggle} disabled={disabled}>{label}</Button>\r\n                <Button\r\n                    color=\"primary\"\r\n                    size=\"small\"\r\n                    disabled={disabled}\r\n                    aria-controls={open ? 'split-button-menu' : undefined}\r\n                    aria-expanded={open ? 'true' : undefined}\r\n                    aria-haspopup=\"menu\"\r\n                    onClick={handleToggle}\r\n                >\r\n                    {working ? <CircularProgress size={24}/> : <ArrowDropDownIcon/>}\r\n                </Button>\r\n            </ButtonGroup>\r\n            <Popper className={classes.zindex} open={open} anchorEl={anchorRef.current} role={undefined} transition disablePortal placement=\"bottom-end\">\r\n                <Paper>\r\n                    <ClickAwayListener onClickAway={handleClose}>\r\n                        <MenuList id=\"split-button-menu\">\r\n                            {buttons.map((button, index) => (\r\n                                <MenuItem\r\n                                    key={button.label}\r\n                                    disabled={working || button.disabled}\r\n                                    onClick={(event) => handleClick(event, index)}\r\n                                >\r\n                                    {button.label}\r\n                                </MenuItem>\r\n                            ))}\r\n                        </MenuList>\r\n                    </ClickAwayListener>\r\n                </Paper>\r\n            </Popper>\r\n        </>\r\n    )\r\n}\r\n\r\nSplitButton.propTypes = {\r\n    className: PropTypes.string,\r\n    classes: PropTypes.any,\r\n    buttonClassName: PropTypes.string,\r\n    label: PropTypes.string.isRequired,\r\n    variant: PropTypes.oneOf([\"text\", \"outlined\", \"contained\"]),\r\n    color: PropTypes.string,\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    buttons: PropTypes.array.isRequired,//created by createButton\r\n    hideEmpty:PropTypes.bool,\r\n}\r\n\r\nSplitButton.defaultProps = {}\r\n\r\nexport const createButton = (label, onClick, disabled = false) => ({\r\n    label,\r\n    onClick,\r\n    disabled\r\n});\r\n\r\n\r\nexport default withStyles(style)(SplitButton);","import React, {useEffect, useMemo, useState} from 'react'\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {useParams} from \"react-router\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport PurchasingGroupStage2Service from \"services/PurchasingGroupStage2Service\";\r\nimport Loading from \"components/Loading\";\r\nimport Tr from \"translations/Translations\";\r\nimport SplitButton, {createButton as createSplitButton} from \"components/popup/components/SplitButton\";\r\nimport {PurchasingGroupStageSections} from \"../../../constants/PurchasingGroupStageSections\";\r\nimport {ProcedureType, ProcedureTypeTr} from \"constants/ProcedureType\";\r\nimport {confirmComplex} from \"libs/ConfirmNotification\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {connect} from \"react-redux\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport Typography from \"components/Typography\";\r\nimport Button from \"components/Button\";\r\nimport RouterPath from \"../../../../../../../libs/RouterPath\";\r\nimport PurchasingGroupStage1Service from \"../../../../../../../services/PurchasingGroupStage1Service\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupStage2Finish(\r\n    {\r\n        panelRef,\r\n        validationSection,\r\n        stageSections\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const editable = validationSection.editable;\r\n    const [working, setWorking] = useState(false);\r\n    const [finishData, setFinishData] = useState(null);\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n\r\n    const getSectionData = async () => {\r\n        await PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.FINISH)\r\n        const section = await PurchasingGroupStage2Service.getFinish(groupId);\r\n        if (section) {\r\n            setFinishData(section);\r\n        }\r\n        return section;\r\n    }\r\n\r\n    useEffect(() => {\r\n        getSectionData();\r\n        // eslint-disable-next-line\r\n    }, [groupId]);\r\n\r\n    const createDemand = (type) => {\r\n\r\n        confirmComplex({\r\n            confirmText: Tr(\"create_new_procedure_confirm\"),\r\n            confirmText2: ProcedureTypeTr[ProcedureType[type]],\r\n            onConfirm: () => {\r\n                setWorking(true);\r\n\r\n                PurchasingGroupStage2Service.saveFinish(groupId, {item: type}).then((resp) => {\r\n                    if (resp) {\r\n                        PurchasingGroupStage2Service.createDemand(resp.result).then(() => {\r\n                            getSectionData().then(resp => {\r\n                                if(resp.demandId && resp.hasDemandPrivilege) {\r\n                                    RouterPath.redirect(RouterPath.createPath(RouterPath.myProcedure.steps.MP_1_ID, {id: resp.demandId}));\r\n                                } else {\r\n                                    PurchasingGroupStage1Service.getHeader(groupId);\r\n                                }\r\n                            }).finally((resp) => {\r\n                                setWorking(false);\r\n                                enqueueSuccessSnackbar(Tr(\"demand_created\"))\r\n                            });\r\n                        })\r\n                    }\r\n                })\r\n            },\r\n            translateConfirmTexts: false\r\n        })\r\n\r\n\r\n    }\r\n\r\n    const buttons = useMemo(() => finishData ? finishData.procedureTypes.map(x =>\r\n            createSplitButton(ProcedureTypeTr[ProcedureType[x]], () => createDemand(x), !editable)) : [],\r\n        // eslint-disable-next-line\r\n        [finishData, editable])\r\n\r\n    const sectionErrors = useMemo(() => {\r\n        return Object.keys(stageSections).map(x => stageSections[x])\r\n            .filter(x => x.section !== validationSection.section && (x.status === DemandValidationSectionStatus.ERROR || x.status === DemandValidationSectionStatus.DISABLED))\r\n            .map(x => x.name)\r\n    }, [stageSections, validationSection])\r\n\r\n    const sendDealingsChangedNotification = () => {\r\n        setWorking(true);\r\n        PurchasingGroupStage2Service.sendDealingsChangedNotification(groupId).then(resp => {\r\n            setWorking(false);\r\n            if (resp && resp.result) {\r\n                enqueueSuccessSnackbar(Tr(\"notification_sent\"));\r\n                PurchasingGroupSectionService.getSections(groupId, validationSection.section);\r\n                PurchasingGroupStage2Service.getFinish(groupId).then(section => {\r\n                    if (section) {\r\n                        setFinishData(section);\r\n                    }\r\n                });\r\n            } else {\r\n                enqueueErrorSnackbar(Tr(\"unknown_error_message\"));\r\n            }\r\n        });\r\n    }\r\n\r\n\r\n    return (<div className={classes.root}>\r\n        <DemandValidationMessages editable={validationSection.editable} section={validationSection}/>\r\n\r\n        <GridBlock\r\n            direction='column'\r\n            alignItems='center'\r\n        >\r\n            {\r\n\r\n                !finishData ? <Loading/> :\r\n                    <>\r\n                        {finishData.hasDemandCreated && <BoldTypography>{Tr(\"demand_created\")}</BoldTypography>}\r\n\r\n                        {\r\n                            sectionErrors.length > 0 ?\r\n                                <Typography color=\"error\">{`${Tr(\"purchase_group_finish_missing_sections\")}: ${sectionErrors.join(\", \")}`}</Typography>\r\n                                :\r\n                                <SplitButton\r\n                                    label={Tr('create_new_procedure')}\r\n                                    working={working}\r\n                                    buttonClassName={classes.buttonPrint}\r\n                                    disabled={!editable || working}\r\n                                    buttons={buttons}\r\n                                    variant=\"outlined\"\r\n                                    hideEmpty\r\n                                />\r\n                        }\r\n\r\n                        {finishData.canSendDealingsChangedNotification &&\r\n                            <Button\r\n                                disabled={working}\r\n                                onClick={() => sendDealingsChangedNotification()}\r\n                            >\r\n                                {Tr('purchase_group_finish_dealings_changed_notification_send')}\r\n                            </Button>\r\n                        }\r\n                    </>\r\n            }\r\n        </GridBlock>\r\n    </div>)\r\n}\r\n\r\nPurchasingGroupStage2Finish.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID]\r\n}))(PurchasingGroupStage2Finish);","import {kebabCase} from \"lodash/string\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport PurchasingGroupStage1BasicData from \"../stage1/panels/basicData/PurchasingGroupStage1BasicData\";\r\nimport PurchasingGroupStage1Commission from \"../stage1/panels/commission/PurchasingGroupStage1Commission\";\r\nimport PurchasingGroupStage1Schedule from \"../stage1/panels/schedule/PurchasingGroupStage1Schedule\";\r\nimport PurchasingGroupStage1Members from \"../stage1/panels/members/PurchasingGroupStage1Members\";\r\nimport PurchasingGroupStage1PapersGenerator from \"../stage1/panels/papersGenerator/PurchasingGroupStage1PapersGenerator\";\r\nimport PurchasingGroupStage1Opinion from \"../stage1/panels/opinion/PurchasingGroupStage1Opinion\";\r\nimport PurchasingGroupStage1FinishPreparing from \"../stage1/panels/finishPreparing/PurchasingGroupStage1FinishPreparing\";\r\nimport PurchasingGroupStage2Schedule from \"../stage2/panels/collectingSchedule/PurchasingGroupStage2Schedule\";\r\nimport PurchasingGroupStage2Template from \"../stage2/panels/template/PurchasingGroupStage2Template\";\r\nimport PurchasingGroupStage2Dealing from \"../stage2/panels/dealing/PurchasingGroupStage2Dealing\";\r\nimport PurchasingGroupStage2Finish from \"../stage2/panels/finish/PurchasingGroupStage2Finish\";\r\n\r\nexport const PurchasingGroupStageSections = {\r\n    //STAGE 1 sections\r\n    STAGE_1_SECTION: \"STAGE_1_SECTION\",\r\n    BASIC_DATA: \"BASIC_DATA\",\r\n    COMMISSION: \"COMMISSION\",\r\n    MEMBERS: \"MEMBERS\",\r\n    SCHEDULE: \"SCHEDULE\",\r\n    OPINION: \"OPINION\",\r\n    FINISH_PREPARING: \"FINISH_PREPARING\",\r\n    PAPERS_GENERATOR: \"PAPERS_GENERATOR\",\r\n\r\n    //STAGE 2 sections\r\n    STAGE_2_SECTION: \"STAGE_2_SECTION\",\r\n    SWZ: \"SWZ\",\r\n    COLLECTING_SCHEDULE: \"COLLECTING_SCHEDULE\",\r\n    OPINION_SWZ: \"OPINION_SWZ\",\r\n    TEMPLATE: \"TEMPLATE\",\r\n    DEALING: \"DEALING\",\r\n    FINISH: \"FINISH\",\r\n    COLLECTING_PAPERS_GENERATOR: \"COLLECTING_PAPERS_GENERATOR\"\r\n}\r\n\r\n\r\nexport const StageSectionNameToSectionParam = Object.keys(PurchasingGroupStageSections).reduce((prev, curr) => {\r\n    prev[curr] = kebabCase(curr);\r\n    return prev;\r\n}, {});\r\n\r\nexport const StageSectionParamToSectionName = Object.keys(PurchasingGroupStageSections).reduce((prev, curr) => {\r\n    prev[kebabCase(curr)] = curr;\r\n    return prev;\r\n}, {});\r\n\r\n\r\nexport const StageSectionsComponents = {\r\n\r\n    BASIC_DATA: PurchasingGroupStage1BasicData,\r\n    COMMISSION: PurchasingGroupStage1Commission,\r\n    MEMBERS: PurchasingGroupStage1Members,\r\n    SCHEDULE: PurchasingGroupStage1Schedule,\r\n    OPINION: PurchasingGroupStage1Opinion,\r\n    FINISH_PREPARING: PurchasingGroupStage1FinishPreparing,\r\n    PAPERS_GENERATOR: PurchasingGroupStage1PapersGenerator,\r\n\r\n    SWZ: PurchasingGroupStage1Members,\r\n    COLLECTING_SCHEDULE: PurchasingGroupStage2Schedule,\r\n    OPINION_SWZ: PurchasingGroupStage1Opinion,\r\n    TEMPLATE: PurchasingGroupStage2Template,\r\n    DEALING: PurchasingGroupStage2Dealing,\r\n    FINISH: PurchasingGroupStage2Finish,\r\n    COLLECTING_PAPERS_GENERATOR: PurchasingGroupStage1PapersGenerator\r\n}\r\n\r\nexport const getSectionVariant = (section) => section ? (section.status === DemandValidationSectionStatus.OK ? 'Done' : (section.status === DemandValidationSectionStatus.DISABLED ? 'Wait' : (section.status === DemandValidationSectionStatus.ERROR ? 'Required' : (section.required ? 'Required' : 'Optional')))) : \"Wait\";","import Endpoints from 'constants/Endpoints';\r\nimport {clearResource, setResource, setSaveStatusClosed, setSaveStatusError, setSaveStatusLoading} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport Tr from \"../translations/Translations\";\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\nimport applySortParams from \"../libs/applySortParams\";\r\nimport downloadFileWithPreloadUrl from \"../libs/downloadFileWithPreloadUrl\";\r\nimport PurchasingGroupSectionService from \"./PurchasingGroupSectionService\";\r\nimport {PurchasingGroupStageSections} from \"../pages/purchaser/PurchasingGroup/stages/constants/PurchasingGroupStageSections\";\r\n\r\nconst PURCHASING_GROUP_HEADER_RESOURCE_ID = \"purchasingGroupHeader\";\r\nconst PURCHASING_GROUP_MEMBERS_RESOURCE_ID = \"purchasingGroupMembers\";\r\nconst PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID = \"purchasingGroupMembersDocuments\";\r\nconst PURCHASING_GROUP_OPINIONS_RESOURCE_ID = \"purchasingGroupOpinions\";\r\nconst PURCHASING_GROUP_MEMBER_RESOURCE_ID = (memberId) => `purchasingGroupMember_${memberId}`;\r\nconst PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID = (opinionId) => `purchasingGroupOpinion_${opinionId}`;\r\n\r\nconst __get = async (url, resourcesName) => {\r\n    try {\r\n        let res = await RestRequestGET(url)\r\n        if (resourcesName) {\r\n            reduxStore.dispatch(setResource(resourcesName, res))\r\n        }\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst __save = async (url, values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const resp = await RestRequestPOST(url, values)\r\n        isResponseValid(resp, (e) => {\r\n            throw new Error(e);\r\n        })\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\n\r\nconst getHeader = async (groupId) => {\r\n    await __get(Endpoints.PURCHASING_GROUP_HEADER(!groupId ? -1 : groupId), PURCHASING_GROUP_HEADER_RESOURCE_ID)\r\n}\r\nconst getRelatedObjects = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_RELATED_OBJECTS(groupId))\r\n}\r\n\r\nconst getPurchasingGroupList = async (searchData) => {\r\n    const {pagination, search, sort} = searchData;\r\n\r\n    let params = {\r\n        ...pagination\r\n    }\r\n    params = applySearchParams(search, params);\r\n    params = applySortParams(sort, params);\r\n    return await RestRequestGET(Endpoints.PURCHASING_GROUP_LIST(), {params});\r\n};\r\n\r\nconst getPurchasingGroupListActions = () => {\r\n    return __get(Endpoints.PURCHASING_GROUP_LIST_ACTIONS())\r\n}\r\n\r\nconst getPurchasingGroupMemberList = async (searchData) => {\r\n    const {pagination, search, sort} = searchData;\r\n\r\n    let params = {\r\n        ...pagination\r\n    }\r\n    params = applySearchParams(search, params);\r\n    params = applySortParams(sort, params);\r\n    return await RestRequestGET(Endpoints.PURCHASING_GROUP_MEMBER_LIST(), {params});\r\n};\r\n\r\nconst getArchiveList = async (groupId, archiveType) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_ARCHIVE_LIST(groupId, archiveType))\r\n}\r\nconst getArchiveElement = async (groupId, archiveType, archiveId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_ARCHIVE_ID(groupId, archiveType, archiveId))\r\n}\r\n\r\n\r\nconst getBasicData = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_BASIC_DATA(!groupId ? -1 : groupId))\r\n}\r\nconst saveBasicData = async (groupId, values) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_BASIC_DATA(!groupId ? -1 : groupId), values)\r\n    if (isResponseValid(resp, (e) => {\r\n        reduxStore.dispatch(setSaveStatusError(e));\r\n    })) {\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n        return resp.result;\r\n    }\r\n}\r\n\r\n\r\nconst getCommission = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COMMISSION(groupId))\r\n}\r\nconst saveCommission = async (groupId, values) => {\r\n    return await __save(Endpoints.PURCHASING_GROUP_COMMISSION(groupId), values)\r\n}\r\nconst getCommissionHistory = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_COMMISSION_HISTORY(groupId))\r\n}\r\n\r\n\r\nconst getSchedule = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_SCHEDULE(groupId))\r\n}\r\nconst saveSchedule = async (groupId, values) => {\r\n    try {\r\n        reduxStore.dispatch(setSaveStatusLoading());\r\n        const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_SCHEDULE(groupId), values);\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n        return resp;\r\n    } catch (e) {\r\n    }\r\n}\r\n\r\n\r\nconst getMembers = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS(groupId), PURCHASING_GROUP_MEMBERS_RESOURCE_ID)\r\n}\r\nconst getMembersRow = async (groupId, memberId) => {\r\n    const members = await __get(Endpoints.PURCHASING_GROUP_MEMBERS(groupId), PURCHASING_GROUP_MEMBERS_RESOURCE_ID);\r\n    if (members.length === 1) {\r\n        const member = members[0];\r\n        const {resources} = reduxStore.getState();\r\n        const res = resources[PURCHASING_GROUP_MEMBERS_RESOURCE_ID].map(x => x.identity === member.identity ? member : x)\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_RESOURCE_ID, res))\r\n    }\r\n}\r\n\r\nconst updateMemberName = async (groupId, memberId, values) => {\r\n    const resp = await RestRequestPUT(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID(groupId, memberId), values)\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = resources[PURCHASING_GROUP_MEMBERS_RESOURCE_ID].map(x => x.identity === resp.identity ? resp : x)\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_RESOURCE_ID, res))\r\n    }\r\n}\r\n\r\nconst rejectMember = async (groupId, memberId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_REJECT(groupId, memberId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = resources[PURCHASING_GROUP_MEMBERS_RESOURCE_ID].map(x => x.identity === resp.identity ? resp : x)\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_RESOURCE_ID, res))\r\n        PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n    }\r\n}\r\n\r\nconst restoreMember = async (groupId, memberId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_RESTORE(groupId, memberId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = resources[PURCHASING_GROUP_MEMBERS_RESOURCE_ID].map(x => x.identity === resp.identity ? resp : x)\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_RESOURCE_ID, res))\r\n        PurchasingGroupSectionService.getSections(groupId, PurchasingGroupStageSections.MEMBERS)\r\n    }\r\n}\r\n\r\nconst withdrawParticipationMember = async (groupId, memberId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_WITHDRAW_PARTICIPATION(groupId, memberId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {canConfirm, confirmationDate} = resp;\r\n        const {resources} = reduxStore.getState();\r\n        const member = resources[PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId)];\r\n        if (member) {\r\n            const res = {...member, canConfirm, confirmationDate}\r\n            reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId), res))\r\n        }\r\n    }\r\n}\r\n\r\nconst confirmParticipationMember = async (groupId, memberId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_CONFIRM_PARTICIPATION(groupId, memberId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {canConfirm, confirmationDate} = resp;\r\n        const {resources} = reduxStore.getState();\r\n        const member = resources[PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId)];\r\n        if (member) {\r\n            const res = {...member, canConfirm, confirmationDate}\r\n            reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId), res))\r\n        }\r\n    }\r\n}\r\n\r\n\r\nconst resendInviteNotification = async (groupId, memberId) => {\r\n    await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_RESEND_INVITE_NOTIFICATION(groupId, memberId))\r\n}\r\n\r\nconst deleteMember = async (groupId, memberId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID(groupId, memberId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = resources[PURCHASING_GROUP_MEMBERS_RESOURCE_ID].filter(x => x.identity !== memberId)\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_RESOURCE_ID, res))\r\n    }\r\n}\r\n\r\nconst getMembersAvailableConcerns = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_AVAILABLE_CONCERNS(groupId));\r\n}\r\n\r\nconst addMembers = async (groupId, values) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER(groupId), values)\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = [...resources[PURCHASING_GROUP_MEMBERS_RESOURCE_ID], ...resp.result]\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_RESOURCE_ID, res))\r\n        return resp.result;\r\n    }\r\n\r\n}\r\n\r\nconst getAllMembersDocuments = async (groupId, documentsApiPathType) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS(groupId, documentsApiPathType), PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID)\r\n}\r\nconst addAllMembersDocuments = async (groupId, documentsApiPathType, values) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS(groupId, documentsApiPathType), {documents: values})\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const noErrorsDocs = resp.filter(d => d.error === null);\r\n\r\n        if (noErrorsDocs.length > 0) {\r\n            const {resources} = reduxStore.getState();\r\n            const res = {\r\n                ...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n                documents: [...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID].documents, ...noErrorsDocs]\r\n            }\r\n            reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID, res))\r\n        }\r\n        return resp;\r\n    }\r\n}\r\nconst generateGroupAgreementDocument = async (groupId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS_GENERATE_GROUP_AGREEMENT(groupId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = {\r\n            ...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n            documents: [...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID].documents, ...resp.result]\r\n        }\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID, res))\r\n        return resp.result;\r\n    }\r\n}\r\n\r\nconst updateAllMembersDocument = async (groupId, {documentsApiPathType, documentId}, description) => {\r\n    const resp = await RestRequestPUT(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID(groupId, documentsApiPathType, documentId), {description})\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = {\r\n            ...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n            documents: [...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID].documents.map(x => x.identity === resp.identity ? resp : x)]\r\n        }\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID, res))\r\n    }\r\n}\r\nconst publishAllMembersDocument = async (groupId, documentsApiPathType, documentId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_PUBLISH(groupId, documentsApiPathType, documentId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = {\r\n            ...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n            documents: [...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID].documents.map(x => x.identity === resp.result.identity ? resp.result : x)]\r\n        }\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID, res))\r\n    }\r\n}\r\nconst unpublishAllMembersDocument = async (groupId, documentsApiPathType, documentId) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_UNPUBLISH(groupId, documentsApiPathType, documentId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const res = {\r\n            ...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n            documents: [...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID].documents.map(x => x.identity === resp.result.identity ? resp.result : x)]\r\n        }\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID, res))\r\n    }\r\n}\r\n\r\n\r\nconst deleteAllMembersDocument = async (groupId, documentsApiPathType, documentId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID(groupId, documentsApiPathType, documentId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n\r\n        const res = {\r\n            ...resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID],\r\n            documents: resources[PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID].documents.filter(x => x.identity !== documentId)\r\n        }\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID, res))\r\n    }\r\n}\r\n\r\nconst downloadAllMembersDocument = async (demandId, documentsApiPathType, identity, openInBrowser) => {\r\n    await downloadFileWithPreloadUrl(\r\n        Endpoints.PURCHASING_GROUP_MEMBERS_DOCUMENTS_ID_URL(demandId, documentsApiPathType, identity, openInBrowser),\r\n        openInBrowser);\r\n}\r\n\r\nconst getMember = async (groupId, memberId) => {\r\n    await __get(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID(groupId, memberId), PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId))\r\n}\r\nconst addMemberDocuments = async (groupId, memberId, values) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT(groupId, memberId), {documents: values})\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const noErrorsDocs = resp.filter(d => d.error === null);\r\n\r\n        if (noErrorsDocs.length > 0) {\r\n            const {resources} = reduxStore.getState();\r\n            const resourceId = PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId);\r\n            const cur = resources[resourceId];\r\n            const res = {\r\n                ...cur,\r\n                memberDocuments: {\r\n                    ...cur.memberDocuments,\r\n                    documents: [...cur.memberDocuments.documents, ...noErrorsDocs]\r\n                }\r\n            }\r\n            reduxStore.dispatch(setResource(resourceId, res))\r\n        }\r\n        return resp;\r\n    }\r\n}\r\n\r\nconst updateMemberDocument = async (groupId, {memberId, documentId}, description) => {\r\n    const resp = await RestRequestPUT(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID(groupId, memberId, documentId), {description})\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const resourceId = PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId);\r\n        const cur = resources[resourceId];\r\n\r\n        const res = {\r\n            ...cur,\r\n            memberDocuments: {\r\n                ...cur.memberDocuments,\r\n                documents: cur.memberDocuments.documents.map(x => x.identity === documentId ? resp : x)\r\n            }\r\n        }\r\n        reduxStore.dispatch(setResource(resourceId, res))\r\n    }\r\n}\r\nconst deleteMemberDocument = async (groupId, memberId, documentId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID(groupId, memberId, documentId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const resourceId = PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId);\r\n        const cur = resources[resourceId];\r\n\r\n        const res = {\r\n            ...cur,\r\n            memberDocuments: {\r\n                ...cur.memberDocuments,\r\n                documents: cur.memberDocuments.documents.filter(x => x.identity !== documentId)\r\n            }\r\n        }\r\n        reduxStore.dispatch(setResource(resourceId, res))\r\n\r\n    }\r\n}\r\nconst downloadMemberDocument = async (demandId, memberId, documentId, openInBrowser) => {\r\n    await downloadFileWithPreloadUrl(\r\n        Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_DOCUMENT_ID_URL(demandId, memberId, documentId, openInBrowser),\r\n        openInBrowser);\r\n}\r\n\r\n\r\nconst getAvailableMemberUsers = async (groupId, memberId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER(groupId, memberId));\r\n}\r\nconst addMemberUser = async (groupId, memberId, userIds) => {\r\n    const resp = await RestRequestPOST(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER(groupId, memberId), {list: userIds})\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const resourceId = PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId);\r\n        const cur = resources[resourceId];\r\n        const res = {\r\n            ...cur,\r\n            users: [...cur.users, ...resp]\r\n        }\r\n        reduxStore.dispatch(setResource(resourceId, res));\r\n        await getMembersRow(groupId, memberId)\r\n    }\r\n}\r\nconst deleteMemberUser = async (groupId, memberId, userId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.PURCHASING_GROUP_MEMBERS_MEMBER_ID_USER_ID(groupId, memberId, userId))\r\n    if (isResponseValid(resp, (e) => {\r\n        throw new Error(e)\r\n    })) {\r\n        const {resources} = reduxStore.getState();\r\n        const resourceId = PURCHASING_GROUP_MEMBER_RESOURCE_ID(memberId);\r\n        const cur = resources[resourceId];\r\n\r\n        const res = {\r\n            ...cur,\r\n            users: cur.users.filter(x => x.identity !== userId)\r\n        }\r\n        reduxStore.dispatch(setResource(resourceId, res))\r\n        await getMembersRow(groupId, memberId)\r\n    }\r\n}\r\n\r\n\r\n//opinion\r\n\r\nconst getOpinions = async (groupId, type) => {\r\n    return __get(Endpoints.PURCHASING_GROUP_OPINION(groupId, type), PURCHASING_GROUP_OPINIONS_RESOURCE_ID)\r\n}\r\n\r\nconst getOpinionAvailableMembers = async (groupId, type) => {\r\n    return __get(Endpoints.PURCHASING_GROUP_OPINION_AVAILABLE_MEMBERS(groupId, type))\r\n}\r\n\r\nconst addOpinionForMember = async (groupId, type, memberId) => {\r\n    const newOpinion = await __save(Endpoints.PURCHASING_GROUP_OPINION_MEMBER_ID(groupId, type, memberId));\r\n    if (newOpinion) {\r\n        const {resources} = reduxStore.getState();\r\n        const cur = resources[PURCHASING_GROUP_OPINIONS_RESOURCE_ID];\r\n\r\n        const newRes = [\r\n            ...cur,\r\n            newOpinion\r\n        ]\r\n        reduxStore.dispatch(setResource(PURCHASING_GROUP_OPINIONS_RESOURCE_ID, newRes))\r\n        return newOpinion;\r\n    }\r\n}\r\n\r\nconst getOpinionMessages = async (groupId, type, opinionId, editable) => {\r\n    if (opinionId > 0) {\r\n        const messages = await __get(Endpoints.PURCHASING_GROUP_OPINION_ID(groupId, type, opinionId), PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID(opinionId));\r\n        if (messages) {\r\n            const ids = messages.filter(x => x.read === false).map(x => x.identity);\r\n            if (ids.length > 0) {\r\n                RestRequestPOST(Endpoints.PURCHASING_GROUP_OPINION_ID_MARK_AS_READ(groupId, type, opinionId), {list: ids}).then(() => {\r\n                    PurchasingGroupSectionService.getSections(groupId, type === \"AGREEMENT\" ? PurchasingGroupStageSections.OPINION : PurchasingGroupStageSections.OPINION_SWZ)\r\n                })\r\n                const {resources} = reduxStore.getState();\r\n                const cur = resources[PURCHASING_GROUP_OPINIONS_RESOURCE_ID];\r\n                const newRes = cur.map(x => x.identity === opinionId ? {...x, unreadCount: 0} : x)\r\n                reduxStore.dispatch(setResource(PURCHASING_GROUP_OPINIONS_RESOURCE_ID, newRes))\r\n            }\r\n        }\r\n    } else {\r\n        await addEmptyOpinionMessage(groupId, type, opinionId, editable);\r\n    }\r\n}\r\n\r\nconst saveOpinionMessage = async (groupId, type, opinionId, message) => {\r\n    const newMessage = await RestRequestPOST(Endpoints.PURCHASING_GROUP_OPINION_ID(groupId, type, opinionId), message);\r\n    if (newMessage) {\r\n\r\n        const {resources} = reduxStore.getState();\r\n        const resourceId = PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID(opinionId);\r\n        const cur = opinionId > 0 ? resources[resourceId] || [] : [];\r\n\r\n        const res = message.identity === 0 ? [\r\n            ...cur,\r\n            newMessage\r\n        ] : cur.map(x => x.identity === message.identity ? newMessage : x)\r\n        reduxStore.dispatch(setResource(resourceId, res))\r\n\r\n        return newMessage;\r\n    }\r\n}\r\n\r\nconst addEmptyOpinionMessage = async (groupId, type, opinionId, editable) => {\r\n    let newMessage;\r\n    if (editable) {\r\n        if (opinionId > 0) {\r\n            newMessage = await RestRequestPOST(Endpoints.PURCHASING_GROUP_OPINION_ID_MESSAGE_NEW(groupId, type, opinionId));\r\n        } else {\r\n            newMessage = {\r\n                identity: 0,\r\n                memberMessage: true,\r\n                author: null,\r\n                contents: \"\",\r\n                status: \"SAVED\",\r\n                createDate: null,\r\n                modifiedDate: null,\r\n                sendDate: null,\r\n                read: true\r\n            }\r\n        }\r\n    }\r\n\r\n    const {resources} = reduxStore.getState();\r\n    const resourceId = PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID(opinionId);\r\n    const cur = resources[resourceId] || [];\r\n    const res = [\r\n        ...cur,\r\n    ]\r\n    if (newMessage) {\r\n        res.push(newMessage)\r\n    }\r\n\r\n    reduxStore.dispatch(setResource(resourceId, res))\r\n}\r\n\r\nconst deleteOpinionMessage = async (groupId, type, opinionId, messageId) => {\r\n\r\n    const resp = await RestRequestDELETE(Endpoints.PURCHASING_GROUP_OPINION_ID_MESSAGE_ID(groupId, type, opinionId, messageId));\r\n    if (resp.success) {\r\n        const {resources} = reduxStore.getState();\r\n        const resourceId = PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID(opinionId);\r\n        const cur = resources[resourceId] || [];\r\n        const res = cur.filter(x => x.identity !== messageId);\r\n        reduxStore.dispatch(setResource(resourceId, res))\r\n    }\r\n\r\n}\r\n\r\nconst canFinishPreparing = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_FINISH_PREPARING(groupId));\r\n}\r\n\r\nconst finishPreparingStage = async (groupId) => {\r\n    return await __save(Endpoints.PURCHASING_GROUP_FINISH_PREPARING(groupId), null);\r\n}\r\n\r\n//papersGenerator\r\nconst getGzmManagementResolution = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_MANAGEMENT_RESOLUTION(groupId))\r\n}\r\nconst printGzmManagementResolution = async (groupId, data) => {\r\n    return __print(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_MANAGEMENT_RESOLUTION(groupId), data);\r\n}\r\n\r\nconst getGzmLeadingDocument = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_LEADING_DOCUMENT(groupId))\r\n}\r\nconst printGzmLeadingDocument = async (groupId, data) => {\r\n    return __print(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_LEADING_DOCUMENT(groupId), data)\r\n}\r\n\r\nconst getGzmDocumentToSign = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DOCUMENT_TO_SIGN(groupId))\r\n}\r\n\r\nconst printGzmDocumentToSign = async (groupId, data) => {\r\n    return __print(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DOCUMENT_TO_SIGN(groupId), data)\r\n}\r\n\r\nconst getGzmDraftGroupAgreement = async (groupId) => {\r\n    return await __get(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DRAFT_GROUP_AGREEMENT(groupId))\r\n}\r\n\r\nconst printGzmDraftGroupAgreement = async (groupId, data) => {\r\n    return __print(Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_GZM_DRAFT_GROUP_AGREEMENT(groupId), data)\r\n}\r\n\r\nconst __print = (url, data) => {\r\n    return RestRequestBLOB(url, {data, method: 'post'});\r\n}\r\n\r\nconst clearResources = (resourceId) => reduxStore.dispatch(clearResource(resourceId))\r\n\r\n\r\nexport default {\r\n    getHeader,\r\n    getRelatedObjects,\r\n    getPurchasingGroupList,\r\n    getPurchasingGroupListActions,\r\n    getPurchasingGroupMemberList,\r\n    getArchiveList,\r\n    getArchiveElement,\r\n\r\n    //basic-data\r\n    getBasicData,\r\n    saveBasicData,\r\n\r\n    //commission\r\n    getCommission,\r\n    saveCommission,\r\n    getCommissionHistory,\r\n\r\n    //schedule\r\n    getSchedule,\r\n    saveSchedule,\r\n\r\n    //members\r\n    getMembers,\r\n    updateMemberName,\r\n    rejectMember,\r\n    restoreMember,\r\n    confirmParticipationMember,\r\n    withdrawParticipationMember,\r\n    resendInviteNotification,\r\n    deleteMember,\r\n    getMembersAvailableConcerns,\r\n    addMembers,\r\n    //member dokumenty główne\r\n    getAllMembersDocuments,\r\n    addAllMembersDocuments,\r\n    generateGroupAgreementDocument,\r\n    updateAllMembersDocument,\r\n    publishAllMembersDocument,\r\n    unpublishAllMembersDocument,\r\n    deleteAllMembersDocument,\r\n    downloadAllMembersDocument,\r\n    //member konkretny member\r\n    getMember,\r\n    addMemberDocuments,\r\n    updateMemberDocument,\r\n    deleteMemberDocument,\r\n    downloadMemberDocument,\r\n    getAvailableMemberUsers,\r\n    addMemberUser,\r\n    deleteMemberUser,\r\n\r\n    //opinion\r\n    getOpinions,\r\n    getOpinionAvailableMembers,\r\n    addOpinionForMember,\r\n    getOpinionMessages,\r\n    saveOpinionMessage,\r\n    addEmptyOpinionMessage,\r\n    deleteOpinionMessage,\r\n\r\n    //finishPreparing\r\n    canFinishPreparing,\r\n    finishPreparingStage,\r\n\r\n    //papersGenerator\r\n    getGzmManagementResolution,\r\n    printGzmManagementResolution,\r\n    getGzmLeadingDocument,\r\n    printGzmLeadingDocument,\r\n    getGzmDocumentToSign,\r\n    printGzmDocumentToSign,\r\n    getGzmDraftGroupAgreement,\r\n    printGzmDraftGroupAgreement,\r\n\r\n    clearResources,\r\n    PURCHASING_GROUP_HEADER_RESOURCE_ID,\r\n    PURCHASING_GROUP_MEMBERS_RESOURCE_ID,\r\n    PURCHASING_GROUP_MEMBERS_DOCUMENTS_RESOURCE_ID,\r\n    PURCHASING_GROUP_MEMBER_RESOURCE_ID,\r\n    PURCHASING_GROUP_OPINIONS_RESOURCE_ID,\r\n    PURCHASING_GROUP_OPINION_MESSAGES_RESOURCE_ID,\r\n}","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport TextInput from \"components/TextInput\";\r\nimport DatePicker from \"components/DatePicker\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    wrap: {\r\n        minWidth: 600,\r\n        minHeight: 40\r\n    }\r\n}));\r\n\r\n\r\nfunction PapersGeneratorGzmManagementResolution(\r\n    {\r\n        groupId,\r\n        paper,\r\n        onClose,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [initData, setInitData] = useState(null)\r\n    const [working, setWorking] = useState(null)\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getGzmManagementResolution(groupId).then(resp => {\r\n            if (resp) {\r\n                setInitData(resp);\r\n            } else {\r\n                onClose();\r\n            }\r\n        });\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    const formId = useId();\r\n    const onSubmit = (values) => {\r\n        setWorking(true);\r\n        PurchasingGroupStage1Service.printGzmManagementResolution(groupId, values).finally(onClose)\r\n    }\r\n\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('generate_paper'), () => formSubmit[formId](), undefined, working, undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={paper.name}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            fullWidth={false}\r\n            onClose={onClose}\r\n            dialogActions={getActions()}\r\n        >\r\n            <div className={classes.wrap}>\r\n                {\r\n                    !initData ?\r\n                        <Loading/> :\r\n                        <>\r\n                            <Form\r\n                                initialValues={initData}\r\n                                validationSchema={VS.object({\r\n                                    resolutionNumber: VS.stringMaxNoRq(50),\r\n                                    resolutionDate: VS.dateTimeNoReq(),\r\n                                    projectName: VS.stringMaxNoRq(200)\r\n                                })}\r\n                                onSubmit={onSubmit}\r\n                                id={formId}\r\n                            >\r\n                                {(formikProps) => (<>\r\n                                        <TextInput\r\n                                            id=\"resolutionNumber\"\r\n                                            label={Tr(\"resolution_number\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={50}\r\n                                        />\r\n\r\n                                        <DatePicker\r\n                                            id=\"resolutionDate\"\r\n                                            label={Tr('resolution_date')}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                        />\r\n\r\n                                        <TextInput\r\n                                            id=\"projectName\"\r\n                                            label={Tr(\"project_name\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={200}\r\n                                        />\r\n\r\n                                    </>\r\n\r\n                                )}\r\n                            </Form>\r\n\r\n                        </>\r\n                }\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nPapersGeneratorGzmManagementResolution.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(PapersGeneratorGzmManagementResolution);","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport TextInput from \"components/TextInput\";\r\nimport DatePicker from \"components/DatePicker\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport PartsTable from \"components/PartsTable\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    wrap: {\r\n        minWidth: 600,\r\n        minHeight: 40\r\n    }\r\n}));\r\n\r\n\r\nfunction PapersGeneratorGzmLeadingDocument(\r\n    {\r\n        groupId,\r\n        paper,\r\n        onClose,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [initData, setInitData] = useState(null)\r\n    const [working, setWorking] = useState(null)\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getGzmLeadingDocument(groupId).then(resp => {\r\n            if (resp) {\r\n                setInitData(resp);\r\n            } else {\r\n                onClose();\r\n            }\r\n        });\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    const formId = useId();\r\n    const onSubmit = (values) => {\r\n        setWorking(true);\r\n        const data = {...values, memberIds: Object.keys(values.memberIds).filter(x => values.memberIds[x] === true).map(x => parseInt(x.substring(1)))}\r\n        PurchasingGroupStage1Service.printGzmLeadingDocument(groupId, data).finally(onClose)\r\n    }\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('generate_paper'), () => formSubmit[formId](), undefined, working, undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={paper.name}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            fullWidth={false}\r\n            onClose={onClose}\r\n            dialogActions={getActions()}\r\n        >\r\n            <div className={classes.wrap}>\r\n                {\r\n                    !initData ?\r\n                        <Loading/> :\r\n                        <>\r\n                            <Form\r\n                                initialValues={{\r\n                                    ...initData.document,\r\n                                    memberIds: initData.membersList.reduce((prev, cur) => {\r\n                                        prev[\"_\" + cur.id] = initData.document.memberIds && initData.document.memberIds.includes(cur.id);\r\n                                        return prev;\r\n                                    }, {}),\r\n                                }}\r\n                                validationSchema={VS.object({\r\n                                    memberIds: VS.any(),\r\n                                    documentNumber: VS.stringMaxNoRq(50),\r\n                                    projectName: VS.stringMaxNoRq(200),\r\n                                    resolutionDate: VS.dateTimeNoReq(),\r\n                                    documentDeadline: VS.dateTimeNoReq(),\r\n                                })}\r\n                                onSubmit={onSubmit}\r\n                                id={formId}\r\n                            >\r\n                                {(formikProps) => (<>\r\n                                        <TextInput\r\n                                            id=\"documentNumber\"\r\n                                            label={Tr(\"document_number\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={50}\r\n                                        />\r\n\r\n                                        <TextInput\r\n                                            id=\"projectName\"\r\n                                            label={Tr(\"project_name\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={200}\r\n                                        />\r\n\r\n                                        <DatePicker\r\n                                            id=\"resolutionDate\"\r\n                                            label={Tr('resolution_date')}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                        />\r\n                                        <br/>\r\n                                        <DatePicker\r\n                                            id=\"documentDeadline\"\r\n                                            label={Tr('documents_deadline')}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                        />\r\n\r\n                                        <PartsTable\r\n                                            id=\"memberIds\"\r\n                                            label={Tr('purchasing_group_member_list')}\r\n                                            formikProps={formikProps}\r\n                                            elementList={initData.membersList.map(x => ({identity: \"_\" + x.id, name: x.name}))}\r\n                                            disabled={working}\r\n                                            required={false}\r\n                                        />\r\n                                    </>\r\n\r\n                                )}\r\n                            </Form>\r\n\r\n                        </>\r\n                }\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nPapersGeneratorGzmLeadingDocument.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(PapersGeneratorGzmLeadingDocument);","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport TextInput from \"components/TextInput\";\r\nimport DatePicker from \"components/DatePicker\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    wrap: {\r\n        minWidth: 600,\r\n        minHeight: 40\r\n    }\r\n}));\r\n\r\n\r\nfunction PapersGeneratorGzmDraftGroupAgreement(\r\n    {\r\n        groupId,\r\n        paper,\r\n        onClose,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [initData, setInitData] = useState(null)\r\n    const [working, setWorking] = useState(null)\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getGzmDraftGroupAgreement(groupId).then(resp => {\r\n            if (resp) {\r\n                setInitData(resp);\r\n            } else {\r\n                onClose();\r\n            }\r\n        });\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    const formId = useId();\r\n    const onSubmit = (values) => {\r\n        setWorking(true);\r\n        PurchasingGroupStage1Service.printGzmDraftGroupAgreement(groupId, values).finally(onClose)\r\n    }\r\n\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('generate_paper'), () => formSubmit[formId](), undefined, working, undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={paper.name}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            fullWidth={false}\r\n            onClose={onClose}\r\n            dialogActions={getActions()}\r\n        >\r\n            <div className={classes.wrap}>\r\n                {\r\n                    !initData ?\r\n                        <Loading/> :\r\n                        <>\r\n                            <Form\r\n                                initialValues={initData}\r\n                                validationSchema={VS.object({\r\n                                    documentNumber: VS.stringMaxNoRq(50),\r\n                                    projectName: VS.stringMaxNoRq(200),\r\n                                    agreementConclusionDate: VS.dateTimeNoReq(),\r\n                                    agreementStartDate: VS.dateTimeNoReq(),\r\n                                })}\r\n                                onSubmit={onSubmit}\r\n                                id={formId}\r\n                            >\r\n                                {(formikProps) => (<>\r\n                                        <TextInput\r\n                                            id=\"documentNumber\"\r\n                                            label={Tr(\"document_number\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={50}\r\n                                        />\r\n\r\n                                        <TextInput\r\n                                            id=\"projectName\"\r\n                                            label={Tr(\"project_name\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={200}\r\n                                        />\r\n\r\n                                        <DatePicker\r\n                                            id=\"agreementConclusionDate\"\r\n                                            label={Tr('agreement_conclusion_date')}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                        />\r\n                                        <br/>\r\n                                        <DatePicker\r\n                                            id=\"agreementStartDate\"\r\n                                            label={Tr('agreement_start_date')}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                        />\r\n                                    </>\r\n\r\n                                )}\r\n                            </Form>\r\n\r\n                        </>\r\n                }\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nPapersGeneratorGzmDraftGroupAgreement.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(PapersGeneratorGzmDraftGroupAgreement);","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport TextInput from \"components/TextInput\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    wrap: {\r\n        minWidth: 600,\r\n        minHeight: 40\r\n    }\r\n}));\r\n\r\n\r\nfunction PapersGeneratorGzmDocumentToSign(\r\n    {\r\n        groupId,\r\n        paper,\r\n        onClose,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [initData, setInitData] = useState(null)\r\n    const [working, setWorking] = useState(null)\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getGzmDocumentToSign(groupId).then(resp => {\r\n            if (resp) {\r\n                setInitData(resp);\r\n            } else {\r\n                onClose();\r\n            }\r\n        });\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    const formId = useId();\r\n    const onSubmit = (values) => {\r\n        setWorking(true);\r\n        PurchasingGroupStage1Service.printGzmDocumentToSign(groupId, values).finally(onClose)\r\n    }\r\n\r\n\r\n    const getActions = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('generate_paper'), () => formSubmit[formId](), undefined, working, undefined, working));\r\n        return <MultiButton buttons={buttons}/>;\r\n    }\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={paper.name}\r\n            titleCentered\r\n            maxWidth=\"md\"\r\n            fullWidth={false}\r\n            onClose={onClose}\r\n            dialogActions={getActions()}\r\n        >\r\n            <div className={classes.wrap}>\r\n                {\r\n                    !initData ?\r\n                        <Loading/> :\r\n                        <>\r\n                            <Form\r\n                                initialValues={initData}\r\n                                validationSchema={VS.object({\r\n                                    projectName: VS.stringMaxNoRq(200)\r\n                                })}\r\n                                onSubmit={onSubmit}\r\n                                id={formId}\r\n                            >\r\n                                {(formikProps) => (<>\r\n                                        <TextInput\r\n                                            id=\"projectName\"\r\n                                            label={Tr(\"project_name\")}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            limit={200}\r\n                                        />\r\n                                    </>\r\n                                )}\r\n                            </Form>\r\n\r\n                        </>\r\n                }\r\n            </div>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nPapersGeneratorGzmDocumentToSign.propTypes = {\r\n    groupId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    paper: PropTypes.object.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(PapersGeneratorGzmDocumentToSign);","import reduxStore from 'redux/store'\r\nimport {setEzamowieniaOauth} from \"../redux/actions\";\r\n\r\n\r\nfunction useEzamowieniaOauth() {\r\n    const authorizeEzamowienia = (successCallback, errorCallback, requiredGroups) => {\r\n        reduxStore.dispatch(setEzamowieniaOauth({successCallback, errorCallback, requiredGroups}));\r\n    }\r\n    return {authorizeEzamowienia}\r\n\r\n}\r\n\r\nexport default useEzamowieniaOauth;","import React from 'react'\r\nimport SvgIcon from \"@material-ui/core/SvgIcon\";\r\n\r\nfunction EZamowieniaIcon(props) {\r\n    return (<SvgIcon viewBox=\"0 0 83 68\" {...props}>\r\n            <path d=\"M69.3128834,34.7931042 L72.708589,36.75246 C73.368865,37.1328281 73.2768405,37.8375827 72.5306748,38.2693312 L42.1825153,55.8222453 C41.4355828,56.2539938 40.2967791,56.2769999 39.6434049,55.8866625 L36.3013804,53.8920306 C35.648773,53.5032269 35.7300613,52.8076748 36.4792945,52.3751594 L66.7753067,34.8590551 C67.5230061,34.4265398 68.6533742,34.4127361 69.3128834,34.7931042 Z M55.5874233,29.7417238 C56.1119632,29.4395766 56.4555215,28.8636564 56.4555215,28.2141165 L56.4509202,10.169638 C56.4509202,9.78696925 55.9900307,9.35828826 55.3312883,9.73788949 L25.3358896,27.0569079 C24.8006135,27.3628895 24.440184,27.9395766 24.440184,28.6006196 L24.440184,46.3107423 C24.440184,47.0300674 25.0697853,47.3230122 25.6495399,46.9886564 L55.5874233,29.7417238 Z M2.49156442,67.1550674 C1.56134969,67.6941778 0.407208589,67.1427975 0.429447853,66.0477054 L0.429447853,62.6220919 C0.429447853,61.9779202 0.771472393,61.4150367 1.28374233,61.1029202 C6.76763804,57.9265398 12.2515337,54.7493926 17.7354294,51.5730122 C18.2492331,51.2754662 18.6027607,50.7179508 18.6027607,50.0845153 C18.6042945,42.3398834 18.6058282,34.5960183 18.607362,26.8513864 C18.6319018,24.9748527 19.8282209,23.5116625 21.3581288,22.6289938 L58.6142638,1.1205582 C60.75,-0.111803761 62.303681,0.750159429 62.3021472,2.91426986 L62.2891104,30.0162637 C62.2891104,30.5891165 62.601227,31.1167238 63.0636503,31.3927975 L63.7315951,31.7915705 L28.5398773,52.0837484 C28.0314417,52.3766932 28.0015337,53.0845153 28.7837423,53.5592085 L40.1863497,60.3391165 C40.8397239,60.7279202 41.9777607,60.7056809 42.7246933,60.2746993 L76.7400307,40.6466318 C77.4892638,40.2141165 78.6173313,40.204914 79.2791411,40.5814478 L82.6625767,42.5093619 C83.3243865,42.8851288 83.2315951,43.5952515 82.4846626,44.026233 L42.672546,67.0231656 C41.9256135,67.4541472 40.7891104,67.4763864 40.1349693,67.0883496 L22.4693252,56.6029202 C21.9493865,56.2938711 21.2745399,56.2892699 20.7131902,56.6144232 L2.49156442,67.1550674 L2.49156442,67.1550674 Z\" id=\"Fill-1\" fill=\"#0089C0\"></path>\r\n        </SvgIcon>\r\n    );\r\n}\r\n\r\nexport default EZamowieniaIcon;\r\n\r\n\r\n\r\n","import Endpoints from \"../constants/Endpoints\";\r\nimport {RestRequestGET, RestRequestPOST} from \"../libs/RestRequest\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst showError = (message) => {\r\n    reduxStore.dispatch(setSaveStatusError(message))\r\n}\r\n\r\nconst getAuthorizationStatus = async () => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.EZAMOWIENIA_AUTHORIZATION_STATUS);\r\n        if (isResponseValid(resp, showError)) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\nconst revokeToken = async () => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.EZAMOWIENIA_REVOKE_TOKEN);\r\n        isResponseValid(resp, showError)\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\nexport default {\r\n    getAuthorizationStatus,\r\n    revokeToken\r\n};\r\n\r\n","import React, {useReducer} from \"react\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport useEzamowieniaOauth from \"hooks/useEzamowieniaOauth\";\r\nimport Tr from \"translations/Translations\";\r\nimport Typography from \"components/Typography\";\r\nimport Button from \"components/Button\";\r\nimport EZamowieniaIcon from \"components/icon/EZamowieniaIcon\";\r\nimport previewFile from \"libs/previewFile\";\r\nimport EzamowieniaService from \"services/EzamowieniaService\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport GetAppIcon from '@material-ui/icons/GetApp';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing()\r\n    },\r\n}))\r\nconst PapersGeneratorXmpUzpPresidentPaperContent = (\r\n    {\r\n        demandId\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n    const {authorizeEzamowienia} = useEzamowieniaOauth();\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        goto: false\r\n    });\r\n\r\n    const goTo = () => {\r\n        authorizeEzamowienia(() => {\r\n            dispatchIconWorks({type: 'download', works: true});\r\n            EzamowieniaService.getAuthorizationStatus().then((resp) => {\r\n                let ezamowieniaOrigin = \"https://ezamowienia.gov.pl\";\r\n                if (resp) {\r\n                    ezamowieniaOrigin = resp.ezamowieniaOrigin;\r\n                }\r\n                previewFile({url: ezamowieniaOrigin + \"/pl/formularz/\"})\r\n            }).finally(() => dispatchIconWorks({type: 'download', works: false}))\r\n        })\r\n    }\r\n\r\n    const download = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        PapersGeneratorService.downloadPaper(Endpoints.XMM_UZP_PRESIDENT_PAPER(demandId), () =>\r\n            dispatchIconWorks({type: 'download', works: false}), () => dispatchIconWorks({type: 'download', works: false}))\r\n    }\r\n\r\n\r\n    return (<>\r\n        <BoldTypography className={classes.marginBottom}>{Tr(\"xmp_uzp_paper_title\")}</BoldTypography>\r\n\r\n        <Typography>{Tr(\"xmp_uzp_paper_steps\")}</Typography>\r\n\r\n        <ol>\r\n            <li className={classes.marginBottom}>\r\n                <Typography>\r\n                    {Tr(\"xmp_uzp_paper_step1\")}\r\n                    <WorkableButton Icon={GetAppIcon} onClick={download} disabled={iconWorks.anyWorks} working={iconWorks.download} className={classes.marginLeft}>{Tr(\"download\") + \" XML\"}</WorkableButton>\r\n                </Typography>\r\n            </li>\r\n            <li>\r\n                <Typography>\r\n                    {Tr(\"xmp_uzp_paper_step2\")}\r\n                    <Button onClick={goTo} className={classes.marginLeft} Icon={EZamowieniaIcon} disabled={iconWorks.anyWorks}>\r\n                        {Tr(\"ezamowienia_go_to\")}\r\n                    </Button>\r\n                </Typography>\r\n            </li>\r\n        </ol>\r\n\r\n\r\n    </>)\r\n}\r\n\r\nexport default PapersGeneratorXmpUzpPresidentPaperContent;","import React from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport PapersGeneratorXmpUzpPresidentPaperContent from \"./PapersGeneratorXmpUzpPresidentPaperContent\";\r\n\r\nconst PapersGeneratorXmpUzpPresidentPaperPopup = (\r\n    {\r\n        onClose,\r\n        demandId,\r\n    }) => {\r\n\r\n    return (<Dialog\r\n        open\r\n        maxWidth='md'\r\n        onClose={onClose}\r\n        dialogActions={<MultiButton buttons={[createButton(Tr('close'), onClose)]}/>}\r\n    >\r\n        <PapersGeneratorXmpUzpPresidentPaperContent demandId={demandId} />\r\n    </Dialog>)\r\n}\r\n\r\nexport default PapersGeneratorXmpUzpPresidentPaperPopup;","export const shareSystemsActive = (demandHeader) => {\r\n    const arr = [];\r\n    if (!!(demandHeader?.applicationClientSettings?.ezdpuwIntegration?.active)) {\r\n        arr.push(\"ezdpuw\")\r\n    }\r\n    return arr;\r\n}\r\n\r\nexport const shareSystemsConnected = (demandHeader) => {\r\n    const arr = [];\r\n    if (!!(demandHeader?.applicationClientSettings?.ezdpuwIntegration?.connected)) {\r\n        arr.push(\"ezdpuw\")\r\n    }\r\n    return arr;\r\n}","import React, {useMemo} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport {connect} from \"react-redux\";\r\nimport ShareIcon from \"@material-ui/icons/Share\";\r\nimport {shareSystemsActive, shareSystemsConnected} from \"libs/shareSystems\";\r\nimport PropTypes from \"prop-types\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport SendIcon from '@material-ui/icons/Send';\r\n\r\nexport const sharePopupData = (name, payload) => ({name, payload})\r\n\r\nconst ShareSelectPopup = (\r\n    {\r\n        data,\r\n        onCancel,\r\n        onChoose,\r\n        demandHeader\r\n    }) => {\r\n\r\n    const activeShareSystems = useMemo(() => shareSystemsActive(demandHeader), [demandHeader])\r\n    const connectedShareSystems = useMemo(() => shareSystemsConnected(demandHeader), [demandHeader])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel));\r\n        return buttons;\r\n    }\r\n    return (<Dialog\r\n        open\r\n        title={Tr(\"int_choose_popup_title\")}\r\n        maxWidth='sm'\r\n        onClose={onCancel}\r\n        dialogActions={<MultiButton buttons={getButtons()}/>}\r\n    >\r\n        <TypographyWithIcon Icon={SendIcon}>{data.name}</TypographyWithIcon>\r\n        <br/>\r\n        <GridBlock justify=\"center\" alignItems=\"center\">\r\n            {\r\n                activeShareSystems.map(x =>\r\n                    <Button key={x}\r\n                            disabled={!connectedShareSystems.includes(x)}\r\n                            tooltip={!connectedShareSystems.includes(x) ? Tr(\"int_demand_not_connected_x\", {x}, true) : undefined}\r\n                            onClick={() => onChoose(data.payload, x)}\r\n                            Icon={ShareIcon}\r\n                    >{Tr(\"int_upload_x\", {x}, true)}</Button>)\r\n            }\r\n        </GridBlock>\r\n    </Dialog>)\r\n}\r\n\r\nShareSelectPopup.propTypes = {\r\n    data: PropTypes.shape({\r\n        name: PropTypes.string.isRequired,\r\n        payload: PropTypes.object,\r\n    }).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onChoose: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(ShareSelectPopup)","import React, {useMemo, useState} from \"react\";\r\nimport {List} from \"@material-ui/core\";\r\nimport Loading from \"components/Loading\";\r\nimport {connect} from \"react-redux\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PaperLink from \"./PaperLink\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PapersGeneratorRfxInvitedSupplierWithOfferPopup from \"./customPopups/PapersGeneratorRfxInvitedSupplierWithOfferPopup\";\r\nimport PapersGeneratorRfxRequestPosition from \"./customPopups/PapersGeneratorRfxRequestPosition\";\r\nimport PapersGeneratorRfxInvitedSupplierPosition from \"./customPopups/PapersGeneratorRfxInvitedSupplierPosition\";\r\nimport ChooseSwzGeneratorOptions from \"./customPopups/swzGenerator/ChooseSwzGeneratorOptions\";\r\nimport PapersGeneratOfferFilesVerification from \"./customPopups/PapersGeneratOfferFilesVerification\";\r\nimport PapersGeneratorMessageFilesVerification from \"./customPopups/PapersGeneratorMessageFilesVerification\";\r\nimport reduxStore from \"redux/store\";\r\nimport {setSalesNotification} from \"redux/actions\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport Tr from \"translations/Translations\";\r\nimport PapersGeneratorGzmManagementResolution from \"./customPopups/gzm/PapersGeneratorGzmManagementResolution\";\r\nimport PapersGeneratorGzmLeadingDocument from \"./customPopups/gzm/PapersGeneratorGzmLeadingDocument\";\r\nimport PapersGeneratorGzmDraftGroupAgreement from \"./customPopups/gzm/PapersGeneratorGzmDraftGroupAgreement\";\r\nimport PapersGeneratorGzmDocumentToSign from \"./customPopups/gzm/PapersGeneratorGzmDocumentToSign\";\r\nimport PapersGeneratorXmpUzpPresidentPaperPopup from \"./customPopups/xmpUzpPresidentPaper/PapersGeneratorXmpUzpPresidentPaperPopup\";\r\nimport {shareSystemsActive} from \"libs/shareSystems\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\n\r\nconst DEF_CUSTOM_POPUP = {type: null, paper: null, shareSystem: null};\r\nconst PAPERS_SHARE_SUPPORTED_CUSTOM_POPUPS = [\"rfxInvitedSupplierWithOffer\", \"rfxInvitedSupplierPosition\", \"rfxRequestPosition\", \"swzParams\"]\r\nconst REPORT_SHARE_SUPPORTED_CUSTOM_POPUPS = [\"rfxMessageVerification\", \"operator_form_verification_popup\"]\r\n\r\nconst PapersGeneratorList = (\r\n    {\r\n        id,\r\n        editable = true,\r\n        papersGeneratorList,\r\n        demandHeader,\r\n        demandPrivileges = {}\r\n    }) => {\r\n\r\n    const [customPopup, setCustomPopup] = useState(DEF_CUSTOM_POPUP);\r\n    const [paperWorking, setPaperWorking] = useState(null);\r\n    const [sharePopupPaper, setSharePopupPaper] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const shareSystems = useMemo(() => shareSystemsActive(demandHeader), [demandHeader])\r\n\r\n    const paperClick = (paper) => {\r\n        if (paperWorking)\r\n            return;\r\n\r\n        if (!paper.available) {\r\n            reduxStore.dispatch(setSalesNotification(paper.salesModule));\r\n            return;\r\n        }\r\n\r\n        if (!paper.customPopup) {\r\n            if (paper.dictionary === 'papersGenerator') {\r\n                setPaperWorking(paper.paperId);\r\n                PapersGeneratorService.downloadPaper(Endpoints.PAPERS_GENERATOR_PRINT(id, paper.paperId),\r\n                    () => setPaperWorking(null), () => setPaperWorking(null))\r\n            } else if (paper.dictionary === 'reportsGenerator') {\r\n                setPaperWorking(paper.paperId);\r\n                let url\r\n                if (paper.paperId === 'demandPrintProcessHistory')\r\n                    url = Endpoints.PAPERS_GENERATOR_DEMAND_PROCESS_HISTORY(id);\r\n                else if (paper.paperId === \"purchasingGroupTemplateFormsReport\")\r\n                    url = Endpoints.PURCHASING_GROUP_MEMBERS_PAPERS_GENERATOR_TEMPLATE_FORM_EXPORT(id);\r\n                else\r\n                    url = Endpoints.PAPERS_GENERATOR_DEMAND_REPORT(id, paper.paperId);\r\n\r\n                PapersGeneratorService.downloadPaper(url,\r\n                    () => setPaperWorking(null), () => setPaperWorking(null))\r\n            }\r\n        } else {\r\n            setCustomPopup({paper: paper, type: paper.customPopup, share: false})\r\n        }\r\n    }\r\n\r\n    const shareClick = (paper) => {\r\n        setSharePopupPaper(sharePopupData(paper.name, paper));\r\n    }\r\n\r\n    const doShare = (paper, system) => {\r\n        setSharePopupPaper(null);\r\n        if (paperWorking)\r\n            return;\r\n\r\n        if (!paper.available) {\r\n            reduxStore.dispatch(setSalesNotification(paper.salesModule));\r\n            return;\r\n        }\r\n        if (!paper.customPopup) {\r\n            if (paper.dictionary === 'papersGenerator') {\r\n                setPaperWorking(paper.paperId);\r\n                PapersGeneratorService.sharePaper(id, paper.paperId, system).then(resp => resp ? enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true)) : null).finally(() => setPaperWorking(null))\r\n            } else if (paper.dictionary === 'reportsGenerator') {\r\n\r\n            }\r\n        } else {\r\n            setCustomPopup({paper: paper, type: paper.customPopup, shareSystem: system})\r\n        }\r\n    }\r\n\r\n    const showShare = (paper) => {\r\n        return demandPrivileges.INTEGRATIONS_UPLOAD &&\r\n            shareSystems.length > 0 && (!paper.customPopup || PAPERS_SHARE_SUPPORTED_CUSTOM_POPUPS.includes(paper.customPopup));\r\n    }\r\n\r\n    const showShareReport = (paper) => {\r\n        return demandPrivileges.INTEGRATIONS_UPLOAD &&\r\n            shareSystems.length > 0 && (REPORT_SHARE_SUPPORTED_CUSTOM_POPUPS.includes(paper.customPopup));\r\n    }\r\n\r\n\r\n    if (!papersGeneratorList) return <Loading/>\r\n    return (\r\n        <>\r\n            {\r\n                papersGeneratorList.modules.length > 0 && <>\r\n                    <BoldTypography>{Tr('papers_generator_modules')}</BoldTypography>\r\n                    <List>\r\n                        {\r\n                            papersGeneratorList.modules.map(paper => (\r\n                                <PaperLink key={paper.paperId} editable={editable} demandId={id} paper={paper} paperWorking={paperWorking}\r\n                                           paperClick={paperClick} showShare={false} shareClick={shareClick}/>))\r\n                        }\r\n\r\n                    </List>\r\n                </>\r\n            }\r\n\r\n            <BoldTypography>{Tr('papers_generator_papers')}</BoldTypography>\r\n            <List dense>\r\n                {\r\n                    papersGeneratorList.papers.map(paper => (\r\n                        <PaperLink key={paper.paperId} editable={editable} demandId={id} paper={paper} paperWorking={paperWorking} paperClick={paperClick}\r\n                                   showShare={showShare(paper)} shareClick={shareClick}\r\n                        />))\r\n                }\r\n            </List>\r\n\r\n            {\r\n                papersGeneratorList.reports.length > 0 && <>\r\n                    <BoldTypography>{Tr('papers_generator_reports')}</BoldTypography>\r\n                    <List dense>\r\n                        {\r\n                            papersGeneratorList.reports.map(paper => (\r\n                                <PaperLink key={paper.paperId} editable={editable} demandId={id} paper={paper} paperWorking={paperWorking} paperClick={paperClick}\r\n                                           showShare={showShareReport(paper)} shareClick={shareClick}/>))\r\n                        }\r\n\r\n                    </List>\r\n                </>\r\n            }\r\n\r\n            {customPopup.type === 'rfxInvitedSupplierWithOffer' &&\r\n                <PapersGeneratorRfxInvitedSupplierWithOfferPopup demandId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}\r\n                                                                 shareSystem={customPopup.shareSystem}/>}\r\n\r\n            {customPopup.type === 'rfxRequestPosition' && <PapersGeneratorRfxRequestPosition demandId={id} paper={customPopup.paper} onClose={() =>\r\n                setCustomPopup(DEF_CUSTOM_POPUP)} shareSystem={customPopup.shareSystem}/>}\r\n\r\n            {customPopup.type === 'rfxInvitedSupplierPosition' &&\r\n                <PapersGeneratorRfxInvitedSupplierPosition demandId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}\r\n                                                           shareSystem={customPopup.shareSystem}/>}\r\n\r\n            {customPopup.type === 'swzParams' &&\r\n                <ChooseSwzGeneratorOptions shareSystem={customPopup.shareSystem} id={id} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'operator_form_verification_popup' &&\r\n                <PapersGeneratOfferFilesVerification shareSystem={customPopup.shareSystem}  demandId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'rfxMessageVerification' &&\r\n                <PapersGeneratorMessageFilesVerification shareSystem={customPopup.shareSystem} demandId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'gzmManagementResolution' &&\r\n                <PapersGeneratorGzmManagementResolution groupId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'gzmLeadingDocument' &&\r\n                <PapersGeneratorGzmLeadingDocument groupId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'gzmDraftGroupAgreement' &&\r\n                <PapersGeneratorGzmDraftGroupAgreement groupId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'gzmDocumentToSign' &&\r\n                <PapersGeneratorGzmDocumentToSign groupId={id} paper={customPopup.paper} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {customPopup.type === 'xml_uzp_president_popup' &&\r\n                <PapersGeneratorXmpUzpPresidentPaperPopup demandId={id} onClose={() => setCustomPopup(DEF_CUSTOM_POPUP)}/>}\r\n\r\n            {!!sharePopupPaper &&\r\n                <ShareSelectPopup data={sharePopupPaper} onCancel={() => setSharePopupPaper(null)} onChoose={(paper, system) => doShare(paper, system)}/>}\r\n\r\n        </>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    papersGeneratorList: state.resources[PapersGeneratorService.PAPERS_GENERATOR_LIST_RESOURCE_ID],\r\n    demandHeader: state.resources.demandHeader,\r\n    demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY],\r\n}), {})(PapersGeneratorList);\r\n","import React, {useEffect} from \"react\";\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidationKeys} from 'constants/DemandValidation';\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport PapersGeneratorList from \"components/complex/papersGenerator/PapersGeneratorList\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\n\r\nfunction PapersGenerator(\r\n    {\r\n        match\r\n    }) {\r\n    const FORM_ID = DemandValidationKeys.PAPERS_GENERATOR;\r\n    const id = match.params.id;\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getAvailablePapers(id);\r\n        return () => {\r\n            PapersGeneratorService.clearResources(PapersGeneratorService.PAPERS_GENERATOR_LIST_RESOURCE_ID);\r\n        }\r\n    }, [id])\r\n\r\n    return (\r\n        <Form\r\n            initialValues={{}}\r\n            validationSchema={ValidationShema.any()}\r\n            id={FORM_ID}\r\n        >{(formikProps) => (\r\n            <PapersGeneratorList id={id}/>)}\r\n        </Form>\r\n    )\r\n}\r\n\r\nPapersGenerator.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withRouter(PapersGenerator);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport PapersGenerator from './PapersGenerator';\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n\r\n    return (expanded && <PapersGenerator/>)\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import {useState} from 'react';\r\n\r\nexport const getPaginationConfig = (page = 1, pageSize = 10) => ({\r\n    page,\r\n    pageSize\r\n});\r\n\r\n\r\nexport default ({pagination = getPaginationConfig(), search = {}, sort = {}} = {}) => {\r\n    const [searchData, setSearchData] = useState({pagination, search, sort});\r\n    const [totalCount, setTotalCount] = useState(0);\r\n    const [contractorTotalCount, setContractorTotalCount] = useState(0);\r\n    const setPaginationConfig = (config) => {\r\n        setSearchData(searchData => ({...searchData, pagination: config}))\r\n    };\r\n    const setSearchConfig = (search, preservePagination) => {\r\n        setSearchData(searchData => ({...searchData, pagination: preservePagination ? searchData.pagination : {...searchData.pagination, page: 1}, search: search}))\r\n    };\r\n    const setSortConfig = (sort) => {\r\n        setSearchData(searchData => ({...searchData, pagination: {...searchData.pagination, page: 1}, sort: sort}))\r\n    };\r\n    return {searchData, totalCount, setTotalCount, contractorTotalCount, setContractorTotalCount, setPaginationConfig, setSearchConfig, setSortConfig};\r\n}\r\n\r\n","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Button from 'components/Button';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {getPaginationConfig} from \"hooks/useSearch\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    info: {\r\n        lineHeight: '2rem'\r\n    }\r\n}))\r\n\r\nfunction MoreButton(\r\n    {\r\n        totalCount = 0,\r\n        loadedCount = 0,\r\n        setConfig = () => {\r\n        },\r\n        config = getPaginationConfig(),\r\n        disabled = false,\r\n        captionTrKey = 'showing_x_of_y_rows',\r\n        label = Tr('load_more'),\r\n    }) {\r\n    const classes = useStyles();\r\n    const handleChangePage = () => {\r\n        setConfig({...config, page: config.page + 1});\r\n    }\r\n\r\n    return (\r\n        <GridBlock\r\n            alignItems='center'\r\n            direction='column'\r\n        >\r\n            <Typography variant='caption' className={classes.info}>\r\n                {Tr(captionTrKey, {count: loadedCount, total: totalCount})}\r\n            </Typography>\r\n            <Button\r\n                variant={'outlined'}\r\n                size={'small'}\r\n                onClick={handleChangePage}\r\n                disabled={disabled || (loadedCount >= totalCount)}\r\n            >\r\n                {label}\r\n            </Button>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nMoreButton.propTypes = {\r\n    totalCount: PropTypes.number,\r\n    loadedCount: PropTypes.number,\r\n    setConfig: PropTypes.func,\r\n    config: PropTypes.shape({\r\n        page: PropTypes.number,\r\n        pageSize: PropTypes.number\r\n    }),\r\n    disabled: PropTypes.bool,\r\n    captionTrKey: PropTypes.string,\r\n    label: PropTypes.string\r\n}\r\n\r\nexport default MoreButton;","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport applySearchParams from \"libs/applySearchParams\";\r\n\r\nconst RESOURCE_ID_RFX_OFFER_LIST = 'rfxOfferList';\r\nconst RESOURCE_ID_RFX_OFFERS_ACTIONS = 'rfxOffersActions';\r\nconst RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS = 'rfxOfferDecryptionStatus';\r\nconst RESOURCE_ID_RFX_OFFER_PUBLIC_SESSION_STATUS = 'rfxOfferPublicSessionStatus';\r\nconst RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS = 'rfxOfferPublicSessionOnlineStatus';\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n}\r\nconst getOffers = async (roundId, pagination, search) => {\r\n    const params = {\r\n        ...pagination\r\n    }\r\n    applySearchParams(search, params)\r\n\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.RFX_OFFERS_LIST(roundId), {params});\r\n\r\n        if (pagination.page > 1) {\r\n            const state = reduxStore.getState();\r\n            if (state.resources && state.resources[RESOURCE_ID_RFX_OFFER_LIST]) {\r\n                const res2 = {\r\n                    ...res,\r\n                    items: [...state.resources[RESOURCE_ID_RFX_OFFER_LIST].items, ...res.items],\r\n                }\r\n                reduxStore.dispatch(setResource(RESOURCE_ID_RFX_OFFER_LIST, res2));\r\n                return;\r\n            }\r\n        }\r\n        reduxStore.dispatch(setResource(RESOURCE_ID_RFX_OFFER_LIST, res));\r\n\r\n    } catch (error) {\r\n    }\r\n}\r\nconst getAvailableActions = async (roundId) => {\r\n    const res = await RestRequestGET(Endpoints.RFX_OFFERS_ACTIONS(roundId));\r\n    reduxStore.dispatch(setResource(RESOURCE_ID_RFX_OFFERS_ACTIONS, res.actions));\r\n}\r\n\r\nconst getAdditionalRoundsOffers = async (roundId, supplierId) => {\r\n\r\n    const res = await RestRequestGET(Endpoints.RFX_OFFERS_ADDITIONAL_ROUND_OFFERS(roundId, supplierId));\r\n    _doAdditionalRoundsOffers(roundId, supplierId, res);\r\n}\r\nconst clearAdditionalRoundsOffers = async (roundId, supplierId) => {\r\n    _doAdditionalRoundsOffers(roundId, supplierId, undefined);\r\n}\r\nconst _doAdditionalRoundsOffers = (roundId, supplierId, additionalOffers) => {\r\n\r\n    const {resources} = reduxStore.getState();\r\n    if (resources[RESOURCE_ID_RFX_OFFER_LIST]) {\r\n        const curList = resources[RESOURCE_ID_RFX_OFFER_LIST];\r\n        const res2 = {\r\n            ...curList,\r\n            items: curList.items.map(item => item.id !== supplierId ? item : {...item, additionalOffers}),\r\n        }\r\n        reduxStore.dispatch(setResource(RESOURCE_ID_RFX_OFFER_LIST, res2));\r\n    }\r\n}\r\n\r\n\r\n\r\n\r\nconst sendIvniteToOffers = async (roundId, emailsTab) => {\r\n    const emails = {\r\n        emails: emailsTab\r\n    }\r\n    const resp = await RestRequestPOST(Endpoints.RFX_OFFERS_SEND_INVITE(roundId), emails);\r\n    return resp;\r\n}\r\n\r\nconst getOffersDecryptionStatus = async (roundId) => {\r\n    const resp = await RestRequestGET(Endpoints.RFX_OFFERS_DECRYPTION_STATUS(roundId));\r\n    reduxStore.dispatch(setResource(RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS, resp));\r\n    return resp;\r\n}\r\n\r\nconst getOffersDecryptionProgress = async (roundId) => {\r\n    return await RestRequestGET(Endpoints.RFX_OFFERS_DECRYPTION_PROGRESS(roundId));\r\n}\r\n\r\nconst startOffersDecryptionProcess = async (roundId) => {\r\n    return await RestRequestPOST(Endpoints.RFX_OFFERS_DECRYPTION_START(roundId));\r\n}\r\n\r\nconst getOffersPublicSessionStatus = async (roundId) => {\r\n    const resp = await RestRequestGET(Endpoints.RFX_OFFERS_PUBLIC_SESSION_STATUS(roundId));\r\n    reduxStore.dispatch(setResource(RESOURCE_ID_RFX_OFFER_PUBLIC_SESSION_STATUS, resp));\r\n    return resp;\r\n}\r\n\r\nconst getOffersPublicSessionProgress = async (roundId) => {\r\n    return await RestRequestGET(Endpoints.RFX_OFFERS_PUBLIC_SESSION_PROGRESS(roundId));\r\n}\r\n\r\nconst startOffersPublicSessionProcess = async (roundId) => {\r\n    return await RestRequestPOST(Endpoints.RFX_OFFERS_PUBLIC_SESSION_START(roundId));\r\n}\r\n\r\nconst getOffersPublicSessionOnlineStatus = async (roundId) => {\r\n    const resp = await RestRequestGET(Endpoints.RFX_OFFERS_PUBLIC_SESSION_ONLINE_STATUS(roundId));\r\n    reduxStore.dispatch(setResource(RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS, resp));\r\n}\r\n\r\nconst saveOffersPublicSessionOnline = async (roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.RFX_OFFERS_PUBLIC_SESSION_ONLINE_SAVE(roundId), values);\r\n}\r\n\r\nconst downloadOffersAttachments = async (roundId, finallyCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.RFX_OFFERS_ATTACHMENTS(roundId))\r\n            .finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst verifyOffersAttachments = async (roundId, finallyCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.RFX_OFFERS_VERIFY_ATTACHMENTS(roundId), undefined, 'post')\r\n            .finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\nconst downloadOffersSummary = async (roundId, type, finallyCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.RFX_OFFERS_SUMMARY(roundId, type))\r\n            .finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\nconst saveEnvelope = async (roundId, envelope) => {\r\n        return await RestRequestPOST(Endpoints.RFX_OFFERS_ENVELOPE(roundId), envelope);\r\n}\r\nconst getEnvelope = async (roundId, envelopeId) => {\r\n        return await RestRequestGET(Endpoints.RFX_OFFERS_ENVELOPE_ID(roundId, envelopeId));\r\n}\r\n\r\n\r\nexport default {\r\n    getOffers,\r\n    sendIvniteToOffers,\r\n    clearResources,\r\n    getOffersDecryptionStatus,\r\n    getOffersDecryptionProgress,\r\n    startOffersDecryptionProcess,\r\n    getOffersPublicSessionStatus,\r\n    getOffersPublicSessionProgress,\r\n    startOffersPublicSessionProcess,\r\n    getOffersPublicSessionOnlineStatus,\r\n    saveOffersPublicSessionOnline,\r\n    downloadOffersAttachments,\r\n    verifyOffersAttachments,\r\n    downloadOffersSummary,\r\n    saveEnvelope,\r\n    getEnvelope,\r\n    getAvailableActions,\r\n    getAdditionalRoundsOffers,\r\n    clearAdditionalRoundsOffers,\r\n    RESOURCE_ID_RFX_OFFER_LIST,\r\n    RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS,\r\n    RESOURCE_ID_RFX_OFFER_PUBLIC_SESSION_STATUS,\r\n    RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS,\r\n    RESOURCE_ID_RFX_OFFERS_ACTIONS\r\n}","import Tr from 'translations/Translations';\r\n\r\nconst _TR_PREFIX = 'offer_status_';\r\n\r\nexport const OfferStatuses = {\r\n    PLACED: 'placed',\r\n    MODIFIED: 'modified',\r\n    NO_OFFER: 'noOffer',\r\n    MODIFIED_BY_OPERATOR: 'modifiedByOperator'\r\n}\r\n\r\nexport const OfferStatusLabel = (status) => (Tr(_TR_PREFIX + status));","import Tr from 'translations/Translations';\r\n\r\nconst _TR_PREFIX = 'offer_encryption_status_';\r\n\r\nexport const OfferEncryptionStatuses = {\r\n    DECRYPTED: 'decrypted',\r\n    ENCRYPTED: 'encrypted',\r\n    PENDING: 'pending'\r\n}\r\n\r\nexport const OfferEncryptionStatusLabel = (status) => Tr(_TR_PREFIX + status);","import React from 'react'\r\nimport {makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport SimpleTable from 'components/complex/simpleTable/SimpleTable';\r\nimport moment from 'moment';\r\nimport {OfferStatusLabel} from \"constants/OfferStatus\";\r\nimport {OfferEncryptionStatuses, OfferEncryptionStatusLabel} from \"constants/OfferEncryptionStatus\";\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport LockOpenOutlinedIcon from '@material-ui/icons/LockOpenOutlined';\r\nimport InsertDriveFileOutlinedIcon from '@material-ui/icons/InsertDriveFileOutlined';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport TooltipIcon from \"components/icon/TooltipIcon\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {},\r\n    cell: {\r\n        padding: theme.spacing(1)\r\n    },\r\n    dateColumn: {\r\n        ...theme.components.table.buttonColumn,\r\n        width: theme.components.table.dateColumn.width + theme.components.table.buttonColumn.width\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    statusColumn: {\r\n        width: 200,\r\n        paddingRight: theme.spacing(2)\r\n    },\r\n}));\r\n\r\nfunction OfferAdditionalOffersTable(\r\n    {\r\n        additionalOffers,\r\n        redirectToOffer\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const createItem = ({roundId, supplierId, name, encryptionStatus, status, offerDate, offerDetailsUrl, roundType}, i) => {\r\n        let encIcon = encryptionStatus ? (encryptionStatus === OfferEncryptionStatuses.DECRYPTED ? LockOpenOutlinedIcon : LockOutlinedIcon) : InsertDriveFileOutlinedIcon;\r\n        const dateStr = offerDate ? moment(offerDate).format(DateFormats.DATETIME_FORMAT) : '';\r\n\r\n        return [\r\n            name,\r\n            <><TooltipIcon tooltip={OfferEncryptionStatusLabel(encryptionStatus)} Icon={encIcon}/> {status ? OfferStatusLabel(status) : ''}</>,\r\n            dateStr,\r\n            <WorkableIconPreviewButton tooltip={Tr('offer_details')} disabled={!offerDetailsUrl}\r\n                                       onClick={offerDetailsUrl ? () => redirectToOffer(roundType, offerDate) : undefined}/>\r\n        ]\r\n    }\r\n\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            {additionalOffers.length === 0 ?\r\n                <BoldTypography>{Tr('additional_offer_collection_pending_info_message')}</BoldTypography>\r\n                :\r\n                <SimpleTable\r\n                    headers={[\r\n                        Tr('name'),\r\n                        Tr('status'),\r\n                        Tr('date_of_receipt'),\r\n                        ''\r\n                    ]}\r\n                    items={\r\n                        additionalOffers.map((item, i) => [\r\n                            ...createItem(item, i)\r\n                        ])\r\n                    }\r\n                    columnClasses={[\r\n                        undefined,\r\n                        classes.statusColumn,\r\n                        classes.dateColumn,\r\n                        classes.buttonColumn\r\n                    ]}\r\n                    cellClassName={classes.cell}\r\n                />}\r\n        </div>\r\n    )\r\n}\r\n\r\nOfferAdditionalOffersTable.propTypes = {\r\n    additionalOffers: PropTypes.array.isRequired,\r\n}\r\n\r\nexport default OfferAdditionalOffersTable;\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestGET} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store'\r\nimport {clearResource, setResource} from \"../redux/actions\";\r\nimport downloadFileWithPreloadUrl from \"../libs/downloadFileWithPreloadUrl\";\r\n\r\n\r\nconst GENERAL_INFO_BASIC_DATA = \"generalInfoBasicData\";\r\nconst GENERAL_INFO_DOCUMENTS = \"generalInfoDocuments\";\r\nconst GENERAL_INFO_PUBLIC_ANSWERS = \"generalInfoPublicAnswers\";\r\n\r\n\r\nconst getContractorGeneralInfoBasicData = async (demandId, stageId, supplierId) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_BASIC_DATA(demandId, stageId, supplierId),{params});\r\n    reduxStore.dispatch(setResource(GENERAL_INFO_BASIC_DATA, resp));\r\n}\r\nconst getContractorGeneralInfoDocuments = async (demandId, stageId, supplierId) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS(demandId, stageId, supplierId), {params});\r\n    reduxStore.dispatch(setResource(GENERAL_INFO_DOCUMENTS, resp));\r\n}\r\nconst getContractorGeneralInfoPublicAnswers = async (demandId, stageId, supplierId) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_PUBLIC_ANSWERS(demandId, stageId, supplierId), {params});\r\n    reduxStore.dispatch(setResource(GENERAL_INFO_PUBLIC_ANSWERS, resp));\r\n}\r\nconst getDownloadFile = async (demandId, stageId, type, documentId, supplierId) => {\r\n    const params = {supplierId}\r\n    await downloadFileWithPreloadUrl(\r\n        Endpoints.DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS_DOWNLOAD_URL(demandId, stageId, type, documentId, supplierId),\r\n        false, params);\r\n}\r\nconst downloadContractorGeneralInfoDocumentsZip = async (demandId, stageId, supplierId, finallyCallback = () => {\r\n}) => {\r\n    const params = {supplierId}\r\n    RestRequestBLOB(Endpoints.DEMAND_OFFERS_CONTRACTOR_GENERAL_INFO_DOCUMENTS_DOWNLOAD_ZIP(demandId, stageId, supplierId), {params})\r\n        .finally(finallyCallback);\r\n}\r\nconst clearResources = (resId) => reduxStore.dispatch(clearResource(resId));\r\n\r\nexport default {\r\n    getContractorGeneralInfoBasicData,\r\n    getContractorGeneralInfoDocuments,\r\n    getContractorGeneralInfoPublicAnswers,\r\n    getDownloadFile,\r\n    downloadContractorGeneralInfoDocumentsZip,\r\n    clearResources,\r\n    GENERAL_INFO_BASIC_DATA,\r\n    GENERAL_INFO_DOCUMENTS,\r\n    GENERAL_INFO_PUBLIC_ANSWERS\r\n}","import React from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport ErrorOutlineOutlinedIcon from \"@material-ui/icons/ErrorOutlineOutlined\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    subject: {\r\n        flexGrow: 1\r\n    },\r\n    unreadElements: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction GeneralInfoExpansionPanelTitle(\r\n    {\r\n        subject,\r\n        unreadElements,\r\n        expanded,\r\n        toggleThread,\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const toggleThread2 = () => {\r\n        toggleThread(!expanded);\r\n    }\r\n    return (\r\n        <GridBlock\r\n            alignItems=\"center\"\r\n            wrap='nowrap'\r\n            justify='space-between'\r\n        >\r\n            <Typography\r\n                className={classes.subject}\r\n                variant='h6'\r\n                onClick={toggleThread2}\r\n            >\r\n                {subject}\r\n                {!!unreadElements &&\r\n                    <ErrorOutlineOutlinedIcon color='error' className={classes.unreadElements} />\r\n                }\r\n            </Typography>\r\n\r\n            <WorkableIconExpandButton\r\n                color='primary'\r\n                onClick={toggleThread2}\r\n                expanded={expanded}\r\n            />\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nGeneralInfoExpansionPanelTitle.propTypes = {\r\n    subject: PropTypes.string.isRequired,\r\n    expanded: PropTypes.bool.isRequired,\r\n    toggleThread: PropTypes.func.isRequired\r\n}\r\n\r\nexport default GeneralInfoExpansionPanelTitle;","import React, {useState} from 'react'\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from \"prop-types\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"components/Typography\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        borderBottom: \"solid 1px\",\r\n        marginBottom: theme.spacing(3),\r\n        paddingBottom: theme.spacing()\r\n    },\r\n    titleRoot: {\r\n        '&>*:nth-child(1)': {\r\n            flexGrow: 1\r\n        }\r\n    },\r\n    titleCollapsible: {\r\n        cursor: \"pointer\"\r\n    },\r\n    content: {\r\n        marginLeft: theme.spacing(2),\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    label: {\r\n        fontSize: '1.1rem'\r\n    }\r\n\r\n}))\r\n\r\nfunction GeneralInfoEntry(\r\n    {\r\n        label,\r\n        collapsible = false,\r\n        defaultCollapsed,\r\n        biggerLabel = false,\r\n        children\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const [collapsed, setCollapsed] = useState(defaultCollapsed === undefined ? collapsible : defaultCollapsed);\r\n\r\n    return <div className={classes.root}>\r\n        <GridBlock className={clsx(classes.titleRoot, {[classes.titleCollapsible]: collapsible})}\r\n                   onClick={collapsible ? () => setCollapsed(x => !x) : undefined}>\r\n            <BoldTypography className={clsx({[classes.label]: biggerLabel})}>{label}</BoldTypography>\r\n            {(collapsible) && <Typography>{Tr(collapsed ? 'expand' : 'collapse')}</Typography>}\r\n        </GridBlock>\r\n        {!collapsed && <div className={classes.content}>{children}</div>}\r\n    </div>\r\n\r\n}\r\n\r\nGeneralInfoEntry.propTypes = {\r\n    label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\r\n    collapsible: PropTypes.bool\r\n}\r\n\r\nexport default GeneralInfoEntry;","import React, { memo } from 'react'\r\nimport { Accordion, AccordionSummary, Typography, AccordionDetails, AccordionActions, Tooltip } from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport { withStyles } from '@material-ui/styles';\r\nimport clsx from 'clsx';\r\nimport GridBlock from './GridBlock';\r\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\ttitle: {\r\n\t},\r\n\thighlighted: {\r\n\t\tcolor: theme.palette.primary.main,\r\n\t},\r\n\ttitleGrid: {\r\n\t\t'&>*:last-child': {\r\n\t\t\tflexGrow: 1,\r\n\t\t\tmarginLeft: theme.spacing(2),\r\n\t\t}\r\n\t},\r\n\tbottomButton: {\r\n\t\twidth: \"100%\",\r\n\t\theight: theme.spacing(4),\r\n\t\tcursor: \"pointer\",\r\n\t\tpaddingRight: theme.spacing(2),\r\n\t\t'&:hover': {\r\n\t\t\tbackground: theme.palette.background.appBarBackground,\r\n\t\t}\r\n\t},\r\n\thide: {\r\n\t\tdisplay: \"none\"\r\n\t}\r\n})\r\n\r\nfunction ExpansionPanel({\r\n\tpanelRef,\r\n\tchildren,\r\n\ttitle,\r\n\tclasses,\r\n\texpanded,\r\n\tonClick,\r\n\tonChange,\r\n\tdefaultExpanded = false,\r\n\thighlighted = false,\r\n\tsquare,\r\n\tclassesObj = {},\r\n\tdisabled = false,\r\n\ttitleAdornment,\r\n\tid,\r\n\thide = false\r\n}) {\r\n\r\n\tconst onCollapse = () => {\r\n\t\tonChange(null, false)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Accordion\r\n\t\t\tref={panelRef}\r\n\t\t\tdisabled={disabled}\r\n\t\t\tsquare={square}\r\n\t\t\tdefaultExpanded={defaultExpanded}\r\n\t\t\texpanded={expanded}\r\n\t\t\tonChange={onChange}\r\n\t\t\tclassName={clsx(classesObj.root, {\r\n\t\t\t\t[classes.hide]: hide\r\n\t\t\t})}\r\n\t\t\tclasses={{\r\n\t\t\t\texpanded: classesObj.expanded\r\n\t\t\t}}\r\n\t\t\tid={id}\r\n\t\t>\r\n\t\t\t<AccordionSummary\r\n\t\t\t\tclasses={{\r\n\t\t\t\t\texpanded: classesObj.expandedSummary\r\n\t\t\t\t}}\r\n\t\t\t\tonClick={onClick}\r\n\t\t\t\tclassName={clsx(classesObj.title, {\r\n\t\t\t\t\t[classes.highlighted]: highlighted\r\n\t\t\t\t})}>\r\n\t\t\t\t<GridBlock\r\n\t\t\t\t\tjustify='space-between'\r\n\t\t\t\t\talignItems='center'\r\n\t\t\t\t\tclassName={clsx(classesObj.titleGrid, classes.titleGrid)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{typeof title === \"string\" ?\r\n\t\t\t\t\t\t<Typography variant='h6'>\r\n\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t: title}\r\n\r\n\t\t\t\t\t{titleAdornment}\r\n\t\t\t\t</GridBlock>\r\n\t\t\t</AccordionSummary>\r\n\t\t\t<AccordionDetails className={classesObj.details}>\r\n\t\t\t\t{children}\r\n\t\t\t</AccordionDetails>\r\n\t\t\t<AccordionActions>\r\n\t\t\t\t<GridBlock\r\n\t\t\t\t\talignItems=\"flex-end\"\r\n\t\t\t\t\tjustify=\"flex-end\"\r\n\t\t\t\t\tclassName={classes.bottomButton}\r\n\t\t\t\t\tonClick={onCollapse}\r\n\t\t\t\t>\r\n\t\t\t\t\t<Tooltip title={Tr('collapse')} placement='top'>\r\n\t\t\t\t\t\t<ExpandLessIcon />\r\n\t\t\t\t\t</Tooltip>\r\n\t\t\t\t</GridBlock>\r\n\t\t\t</AccordionActions>\r\n\t\t</Accordion>\r\n\t)\r\n}\r\n\r\nExpansionPanel.propTypes = {\r\n\ttitle: PropTypes.oneOfType([\r\n\t\tPropTypes.string,\r\n\t\tPropTypes.object\r\n\t]),\r\n\tchildren: PropTypes.any,\r\n\tdefaultExpanded: PropTypes.bool,\r\n\texpanded: PropTypes.bool,\r\n\tonClick: PropTypes.func,\r\n\thighlighted: PropTypes.bool,\r\n\twithPadding: PropTypes.bool,\r\n\tsquare: PropTypes.bool,\r\n\tpanelRef: PropTypes.any\r\n}\r\n\r\nexport default withStyles(style)(memo(ExpansionPanel));\r\n","const formatAmountNumber = (val, undefinedValue, fixed) => {\r\n    if (val === null || val === undefinedValue) {\r\n        return undefinedValue;\r\n    }\r\n\r\n    return Number.parseFloat(val).toFixed(2).replace(/[.]/, \",\");\r\n}\r\n\r\nexport default formatAmountNumber;","import React from 'react';\r\n\r\nconst OfferStageTranslationsContext = React.createContext(trKey => trKey);\r\nexport const OfferStageTranslationsContextProvider = OfferStageTranslationsContext.Provider;\r\nexport default OfferStageTranslationsContext;","import React, {useContext, useState} from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport GeneralInfoExpansionPanelTitle from \"./GeneralInfoExpansionPanelTitle\";\r\nimport Tr from \"translations/Translations\";\r\nimport GeneralInfoEntry from \"./GeneralInfoEntry\";\r\nimport ExpansionPanel from \"components/ExpansionPanel\";\r\nimport {PriceTypeLabel} from \"constants/PriceTypes\";\r\nimport {isEuropeProcedure} from \"constants/ProcedureType\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {VALUES as ProcedureStatus} from \"constants/ProcedureStatus\";\r\nimport {jedzTranslations} from \"pages/purchaser/MyProcedure/scenes/part1/panels/demand/dataEdit/fieldsOptions/jedz.values\";\r\nimport {PrimaryTenderVariantTr} from \"constants/PrimaryTenderVariant\";\r\nimport OfferStageTranslationsContext from \"../../../../../../../../../context/OfferStageTranslationsContext\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    textarea: {\r\n        whiteSpace: 'pre-wrap'\r\n    }\r\n}));\r\n\r\nfunction GeneralInfoBasicData(\r\n    {\r\n        panelsClassesObject,\r\n        generalInfoBasicData,\r\n        demandHeader\r\n    }) {\r\n    const classes = useStyles();\r\n    const [expanded, setExpanded] = useState(false);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    return (\r\n        <ExpansionPanel\r\n            classesObj={panelsClassesObject}\r\n            title={\r\n                <GeneralInfoExpansionPanelTitle\r\n                    subject={Tr(\"basic_data\")}\r\n                    toggleThread={() => setExpanded(x => !x)}\r\n                    expanded={expanded}\r\n                />\r\n            }\r\n            expanded={expanded}\r\n            onChange={(e, isExpanded) => setExpanded(isExpanded)}\r\n\r\n        >\r\n            <GridBlock column>\r\n                <GeneralInfoEntry label={Tr('contact_person')}>\r\n                    <Typography>\r\n                        {generalInfoBasicData.contactPerson}\r\n                        <br/>\r\n                        {generalInfoBasicData.purchaserEmail}\r\n                        <br/>\r\n                        {generalInfoBasicData.contactPersonPhone}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry label={Tr('demand_type')}>\r\n                    <Typography>\r\n                        {generalInfoBasicData.procedureTypeTranslated}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry label={Tr('demand_realization_type')}>\r\n                    <Typography>\r\n                        {generalInfoBasicData.realizationTypeTranslated}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n\r\n                {!!generalInfoBasicData.description &&\r\n                <GeneralInfoEntry label={Tr('demand_description')}>\r\n                    <Typography className={classes.textarea}>\r\n                        {generalInfoBasicData.description}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n                }\r\n\r\n                {!!generalInfoBasicData.primaryTenderVariant &&\r\n                <GeneralInfoEntry label={Tr('primary_tender_variant')}>\r\n                    <Typography>\r\n                        {PrimaryTenderVariantTr[generalInfoBasicData.primaryTenderVariant]}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n                }\r\n\r\n                {!!generalInfoBasicData.orderType &&\r\n                <GeneralInfoEntry label={Tr('order_type')}>\r\n                    <Typography>\r\n                        {generalInfoBasicData.orderType}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n                }\r\n\r\n                {!generalInfoBasicData.passiveOfferForm &&\r\n                <GeneralInfoEntry label={Tr('offer_price_type')}>\r\n                    <Typography>\r\n                        {PriceTypeLabel(generalInfoBasicData.priceType)} (PLN)\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n                }\r\n\r\n                {generalInfoBasicData.canCreateAuction !== null &&\r\n                    <GeneralInfoEntry label={Tr('offer_electronic_auction')}>\r\n                        <Typography>\r\n                            {Tr(generalInfoBasicData.canCreateAuction ? 'yes' : 'no')}\r\n                        </Typography>\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                {generalInfoBasicData.digitalSign !== null &&\r\n                    <GeneralInfoEntry\r\n                        label={stageTr(isEuropeProcedure(generalInfoBasicData.procedureType) ? \"electronic_signature_question\" : \"electronic_signature_national_question\")}>\r\n                        <Typography>\r\n                            {Tr(generalInfoBasicData.digitalSign ? 'yes' : 'no')}\r\n                        </Typography>\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                {generalInfoBasicData.requiredJEDZ !== null &&\r\n                    <GeneralInfoEntry\r\n                        label={Tr('enable_JEDZ_question')}>\r\n                        <Typography>\r\n                            {jedzTranslations(generalInfoBasicData.requiredJEDZ)}\r\n                        </Typography>\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                {!generalInfoBasicData.passiveOfferForm &&\r\n                    <GeneralInfoEntry\r\n                        label={Tr('guarantee')}\r\n                        collapsible={generalInfoBasicData.guaranteeList && generalInfoBasicData.guaranteeList.length > 3}\r\n                    >\r\n\r\n                        {generalInfoBasicData.guaranteeList === null ?\r\n                            <Typography>{Tr('guarantee_not_required')}</Typography>\r\n                            :\r\n                            <>\r\n                                {generalInfoBasicData.dealingsCount === 1 ?\r\n                                    <>\r\n                                        {generalInfoBasicData.guaranteeList.length > 0 &&\r\n                                            <Typography>{formatAmountNumber(generalInfoBasicData.guaranteeList[0].value)} PLN</Typography>}\r\n                                    </>\r\n                                    :\r\n                                    <>\r\n                                        {generalInfoBasicData.guaranteeList.map(x => (\r\n                                            <Typography\r\n                                                key={x.identity}>{Tr(\"part_x\", {x: x.ordinalNumber})}: {formatAmountNumber(x.value)} PLN</Typography>))}\r\n\r\n                                    </>\r\n                                }\r\n                            </>\r\n                        }\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n\r\n                <GeneralInfoEntry label={Tr(\"demand_publish_date\")}>\r\n                    <Typography>\r\n                        {moment(generalInfoBasicData.procedureStartDate).format(DateFormats.DATETIME_FORMAT)}\r\n                    </Typography>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry label={generalInfoBasicData.stageTypeTranslated}>\r\n                    {generalInfoBasicData.stageEndDate === null ?\r\n                        <Typography>{Tr('offer_end_date_neg_dialog')}: {Tr('according_to_the_documentation')}</Typography>\r\n                        :\r\n                        <Typography>\r\n                            {Tr(\"offer_end_date\")}: {moment(generalInfoBasicData.stageEndDate).format(DateFormats.DATETIME_FORMAT)}\r\n                        </Typography>\r\n                    }\r\n                    <Typography>\r\n                        {Tr(\"offer_open_date\")}: {generalInfoBasicData.openOfferDate === null ? Tr('according_to_the_documentation') : moment(generalInfoBasicData.openOfferDate).format(DateFormats.DATETIME_FORMAT)}\r\n                    </Typography>\r\n                    {generalInfoBasicData.stageSecondEndDate &&\r\n                        <Typography>\r\n                            {Tr(\"offer_second_end_date\")}: {moment(generalInfoBasicData.stageSecondEndDate).format(DateFormats.DATETIME_FORMAT)}\r\n                        </Typography>\r\n                    }\r\n                </GeneralInfoEntry>\r\n\r\n                {generalInfoBasicData.demandFinishDate !== null &&\r\n                    <GeneralInfoEntry label={Tr(\"demand_finish_date\")}>\r\n                        {demandHeader.status === ProcedureStatus.CANCELLED ?\r\n                            <Typography>{Tr('procedure_status_6')}</Typography>\r\n                            :\r\n                            <Typography>\r\n                                {moment(generalInfoBasicData.demandFinishDate).format(DateFormats.DATETIME_FORMAT)}\r\n                            </Typography>\r\n                        }\r\n                    </GeneralInfoEntry>\r\n                }\r\n            </GridBlock>\r\n        </ExpansionPanel>\r\n    )\r\n}\r\n\r\nGeneralInfoBasicData.propTypes = {\r\n    generalInfoBasicData: PropTypes.object.isRequired,\r\n    demandHeader: PropTypes.object.isRequired,\r\n}\r\n\r\nexport default GeneralInfoBasicData;","import React from 'react'\r\nimport ForwardIcon from '@material-ui/icons/Forward';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconForwardButton(\r\n    {\r\n        tooltip = Tr('enter'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={ForwardIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconForwardButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconForwardButton;","import React, {useReducer} from 'react'\r\nimport {makeStyles, TableCell, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport moment from \"moment\";\r\nimport WorkableIconDownloadButton from 'components/button/WorkableIconDownloadButton';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport DemandOffersGeneralInfoService from \"services/DemandOffersGeneralInfoService\";\r\nimport WorkableIconForwardButton from \"components/button/WorkableIconForwardButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    warnIcon: {\r\n        padding: 0,\r\n        color: `${theme.palette.secondary.main} !important`\r\n    },\r\n    descriptionTooltip: {\r\n        whiteSpace: 'pre-line'\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    versionsCell: {\r\n        background: theme.palette.background.default,\r\n        paddingLeft: 0,\r\n        paddingRight: 0\r\n    }\r\n}));\r\n\r\nfunction GeneralInfoDocumentsFileTableRow(\r\n    {\r\n        demandId,\r\n        stageId,\r\n        supplierId,\r\n        index,\r\n        row,\r\n        onEditDescriptionFile,\r\n\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        goto: false\r\n    });\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: \"download\", works: true});\r\n        DemandOffersGeneralInfoService.getDownloadFile(demandId, stageId, row.source, row.identity, supplierId)\r\n            .finally(() => dispatchIconWorks({type: 'download', works: false}));\r\n    }\r\n\r\n\r\n    return (\r\n        <>\r\n            <TableRow>\r\n                <TableCell>{index}</TableCell>\r\n                <TableCell>\r\n                    {row.name}\r\n                </TableCell>\r\n                <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconSearchButton\r\n                        onClick={() => onEditDescriptionFile(row)}\r\n                        tooltip={row.description ? <p className={classes.descriptionTooltip}>{row.description}</p> : <i>{Tr('no_description')}</i>}\r\n                    />\r\n                </TableCell>\r\n                <TableCell>{row.publishDate ? moment(row.publishDate).format(DateFormats.DATETIME_FORMAT) : null}</TableCell>\r\n                <TableCell className={classes.buttonColumn}>\r\n                    {\r\n                        !!row.actions.goto &&\r\n                        <WorkableIconForwardButton\r\n                            onClick={()=>{\r\n                                dispatchIconWorks({type: \"download\", works: true});\r\n                                window.location.href = row.actions.goto.url\r\n                            }\r\n                            }\r\n                            tooltip={Tr('go')}\r\n                            disabled={iconWorks.anyWorks}\r\n                            working={iconWorks.goto}/>\r\n                    }\r\n                    {\r\n                        !!row.actions.download &&\r\n                        <WorkableIconDownloadButton\r\n                                onClick={() => onDownload(row)}\r\n                                hideTooltip={!row.actions.download}\r\n                                disabled={iconWorks.anyWorks}\r\n                                working={iconWorks.download}\r\n                            />\r\n                    }\r\n                </TableCell>\r\n            </TableRow>\r\n\r\n        </>\r\n    )\r\n}\r\n\r\nGeneralInfoDocumentsFileTableRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    stageId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    row: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        source: PropTypes.string.isRequired\r\n    }).isRequired,\r\n    index: PropTypes.number.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired\r\n};\r\n\r\nexport default GeneralInfoDocumentsFileTableRow;","import React, {useState} from 'react'\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport EditDescriptionPopup, {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport GeneralInfoDocumentsFileTableRow from \"./GeneralInfoDocumentsFileTableRow\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from 'prop-types';\r\nimport WorkableIconDownloadButton from \"components/button/WorkableIconDownloadButton\";\r\nimport DemandOffersGeneralInfoService from \"services/DemandOffersGeneralInfoService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: \"100%\"\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n}));\r\n\r\nfunction GeneralInfoDocumentsFileTable(\r\n    {\r\n        demandId,\r\n        stageId,\r\n        supplierId,\r\n        generalInfoDocuments,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [downloadZipWorking, setDownloadZipWorking] = useState(false);\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(null);\r\n\r\n    const openEditDescription = (row) => {\r\n        setEditDescriptionFile(createEditDescriptionFile(demandId, row.identity, row.name, row.description, true));\r\n    };\r\n\r\n    return (<div className={classes.root}>\r\n        {!generalInfoDocuments.length ?\r\n            <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            :\r\n            <>\r\n\r\n                <Table>\r\n                    <TableHead>\r\n                        <TableRow>\r\n                            <TableCell className={classes.lpColumn}>{Tr(\"column_lp\")}</TableCell>\r\n                            <TableCell>{Tr(\"name\")}</TableCell>\r\n                            <TableCell className={classes.buttonColumn}>{Tr(\"description\")}</TableCell>\r\n                            <TableCell className={classes.dateColumn}>{Tr(\"publish_data\")}</TableCell>\r\n                            <TableCell className={classes.buttonColumn}>\r\n                                <WorkableIconDownloadButton\r\n                                    tooltip={Tr('download_all_files_compressed')}\r\n                                    working={downloadZipWorking}\r\n                                    onClick={() => {\r\n                                        setDownloadZipWorking(true);\r\n                                        DemandOffersGeneralInfoService.downloadContractorGeneralInfoDocumentsZip(demandId, stageId, supplierId, () => {\r\n                                            setDownloadZipWorking(false);\r\n                                        })\r\n                                    }\r\n                                    }\r\n                                />\r\n                            </TableCell>\r\n                        </TableRow>\r\n                    </TableHead>\r\n                    <TableBody>\r\n                        {\r\n                            generalInfoDocuments.map((doc, index) => (\r\n                                <GeneralInfoDocumentsFileTableRow\r\n                                    key={doc.source + \"_\" + doc.identity}\r\n                                    demandId={demandId}\r\n                                    stageId={stageId}\r\n                                    supplierId={supplierId}\r\n                                    row={doc}\r\n                                    index={index + 1}\r\n                                    onEditDescriptionFile={openEditDescription}\r\n                                />))\r\n                        }\r\n                    </TableBody>\r\n                </Table>\r\n            </>\r\n        }\r\n        {Boolean(editDescriptionFile) &&\r\n            <EditDescriptionPopup\r\n                editDescriptionFile={editDescriptionFile}\r\n                onUpdated={() => setEditDescriptionFile(null)}\r\n                onClose={() => setEditDescriptionFile(null)}\r\n                service={{\r\n                    updateDescription: () => {\r\n                    }\r\n                }}\r\n            />\r\n        }\r\n    </div>)\r\n}\r\n\r\nGeneralInfoDocumentsFileTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    stageId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n};\r\nexport default GeneralInfoDocumentsFileTable;","import React from 'react';\r\n\r\nconst PurchaserOfferContext = React.createContext();\r\nexport const PurchaserOfferContextProvider = PurchaserOfferContext.Provider;\r\nexport default PurchaserOfferContext;","import React, {useContext, useEffect, useState} from 'react'\r\nimport GeneralInfoExpansionPanelTitle from \"./GeneralInfoExpansionPanelTitle\";\r\nimport Tr from \"translations/Translations\";\r\nimport ExpansionPanel from \"components/ExpansionPanel\";\r\nimport DemandOffersGeneralInfoService from \"services/DemandOffersGeneralInfoService\";\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport GeneralInfoDocumentsFileTable from \"./GeneralInfoDocumentsFileTable\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {StageSections} from \"../../../../constants/StageSections\";\r\n\r\nfunction GeneralInfoDocuments(\r\n    {\r\n        match,\r\n        panelsClassesObject,\r\n        generalInfoDocuments,\r\n        demandStageSectionsList\r\n    }) {\r\n    const [expanded, setExpanded] = useState(false);\r\n    const demandId = match.params.id;\r\n    const stageId = match.params.stageId;\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const unreadDemandDocuments = demandStageSectionsList[StageSections.GENERAL_INFO].unreadDemandDocuments;\r\n    useEffect(() => {\r\n        if (expanded && generalInfoDocuments === undefined)\r\n            DemandOffersGeneralInfoService.getContractorGeneralInfoDocuments(demandId, stageId, purchaserOfferContext?.supplierId);\r\n        return () => {\r\n            DemandOffersGeneralInfoService.clearResources(DemandOffersGeneralInfoService.GENERAL_INFO_DOCUMENTS);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [expanded])\r\n\r\n\r\n    return (\r\n        <ExpansionPanel\r\n            classesObj={panelsClassesObject}\r\n            title={\r\n                <GeneralInfoExpansionPanelTitle\r\n                    subject={Tr(\"order_documents\")}\r\n                    unreadElements={unreadDemandDocuments}\r\n                    toggleThread={() => setExpanded(x => !x)}\r\n                    expanded={expanded}\r\n                />\r\n            }\r\n            expanded={expanded}\r\n            onChange={(e, isExpanded) => setExpanded(isExpanded)}\r\n\r\n        >\r\n            {\r\n                !generalInfoDocuments ?\r\n                    <Loading/>\r\n                    :\r\n                    <GeneralInfoDocumentsFileTable demandId={demandId} stageId={stageId} supplierId={purchaserOfferContext?.supplierId} generalInfoDocuments={generalInfoDocuments}/>\r\n            }\r\n        </ExpansionPanel>\r\n    )\r\n}\r\n\r\nGeneralInfoDocuments.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    generalInfoDocuments: state.resources[DemandOffersGeneralInfoService.GENERAL_INFO_DOCUMENTS],\r\n    demandStageSectionsList: state.resources[DemandOffersService.DEMAND_STAGE_SECTIONS_LIST]\r\n}), {})(withRouter(GeneralInfoDocuments));","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store';\r\nimport {clearResource, setResource, setSaveStatusError} from 'redux/actions';\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\nimport PrivilegeService from \"./PrivilegeService\";\r\nimport downloadFileWithPreloadUrl from \"../libs/downloadFileWithPreloadUrl\";\r\nimport Tr from \"translations/Translations\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\n\r\nconst CORRESPONDENCE_RES_PREFIX = 'correspondence';\r\nconst CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID = CORRESPONDENCE_RES_PREFIX + \"BeforeBiddingEndThreads\";\r\nconst CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID = CORRESPONDENCE_RES_PREFIX + \"AfterBiddingEndThreads\";\r\nconst CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID = CORRESPONDENCE_RES_PREFIX + \"NotSplicedThreads\";\r\nconst CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID = CORRESPONDENCE_RES_PREFIX + \"LastCheckTime\";\r\nconst CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID = CORRESPONDENCE_RES_PREFIX + \"SplitDate\";\r\nconst CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID = CORRESPONDENCE_RES_PREFIX + \"DownloadAttachmentRegistrationDate\";\r\n\r\nconst cleanupPrivileges = () => {\r\n    PrivilegeService.cleanupPrivileges(PrivilegeService.CORRESPONDENCE_PRIVILEGE_STORE_KEY);\r\n}\r\n\r\nconst cleanupThreadList = () => {\r\n    reduxStore.dispatch(clearResource(CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID));\r\n    reduxStore.dispatch(clearResource(CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID));\r\n    reduxStore.dispatch(clearResource(CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID));\r\n    reduxStore.dispatch(clearResource(CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID));\r\n    reduxStore.dispatch(clearResource(CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID));\r\n    reduxStore.dispatch(clearResource(CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID));\r\n};\r\n\r\nconst getContractorThreadList = async (roundId) => {\r\n    const threadList = await RestRequestGET(Endpoints.CORRESPONDENCE_CONTRACTOR_THREAD_LIST(roundId));\r\n\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID, threadList.checkTime));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID, threadList.correspondenceSplitDate));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, threadList.beforeBiddingEndThreads));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID, threadList.afterBiddingEndThreads));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID, threadList.notSplicedThreads));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID, threadList.attachmentDownloadRegistrationStartDate))\r\n}\r\n\r\nconst getBuyerNewMessages = async (roundId) => {\r\n    const state = reduxStore.getState();\r\n    let params = applySearchParams({dateFrom: state.resources[CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID]})\r\n\r\n    const response = await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_NEW_MESSAGES(roundId), {params});\r\n    if (response.success !== false) {\r\n        const unreadIds = _processNewMessagesUpdate(response);\r\n        if (unreadIds.length > 0) {\r\n            RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_MARK_AS_READ(roundId), {list: unreadIds});\r\n        }\r\n    }\r\n}\r\n\r\nconst _processNewMessagesUpdate = (response) => {\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID, response.checkTime));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID, response.correspondenceSplitDate));\r\n    const state = reduxStore.getState();\r\n    const newReadMessageIds = [];\r\n    for (const listResourceId of [CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID, CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID]) {\r\n        const reqResource = listResourceId.substring(CORRESPONDENCE_RES_PREFIX.length).charAt(0).toLowerCase() + listResourceId.substring(CORRESPONDENCE_RES_PREFIX.length).slice(1);\r\n        if (response?.[reqResource]?.threads?.length) {\r\n            const threadsObject = response[reqResource].threads.reduce(function (o, val) {\r\n                o[val.threadId] = val;\r\n                return o;\r\n            }, {});\r\n            if (state?.resources?.[listResourceId]?.threads) {\r\n                const threads = state.resources[listResourceId].threads.map(th => {\r\n                    if (threadsObject.hasOwnProperty(th.threadId)) {\r\n                        const reqThread = threadsObject[th.threadId];\r\n                        const {messages, unreadMessagesCount, ...others} = th;\r\n                        let newMessageList = null;\r\n                        if (messages) {\r\n                            let index = messages.findIndex(x => x.status === 'saved');\r\n                            if (index === -1) index = messages.length;\r\n                            newMessageList = [...messages];\r\n                            newMessageList.splice(index, 0, ...reqThread.messages);\r\n                            newReadMessageIds.push(...reqThread.messages.map(x => x.messageId));\r\n                        }\r\n                        delete threadsObject[th.threadId];\r\n                        return ({\r\n                            ...others,\r\n                            unreadMessagesCount: unreadMessagesCount + reqThread.messages.length,\r\n                            messages: newMessageList\r\n                        })\r\n                    }\r\n                    return th;\r\n                });\r\n                Object.values(threadsObject).forEach(x => threads.unshift({...x, messages: null}));\r\n\r\n                reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n            }\r\n\r\n        }\r\n    }\r\n    return newReadMessageIds;\r\n}\r\n\r\nconst getContractorNewMessages = async (roundId) => {\r\n    const state = reduxStore.getState();\r\n    let params = applySearchParams({dateFrom: state.resources[CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID]})\r\n\r\n    const response = await RestRequestGET(Endpoints.CORRESPONDENCE_CONTRACTOR_NEW_MESSAGES(roundId), {params});\r\n    if (response.success !== false) {\r\n        const unreadIds = _processNewMessagesUpdate(response);\r\n        if (unreadIds.length > 0) {\r\n            RestRequestPOST(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_MARK_AS_READ(roundId), {list: unreadIds});\r\n        }\r\n    }\r\n}\r\n\r\nconst getBuyerThreadList = async (roundId) => {\r\n    const threadList = await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_THREAD_LIST(roundId));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID, threadList.checkTime));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID, threadList.correspondenceSplitDate));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, threadList.beforeBiddingEndThreads));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID, threadList.afterBiddingEndThreads));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID, threadList.notSplicedThreads));\r\n    reduxStore.dispatch(setResource(CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID, threadList.attachmentDownloadRegistrationStartDate));\r\n};\r\n\r\nconst getBuyerContractorInRoundList = async (roundId) => {\r\n    return await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_CTR_IN_ROUND(roundId));\r\n};\r\n\r\nconst getBuyerThreadMessageList = async (roundId, threadId, listResourceId) => {\r\n    const messages = await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_LIST(roundId, threadId));\r\n    if (messages.success !== false) {\r\n        const unreadIds = messages.filter(x => !x.read && (x.contractorUser || x.publicQuestion)).map(x => x.messageId);\r\n        if (unreadIds.length > 0) {\r\n            RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_MARK_AS_READ(roundId), {list: unreadIds});\r\n        }\r\n        _setMessagesInThread(threadId, messages, listResourceId);\r\n    }\r\n}\r\n\r\nconst getBuyerMessageDelivery = async (roundId, messageId, type, identity) => {\r\n    return await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_EMAIL_DELIVERY(roundId, messageId, type, identity));\r\n}\r\n\r\nconst getContractorThreadMessageList = async (roundId, threadId, listResourceId) => {\r\n    const messages = await RestRequestGET(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_LIST(roundId, threadId));\r\n    if (messages.success !== false) {\r\n        const unreadIds = messages.filter(x => !x.read && x.buyerUser).map(x => x.messageId);\r\n        if (unreadIds.length > 0) {\r\n            RestRequestPOST(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_MARK_AS_READ(roundId), {list: unreadIds});\r\n        }\r\n        _setMessagesInThread(threadId, messages, listResourceId);\r\n    }\r\n}\r\n\r\nconst _setMessagesInThread = (threadId, reqMessages, listResourceId) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        const threads = state.resources[listResourceId].threads.map(th => {\r\n            if (th.threadId === threadId) {\r\n                const {messages, ...others} = th;\r\n                return ({\r\n                    ...others,\r\n                    messages: reqMessages\r\n                })\r\n            }\r\n            return th;\r\n        })\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n}\r\n\r\nconst _addThreadToList = (thread, listResourceId) => {\r\n    if (thread.threadId) {\r\n        const state = reduxStore.getState();\r\n        if (state?.resources?.[listResourceId]?.threads) {\r\n            const threads = [\r\n                thread,\r\n                ...state.resources[listResourceId].threads\r\n            ]\r\n            reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n        }\r\n    }\r\n}\r\n\r\nconst addBuyerThread = async (roundId, thread, listResourceId) => {\r\n    const response = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_THREAD_ADD(roundId), thread);\r\n    if (response.success !== false) {\r\n        _addThreadToList(response, listResourceId);\r\n    }\r\n    return response;\r\n}\r\n\r\nconst addContractorThread = async (roundId, thread, listResourceId) => {\r\n    const response = await RestRequestPOST(Endpoints.CORRESPONDENCE_CONTRACTOR_THREAD_ADD(roundId), thread);\r\n    if (response.success !== false) {\r\n        _addThreadToList(response, listResourceId);\r\n    }\r\n    return response;\r\n}\r\nconst saveBuyerThreadAsContractor = async (roundId, thread, listResourceId) => {\r\n    const response = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_THREAD_AS_CRT_SEND(roundId), thread);\r\n    if (response.success !== false) {\r\n        _addThreadToList(response, listResourceId);\r\n    }\r\n    return response;\r\n}\r\n\r\nconst _updateMessageInThread = (threadId, messageId, listResourceId, response) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        const threads = state.resources[listResourceId].threads.map(th => {\r\n            if (th.threadId === threadId) {\r\n                const {messages, ...other} = th;\r\n                if (messages) {\r\n                    return ({\r\n                        ...other,\r\n                        messages: messages.map(msg => (msg.messageId === messageId ? response : msg))\r\n                    })\r\n                }\r\n            }\r\n            return th;\r\n        });\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n};\r\n\r\nconst clearThreadMessages = (threadId, listResourceId) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        const threads = state.resources[listResourceId].threads.map(th => {\r\n\r\n            if (th.threadId === threadId) {\r\n                const {messages, unreadMessagesCount, ...other} = th;\r\n                if (messages) {\r\n                    return ({\r\n                        ...other,\r\n                        unreadMessagesCount: 0,\r\n                        messages: null\r\n                    })\r\n                }\r\n            }\r\n            return th;\r\n\r\n        });\r\n\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n};\r\n\r\nconst updateBuyerMessage = async (roundId, threadId, messageId, listResourceId, message) => {\r\n    const resp = await RestRequestPUT(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_UPDATE(roundId, messageId), message);\r\n    if (resp.success !== false) {\r\n        _updateMessageInThread(threadId, messageId, listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst updateContractorMessage = async (roundId, threadId, messageId, listResourceId, message) => {\r\n    const resp = await RestRequestPUT(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_UPDATE(roundId, messageId), message);\r\n    if (resp.success !== false) {\r\n        _updateMessageInThread(threadId, messageId, listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst sendBuyerMessage = async (roundId, threadId, messageId, listResourceId) => {\r\n    const resp = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_SEND(roundId, messageId));\r\n    if (resp.success !== false) {\r\n        _updateMessageInThread(threadId, messageId, listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst sendContractorMessage = async (roundId, threadId, messageId, listResourceId) => {\r\n    const resp = await RestRequestPOST(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_SEND(roundId, messageId));\r\n    if (resp.success !== false) {\r\n        _updateMessageInThread(threadId, messageId, listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst publishBuyerMessage = async (roundId, threadId, messageId, listResourceId) => {\r\n    const resp = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_PUBLISH(roundId, messageId));\r\n    if (resp.success !== false) {\r\n        _updateMessagesInThreads(listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst deleteBuyerMessage = async (roundId, threadId, messageId, listResourceId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_DELETE(roundId, messageId));\r\n    if (resp.success) {\r\n        _removeMessagesFromThread(threadId, messageId, listResourceId);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst deleteContractorMessage = async (roundId, threadId, messageId, listResourceId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_DELETE(roundId, messageId));\r\n    if (resp.success) {\r\n        _removeMessagesFromThread(threadId, messageId, listResourceId);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst _removeMessagesFromThread = (threadId, messageId, listResourceId) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        let removedLast = false;\r\n        let threads = state.resources[listResourceId].threads.map(th => {\r\n            if (th.threadId === threadId) {\r\n\r\n                const {messages, ...other} = th;\r\n                const messagesFiltered = messages.filter(msg => (msg.messageId !== messageId));\r\n                if (messagesFiltered.length === 0) {\r\n                    removedLast = true;\r\n                }\r\n                return ({\r\n                    ...other,\r\n                    messages: messagesFiltered\r\n                })\r\n            }\r\n            return th;\r\n        });\r\n        if (removedLast) {\r\n            threads = threads.filter(t => t.threadId !== threadId);\r\n        }\r\n\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n};\r\n\r\nconst _updateMessagesInThreads = (listResourceId, response) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        const threads = state.resources[listResourceId].threads.map(th => {\r\n            const respTh = response.find(x => x.threadId === th.threadId);\r\n            if (respTh) {\r\n                const mesMap = respTh.messages.reduce(function (acc, cur, i) {\r\n                    acc[cur.messageId] = cur;\r\n                    return acc;\r\n                }, {});\r\n\r\n                const {messages, ...other} = th;\r\n                if (messages) {\r\n                    return ({\r\n                        ...other,\r\n                        messages: messages.map(msg => (mesMap.hasOwnProperty(msg.messageId) ? mesMap[msg.messageId] : msg))\r\n                    })\r\n                }\r\n            }\r\n            return th;\r\n        });\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n};\r\n\r\n\r\nconst _addMessagesToThreads = (listResourceId, threadList) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        const threads = state.resources[listResourceId].threads.map(th => {\r\n            const respTh = threadList.find(x => x.threadId === th.threadId);\r\n            if (respTh) {\r\n                const {messages, ...other} = th;\r\n                if (messages) {\r\n                    return ({\r\n                        ...other,\r\n                        messages: [...messages, ...respTh.messages]\r\n                    })\r\n                }\r\n            }\r\n            return th;\r\n        });\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n};\r\nconst sendBuyerBulkMessages = async (roundId, bulkMessages, listResourceId) => {\r\n    const resp = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_BULK_MESSAGES_SEND(roundId), bulkMessages);\r\n    if (resp.success !== false) {\r\n        _addMessagesToThreads(listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst publishBuyerBulkMessages = async (roundId, bulkMessages, listResourceId) => {\r\n    const resp = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_BULK_MESSAGES_PUBLISH(roundId), bulkMessages);\r\n    if (resp.success !== false) {\r\n        _addMessagesToThreads(listResourceId, resp);\r\n    }\r\n    return resp;\r\n}\r\n\r\nconst createBuyerMessage = async (roundId, threadId, listResourceId) => {\r\n    const message = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_CREATE(roundId, threadId));\r\n    _addMessagesToThreads(listResourceId, [{threadId, messages: [message]}]);\r\n    return message;\r\n}\r\n\r\nconst createContractorMessage = async (roundId, threadId, listResourceId) => {\r\n    const message = await RestRequestPOST(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_CREATE(roundId, threadId));\r\n    _addMessagesToThreads(listResourceId, [{threadId, messages: [message]}]);\r\n    return message;\r\n}\r\n\r\nconst _modifyFlag = (threadId, listResourceId, flag) => {\r\n    const state = reduxStore.getState();\r\n    if (state?.resources?.[listResourceId]?.threads) {\r\n        const threads = state.resources[listResourceId].threads.map(x => (x.threadId !== threadId ? x : {...x, hasRedFlag: flag}));\r\n        reduxStore.dispatch(setResource(listResourceId, {...state.resources[listResourceId], threads}));\r\n    }\r\n}\r\n\r\nconst getContractorPrivileges = async (roundId) => {\r\n    await PrivilegeService.getPrivileges(Endpoints.CORRESPONDENCE_CONTRACTOR_PRIVILEGES(roundId), PrivilegeService.CORRESPONDENCE_PRIVILEGE_STORE_KEY);\r\n}\r\n\r\nconst getBuyerPrivileges = async (roundId) => {\r\n    await PrivilegeService.getPrivileges(Endpoints.CORRESPONDENCE_BUYER_PRIVILEGES(roundId), PrivilegeService.CORRESPONDENCE_PRIVILEGE_STORE_KEY);\r\n}\r\n\r\nconst sendBuyerFlagThread = async (roundId, threadId, listResourceId) => {\r\n    return await _sendFlagUnflagThread(Endpoints.CORRESPONDENCE_BUYER_FLAG, roundId, threadId, listResourceId, true);\r\n}\r\n\r\nconst sendBuyerUnflagThread = async (roundId, threadId, listResourceId) => {\r\n    return await _sendFlagUnflagThread(Endpoints.CORRESPONDENCE_BUYER_UNFLAG, roundId, threadId, listResourceId, false);\r\n}\r\n\r\nconst sendContractorFlagThread = async (roundId, threadId, listResourceId) => {\r\n    return await _sendFlagUnflagThread(Endpoints.CORRESPONDENCE_CONTRACTOR_FLAG, roundId, threadId, listResourceId, true);\r\n}\r\n\r\nconst sendContractorUnflagThread = async (roundId, threadId, listResourceId) => {\r\n    return await _sendFlagUnflagThread(Endpoints.CORRESPONDENCE_CONTRACTOR_UNFLAG, roundId, threadId, listResourceId, false);\r\n}\r\n\r\nconst _sendFlagUnflagThread = async (urlFn, roundId, threadId, listResourceId, flag) => {\r\n    const resp = await RestRequestPOST(urlFn(roundId, threadId));\r\n    if (resp.result) {\r\n        _modifyFlag(threadId, listResourceId, flag);\r\n    }\r\n}\r\n\r\nconst downloadBuyerMessageAttachmentsZip = async (roundId, messageId, finallyCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_ZIP(roundId, messageId))\r\n            .finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst downloadBuyerMessageAttachment = async (roundId, attachmentId, finallyCallback = () => {\r\n}) => {\r\n    await downloadFileWithPreloadUrl(Endpoints.CORRESPONDENCE_BUYER_ATTACHMENT_URL(roundId, attachmentId), false)\r\n        .finally(finallyCallback);\r\n}\r\n\r\nconst checkVerificationLimit = async (roundId, messageId) => {\r\n    const resp = await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_CHECK_LIMIT(roundId, messageId));\r\n    return resp;\r\n}\r\nconst printBuyerMessageAttachmentsVerification = async (roundId, messageId, finallyCallback = () => {\r\n}) => {\r\n    RestRequestBLOB(Endpoints.CORRESPONDENCE_BUYER_MESSAGE_ATTACHMENTS_VERIFY(roundId, messageId))\r\n        .finally(finallyCallback);\r\n}\r\n\r\nconst downloadContractorMessageAttachmentsZip = async (roundId, messageId, finallyCallback = () => {\r\n}) => {\r\n    RestRequestBLOB(Endpoints.CORRESPONDENCE_CONTRACTOR_MESSAGE_ATTACHMENTS_ZIP(roundId, messageId))\r\n        .finally(finallyCallback);\r\n}\r\n\r\nconst downloadContractorMessageAttachment = async (roundId, attachmentId, finallyCallback = () => {\r\n}) => {\r\n    await downloadFileWithPreloadUrl(Endpoints.CORRESPONDENCE_CONTRACTOR_ATTACHMENT_URL(roundId, attachmentId), false)\r\n        .finally(finallyCallback);\r\n}\r\n\r\nconst getContractorSearchResult = async (roundId, searchObject) => {\r\n    return await getSearchResult(searchObject, Endpoints.CORRESPONDENCE_CONTRACTOR_SEARCH(roundId));\r\n}\r\n\r\nconst getBuyerSearchResult = async (roundId, searchObject) => {\r\n    return await getSearchResult(searchObject, Endpoints.CORRESPONDENCE_BUYER_SEARCH(roundId));\r\n}\r\n\r\nconst getSearchResult = async (searchObject, url) => {\r\n    //const state = reduxStore.getState();\r\n    let params = applySearchParams(searchObject);\r\n\r\n    const threadList = await RestRequestGET(url, {params});\r\n    if (threadList.success !== false) {\r\n        cleanupThreadList();\r\n        reduxStore.dispatch(setResource(CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID, threadList.checkTime));\r\n        reduxStore.dispatch(setResource(CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID, threadList.correspondenceSplitDate));\r\n        reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, threadList.beforeBiddingEndThreads));\r\n        reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID, threadList.afterBiddingEndThreads));\r\n        reduxStore.dispatch(setResource(CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID, threadList.notSplicedThreads));\r\n        reduxStore.dispatch(setResource(CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID, threadList.attachmentDownloadRegistrationStartDate))\r\n    }\r\n    return threadList;\r\n}\r\n\r\nconst getBuyerPrint = async (roundId, type, before, threadIds) => {\r\n    return print(Endpoints.CORRESPONDENCE_BUYER_PRINT(roundId, type, before), threadIds);\r\n}\r\n\r\nconst getContractorPrint = async (roundId, type, before, threadIds) => {\r\n    return print(Endpoints.CORRESPONDENCE_CONTRACTOR_PRINT(roundId, type, before), threadIds);\r\n}\r\n\r\nconst getBuyerContractorEmailList = async (roundId, departmentId) => {\r\n    return await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_CONTRACTOR_EMAIL_LIST(roundId, departmentId));\r\n}\r\n\r\nconst getBuyerThreadEmailList = async (roundId, threadId) => {\r\n    return await RestRequestGET(Endpoints.CORRESPONDENCE_BUYER_THREAD_EMAIL_LIST(roundId, threadId));\r\n}\r\n\r\nconst print = (url, threadIds) => {\r\n    let params = {\r\n        threadIds: threadIds.join()\r\n    }\r\n    return RestRequestBLOB(url, {params});\r\n}\r\n\r\nconst shareCorrespondencePrint = async (roundId, type, before, threadIds, system) => {\r\n    let params = {\r\n        threadIds: threadIds.join()\r\n    }\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.CORRESPONDENCE_BUYER_SHARE(roundId, type, before), {system}, {params});\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n    return false;\r\n}\r\n\r\nexport default {\r\n    getBuyerThreadList,\r\n    getBuyerNewMessages,\r\n    getBuyerSearchResult,\r\n    getBuyerThreadMessageList,\r\n    addBuyerThread,\r\n    sendBuyerMessage,\r\n    publishBuyerMessage,\r\n    updateBuyerMessage,\r\n    saveBuyerThreadAsContractor,\r\n    createBuyerMessage,\r\n    deleteBuyerMessage,\r\n    sendBuyerBulkMessages,\r\n    publishBuyerBulkMessages,\r\n    getBuyerContractorInRoundList,\r\n    getBuyerMessageDelivery,\r\n    downloadBuyerMessageAttachmentsZip,\r\n    downloadBuyerMessageAttachment,\r\n    checkVerificationLimit,\r\n    printBuyerMessageAttachmentsVerification,\r\n    sendBuyerFlagThread,\r\n    sendBuyerUnflagThread,\r\n    getBuyerPrivileges,\r\n    getBuyerPrint,\r\n    getBuyerThreadEmailList,\r\n    getBuyerContractorEmailList,\r\n    shareCorrespondencePrint,\r\n\r\n    cleanupThreadList,\r\n    cleanupPrivileges,\r\n    clearThreadMessages,\r\n\r\n    getContractorThreadList,\r\n    getContractorNewMessages,\r\n    getContractorSearchResult,\r\n    getContractorThreadMessageList,\r\n    createContractorMessage,\r\n    updateContractorMessage,\r\n    sendContractorMessage,\r\n    deleteContractorMessage,\r\n    addContractorThread,\r\n    downloadContractorMessageAttachmentsZip,\r\n    downloadContractorMessageAttachment,\r\n    sendContractorFlagThread,\r\n    sendContractorUnflagThread,\r\n    getContractorPrivileges,\r\n    getContractorPrint,\r\n\r\n    CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID,\r\n    CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID,\r\n    CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID,\r\n    CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID,\r\n    CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID,\r\n    CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID\r\n}","import React, {useState} from 'react'\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from \"clsx\";\r\nimport {Badge, makeStyles, Typography} from \"@material-ui/core\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport FilesList from \"components/FilesList\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport GetAppIcon from \"@material-ui/icons/GetApp\";\r\nimport PropTypes from \"prop-types\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    contentWrapper: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        position: 'relative'\r\n    },\r\n    contentWrapperUnread: {\r\n        borderWidth: 3\r\n    },\r\n    content: {\r\n        padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`\r\n    },\r\n    sendDate: {\r\n        margin: `0 ${theme.spacing(1)}px`,\r\n        minWidth: 110\r\n    },\r\n    message: {\r\n        whiteSpace: 'pre-line',\r\n        margin: `${theme.spacing(2)}px 0`\r\n    },\r\n    newBadge: {\r\n        position: 'absolute',\r\n        right: 0,\r\n        top: 3\r\n    },\r\n}));\r\n\r\nfunction GeneralInfoPublicAnswersMessage(\r\n    {\r\n        demandId,\r\n        index,\r\n        message,\r\n        currentRfxRoundId,\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [downloadZipWorking, setDownloadZipWorking] = useState(false);\r\n    const unread = !message.read;\r\n\r\n    const downloadZip = () => {\r\n        setDownloadZipWorking(true);\r\n        CorrespondenceService.downloadContractorMessageAttachmentsZip(currentRfxRoundId, message.messageId, () => setDownloadZipWorking(false));\r\n    }\r\n\r\n    const downloadAttachment = (attachment) => {\r\n        CorrespondenceService.downloadContractorMessageAttachment(currentRfxRoundId, attachment.identity)\r\n    }\r\n\r\n    return (\r\n        <div className={clsx(classes.root)}>\r\n\r\n            <div className={clsx(classes.contentWrapper, {[classes.contentWrapperUnread]: unread})}>\r\n                <div className={classes.content}>\r\n                    {unread && <Badge className={clsx(classes.newBadge)} badgeContent='NOWA' color=\"error\">\r\n                        <MailIcon color='primary'/>\r\n                    </Badge>}\r\n                    <GridBlock justify='flex-end'>\r\n                        <BoldTypography variant='caption'>{Tr(\"answer_date\")}:</BoldTypography>\r\n                        <Typography variant='caption' component='p' className={classes.sendDate}>\r\n                            {message.publishDate ? moment(message.publishDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT) : ''}\r\n                        </Typography>\r\n                    </GridBlock>\r\n\r\n                    <Typography variant='body1' className={classes.message}>{message.contents}</Typography>\r\n\r\n                    {!!message?.attachments?.length && <>\r\n                        <BoldTypography>{Tr('attachment')}</BoldTypography>\r\n                        <FilesList\r\n                            elements={message.attachments}\r\n                            onDownload={downloadAttachment}\r\n                            customAction={\r\n                                <WorkableIconButton\r\n                                    tooltip={Tr('download_all_message_attachments')}\r\n                                    Icon={GetAppIcon}\r\n                                    onClick={downloadZip}\r\n                                    working={downloadZipWorking}/>\r\n                            }/>\r\n                    </>}\r\n                </div>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n\r\nGeneralInfoPublicAnswersMessage.propTypes = {\r\n    message: PropTypes.object.isRequired,\r\n    currentRfxRoundId: PropTypes.number.isRequired\r\n}\r\n\r\nexport default GeneralInfoPublicAnswersMessage;\r\n","import React, {useContext, useEffect, useState} from 'react'\r\nimport GeneralInfoExpansionPanelTitle from \"./GeneralInfoExpansionPanelTitle\";\r\nimport Tr from \"translations/Translations\";\r\nimport ExpansionPanel from \"components/ExpansionPanel\";\r\nimport DemandOffersGeneralInfoService from \"services/DemandOffersGeneralInfoService\";\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport GeneralInfoPublicAnswersMessage from \"./GeneralInfoPublicAnswersMessage\";\r\nimport PropTypes from \"prop-types\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {StageSections} from \"../../../../constants/StageSections\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    messagesDiv: {\r\n        width: '90%'\r\n    }\r\n}));\r\n\r\nfunction GeneralInfoPublicAnswers(\r\n    {\r\n        match,\r\n        panelsClassesObject,\r\n        currentRfxRoundId,\r\n        generalInfoPublicAnswers,\r\n        demandStageSectionsList\r\n    }) {\r\n    const classes = useStyles();\r\n    const [expanded, setExpanded] = useState(false);\r\n    const demandId = match.params.id;\r\n    const stageId = match.params.stageId;\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const unreadAnswers = demandStageSectionsList[StageSections.GENERAL_INFO].unreadRfxMessages;\r\n\r\n    useEffect(() => {\r\n        if (expanded && generalInfoPublicAnswers === undefined)\r\n            DemandOffersGeneralInfoService.getContractorGeneralInfoPublicAnswers(demandId, stageId, purchaserOfferContext?.supplierId);\r\n        return () => {\r\n            DemandOffersGeneralInfoService.clearResources(DemandOffersGeneralInfoService.GENERAL_INFO_PUBLIC_ANSWERS);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [expanded])\r\n\r\n\r\n    return (\r\n        <ExpansionPanel\r\n            classesObj={panelsClassesObject}\r\n            title={\r\n                <GeneralInfoExpansionPanelTitle\r\n                    subject={Tr(\"answer_on_question\")}\r\n                    unreadElements={unreadAnswers}\r\n                    toggleThread={() => setExpanded(x => !x)}\r\n                    expanded={expanded}\r\n                />\r\n            }\r\n            expanded={expanded}\r\n            onChange={(e, isExpanded) => setExpanded(isExpanded)}\r\n\r\n        >\r\n            {\r\n                !generalInfoPublicAnswers ?\r\n                    <Loading/>\r\n                    :\r\n                    <div className={classes.messagesDiv}>\r\n                        {\r\n                            generalInfoPublicAnswers.map((x, i ) => (<GeneralInfoPublicAnswersMessage key={x.messageId} demandId={demandId} index={i+1} message={x} currentRfxRoundId={currentRfxRoundId} />))\r\n                        }\r\n                    </div>\r\n\r\n\r\n            }\r\n        </ExpansionPanel>\r\n    )\r\n}\r\n\r\nGeneralInfoPublicAnswers.propTypes = {\r\n    currentRfxRoundId: PropTypes.number.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    generalInfoPublicAnswers: state.resources[DemandOffersGeneralInfoService.GENERAL_INFO_PUBLIC_ANSWERS],\r\n    demandStageSectionsList: state.resources[DemandOffersService.DEMAND_STAGE_SECTIONS_LIST]\r\n}), {})(withRouter(GeneralInfoPublicAnswers));","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\n\r\nconst DEMAND_STATISTICS_RESOURCE_ID = 'demandStatistics';\r\nconst CURRENT_RFX_RESOURCE_ID = 'currentRfxRound';\r\n\r\nconst clearStats = () => {\r\n    reduxStore.dispatch(clearResource(DEMAND_STATISTICS_RESOURCE_ID));\r\n\r\n}\r\n\r\nconst getStats = async (demandId, roundId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.STATISTIC(demandId, roundId));\r\n        reduxStore.dispatch(setResource(DEMAND_STATISTICS_RESOURCE_ID, res));\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst clearCurrentRound = () => {\r\n    reduxStore.dispatch(clearResource(CURRENT_RFX_RESOURCE_ID));\r\n}\r\n\r\nconst getCurrentRound = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.STATISTIC_CURRENT_ROUND(demandId));\r\n        reduxStore.dispatch(setResource(CURRENT_RFX_RESOURCE_ID, res));\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nexport default {\r\n    getStats,\r\n    clearStats,\r\n    getCurrentRound,\r\n    clearCurrentRound,\r\n    CURRENT_RFX_RESOURCE_ID,\r\n    DEMAND_STATISTICS_RESOURCE_ID\r\n}","import React, {useState} from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport GeneralInfoExpansionPanelTitle from \"./GeneralInfoExpansionPanelTitle\";\r\nimport Tr from \"translations/Translations\";\r\nimport ExpansionPanel from \"components/ExpansionPanel\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    buttonRow: {\r\n        marginTop: theme.spacing(2),\r\n        textAlign: \"end\"\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    ipColumn: theme.components.table.ipColumn,\r\n    dateColumn: theme.components.table.dateColumn\r\n}));\r\n\r\nfunction GeneralInfoRealizationAmount(\r\n    {\r\n        panelsClassesObject,\r\n        generalInfoBasicData\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [expanded, setExpanded] = useState(false);\r\n\r\n\r\n\r\n    return (\r\n        (!!generalInfoBasicData.realizationList && generalInfoBasicData.realizationList.length > 0) ?\r\n        <ExpansionPanel\r\n            classesObj={panelsClassesObject}\r\n            title={\r\n                <GeneralInfoExpansionPanelTitle\r\n                    subject={Tr(\"realization_demand_value\")}\r\n                    toggleThread={() => setExpanded(x => !x)}\r\n                    expanded={expanded}\r\n                />\r\n            }\r\n            expanded={expanded}\r\n            onChange={(e, isExpanded) => setExpanded(isExpanded)}\r\n\r\n        >\r\n            <SimpleTable\r\n                columnClasses={[\r\n                    undefined,\r\n                    classes.dateColumn,\r\n                    classes.dateColumn,\r\n                ]}\r\n                headers={[Tr('name'), Tr('gross_value'), Tr('publish_data')]}\r\n                items={generalInfoBasicData.realizationList.map((item, index) => [\r\n                    `${Tr('part_x', {x: item.ordinalNumber})}: ${item.name}`,\r\n                    `${formatAmountNumber(item.value)} PLN`,\r\n                    item.publishDate ? moment(item.publishDate).format(DateFormats.DATETIME_FORMAT) : ''\r\n                ])}\r\n            />\r\n        </ExpansionPanel>\r\n            :\r\n            null\r\n    )\r\n}\r\n\r\nGeneralInfoRealizationAmount.propTypes = {\r\n    generalInfoBasicData: PropTypes.object.isRequired\r\n}\r\n\r\nexport default GeneralInfoRealizationAmount;","import React, {useContext, useEffect} from 'react'\r\nimport DemandOffersGeneralInfoService from \"services/DemandOffersGeneralInfoService\";\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport GeneralInfoBasicData from \"./components/GeneralInfoBasicData\";\r\nimport {connect} from \"react-redux\";\r\nimport GeneralInfoDocuments from \"./components/GeneralInfoDocuments\";\r\nimport GeneralInfoPublicAnswers from \"./components/GeneralInfoPublicAnswers\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport GeneralInfoRealizationAmount from \"./components/GeneralInfoRealizationAmount\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport PropTypes from \"prop-types\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {StageSections} from \"../../../constants/StageSections\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n    },\r\n    rootExpanded: {\r\n        marginBottom: `${theme.spacing(2)}px !important`\r\n    },\r\n    title: {\r\n        padding: 0,\r\n    },\r\n    details: {}\r\n}));\r\n\r\n\r\nfunction GeneralInfoPanel(\r\n    {\r\n        panelRef,\r\n        sectionId,\r\n        demandHeader,\r\n        currentRfxRound,\r\n        generalInfoBasicData,\r\n        demandStageSectionsList\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const section = params.section;\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const dataLoading = !generalInfoBasicData || !demandHeader || !currentRfxRound;\r\n    useEffect(() => {\r\n            if (!dataLoading) {\r\n                setTimeout((elem) => scrollTo(elem), 100, panelRef.current);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n        , [dataLoading])\r\n\r\n    useEffect(() => {\r\n        DemandOffersGeneralInfoService.getContractorGeneralInfoBasicData(demandId, stageId, purchaserOfferContext?.supplierId);\r\n        StatisticsService.getCurrentRound(demandId);\r\n        return () => {\r\n            DemandOffersGeneralInfoService.clearResources(DemandOffersGeneralInfoService.GENERAL_INFO_BASIC_DATA);\r\n            StatisticsService.clearCurrentRound();\r\n            if (demandStageSectionsList[StageSections.GENERAL_INFO]?.unreadDemandDocuments || demandStageSectionsList[StageSections.GENERAL_INFO]?.unreadRfxMessages)\r\n                DemandOffersService.getStageSection(demandId, stageId, StageSections.GENERAL_INFO, purchaserOfferContext?.supplierId);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandId, stageId, section])\r\n\r\n\r\n    const panelsClassesObject = {root: classes.root, expanded: classes.rootExpanded, title: classes.title, details: classes.details}\r\n\r\n    return dataLoading ? <Loading/> :\r\n        <GridBlock column>\r\n            <GeneralInfoBasicData generalInfoBasicData={generalInfoBasicData} demandHeader={demandHeader} panelsClassesObject={panelsClassesObject}/>\r\n            <GeneralInfoDocuments panelsClassesObject={panelsClassesObject} />\r\n            <GeneralInfoPublicAnswers currentRfxRoundId={currentRfxRound.id} panelsClassesObject={panelsClassesObject}/>\r\n            <GeneralInfoRealizationAmount generalInfoBasicData={generalInfoBasicData} panelsClassesObject={panelsClassesObject}/>\r\n        </GridBlock>\r\n}\r\n\r\nGeneralInfoPanel.propTypes = {\r\n    sectionId: PropTypes.string.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    generalInfoBasicData: state.resources[DemandOffersGeneralInfoService.GENERAL_INFO_BASIC_DATA],\r\n    currentRfxRound: state.resources[StatisticsService.CURRENT_RFX_RESOURCE_ID],\r\n    demandStageSectionsList: state.resources[DemandOffersService.DEMAND_STAGE_SECTIONS_LIST]\r\n}), {})(GeneralInfoPanel);","import DemandOffersService from \"../services/DemandOffersService\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst isResponseValidWithStoredPasswordCheck = (\r\n    response, passwordSetSuccessCallback, passwordSetErrorCallback, setErrors, skipShowError) => {\r\n\r\n    if (response.success === true) {\r\n        return true;\r\n    } else {\r\n        if (response.noValidPassword) {\r\n            DemandOffersService.openContractorPasswordPopup(passwordSetSuccessCallback, passwordSetErrorCallback)\r\n        } else if (!skipShowError) {\r\n            if (response.errors && response.errors.length > 0)\r\n                reduxStore.dispatch(setSaveStatusError(response.errors[0]));\r\n            else\r\n                reduxStore.dispatch(setSaveStatusError(Tr('bad_request_error')));\r\n        }\r\n        if (setErrors) {\r\n            if(response.hasOwnProperty(\"offerErrors\")) {\r\n                setErrors(response.offerErrors);\r\n            } else if (!response.noValidPassword) {\r\n                setErrors(response.errors);\r\n            }\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\nexport default isResponseValidWithStoredPasswordCheck;","import React from 'react'\r\nimport {Avatar, makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\nimport PriorityHighIcon from '@material-ui/icons/PriorityHigh'\r\nimport DoneIcon from '@material-ui/icons/Done'\r\nimport PlaylistAddIcon from '@material-ui/icons/PlaylistAdd';\r\nimport HourglassFullIcon from '@material-ui/icons/HourglassFull';\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport EditIcon from '@material-ui/icons/Edit';\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    Done: {backgroundColor: theme.palette.common.success},\r\n    Finished: {backgroundColor: theme.palette.common.success},\r\n    Required: {backgroundColor: theme.palette.common.error},\r\n    Optional: {backgroundColor: theme.palette.common.info},\r\n    Pending: {backgroundColor: theme.palette.common.info},\r\n    Progress: {backgroundColor: theme.palette.common.info},\r\n    Wait: {backgroundColor: theme.palette.action.disabled},\r\n    avatar: {\r\n        width: 30,\r\n        height: 30,\r\n        marginRight: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nconst icoTab = {\r\n    Required: PriorityHighIcon,\r\n    Done: DoneIcon,\r\n    Optional: PlaylistAddIcon,\r\n    Wait: HourglassFullIcon,\r\n    Finished: CheckCircleIcon,\r\n    Progress: EditIcon\r\n}\r\n\r\nexport const AvatarStatus = {\r\n    Required: \"Required\",\r\n    Done: \"Done\",\r\n    Optional: \"Optional\",\r\n    Wait: \"Wait\",\r\n    Finished: \"Finished\",\r\n    Progress: \"Progress\"\r\n}\r\n\r\nfunction ExpansionPanelTitleAvatar(\r\n    {\r\n        variant,\r\n        title\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const Icon = icoTab[variant];\r\n    const className = classes[variant];\r\n\r\n    return (<Avatar title={title} className={clsx(className, classes.avatar)}>{Icon && <Icon/>}</Avatar>)\r\n\r\n}\r\n\r\nExpansionPanelTitleAvatar.propTypes = {\r\n    variant: PropTypes.oneOf(Object.keys(AvatarStatus)).isRequired,\r\n    title: PropTypes.string\r\n}\r\n\r\nexport default ExpansionPanelTitleAvatar;","export const OfferMode = {\r\n    EDIT: \"EDIT\",\r\n    PLACED: \"PLACED\"\r\n}\r\n","import {AvatarStatus} from \"components/ExpansionPanelTitleAvatar\";\r\nimport {OfferMode} from \"./OfferMode\";\r\n\r\nexport const OfferPositionStatusType = {\r\n    NO_OFFER: \"NO_OFFER\", //nieb\r\n    INCOMPLETE: \"INCOMPLETE\", //dotkniety - nieskończony\r\n    COMPLETED: \"COMPLETED\", //wypełniony - nieskończony\r\n    PLACED: \"PLACED\", //złożony\r\n    PLACED_INCOMPLETE: \"PLACED_INCOMPLETE\", //dotkniety - nieskończony\r\n    PLACED_COMPLETED: \"PLACED_COMPLETED\", //wypełniony - nieskończony\r\n    PLACED_OUT_OF_DATE: \"PLACED_OUT_OF_DATE\", //złożony - nieaktualny\r\n    WITHDRAWN: \"WITHDRAWN\", //ziel\r\n    WAITING_SIGNATURE: \"WAITING_SIGNATURE\", //ziel\r\n    WAITING_WITHDRAW_SIGNATURE: \"WAITING_WITHDRAW_SIGNATURE\", //ziel\r\n    WAITING_ADDITIONAL_OFFERS: \"WAITING_ADDITIONAL_OFFERS\" //ziel\r\n}\r\n\r\nexport const OfferPositionStatusToAvatar = (status, mode) => {\r\n    switch (status) {\r\n        case OfferPositionStatusType.NO_OFFER:\r\n            return AvatarStatus.Optional;\r\n        case OfferPositionStatusType.INCOMPLETE:\r\n            return AvatarStatus.Progress;\r\n        case OfferPositionStatusType.COMPLETED:\r\n            return AvatarStatus.Finished;\r\n        case OfferPositionStatusType.PLACED:\r\n            return AvatarStatus.Done;\r\n        case OfferPositionStatusType.PLACED_INCOMPLETE:\r\n            return AvatarStatus.Progress;\r\n        case OfferPositionStatusType.PLACED_COMPLETED:\r\n            return mode === OfferMode.PLACED ? AvatarStatus.Done : AvatarStatus.Finished;\r\n        case OfferPositionStatusType.PLACED_OUT_OF_DATE:\r\n            return mode === OfferMode.PLACED ? AvatarStatus.Finished : AvatarStatus.Required;\r\n        case OfferPositionStatusType.WITHDRAWN:\r\n            return AvatarStatus.Finished;\r\n        case OfferPositionStatusType.WAITING_SIGNATURE:\r\n            return AvatarStatus.Finished;\r\n        case OfferPositionStatusType.WAITING_WITHDRAW_SIGNATURE:\r\n            return AvatarStatus.Done;\r\n        case OfferPositionStatusType.WAITING_ADDITIONAL_OFFERS:\r\n            return AvatarStatus.Finished;\r\n        default:\r\n            return AvatarStatus.Wait;\r\n\r\n    }\r\n}\r\n\r\nexport const OfferPositionStatusesReadyToOffering = [OfferPositionStatusType.COMPLETED, OfferPositionStatusType.PLACED_COMPLETED, OfferPositionStatusType.WITHDRAWN]\r\nexport const OfferPositionStatusesReadyToOfferSign = [OfferPositionStatusType.WAITING_SIGNATURE]\r\nexport const OfferPositionStatusesReadyToWithdraw = [OfferPositionStatusType.PLACED, OfferPositionStatusType.PLACED_COMPLETED, OfferPositionStatusType.PLACED_INCOMPLETE]\r\nexport const OfferPositionStatusesReadyToWithdrawSign = [OfferPositionStatusType.WAITING_WITHDRAW_SIGNATURE]\r\nexport const OfferPositionStatusesReadyToDelete = [OfferPositionStatusType.INCOMPLETE, OfferPositionStatusType.COMPLETED]\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const SignatureType = {\r\n    QUALIFIED: \"QUALIFIED\",\r\n    PERSONAL_ID: \"PERSONAL_ID\",\r\n    E_PUAP: \"E_PUAP\",\r\n    UNKNOWN: \"UNKNOWN\"\r\n}\r\nconst _TR_PREFIX = 'signature_type_';\r\n\r\nexport const SignatureTypeLabel = (priceType) => (Tr(_TR_PREFIX + priceType.toLowerCase()));\r\n","export const OfferStatusType = {\r\n    NORMAL: \"NORMAL\",\r\n    WAITING_SIGNATURE: \"WAITING_SIGNATURE\",\r\n    WAITING_WITHDRAW_SIGNATURE: \"WAITING_WITHDRAW_SIGNATURE\"\r\n}\r\n","import reduxStore from 'redux/store'\r\nimport {clearResource, setResource, setSaveStatusError, setSaveStatusInfo} from \"../redux/actions\";\r\nimport {RestRequestBLOB, RestRequestBLOBBase64Encoded, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from \"../libs/RestRequest\";\r\nimport Endpoints from \"../constants/Endpoints\";\r\nimport RouterPath from \"../libs/RouterPath\";\r\nimport Tr from \"../translations/Translations\";\r\nimport isResponseValidWithStoredPasswordCheck from \"../libs/isResponseValidWithStoredPasswordCheck\";\r\nimport downloadFile from \"../libs/downloadFile\";\r\nimport {OfferPositionStatusType} from \"../pages/contractor/demand/scenes/offer/components/common/constants/OfferPositionStatusType\";\r\nimport {SignatureType} from \"../constants/SignatureType\";\r\nimport {OfferStatusType} from \"../pages/contractor/demand/scenes/offer/components/common/constants/OfferStatusType\";\r\nimport DemandOffersService from \"./DemandOffersService\";\r\nimport {StageSections} from \"../pages/contractor/demand/scenes/offer/constants/StageSections\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport saveStatusValues from \"../constants/status.save\";\r\nimport {OfferMode} from \"../pages/contractor/demand/scenes/offer/components/common/constants/OfferMode\";\r\n\r\n\r\nconst OFFER_EDIT = \"offerEdit\";\r\nconst OFFER_PLACED = \"offerPlaced\";\r\nconst OFFER_POSITIONS_LOADED = \"offerPositionsLoaded\";\r\n\r\nconst postSaveCommonData = async (demandId, stageId, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_STAGE_CONTRACTOR_OFFER(demandId, stageId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postSaveCommonData(demandId, stageId, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, {...resources[OFFER_EDIT], commonData: resp.result}))\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst postSavePositionData = async (demandId, stageId, supplierId, mode, data) => {\r\n    let errors;\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_POSITION(demandId, stageId, supplierId), data, {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postSavePositionData(demandId, stageId, supplierId, mode, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId),\r\n            (err) => {\r\n                errors = err;\r\n            }, true\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const loaded = resources[OFFER_POSITIONS_LOADED] || {};\r\n            const newLoaded = {\r\n                ...loaded,\r\n                [getLoadedPositionKey(data.positionId)]: {\r\n                    ...data,\r\n                    placingType: null\r\n                }\r\n                //[getPositionKey(positionId)]: {...resp.result, priceType: PriceType.NET_GROSS, criteriums: resp.result.criteriums.map(x => ({...x, vatType: \"OTHER\", vatValue: 7, currency: \"PLN\"}))}\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_POSITIONS_LOADED, newLoaded))\r\n\r\n            let filesResp = null;\r\n            if (data.placingType) {\r\n                filesResp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_FILES(demandId, stageId, mode, supplierId), {params});\r\n            }\r\n\r\n            const curEdit = resources[OFFER_EDIT];\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                positions: curEdit.positions.map(x => x.positionId === resp.result.positionId ? resp.result : x)\r\n            }\r\n\r\n            if (filesResp?.success) {\r\n                edit.offerFiles = filesResp.result;\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n            await DemandOffersService.getStageSection(demandId, stageId, StageSections.OFFER_EDIT, supplierId);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        if (saveStatusValues.CLOSED === reduxStore.getState().store.saveStatus)\r\n            reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n    if (Array.isArray(errors)) {\r\n        if (errors.length > 0) {\r\n            if (typeof errors[0] === 'string' || errors[0] instanceof String) {\r\n                reduxStore.dispatch(setSaveStatusError(errors[0]))\r\n            }\r\n        } else {\r\n            reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n        }\r\n    }\r\n    return errors;\r\n}\r\n\r\nconst signEspdFile = async (demandId, stageId, fileId, data) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_ESPD_ID_SIGN_FILE(demandId, stageId, fileId), data);\r\n\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            await _processAddNewEspdFiles(demandId, stageId, undefined, resp);\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\n\r\nconst postOfferEspdFiles = async (demandId, stageId, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_ESPD(demandId, stageId, supplierId), {files: data}, {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postOfferEspdFiles(demandId, stageId, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            _processAddNewEspdFiles(demandId, stageId, supplierId, resp)\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\n\r\nconst _processAddNewEspdFiles = async (demandId, stageId, supplierId, resp) => {\r\n    const {resources} = reduxStore.getState();\r\n    const curEdit = resources[OFFER_EDIT];\r\n    const touchedPositions = resp.result.map(x => x.positionId);\r\n\r\n    const tmpEspdFiles = curEdit.espdFiles.map(of => {\r\n        const updatedOf = resp.result.find(x => x.identity === of.identity);\r\n        return updatedOf ? updatedOf : of;\r\n    });\r\n    resp.result.forEach(x => {\r\n        if (!curEdit.espdFiles.find(o => o.identity === x.identity))\r\n            tmpEspdFiles.push(x);\r\n    });\r\n\r\n    const edit = {\r\n        ...curEdit,\r\n        espdFiles: [\r\n            ...tmpEspdFiles\r\n        ],\r\n        positions: curEdit.positions.map(x => touchedPositions.includes(x.positionId) && x.status === OfferPositionStatusType.NO_OFFER ? {\r\n            ...x,\r\n            status: OfferPositionStatusType.INCOMPLETE\r\n        } : x)\r\n    }\r\n    reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n    await DemandOffersService.getStageSection(demandId, stageId, StageSections.OFFER_EDIT, supplierId);\r\n\r\n}\r\n\r\n\r\n\r\n\r\nconst placeOffer = async (demandId, stageId, supplierId, onePositionMode, data, stageTr) => {\r\n\r\n    const params = {supplierId}\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_PLACE_OFFER(demandId, stageId, supplierId), data, {params});\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => placeOffer(demandId, stageId, supplierId, onePositionMode, data, stageTr),\r\n        () => defErrorCallback(demandId, stageId, supplierId)\r\n    )) {\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(supplierId ? stageTr(\"offer_placed_successfully_operator\") : (onePositionMode ? stageTr(\"offer_placed_successfully\") :\r\n                stageTr(\"offer_placed_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \"))));\r\n        else if (resp.result.status === OfferStatusType.WAITING_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n        await DemandOffersService.getStageSections(demandId, stageId, supplierId)\r\n        defErrorCallback(demandId, stageId, supplierId);\r\n    }\r\n\r\n}\r\nconst verifyBeforePlaceOffer = async (demandId, stageId, supplierId, positionIds) => {\r\n    const params = {positionIds: positionIds ? positionIds.join(\",\") : undefined}\r\n    return await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_VERIFICATION_BEFORE_PLACE(demandId, stageId, supplierId), {params});\r\n}\r\n\r\nconst getPreviewSection = async (demandId, stageId, supplierId, mode) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_PREVIEW_OFFER_MODE_SECTION(demandId, stageId, supplierId, mode));\r\n}\r\n\r\nconst deleteOffer = async (demandId, stageId, positionIds, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_DELETE_OFFER(demandId, stageId), {list: positionIds});\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => deleteOffer(demandId, stageId, positionIds, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        await DemandOffersService.getStageSection(demandId, stageId, StageSections.OFFER_EDIT, null);\r\n        defErrorCallback(demandId, stageId);\r\n        reduxStore.dispatch(setSaveStatusInfo(stageTr(\"delete_offer_success\")));\r\n    }\r\n}\r\n\r\nconst withdrawOffer = async (demandId, stageId, data, onePositionMode, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_WITHDRAW_OFFER(demandId, stageId), data);\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => withdrawOffer(demandId, stageId, data, onePositionMode, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(onePositionMode ? stageTr(\"offer_withdrawn_successfully\") :\r\n                stageTr(\"offer_withdrawn_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \")));\r\n        else if (resp.result.status === OfferStatusType.WAITING_WITHDRAW_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_withdrawn_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst signOffer = async (demandId, stageId, data, onePositionMode, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_SIGN_OFFER(demandId, stageId), data);\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => signOffer(demandId, stageId, data, onePositionMode, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(onePositionMode ? stageTr(\"offer_placed_successfully\") :\r\n                stageTr(\"offer_placed_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \")));\r\n        else if (resp.result.status === OfferStatusType.WAITING_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst signWithdraw = async (demandId, stageId, data, onePositionMode, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_SIGN_WITHDRAW(demandId, stageId), data);\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => signWithdraw(demandId, stageId, data, onePositionMode, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(onePositionMode ? stageTr(\"offer_withdrawn_successfully\") :\r\n                stageTr(\"offer_withdrawn_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \")));\r\n        else if (resp.result.status === OfferStatusType.WAITING_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_withdrawn_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst stopSigningOperation = async (demandId, stageId) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_STOP_SIGNING_OPERATION(demandId, stageId));\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => stopSigningOperation(demandId, stageId),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst getDocumentToSign = async (demandId, stageId, data) => {\r\n    try {\r\n        if (data.signatureType === SignatureType.QUALIFIED || data.signatureType === SignatureType.PERSONAL_ID) {\r\n            let resp = await RestRequestBLOBBase64Encoded(Endpoints.DEMAND_OFFERS_OFFER_DOC_TO_SIGN(demandId, stageId), {data, method: 'post'})\r\n            if (isResponseValidWithStoredPasswordCheck(resp,\r\n                () => {\r\n                },\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n        } else {\r\n            const resp = await RestRequestBLOB(Endpoints.DEMAND_OFFERS_OFFER_DOC_TO_SIGN(demandId, stageId), {data, method: 'post'})\r\n\r\n            if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n                () => getDocumentToSign(demandId, stageId, data),\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n    }\r\n}\r\n\r\nconst getDocumentBase64EncodedToSignDocument = async (url) => {\r\n    try {\r\n        let resp = await RestRequestBLOBBase64Encoded(url, {method: 'get'})\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => void 0,\r\n            () => void 0\r\n        )) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n    }\r\n}\r\n\r\nconst getDocumentToWithdraw = async (demandId, stageId, data) => {\r\n    try {\r\n        if (data.signatureType === SignatureType.QUALIFIED || data.signatureType === SignatureType.PERSONAL_ID) {\r\n            let resp = await RestRequestBLOBBase64Encoded(Endpoints.DEMAND_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN(demandId, stageId), {\r\n                data,\r\n                method: 'post'\r\n            })\r\n            if (isResponseValidWithStoredPasswordCheck(resp,\r\n                () => {\r\n                },\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n        } else {\r\n            const resp = await RestRequestBLOB(Endpoints.DEMAND_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN(demandId, stageId), {data, method: 'post'})\r\n\r\n            if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n                () => getDocumentToSign(demandId, stageId, data),\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n    }\r\n}\r\n\r\nconst getDownloadOfferFileUrl = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => {\r\n        },\r\n        () => {\r\n        }\r\n    )) {\r\n        return resp.result;\r\n    }\r\n}\r\n\r\nconst getDownloadOfferFile = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getDownloadOfferFile(demandId, stageId, mode, fileId, supplierId),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getDownloadOfferFilesZip = async (demandId, stageId, supplierId) => {\r\n    const params = {supplierId}\r\n    await RestRequestBLOB(Endpoints.DEMAND_OFFERS_OFFER_MODE_FILE_DOWNLOAD_ZIP(demandId, stageId, supplierId), {params});\r\n}\r\n\r\nconst getDownloadEspdFileUrl = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => {\r\n        },\r\n        () => {\r\n        }\r\n    )) {\r\n        return resp.result;\r\n    }\r\n}\r\n\r\nconst getDownloadEspdFile = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getDownloadEspdFile(demandId, stageId, mode, fileId, supplierId),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst signFile = async (demandId, stageId, fileId, data) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_FILE_ID_SIGN_FILE(demandId, stageId, fileId), data);\r\n\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            await _processAddNewFiles(demandId, stageId, OfferMode.EDIT, undefined, resp);\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst postOfferFiles = async (demandId, stageId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_FILE(demandId, stageId, supplierId), {files: data}, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postOfferFiles(demandId, stageId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            await _processAddNewFiles(demandId, stageId, mode, supplierId, resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst _processAddNewFiles = async (demandId, stageId, mode, supplierId, resp) => {\r\n    const {resources} = reduxStore.getState();\r\n    let curEdit = resources[OFFER_EDIT];\r\n\r\n    let touchedPositions;\r\n\r\n    if (curEdit.passiveOfferForm) {\r\n        touchedPositions = [curEdit.positions[0].positionId]\r\n    } else {\r\n        touchedPositions = [...new Set(resp.result.filter(x => !!x.positionId).map(x => x.positionId))];\r\n    }\r\n\r\n    let positions = [];\r\n    if (touchedPositions.length > 0) {\r\n        const params = {\r\n            positionIds: touchedPositions.join(\",\"),\r\n            supplierId\r\n        }\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n        if (resp.success) {\r\n            positions = resp.result;\r\n        }\r\n        //odświeżam reduxa bo mogło się pozmieniać\r\n        curEdit = resources[OFFER_EDIT];\r\n    }\r\n\r\n    const tmpOfferFiles = curEdit.offerFiles.map(of => {\r\n        const updatedOf = resp.result.find(x => x.identity === of.identity);\r\n        return updatedOf ? updatedOf : of;\r\n    });\r\n    resp.result.forEach(x => {\r\n        if (!curEdit.offerFiles.find(o => o.identity === x.identity))\r\n            tmpOfferFiles.push(x);\r\n    });\r\n    const edit = {\r\n        ...curEdit,\r\n        offerFiles: [\r\n            ...tmpOfferFiles\r\n        ],\r\n        positions: curEdit.positions.map(x => {\r\n            const pos = positions.find(p => p.positionId === x.positionId);\r\n            return pos ? pos : x;\r\n        })\r\n    }\r\n    reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n    await DemandOffersService.getStageSection(demandId, stageId, StageSections.OFFER_EDIT, supplierId);\r\n}\r\n\r\nconst deleteOfferFile = async (demandId, stageId, mode, supplierId, fileId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestDELETE(Endpoints.DEMAND_OFFERS_OFFER_FILE_ID(demandId, stageId, fileId, supplierId), {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => deleteOfferFile(demandId, stageId, mode, supplierId, fileId),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[OFFER_EDIT];\r\n\r\n            let positionId;\r\n            if (curEdit.passiveOfferForm) {\r\n                positionId = curEdit.positions[0].positionId;\r\n            } else {\r\n                const file = curEdit.offerFiles.find(x => x.identity === fileId);\r\n                if (file) {\r\n                    positionId = file.positionId;\r\n                }\r\n            }\r\n\r\n            let position;\r\n            if (positionId) {\r\n                const params = {\r\n                    positionIds: positionId,\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    position = resp.result[0];\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[OFFER_EDIT];\r\n            }\r\n\r\n            let tmpOfferFiles = curEdit.offerFiles.filter(x => x.identity !== fileId);\r\n            if (!!resp.result) {\r\n                tmpOfferFiles = tmpOfferFiles.map(x => {\r\n                    return x.identity === resp.result.identity ? resp.result : x;\r\n                })\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                offerFiles: tmpOfferFiles,\r\n                positions: curEdit.positions.map(x => position && position.identity === x.identity ? position : x)\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n            await DemandOffersService.getStageSection(demandId, stageId, StageSections.OFFER_EDIT, supplierId);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\n\r\nconst editEspdFile = async (demandId, stageId, espdId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPUT(Endpoints.DEMAND_OFFERS_OFFER_ESPD_ID(demandId, stageId, espdId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => editEspdFile(demandId, stageId, espdId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[OFFER_EDIT];\r\n\r\n            let positionId;\r\n            if (curEdit.passiveOfferForm) {\r\n                positionId = curEdit.positions[0].positionId;\r\n            } else {\r\n                const file = curEdit.offerFiles.find(x => x.identity === espdId);\r\n                if (file) {\r\n                    positionId = file.positionId;\r\n                }\r\n            }\r\n\r\n            let position;\r\n            if (positionId) {\r\n                const params = {\r\n                    positionIds: positionId,\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    position = resp.result[0];\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[OFFER_EDIT];\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                espdFiles: curEdit.espdFiles.map(x => x.identity === resp.result.identity ? resp.result : x),\r\n                positions: curEdit.positions.map(x => position && position.identity === x.identity ? position : x)\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst editEspdFiles = async (demandId, stageId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPUT(Endpoints.DEMAND_OFFERS_OFFER_ESPDS(demandId, stageId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => editEspdFiles(demandId, stageId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[OFFER_EDIT];\r\n\r\n            let touchedPositions;\r\n\r\n            if (curEdit.passiveOfferForm) {\r\n                touchedPositions = [curEdit.positions[0].positionId]\r\n            } else {\r\n                touchedPositions = [...new Set(resp.result.filter(x => !!x.positionId).map(x => x.positionId))];\r\n            }\r\n\r\n            let positions = [];\r\n            if (touchedPositions.length > 0) {\r\n                const params = {\r\n                    positionIds: touchedPositions.join(\",\"),\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    positions = resp.result;\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[OFFER_EDIT];\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                espdFiles: curEdit.espdFiles.map(x => resp.result.find(y => y.identity === x.identity) || x),\r\n                positions: curEdit.positions.map(x => {\r\n                    const pos = positions.find(p => p.positionId === x.positionId);\r\n                    return pos ? pos : x;\r\n                })\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst deleteEspdFile = async (demandId, stageId, espdId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestDELETE(Endpoints.DEMAND_OFFERS_OFFER_ESPD_ID(demandId, stageId, espdId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => deleteEspdFile(demandId, stageId, espdId, supplierId),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const curEdit = resources[OFFER_EDIT];\r\n\r\n            let tmpOfferFiles = curEdit.espdFiles.filter(x => x.identity !== espdId);\r\n            if (!!resp.result) {\r\n                tmpOfferFiles = tmpOfferFiles.map(x => {\r\n                    return x.identity === resp.result.identity ? resp.result : x;\r\n                })\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                espdFiles: tmpOfferFiles\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst editOfferFile = async (demandId, stageId, fileId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPUT(Endpoints.DEMAND_OFFERS_OFFER_FILE_ID(demandId, stageId, fileId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => editOfferFile(demandId, stageId, fileId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[OFFER_EDIT];\r\n\r\n            let positionId;\r\n            if (curEdit.passiveOfferForm) {\r\n                positionId = curEdit.positions[0].positionId;\r\n            } else {\r\n                const file = curEdit.offerFiles.find(x => x.identity === fileId);\r\n                if (file) {\r\n                    positionId = file.positionId;\r\n                }\r\n            }\r\n\r\n            let position;\r\n            if (positionId) {\r\n                const params = {\r\n                    positionIds: positionId,\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    position = resp.result[0];\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[OFFER_EDIT];\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                offerFiles: curEdit.offerFiles.map(x => x.identity === resp.result.identity ? resp.result : x),\r\n                positions: curEdit.positions.map(x => position && position.identity === x.identity ? position : x)\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\nconst editOfferFiles = async (demandId, stageId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPUT(Endpoints.DEMAND_OFFERS_OFFER_FILES(demandId, stageId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => editOfferFiles(demandId, stageId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[OFFER_EDIT];\r\n\r\n            let touchedPositions;\r\n\r\n            if (curEdit.passiveOfferForm) {\r\n                touchedPositions = [curEdit.positions[0].positionId]\r\n            } else {\r\n                touchedPositions = [...new Set(resp.result.filter(x => !!x.positionId).map(x => x.positionId))];\r\n            }\r\n\r\n            let positions = [];\r\n            if (touchedPositions.length > 0) {\r\n                const params = {\r\n                    positionIds: touchedPositions.join(\",\"),\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    positions = resp.result;\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[OFFER_EDIT];\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                offerFiles: curEdit.offerFiles.map(x => resp.result.find(y => y.identity === x.identity) || x),\r\n                positions: curEdit.positions.map(x => {\r\n                    const pos = positions.find(p => p.positionId === x.positionId);\r\n                    return pos ? pos : x;\r\n                })\r\n            }\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, edit));\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getOfferEdit = async (demandId, stageId, mode, supplierId, preview) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const endpoint = preview ? Endpoints.DEMAND_PREVIEW_OFFER_MODE : Endpoints.DEMAND_OFFERS_OFFER_MODE\r\n\r\n        const resp = await RestRequestGET(endpoint(demandId, stageId, supplierId, mode), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getOfferEdit(demandId, stageId, mode, supplierId, preview),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            reduxStore.dispatch(setResource(OFFER_EDIT, resp.result))\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getOfferPosition = async (demandId, stageId, mode, positionId, supplierId, preview) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const endpoint = preview ? Endpoints.DEMAND_PREVIEW_OFFER_MODE_POSITION_ID : Endpoints.DEMAND_OFFERS_OFFER_MODE_POSITION_ID;\r\n\r\n        const resp = await RestRequestGET(endpoint(demandId, stageId, mode, positionId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getOfferPosition(demandId, stageId, mode, positionId, supplierId, preview),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const loaded = resources[OFFER_POSITIONS_LOADED] || {};\r\n\r\n            const newLoaded = {\r\n                ...loaded,\r\n                [getLoadedPositionKey(positionId)]: resp.result\r\n                //[getPositionKey(positionId)]: {...resp.result, priceType: PriceType.NET_GROSS, criteriums: resp.result.criteriums.map(x => ({...x, vatType: \"OTHER\", vatValue: 7, currency: \"PLN\"}))}\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(OFFER_POSITIONS_LOADED, newLoaded))\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\nconst printOfferPosition = async (demandId, stageId, mode, positionId, supplierId, preview) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_PREVIEW_OFFER_MODE_POSITION_ID_PRINT(demandId, stageId, mode, positionId, supplierId), {params});\r\n        if (isResponseValid(resp, (e) => {throw new Error(e)})\r\n        ) {\r\n         downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst requireWithdrawEncryption = async (demandId, stageId, positionIds) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_OFFERS_OFFER_REQUIRE_WITHDRAW_ENCRYPTION(demandId, stageId), {positionIds});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => defErrorCallback(demandId, stageId),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            return resp.result;\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\n\r\nconst redirectContractorESPDMpAppUrl = async (demandId, stageId, positionId) => {\r\n    try {\r\n        const params = positionId ? {positionId} : {};\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_ESPD_MP_APP_URL(demandId, stageId), {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => redirectContractorESPDMpAppUrl(demandId, stageId, positionId),\r\n            () => defErrorCallback(demandId, stageId))\r\n        ) {\r\n            const resp2 = await RestRequestGET(resp.result);\r\n            if (resp2.code === 'ok') {\r\n                window.location.href = resp2.url;\r\n            } else\r\n                throw new Error(resp2);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst downloadContractorESPDExportFile = async (demandId, stageId, positionId) => {\r\n\r\n    try {\r\n        const params = positionId ? {positionId} : {};\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_ESPD_EXPORT_FILE_URL(demandId, stageId), {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => downloadContractorESPDExportFile(demandId, stageId, positionId),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            await RestRequestBLOB(resp.result);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getSnapshots = async (demandId, stageId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_SNAPSHOTS(demandId, stageId, supplierId), {params});\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst downloadSnapshot = async (demandId, stageId, snapshotId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestBLOB(Endpoints.DEMAND_OFFERS_OFFER_SNAPSHOT_ID(demandId, stageId, snapshotId, supplierId), {params});\r\n\r\n        if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n            () => downloadSnapshot(demandId, stageId, snapshotId, supplierId),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            return resp.result;\r\n        }\r\n        return true;\r\n\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\n\r\nconst getVerifications = async (demandId, stageId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_OFFERS_OFFER_VERIFICATIONS(demandId, stageId, supplierId), {params});\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst downloadVerifications = async (demandId, stageId, supplierId, positionIds) => {\r\n    const data = {\r\n        list: positionIds\r\n    }\r\n    const params = {supplierId}\r\n    await RestRequestBLOB(Endpoints.DEMAND_OFFERS_OFFER_VERIFICATIONS(demandId, stageId, supplierId), {data, params, method: 'post'})\r\n}\r\n\r\nconst getDownloadOfferTemplate = async (demandId, stageId, supplierId, mode) => {\r\n    const params = {supplierId}\r\n    await RestRequestBLOB(Endpoints.DEMAND_OFFERS_OFFER_MODE_TEMPLATE(demandId, stageId, mode, supplierId), {params});\r\n}\r\n\r\nconst defErrorCallback = (demandId, stageId, supplierId) => {\r\n    if (supplierId) {\r\n        const {resources} = reduxStore.getState()\r\n        if (resources[DemandOffersService.DEMAND_STAGES_LIST]) {\r\n            const stage = resources[DemandOffersService.DEMAND_STAGES_LIST].find(x => x.supplierId === supplierId);\r\n            if (stage?.contractorDepartmentId) {\r\n                RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID, {\r\n                    id: demandId,\r\n                    contractorDepartmentId: stage.contractorDepartmentId,\r\n                    stageId\r\n                }));\r\n            }\r\n        }\r\n    } else {\r\n        RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID, {\r\n            id: demandId,\r\n            stageId\r\n        }));\r\n    }\r\n\r\n\r\n}\r\n\r\nconst clearResources = (resId) => reduxStore.dispatch(clearResource(resId));\r\n\r\n//jeśli ID jest liczbą potrafią różne dziwne rzeczy się dziać\r\nconst getLoadedPositionKey = (positionId) => \"_\" + positionId;\r\n\r\nexport default {\r\n    getLoadedPositionKey,\r\n    getOfferEdit,\r\n    postSaveCommonData,\r\n    getDownloadOfferFile,\r\n    getDownloadOfferFileUrl,\r\n    getDownloadOfferFilesZip,\r\n    postOfferFiles,\r\n    deleteOfferFile,\r\n    editOfferFile,\r\n    signFile,\r\n    editOfferFiles,\r\n    redirectContractorESPDMpAppUrl,\r\n    downloadContractorESPDExportFile,\r\n    signEspdFile,\r\n    postOfferEspdFiles,\r\n    editEspdFile,\r\n    editEspdFiles,\r\n    deleteEspdFile,\r\n    getDownloadEspdFileUrl,\r\n    getDownloadEspdFile,\r\n    getOfferPosition,\r\n    printOfferPosition,\r\n    postSavePositionData,\r\n    placeOffer,\r\n    withdrawOffer,\r\n    signOffer,\r\n    signWithdraw,\r\n    getDocumentToSign,\r\n    getDocumentBase64EncodedToSignDocument,\r\n    getDocumentToWithdraw,\r\n    stopSigningOperation,\r\n    clearResources,\r\n    requireWithdrawEncryption,\r\n    deleteOffer,\r\n    getSnapshots,\r\n    downloadSnapshot,\r\n    getVerifications,\r\n    downloadVerifications,\r\n    verifyBeforePlaceOffer,\r\n    getPreviewSection,\r\n    getDownloadOfferTemplate,\r\n    OFFER_EDIT,\r\n    OFFER_PLACED,\r\n    OFFER_POSITIONS_LOADED\r\n}","import Tr from 'translations/Translations';\r\nimport {createSelectItem} from \"../components/Select\";\r\n\r\nexport const ContractorDocumentType = {\r\n    PUBLIC: \"PUBLIC\",\r\n    SECRET: \"SECRET\",\r\n    RODO: \"RODO\"\r\n}\r\n\r\nexport const ContractorDocumentTypeSelectItems = (curVal) => Object.values(ContractorDocumentType)\r\n    .filter((type) => type !== ContractorDocumentType.RODO || curVal === ContractorDocumentType.RODO).map(x => createSelectItem(x, ContractorDocumentTypeLabel(x)));\r\n\r\n\r\nconst _TR_PREFIX = 'contractor_document_type_';\r\nexport const ContractorDocumentTypeLabel = (type) => (Tr(_TR_PREFIX + type.toLowerCase()));\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const RoundType = {\r\n\tBASE: \"BASE\",\r\n\tADDITIONAL_OFFERS: \"ADDITIONAL_OFFERS\",\r\n\tAUCTION: \"AUCTION\"\r\n}\r\n\r\nconst _TR_PREFIX = 'additional_round_type_';\r\n\r\nexport const RoundTypeLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value = Tr(trKey)) => ({\r\n    label: Tr(trKey),\r\n    value,\r\n})\r\n\r\nexport const TRUE_FALSE_VALUE = {\r\n    TRUE: 'true',\r\n    FALSE: 'false'\r\n}\r\n\r\nexport default [\r\n    createItem('yes', TRUE_FALSE_VALUE.TRUE),\r\n    createItem('no', TRUE_FALSE_VALUE.FALSE)\r\n]\r\n\r\nexport const TrueFalseWithEmpty = [\r\n    createItem('not_specified', '_'),\r\n    createItem('yes', TRUE_FALSE_VALUE.TRUE),\r\n    createItem('no', TRUE_FALSE_VALUE.FALSE)\r\n]","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport Select, {createSelectItem} from 'components/Select';\r\nimport VS from 'constants/ValidationShema';\r\nimport PropTypes from \"prop-types\";\r\nimport {ContractorDocumentType, ContractorDocumentTypeSelectItems} from \"constants/ContractorDocumentType\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport {TrueFalseWithEmpty} from \"constants/TrueFalseItems\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    gridContainer: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    fileName: {\r\n        width: 480,\r\n        marginBottom: theme.spacing()\r\n    },\r\n    select: {\r\n        width: 180\r\n    },\r\n    rodoSelect: {\r\n        width: 200\r\n    },\r\n    typeSelect: {\r\n        width: 230,\r\n    }\r\n}));\r\n\r\nfunction SelectOfferFilesType(\r\n    {\r\n        items,\r\n        onCancel,\r\n        onSubmit,\r\n        positions,\r\n        onePositionMode,\r\n        roundType,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const formId = useId();\r\n    const typeId = 'type';\r\n    const positionId = 'position';\r\n    const containsRodoId = 'containsRodo';\r\n\r\n    const getPositionItems = () => {\r\n        const map = positions.map(x => createSelectItem(x.positionId, Tr(\"part_x\", {x: x.order})));\r\n        if(roundType === RoundType.BASE) {\r\n            map.unshift(createSelectItem(0, Tr(\"whole_demand\")));\r\n        }\r\n        return map;\r\n    }\r\n\r\n    const generateItems = (formikProps) => {\r\n        if (items.length === 0) {\r\n            return <Typography>{Tr(\"file_extension_error\")}</Typography>\r\n        }\r\n        return items.map((item, i) => {\r\n            return (\r\n                <GridBlock key={i} justify=\"space-between\" alignItems=\"center\">\r\n                    <Typography className={classes.fileName}> {item.name}</Typography>\r\n\r\n                    <Select\r\n                        id={containsRodoId + i}\r\n                        formikProps={formikProps}\r\n                        items={TrueFalseWithEmpty}\r\n                        label={Tr('contains_rodo')}\r\n                        className={classes.rodoSelect}\r\n                    />\r\n\r\n                    <Select\r\n                        id={typeId + i}\r\n                        formikProps={formikProps}\r\n                        items={ContractorDocumentTypeSelectItems()}\r\n                        label={Tr('document_type')}\r\n                        className={classes.typeSelect}\r\n                    />\r\n\r\n                    {!onePositionMode && <Select\r\n                        id={positionId + i}\r\n                        formikProps={formikProps}\r\n                        items={getPositionItems()}\r\n                        label={Tr('assignment')}\r\n                        className={classes.select}\r\n                    />}\r\n\r\n                </GridBlock>\r\n            )\r\n        })\r\n    };\r\n\r\n    const submitForm = () => {\r\n        formSubmit[formId]()\r\n    };\r\n\r\n    const handleSubmit = (values) => onSubmit(values, items)\r\n\r\n    const generateInitialValues = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[typeId + i] = null;\r\n            obj[containsRodoId + i] = '_';\r\n            if (!onePositionMode)\r\n                obj[positionId + i] = null;\r\n        }\r\n        return obj\r\n    };\r\n\r\n    const generateValidationSchema = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[typeId + i] = VS.stringNotOneOf([ContractorDocumentType.RODO], Tr('required_field'));\r\n            obj[containsRodoId + i] = VS.any();\r\n            if (!onePositionMode)\r\n                obj[positionId + i] = VS.anyRequired();\r\n        }\r\n        return VS.object(obj)\r\n    };\r\n\r\n    if (items === undefined) return '';\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('select_document_type')}\r\n            titleCentered\r\n            maxWidth=\"lg\"\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr('add')}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={submitForm}\r\n            />}\r\n        >\r\n            <Form\r\n                onSubmit={handleSubmit}\r\n                id={formId}\r\n                initialValues={generateInitialValues()}\r\n                validationSchema={generateValidationSchema()}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <GridBlock column className={classes.gridContainer}>\r\n                            {generateItems(formikProps)}\r\n                        </GridBlock>\r\n\r\n\r\n                    </>\r\n                )}\r\n            </Form>\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSelectOfferFilesType.propTypes = {\r\n    items: PropTypes.arrayOf(PropTypes.shape({\r\n        name: PropTypes.string.isRequired\r\n    })).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n    positions: PropTypes.arrayOf(PropTypes.object).isRequired,\r\n    onePositionMode: PropTypes.bool.isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n}), {})(SelectOfferFilesType);","import React from 'react'\r\nimport {connect} from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport DescriptionIcon from '@material-ui/icons/Description';\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport PropTypes from 'prop-types'\r\nimport Select from \"components/Select\";\r\nimport {ContractorDocumentType, ContractorDocumentTypeSelectItems} from \"constants/ContractorDocumentType\";\r\nimport {TrueFalseWithEmpty} from \"constants/TrueFalseItems\"\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    disabledEmpty: {\r\n        fontStyle: 'italic'\r\n    },\r\n    textField: {\r\n        wordBreak: \"break-word\",\r\n        whiteSpace: 'pre-line',\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\n\r\nfunction EditFilePopup(\r\n    {\r\n        file,\r\n        onCancel,\r\n        onUpdate,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('edit_type')}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('confirm')}\r\n                    onClickFirst={onCancel}\r\n                    onClickSecond={handleSubmit}\r\n                />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    documentType: file.documentType,\r\n                    containsRodo: file.containsRodo\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    documentType: VS.stringNotOneOf([ContractorDocumentType.RODO], Tr('required_field')),\r\n                    containsRodo: VS.any()\r\n                })}\r\n                onSubmit={onUpdate}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <TypographyWithIcon Icon={DescriptionIcon} className={classes.margin}>\r\n                            {file.file.name}\r\n                        </TypographyWithIcon>\r\n\r\n                        <Select\r\n                            id=\"containsRodo\"\r\n                            formikProps={formikProps}\r\n                            items={TrueFalseWithEmpty}\r\n                            label={Tr('contains_rodo')}\r\n                            className={classes.select}\r\n                        />\r\n\r\n                        <Select\r\n                            id=\"documentType\"\r\n                            formikProps={formikProps}\r\n                            items={ContractorDocumentTypeSelectItems()}\r\n                            label={Tr('document_type')}\r\n                            className={classes.select}\r\n                        />\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEditFilePopup.propTypes = {\r\n    file: PropTypes.shape({\r\n        file: PropTypes.shape({\r\n            name: PropTypes.string.isRequired\r\n        }).isRequired,\r\n        identity: PropTypes.number.isRequired,\r\n        documentType: PropTypes.string.isRequired,\r\n    }).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onUpdate: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(EditFilePopup);","import reduxStore from 'redux/store'\r\nimport {clearResource, setResource, setSaveStatusError, setSaveStatusInfo} from \"../redux/actions\";\r\nimport {RestRequestBLOB, RestRequestBLOBBase64Encoded, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from \"../libs/RestRequest\";\r\nimport Endpoints from \"../constants/Endpoints\";\r\nimport RouterPath from \"../libs/RouterPath\";\r\nimport Tr from \"../translations/Translations\";\r\nimport isResponseValidWithStoredPasswordCheck from \"../libs/isResponseValidWithStoredPasswordCheck\";\r\nimport downloadFile from \"../libs/downloadFile\";\r\nimport {SignatureType} from \"../constants/SignatureType\";\r\nimport {OfferStatusType} from \"../pages/contractor/demand/scenes/offer/components/common/constants/OfferStatusType\";\r\nimport DemandOffersService from \"./DemandOffersService\";\r\nimport {StageSections} from \"../pages/contractor/demand/scenes/offer/constants/StageSections\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport DemandOffersOfferService from \"./DemandOffersOfferService\";\r\nimport {OfferMode} from \"../pages/contractor/demand/scenes/offer/components/common/constants/OfferMode\";\r\n\r\n\r\nconst ADDITIONAL_OFFER_EDIT = \"additionalOfferEdit\";\r\nconst ADDITIONAL_OFFER_POSITIONS_LOADED = \"additionalOfferPositionsLoaded\";\r\n\r\nconst postSavePositionData = async (demandId, stageId, supplierId, mode, data) => {\r\n    let errors;\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_POSITION(demandId, stageId, supplierId), data, {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postSavePositionData(demandId, stageId, supplierId, mode, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId),\r\n            (err) => {\r\n                errors = err;\r\n            },\r\n            true\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const loaded = resources[ADDITIONAL_OFFER_POSITIONS_LOADED] || {};\r\n            const newLoaded = {\r\n                ...loaded,\r\n                [getLoadedPositionKey(data.positionId)]: {\r\n                    ...data,\r\n                    placingType: null\r\n                }\r\n                //[getPositionKey(positionId)]: {...resp.result, priceType: PriceType.NET_GROSS, criteriums: resp.result.criteriums.map(x => ({...x, vatType: \"OTHER\", vatValue: 7, currency: \"PLN\"}))}\r\n            }\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_POSITIONS_LOADED, newLoaded))\r\n            let filesResp = null;\r\n            if (data.placingType) {\r\n                filesResp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILES(demandId, stageId, mode, supplierId), {params});\r\n            }\r\n\r\n            const curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n            const edit = {\r\n                ...curEdit,\r\n                positions: curEdit.positions.map(x => x.positionId === resp.result.positionId ? resp.result : x)\r\n            }\r\n            if (filesResp?.success) {\r\n                edit.offerFiles = filesResp.result;\r\n            }\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_EDIT, edit));\r\n            await DemandOffersService.getStageSection(demandId, stageId, StageSections.ADDITIONAL_OFFER_EDIT, supplierId);\r\n            await DemandOffersService.getStageSection(demandId, stageId, StageSections.ADDITIONAL_OFFER_EDIT_ALT, supplierId);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n    if (Array.isArray(errors)) {\r\n        if (errors.length > 0) {\r\n            if (typeof errors[0] === 'string' || errors[0] instanceof String) {\r\n                reduxStore.dispatch(setSaveStatusError(errors[0]))\r\n            }\r\n        } else {\r\n            reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n        }\r\n    }\r\n    return errors;\r\n}\r\n\r\nconst placeOffer = async (demandId, stageId, supplierId, onePositionMode, data, stageTr) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_PLACE_OFFER(demandId, stageId, supplierId), data, {params});\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => placeOffer(demandId, stageId, supplierId, onePositionMode, data, stageTr),\r\n        () => defErrorCallback(demandId, stageId, supplierId)\r\n    )) {\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(supplierId ? stageTr(\"offer_placed_successfully_operator\") : (onePositionMode ? stageTr(\"offer_placed_successfully\") :\r\n                stageTr(\"offer_placed_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \"))));\r\n        else if (resp.result.status === OfferStatusType.WAITING_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n        await DemandOffersService.getStageSections(demandId, stageId, supplierId)\r\n        defErrorCallback(demandId, stageId, supplierId);\r\n    }\r\n\r\n}\r\n\r\n\r\nconst verifyBeforePlaceOffer = async (demandId, stageId, supplierId, positionIds) => {\r\n    const params = {positionIds: positionIds ? positionIds.join(\",\") : undefined}\r\n    return await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATION_BEFORE_PLACE(demandId, stageId, supplierId), {params});\r\n}\r\n\r\nconst deleteOffer = async (demandId, stageId, positionIds) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_DELETE_OFFER(demandId, stageId), {list: positionIds});\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => deleteOffer(demandId, stageId, positionIds),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        await DemandOffersService.getStageSections(demandId, stageId);\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\n\r\nconst withdrawOffer = async (demandId, stageId, data, onePositionMode, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_OFFER(demandId, stageId), data);\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => withdrawOffer(demandId, stageId, data, onePositionMode, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(onePositionMode ? stageTr(\"offer_withdrawn_successfully\") :\r\n                stageTr(\"offer_withdrawn_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \")));\r\n        else if (resp.result.status === OfferStatusType.WAITING_WITHDRAW_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_withdrawn_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst signOffer = async (demandId, stageId, data, onePositionMode, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_SIGN_OFFER(demandId, stageId), data);\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => signOffer(demandId, stageId, data, onePositionMode, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(onePositionMode ? stageTr(\"offer_placed_successfully\") :\r\n                stageTr(\"offer_placed_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \")));\r\n        else if (resp.result.status === OfferStatusType.WAITING_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst signWithdraw = async (demandId, stageId, data, onePositionMode, stageTr) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_SIGN_WITHDRAW(demandId, stageId), data);\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => signWithdraw(demandId, stageId, data, onePositionMode, stageTr),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        if (resp.result.status === OfferStatusType.NORMAL)\r\n            reduxStore.dispatch(setSaveStatusInfo(onePositionMode ? stageTr(\"offer_withdrawn_successfully\") :\r\n                stageTr(\"offer_withdrawn_successfully_on_parts_x\") + \": \" + resp.result.positions.map(x => x.order).join(\", \")));\r\n        else if (resp.result.status === OfferStatusType.WAITING_SIGNATURE)\r\n            reduxStore.dispatch(setSaveStatusInfo(stageTr(\"offer_withdrawn_waiting_for_signatures_x\") + \": \" + resp.result.missingSignatures));\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst stopSigningOperation = async (demandId, stageId, positionId) => {\r\n    const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_STOP_SIGNING_OPERATION(demandId, stageId, positionId));\r\n\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => stopSigningOperation(demandId, stageId, positionId),\r\n        () => defErrorCallback(demandId, stageId)\r\n    )) {\r\n        await DemandOffersService.getStageSections(demandId, stageId)\r\n        defErrorCallback(demandId, stageId);\r\n    }\r\n}\r\n\r\nconst getDocumentToSign = async (demandId, stageId, data) => {\r\n    try {\r\n        if (data.signatureType === SignatureType.QUALIFIED || data.signatureType === SignatureType.PERSONAL_ID) {\r\n            let resp = await RestRequestBLOBBase64Encoded(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_DOC_TO_SIGN(demandId, stageId), {\r\n                data,\r\n                method: 'post'\r\n            })\r\n            if (isResponseValidWithStoredPasswordCheck(resp,\r\n                () => {\r\n                },\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n        } else {\r\n            const resp = await RestRequestBLOB(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_DOC_TO_SIGN(demandId, stageId), {data, method: 'post'})\r\n\r\n            if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n                () => getDocumentToSign(demandId, stageId, data),\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n    }\r\n}\r\n\r\nconst getDocumentToWithdraw = async (demandId, stageId, data) => {\r\n    try {\r\n        if (data.signatureType === SignatureType.QUALIFIED || data.signatureType === SignatureType.PERSONAL_ID) {\r\n            const resp = await RestRequestBLOBBase64Encoded(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN(demandId, stageId), {\r\n                data,\r\n                method: 'post'\r\n            })\r\n            if (isResponseValidWithStoredPasswordCheck(resp,\r\n                () => {\r\n                },\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n        } else {\r\n            const resp = await RestRequestBLOB(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_WITHDRAW_DOC_TO_SIGN(demandId, stageId), {data, method: 'post'})\r\n\r\n            if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n                () => getDocumentToWithdraw(demandId, stageId, data),\r\n                () => defErrorCallback(demandId, stageId)\r\n            )) {\r\n                return resp.result;\r\n            }\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n    }\r\n}\r\n\r\n\r\nconst getDownloadOfferFileUrl = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    const params = {supplierId}\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n    if (isResponseValidWithStoredPasswordCheck(resp,\r\n        () => {\r\n        },\r\n        () => {\r\n        }\r\n    )) {\r\n        return resp.result;\r\n    }\r\n}\r\n\r\nconst getDownloadOfferFile = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getDownloadOfferFile(demandId, stageId, mode, fileId, supplierId),\r\n            () => {\r\n            }\r\n        )) {\r\n            downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getDownloadOfferFilesZip = async (demandId, stageId, supplierId) => {\r\n    const params = {supplierId}\r\n    await RestRequestBLOB(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_FILE_DOWNLOAD_ZIP(demandId, stageId, supplierId), {params});\r\n}\r\n\r\nconst getDownloadEspdFile = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_ESPD_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getDownloadEspdFile(demandId, stageId, mode, fileId, supplierId),\r\n            () => {\r\n            }\r\n        )) {\r\n            downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\nconst signFile = async (demandId, stageId, fileId, data) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID_SIGN_FILE(demandId, stageId, fileId), data);\r\n\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            await _processAddNewFiles(demandId, stageId, OfferMode.EDIT, undefined, resp);\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst postOfferFiles = async (demandId, stageId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_FILE(demandId, stageId, supplierId), {files: data}, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postOfferFiles(demandId, stageId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            await _processAddNewFiles(demandId, stageId, mode, supplierId, resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst _processAddNewFiles = async (demandId, stageId, mode, supplierId, resp) => {\r\n    const {resources} = reduxStore.getState();\r\n    let curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n    let touchedPositions;\r\n\r\n    if (curEdit.passiveOfferForm) {\r\n        touchedPositions = [curEdit.positions[0].positionId]\r\n    } else {\r\n        touchedPositions = [...new Set(resp.result.filter(x => !!x.positionId).map(x => x.positionId))];\r\n    }\r\n    let positions = [];\r\n    if (touchedPositions.length > 0) {\r\n        const params = {\r\n            positionIds: touchedPositions.join(\",\"),\r\n            supplierId\r\n        }\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n        if (resp.success) {\r\n            positions = resp.result;\r\n        }\r\n        //odświeżam reduxa bo mogło się pozmieniać\r\n        curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n    }\r\n\r\n    const tmpOfferFiles = curEdit.offerFiles.map(of => {\r\n        const updatedOf = resp.result.find(x => x.identity === of.identity);\r\n        return updatedOf ? updatedOf : of;\r\n    });\r\n    resp.result.forEach(x => {\r\n        if (!curEdit.offerFiles.find(o => o.identity === x.identity))\r\n            tmpOfferFiles.push(x);\r\n    });\r\n\r\n    const edit = {\r\n        ...curEdit,\r\n        offerFiles: [\r\n            ...tmpOfferFiles\r\n        ],\r\n        positions: curEdit.positions.map(x => {\r\n            const pos = positions.find(p => p.positionId === x.positionId);\r\n            return pos ? pos : x;\r\n        })\r\n    }\r\n    reduxStore.dispatch(setResource(ADDITIONAL_OFFER_EDIT, edit));\r\n    await DemandOffersService.getStageSection(demandId, stageId, StageSections.ADDITIONAL_OFFER_EDIT, supplierId);\r\n}\r\n\r\nconst deleteOfferFile = async (demandId, stageId, mode, supplierId, fileId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestDELETE(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID(demandId, stageId, fileId, supplierId), {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => deleteOfferFile(demandId, stageId, mode, supplierId, fileId),\r\n            () => {\r\n            }\r\n        )) {\r\n\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n\r\n\r\n            let positionId;\r\n            if (curEdit.passiveOfferForm) {\r\n                positionId = curEdit.positions[0].positionId;\r\n            } else {\r\n                const file = curEdit.offerFiles.find(x => x.identity === fileId);\r\n                if (file) {\r\n                    positionId = file.positionId;\r\n                }\r\n            }\r\n\r\n            let position;\r\n            if (positionId) {\r\n                const params = {\r\n                    positionIds: positionId,\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    position = resp.result[0];\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n            }\r\n\r\n            let tmpOfferFiles = curEdit.offerFiles.filter(x => x.identity !== fileId);\r\n            if (!!resp.result) {\r\n                tmpOfferFiles = tmpOfferFiles.map(x => {\r\n                    return x.identity === resp.result.identity ? resp.result : x;\r\n                })\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                offerFiles: tmpOfferFiles,\r\n                positions: curEdit.positions.map(x => position && position.identity === x.identity ? position : x)\r\n            }\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_EDIT, edit));\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst editOfferFile = async (demandId, stageId, fileId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPUT(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_FILE_ID(demandId, stageId, fileId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => editOfferFile(demandId, stageId, fileId, mode, supplierId, data),\r\n            () => {\r\n            }\r\n        )) {\r\n\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n\r\n\r\n            let positionId;\r\n            if (curEdit.passiveOfferForm) {\r\n                positionId = curEdit.positions[0].positionId;\r\n            } else {\r\n                const file = curEdit.offerFiles.find(x => x.identity === fileId);\r\n                if (file) {\r\n                    positionId = file.positionId;\r\n                }\r\n            }\r\n\r\n            let position;\r\n            if (positionId) {\r\n                const params = {\r\n                    positionIds: positionId,\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    position = resp.result[0];\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                offerFiles: curEdit.offerFiles.map(x => x.identity === resp.result.identity ? resp.result : x),\r\n                positions: curEdit.positions.map(x => position && position.identity === x.identity ? position : x)\r\n            }\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_EDIT, edit));\r\n\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n\r\n}\r\n\r\nconst editOfferFiles = async (demandId, stageId, mode, supplierId, data) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPUT(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_FILES(demandId, stageId, supplierId), data, {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => editOfferFiles(demandId, stageId, mode, supplierId, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            let curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n            let touchedPositions;\r\n\r\n            if (curEdit.passiveOfferForm) {\r\n                touchedPositions = [curEdit.positions[0].positionId]\r\n            } else {\r\n                touchedPositions = [...new Set(resp.result.filter(x => !!x.positionId).map(x => x.positionId))];\r\n            }\r\n            let positions = [];\r\n            if (touchedPositions.length > 0) {\r\n                const params = {\r\n                    positionIds: touchedPositions.join(\",\"),\r\n                    supplierId\r\n                }\r\n                const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITIONS(demandId, stageId, mode, supplierId), {params});\r\n                if (resp.success) {\r\n                    positions = resp.result;\r\n                }\r\n                //odświeżam reduxa bo mogło się pozmieniać\r\n                curEdit = resources[ADDITIONAL_OFFER_EDIT];\r\n            }\r\n\r\n            const edit = {\r\n                ...curEdit,\r\n                offerFiles: curEdit.offerFiles.map(x => resp.result.find(y => y.identity === x.identity) || x),\r\n                positions: curEdit.positions.map(x => {\r\n                    const pos = positions.find(p => p.positionId === x.positionId);\r\n                    return pos ? pos : x;\r\n                })\r\n            }\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_EDIT, edit));\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getOfferEdit = async (demandId, stageId, mode, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE(demandId, stageId, mode, supplierId), {params});\r\n        if (isResponseValid(resp,\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_EDIT, resp.result))\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getOfferPosition = async (demandId, stageId, mode, positionId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_MODE_POSITION_ID(demandId, stageId, mode, positionId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getOfferPosition(demandId, stageId, mode, positionId, supplierId),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const loaded = resources[ADDITIONAL_OFFER_POSITIONS_LOADED] || {};\r\n\r\n            const newLoaded = {\r\n                ...loaded,\r\n                [getLoadedPositionKey(positionId)]: resp.result\r\n                //[getPositionKey(positionId)]: {...resp.result, priceType: PriceType.NET_GROSS, criteriums: resp.result.criteriums.map(x => ({...x, vatType: \"OTHER\", vatValue: 7, currency: \"PLN\"}))}\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(ADDITIONAL_OFFER_POSITIONS_LOADED, newLoaded))\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst requireWithdrawEncryption = async (demandId, stageId, positionIds) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_REQUIRE_WITHDRAW_ENCRYPTION(demandId, stageId), {positionIds});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => defErrorCallback(demandId, stageId),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            return resp.result;\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getSnapshots = async (demandId, stageId, positionId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_SNAPSHOTS(demandId, stageId, positionId, supplierId), {params});\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst downloadSnapshot = async (demandId, stageId, positionId, snapshotId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestBLOB(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_SNAPSHOT_ID(demandId, stageId, positionId, snapshotId, supplierId), {params});\r\n        if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n            () => downloadSnapshot(demandId, stageId, positionId, snapshotId, supplierId),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            return resp.result;\r\n        }\r\n        return true;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getVerifications = async (demandId, stageId, positionId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATIONS(demandId, stageId, positionId, supplierId), {params});\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst downloadVerifications = async (demandId, stageId, positionId, supplierId, positionIds) => {\r\n    const data = {\r\n        list: positionIds\r\n    }\r\n    const params = {supplierId}\r\n    await RestRequestBLOB(Endpoints.DEMAND_ADDITIONAL_OFFERS_OFFER_VERIFICATIONS(demandId, stageId, positionId, supplierId), {data, params, method: 'post'})\r\n}\r\n\r\nconst defErrorCallback = (demandId, stageId, supplierId) => {\r\n\r\n    if (supplierId) {\r\n        const {resources} = reduxStore.getState()\r\n        if (resources[DemandOffersService.DEMAND_STAGES_LIST]) {\r\n            const stage = resources[DemandOffersService.DEMAND_STAGES_LIST].find(x => x.supplierId === supplierId);\r\n            if (stage?.contractorDepartmentId) {\r\n                RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID, {\r\n                    id: demandId,\r\n                    contractorDepartmentId: stage.contractorDepartmentId,\r\n                    stageId\r\n                }));\r\n            }\r\n        }\r\n    } else {\r\n        RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID, {\r\n            id: demandId,\r\n            stageId\r\n        }));\r\n    }\r\n}\r\nconst clearResources = (resId) => reduxStore.dispatch(clearResource(resId));\r\n\r\nconst getLoadedPositionKey = DemandOffersOfferService.getLoadedPositionKey;\r\n\r\nexport default {\r\n    getOfferEdit,\r\n    getDownloadOfferFile,\r\n    getDownloadOfferFileUrl,\r\n    getDownloadOfferFilesZip,\r\n    signFile,\r\n    postOfferFiles,\r\n    deleteOfferFile,\r\n    editOfferFile,\r\n    editOfferFiles,\r\n    getDownloadEspdFile,\r\n    getOfferPosition,\r\n    postSavePositionData,\r\n    placeOffer,\r\n    withdrawOffer,\r\n    signOffer,\r\n    signWithdraw,\r\n    getDocumentToSign,\r\n    getDocumentToWithdraw,\r\n    stopSigningOperation,\r\n    clearResources,\r\n    requireWithdrawEncryption,\r\n    deleteOffer,\r\n    getSnapshots,\r\n    downloadSnapshot,\r\n    getVerifications,\r\n    downloadVerifications,\r\n    verifyBeforePlaceOffer,\r\n    ADDITIONAL_OFFER_EDIT,\r\n    ADDITIONAL_OFFER_POSITIONS_LOADED\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport reduxStore from 'redux/store'\r\nimport {clearResource, setResource, setSaveStatusError} from \"../redux/actions\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport Tr from \"../translations/Translations\";\r\nimport RouterPath from \"../libs/RouterPath\";\r\nimport isResponseValidWithStoredPasswordCheck from \"../libs/isResponseValidWithStoredPasswordCheck\";\r\nimport downloadFile from \"../libs/downloadFile\";\r\nimport DemandOffersService from \"./DemandOffersService\";\r\nimport DemandOffersOfferService from \"./DemandOffersOfferService\";\r\nimport {StageSections} from \"../pages/contractor/demand/scenes/offer/constants/StageSections\";\r\n\r\n\r\nconst OFFER_AUCTIONS_LIST_DATA = \"offerAuctionsListData\";\r\nconst AUCTIONS_OFFER_EDIT = \"auctionOfferEdit\";\r\nconst AUCTIONS_OFFER_POSITIONS_LOADED = \"auctionOfferPositionsLoaded\";\r\n\r\nconst getOfferAuctionsList = async (demandId, stageId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_AUCTIONS(demandId, stageId));\r\n        if (isResponseValid(resp,\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            reduxStore.dispatch(setResource(OFFER_AUCTIONS_LIST_DATA, resp.result));\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n\r\n\r\n}\r\n\r\nconst assignToAuction = async (demandId, stageId, auctionId) => {\r\n    try {\r\n        return await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_AUCTIONS_ASSIGN(demandId, stageId, auctionId));\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getOfferEdit = async (demandId, stageId, mode, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE(demandId, stageId, mode, supplierId), {params});\r\n        if (isResponseValid(resp,\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            reduxStore.dispatch(setResource(AUCTIONS_OFFER_EDIT, resp.result))\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst getDownloadEspdFile = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_ESPD_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getDownloadEspdFile(demandId, stageId, mode, fileId, supplierId),\r\n            () => {\r\n            }\r\n        )) {\r\n            downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\nconst getDownloadOfferFile = async (demandId, stageId, mode, fileId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_FILE_DOWNLOAD_URL(demandId, stageId, mode, fileId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getDownloadOfferFile(demandId, stageId, mode, fileId, supplierId),\r\n            () => {\r\n            }\r\n        )) {\r\n            downloadFile({url: resp.result})\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\n\r\nconst getOfferPosition = async (demandId, stageId, mode, positionId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_POSITION_ID(demandId, stageId, mode, positionId, supplierId), {params});\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => getOfferPosition(demandId, stageId, mode, positionId, supplierId),\r\n            () => defErrorCallback(demandId, stageId, supplierId)\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const loaded = resources[AUCTIONS_OFFER_POSITIONS_LOADED] || {};\r\n\r\n            const newLoaded = {\r\n                ...loaded,\r\n                [getLoadedPositionKey(positionId)]: resp.result\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(AUCTIONS_OFFER_POSITIONS_LOADED, newLoaded))\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst postSavePositionData = async (demandId, stageId, supplierId, mode, data) => {\r\n    let errors;\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_POSITION(demandId, stageId, supplierId), data, {params});\r\n\r\n        if (isResponseValidWithStoredPasswordCheck(resp,\r\n            () => postSavePositionData(demandId, stageId, supplierId, mode, data),\r\n            () => defErrorCallback(demandId, stageId, supplierId),\r\n            (err) => {\r\n                errors = err;\r\n            }, true\r\n        )) {\r\n            const {resources} = reduxStore.getState();\r\n            const loaded = resources[AUCTIONS_OFFER_POSITIONS_LOADED] || {};\r\n            const newLoaded = {\r\n                ...loaded,\r\n                [getLoadedPositionKey(data.positionId)]: {\r\n                    ...data,\r\n                    placingType: null\r\n                }\r\n            }\r\n            reduxStore.dispatch(setResource(AUCTIONS_OFFER_POSITIONS_LOADED, newLoaded))\r\n            let filesResp = null;\r\n            if (data.placingType) {\r\n                filesResp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_MODE_FILES(demandId, stageId, mode, supplierId), {params});\r\n            }\r\n\r\n            const curEdit = resources[AUCTIONS_OFFER_EDIT];\r\n            const edit = {\r\n                ...curEdit,\r\n                positions: curEdit.positions.map(x => x.positionId === resp.result.positionId ? resp.result : x)\r\n            }\r\n            if (filesResp?.success) {\r\n                edit.offerFiles = filesResp.result;\r\n            }\r\n            reduxStore.dispatch(setResource(AUCTIONS_OFFER_EDIT, edit));\r\n            await DemandOffersService.getStageSection(demandId, stageId, StageSections.AUCTION_OFFER_PLACED, supplierId);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n    if(Array.isArray(errors)) {\r\n        if(errors.length > 0) {\r\n            if(typeof errors[0] === 'string' || errors[0] instanceof String) {\r\n                reduxStore.dispatch(setSaveStatusError(errors[0]))\r\n            }\r\n        } else {\r\n            reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n        }\r\n    }\r\n    return errors;\r\n}\r\n\r\nconst getSnapshots = async (demandId, stageId, positionId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_SNAPSHOTS(demandId, stageId, positionId, supplierId), {params});\r\n        if (isResponseValid(resp, (e) => {\r\n            throw new Error(e)\r\n        })) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst downloadSnapshot = async (demandId, stageId, positionId, snapshotId, supplierId) => {\r\n    try {\r\n        const params = {supplierId}\r\n        const resp = await RestRequestBLOB(Endpoints.DEMAND_ADDITIONAL_AUCTIONS_OFFER_SNAPSHOT_ID(demandId, stageId, positionId, snapshotId, supplierId), {params});\r\n\r\n        if (resp && isResponseValidWithStoredPasswordCheck(resp,\r\n            () => downloadSnapshot(demandId, stageId, positionId, snapshotId, supplierId),\r\n            () => defErrorCallback(demandId, stageId)\r\n        )) {\r\n            return resp.result;\r\n        }\r\n        return true;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\n\r\nconst defErrorCallback = (demandId, stageId, supplierId) => {\r\n\r\n    if (supplierId) {\r\n        const {resources} = reduxStore.getState()\r\n        if (resources[DemandOffersService.DEMAND_STAGES_LIST]) {\r\n            const stage = resources[DemandOffersService.DEMAND_STAGES_LIST].find(x => x.supplierId === supplierId);\r\n            if (stage?.contractorDepartmentId) {\r\n                RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID, {\r\n                    id: demandId,\r\n                    contractorDepartmentId: stage.contractorDepartmentId,\r\n                    stageId\r\n                }));\r\n            }\r\n        }\r\n    } else {\r\n        RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID, {\r\n            id: demandId,\r\n            stageId\r\n        }));\r\n    }\r\n}\r\n\r\nconst getLoadedPositionKey = DemandOffersOfferService.getLoadedPositionKey;\r\n\r\nconst clearResources = (resId) => reduxStore.dispatch(clearResource(resId));\r\n\r\nexport default {\r\n    getOfferAuctionsList,\r\n    assignToAuction,\r\n\r\n    getOfferEdit,\r\n    getDownloadEspdFile,\r\n    getDownloadOfferFile,\r\n    getOfferPosition,\r\n    postSavePositionData,\r\n    getSnapshots,\r\n    downloadSnapshot,\r\n    getLoadedPositionKey,\r\n    clearResources,\r\n    OFFER_AUCTIONS_LIST_DATA,\r\n    AUCTIONS_OFFER_EDIT,\r\n    AUCTIONS_OFFER_POSITIONS_LOADED\r\n}","import React from 'react';\r\n\r\nconst OfferSectionContext = React.createContext(null);\r\nexport const OfferSectionProvider = OfferSectionContext.Provider;\r\nexport default OfferSectionContext;","import React from 'react'\r\nimport SvgIcon from '@material-ui/core/SvgIcon';\r\n\r\nfunction SignatureIcon(props) {\r\n    return (\r\n        <SvgIcon viewBox=\"0 0 911.874 911.874\" {...props}>\r\n            <path d=\"M875.149,824.874c-1.4,0-2.7,0.1-4.101,0.3l-245.699,31.8c-12.601,1.601-21.4-12.2-14.601-23c3.7-5.7,7.3-11.5,10.9-17.3\r\n\t\tc9.5-15.4-3.2-35.9-20.8-35.9c-1.2,0-2.4,0.101-3.7,0.301l-322,48.399l-38.5,5.8l-105,15.801c-11.9,1.8-19.9,11.899-18.9,24\r\n\t\tc0.4,5.399,2.6,10.5,6.1,14.3c4.101,4.5,9.801,7,16,7c1.2,0,2.4-0.101,3.7-0.3l383.801-57.7c13.1-2,22.1,12.8,14.399,23.6\r\n\t\tc-2.5,3.4-5,6.9-7.5,10.3c-6.899,9.4-5.3,25.101,2.7,33.2c4.1,4.2,9.3,6.4,14.8,6.4c0.601,0,1.3,0,1.9-0.101h0.1h0.101\r\n\t\tl331.3-42.199h0.1h0.101c5.699-0.9,10.699-4.2,14-9.301c3.6-5.6,4.899-12.5,3.3-18.699\r\n\t\tC895.049,831.474,886.249,824.874,875.149,824.874z\"/>\r\n            <path d=\"M46.649,847.273c-3.2,4.301,1.699,9.9,6.399,7.4c53.601-29.3,107.5-42.8,137.101-46c10.6-1.1,19.399-8.8,21.699-19.2\r\n\t\tc14.2-63,102.801-208.1,102.801-208.1l-118.7-87.3c0,0-112.101,127.3-168.101,159.699c-9.199,5.301-14.199,15.9-12.1,26.4\r\n\t\tc5.7,29.1,9.9,83.3-2.1,143c-1,5.2,5.8,8.2,8.899,3.9l144.601-196.301c5.199-7,15.1-8.199,21.8-2.5l0.899,0.801\r\n\t\tc6,5.1,7.101,14,2.4,20.3L46.649,847.273z\"/>\r\n            <path d=\"M210.349,467.273l125.501,92.4c11,8.1,26.6,5.9,34.8-5.1c25.6-34.101,83.3-101,155.399-120.801l171.9-238.1\r\n\t\tc8.2-11.1,5.8-26.8-5.3-35l-211.7-155.8c-11.1-8.2-26.8-5.8-35,5.3l-171.7,238c2.5,74.7-44.3,149.7-69.3,184.3\r\n\t\tC196.949,443.574,199.349,459.074,210.349,467.273z\"/>\r\n        </SvgIcon>\r\n    );\r\n}\r\n\r\nexport default SignatureIcon;","export const OfferFileSignStatus = {\r\n    NOT_SIGNED: \"NOT_SIGNED\",\r\n    SIGNED: \"SIGNED\",\r\n    WRONG_SIGN: \"WRONG_SIGN\",\r\n    SIGNATURE_FILE: \"SIGNATURE_FILE\"\r\n}","import React from \"react\"\r\nimport {OfferFileSignStatus} from \"../../../../common/constants/OfferFileSignStatus\";\r\nimport {makeStyles, Tooltip} from \"@material-ui/core\";\r\nimport Tr from \"../../../../../../../../../../translations/Translations\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport CheckCircleOutlineIcon from \"@material-ui/icons/CheckCircleOutline\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    signature_file: {color: theme.palette.action.disabled},\r\n    not_signed: {color: theme.palette.primary.main},\r\n    signed: {color: theme.palette.common.success},\r\n    wrong_sign_type: {color: theme.palette.common.error},\r\n}))\r\n\r\nfunction OfferFilesTableSignStatus(\r\n    {row}) {\r\n    const classes = useStyle();\r\n\r\n    return <>\r\n        {OfferFileSignStatus.NOT_SIGNED === row.signState &&\r\n            <Tooltip title={Tr(\"file_sign_status_not_signed\")} placement=\"top\"><span><ErrorOutlineIcon className={classes.not_signed}/></span></Tooltip>}\r\n        {OfferFileSignStatus.SIGNED === row.signState &&\r\n            <Tooltip title={Tr(\"file_sign_status_signed\")} placement=\"top\"><span><CheckCircleOutlineIcon className={classes.signed}/></span></Tooltip>}\r\n        {OfferFileSignStatus.SIGNATURE_FILE === row.signState &&\r\n            <Tooltip title={Tr(\"file_sign_status_signature_file\")} placement=\"top\"><span><CheckCircleOutlineIcon\r\n                className={classes.signature}/></span></Tooltip>}\r\n        {OfferFileSignStatus.WRONG_SIGN === row.signState && <Tooltip title={Tr(\"file_sign_status_wrong_sign\")} placement=\"top\"><span><ErrorOutlineIcon\r\n            className={classes.wrong_sign_type}/></span></Tooltip>}\r\n    </>\r\n}\r\n\r\nexport default OfferFilesTableSignStatus;","import React from 'react';\r\n\r\nconst SupportModeContext = React.createContext(false);\r\nexport const SupportModeContextProvider = SupportModeContext.Provider;\r\nexport default SupportModeContext;","import React, {useContext, useReducer, useState} from 'react'\r\nimport {TableCell, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport moment from \"moment\";\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconDownloadButton from 'components/button/WorkableIconDownloadButton';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport {ContractorDocumentTypeLabel, ContractorDocumentTypeSelectItems} from \"constants/ContractorDocumentType\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {useParams} from \"react-router\";\r\nimport EditFilePopup from \"./EditFilePopup\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport Select from \"components/Select\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport OfferFilesTableSignStatus from \"./OfferFilesTableSignStatus\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {TrueFalseWithEmpty} from \"constants/TrueFalseItems\"\r\nimport HelpComponent from \"../../../../../../../../../../components/HelpComponent\";\r\n\r\nfunction OfferFilesTableRow(\r\n    {\r\n        formikProps,\r\n        index,\r\n        row,\r\n        disabled,\r\n        onePositionMode,\r\n        positionIdToOrderMap,\r\n        mode,\r\n        classes,\r\n        roundType,\r\n        bulkEdit,\r\n        passiveOfferForm,\r\n        signFileAvailable,\r\n        onSignDocument\r\n    }) {\r\n    const params = useParams();\r\n    const [editFile, setEditFile] = useState(null);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const contextSection = useContext(OfferSectionContext);\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        edit: false,\r\n        delete: false,\r\n    });\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        let promise;\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.getDownloadOfferFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.getDownloadOfferFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId)\r\n                break;\r\n            case RoundType.AUCTION:\r\n                promise = DemandOffersAuctionService.getDownloadOfferFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId)\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n        promise.finally(() => {\r\n            dispatchIconWorks({type: 'download', works: false});\r\n        })\r\n    }\r\n\r\n    const onDelete = () => {\r\n        simpleConfirm(\"confirm_delete_file\", doDelete)\r\n    }\r\n    const doDelete = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        let promise;\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.deleteOfferFile(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, row.identity)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.deleteOfferFile(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, row.identity)\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n        promise.finally(() => dispatchIconWorks({type: 'delete', works: false}));\r\n    }\r\n\r\n    const updateFile = (data) => {\r\n        dispatchIconWorks({type: 'edit', works: true});\r\n        let promise;\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.editOfferFile(params.id, params.stageId, row.identity, mode, purchaserOfferContext?.supplierId, data)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.editOfferFile(params.id, params.stageId, row.identity, mode, purchaserOfferContext?.supplierId, data)\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n        promise.finally(() => dispatchIconWorks({type: 'edit', works: false}));\r\n        setEditFile(null);\r\n    }\r\n\r\n\r\n    return (<TableRow>\r\n        <TableCell>{row.file.name}</TableCell>\r\n        <TableCell>{moment(row.file.insertDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n        <TableCell className={classes.typeColumn}>\r\n            {bulkEdit ?\r\n                <Select\r\n                    className={classes.typeColumn}\r\n                    id={`form.${index}.containsRodo`}\r\n                    formikProps={formikProps}\r\n                    items={TrueFalseWithEmpty}\r\n                    disabled={disabled}\r\n                />\r\n                : TrueFalseWithEmpty.find(x => x.value === row.containsRodo).label}\r\n        </TableCell>\r\n        <TableCell className={classes.typeColumn}>\r\n            {bulkEdit ?\r\n                <Select\r\n                    className={classes.typeColumn}\r\n                    id={`form.${index}.documentType`}\r\n                    formikProps={formikProps}\r\n                    items={ContractorDocumentTypeSelectItems(getObjectValue(`form.${index}.documentType`, formikProps.values, null))}\r\n                    disabled={disabled}\r\n                />\r\n                : ContractorDocumentTypeLabel(row.documentType)}\r\n        </TableCell>\r\n        <TableCell><HelpComponent text={`${row.file.fileSize}, SHA256: ${row.file.sha256}`}></HelpComponent></TableCell>\r\n        {!onePositionMode &&\r\n            <TableCell>{row.positionId ? Tr(passiveOfferForm ? 'round_additional_x' : 'part_x', {x: positionIdToOrderMap[`positionId_${row.positionId}`]}) : Tr(\"whole_demand\")}</TableCell>}\r\n        {(!purchaserOfferContext && (!!contextSection.digitalSign || passiveOfferForm)) && <TableCell className={classes.buttonColumn}>\r\n            <OfferFilesTableSignStatus row={row} />\r\n        </TableCell>}\r\n        {\r\n            !purchaserOfferContext && signFileAvailable && <TableCell className={classes.buttonColumn}>\r\n                {!!row.signatureConfiguration &&\r\n                    <WorkableIconButton\r\n                        tooltip={Tr('sign_document')}\r\n                        Icon={SignatureIcon}\r\n                        onClick={() => onSignDocument(row)}\r\n                        disabled={supportMode}\r\n                    />\r\n                }\r\n            </TableCell>\r\n        }\r\n\r\n        <TableCell className={classes.buttonColumn}>\r\n            {!row.inaccessible && <WorkableIconDownloadButton\r\n                onClick={onDownload}\r\n                disabled={iconWorks.anyWorks || supportMode}\r\n                working={iconWorks.download}\r\n            />}\r\n        </TableCell>\r\n\r\n        {!disabled && (!purchaserOfferContext || mode === OfferMode.EDIT) && <TableCell className={classes.buttonColumn}>\r\n            {!row.inaccessible && <WorkableIconEditButton\r\n                tooltip={Tr('edit_type')}\r\n                disabled={iconWorks.anyWorks || disabled || supportMode}\r\n                working={iconWorks.edit}\r\n                onClick={() => setEditFile(row)}\r\n            />}\r\n            {!!editFile &&\r\n                <EditFilePopup\r\n                    file={editFile}\r\n                    onCancel={() => setEditFile(null)}\r\n                    onUpdate={(data) => updateFile(data)}\r\n                />\r\n            }\r\n        </TableCell>}\r\n\r\n        {!disabled && (!purchaserOfferContext || mode === OfferMode.EDIT) && <TableCell className={classes.buttonColumn}>\r\n            {!row.inaccessible && <WorkableIconDeleteButton\r\n                tooltip={Tr('delete')}\r\n                onClick={onDelete}\r\n                disabled={iconWorks.anyWorks || disabled || supportMode}\r\n                working={iconWorks.delete}\r\n            />}\r\n        </TableCell>}\r\n    </TableRow>)\r\n}\r\n\r\nOfferFilesTableRow.propTypes = {};\r\n\r\nexport default OfferFilesTableRow;","import reduxStore from 'redux/store'\r\nimport {clearSignature, setSignature} from \"../redux/actions\";\r\n\r\nexport default () => {\r\n\r\n    const doSignDocContent = (signatureTypes, docContentFunc, successCallback, errorCallback, cancelCallback, getEncryptionRoundId, makeTaskListConfig) => {\r\n        reduxStore.dispatch(setSignature(\"config\", {\r\n            signatureTypes,\r\n            docContentFunc,\r\n            successCallback,\r\n            errorCallback,\r\n            cancelCallback,\r\n            getEncryptionRoundId,\r\n            makeTaskListConfig\r\n        }))\r\n    }\r\n\r\n    const breakSigning = () => {\r\n        reduxStore.dispatch(clearSignature(\"config\"));\r\n    }\r\n\r\n    return {doSignDocContent, breakSigning};\r\n}\r\n\r\n","import reduxStore from 'redux/store'\r\nimport {setLoadingScreen} from \"../redux/actions\";\r\n\r\nexport default () => {\r\n    const showLoadingScreen = () => setLoadingScreenShow(true);\r\n    const hideLoadingScreen = () => setLoadingScreenShow(undefined);\r\n    const setLoadingScreenShow = (show) => {\r\n        reduxStore.dispatch(setLoadingScreen(!show ? undefined : true));\r\n    }\r\n\r\n    return {setLoadingScreenShow, hideLoadingScreen, showLoadingScreen};\r\n}\r\n","import reduxStore from 'redux/store'\r\nimport {setAlertNotifications} from \"../redux/actions\";\r\n\r\n\r\nexport const simpleAlert = (confirmText, translateTexts = true, onClose) => alertComplex({confirmText, translateTexts, onClose})\r\nexport const alertComplex = ({confirmText, confirmText2, onClose, title, maxWidth, buttonText, translateTexts = true}) => {\r\n    reduxStore.dispatch(setAlertNotifications({\r\n        confirmText,\r\n        confirmText2,\r\n        onClose,\r\n        title,\r\n        maxWidth,\r\n        buttonText,\r\n        translateTexts\r\n    }))\r\n}\r\n","import React, {useContext, useMemo, useReducer, useRef, useState} from 'react'\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from 'prop-types';\r\nimport OfferFilesTableRow from \"./OfferFilesTableRow\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport Form from \"components/Form\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport EditIcon from \"@material-ui/icons/Edit\";\r\nimport SaveIcon from \"@material-ui/icons/Save\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {useParams} from \"react-router\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport WorkableIconDownloadButton from \"components/button/WorkableIconDownloadButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport {SignatureType} from \"constants/SignatureType\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: theme.components.table.lpColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    dateTimeColumn: theme.components.table.dateTimeColumn,\r\n    typeColumn: {\r\n        width: 180,\r\n        '& .MuiFormHelperText-root': {\r\n            display: 'none'\r\n        }\r\n    }\r\n}));\r\n\r\nexport const CONTRACTOR_OFFER_EDIT_FILES_FORM_ID = \"cont_offer_edit_files\";\r\n\r\nfunction OfferFilesTable(\r\n    {\r\n        disabled,\r\n        mode,\r\n        section,\r\n        offerEdit,\r\n        roundType,\r\n\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const [bulkEdit, setBulkEdit] = useState(false);\r\n    const [bulkEditWorking, setBulkEditWorking] = useState(false);\r\n    const params = useParams();\r\n    const realOnePositionMode = section.onePositionMode || (offerEdit.positions.length === 1 && !(roundType === RoundType.ADDITIONAL_OFFERS || mode === OfferMode.PLACED))\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const signFileRef = useRef(null);\r\n    const {doSignDocContent, breakSigning} = useSignature();\r\n    const {hideLoadingScreen, showLoadingScreen} = useLoadingScreen();\r\n\r\n    const positionIdToOrderMap = useMemo(() => offerEdit.positions.reduce((prev, cur) => {\r\n        prev[`positionId_${cur.positionId}`] = cur.order;\r\n        return prev;\r\n    }, {}), [offerEdit.positions]);\r\n\r\n    const signFileAvailable = useMemo(() => !purchaserOfferContext && offerEdit.offerFiles.some(x => x.signatureConfiguration !== null), [offerEdit.offerFiles, purchaserOfferContext]);\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n    });\r\n\r\n    const onDownloadZip = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        let promise;\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.getDownloadOfferFilesZip(params.id, params.stageId, purchaserOfferContext?.supplierId)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.getDownloadOfferFilesZip(params.id, params.stageId, purchaserOfferContext?.supplierId)\r\n                break;\r\n            // case RoundType.AUCTION:\r\n            //     promise = DemandOffersAuctionService.getDownloadOfferFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId)\r\n            //     break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n        promise.finally(() => {\r\n            dispatchIconWorks({type: 'download', works: false});\r\n        })\r\n    }\r\n\r\n    const onBulkSubmit = ({form}, actions) => {\r\n        setBulkEditWorking(true);\r\n        const filtered = form.filter((x, i) => offerEdit.offerFiles[i].documentType !== x.documentType || offerEdit.offerFiles[i].containsRodo !== x.containsRodo).map(x => ({\r\n            fileId: x.identity,\r\n            documentType: x.documentType,\r\n            containsRodo: x.containsRodo\r\n        }))\r\n\r\n        if (filtered.length > 0) {\r\n            let promise;\r\n            switch (roundType) {\r\n                case RoundType.BASE:\r\n                    promise = DemandOffersOfferService.editOfferFiles(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, {files: filtered})\r\n                    break;\r\n                case RoundType.ADDITIONAL_OFFERS:\r\n                    promise = DemandAdditionalOffersOfferService.editOfferFiles(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, {files: filtered})\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unsupported roundType: \" + roundType)\r\n            }\r\n\r\n            promise.finally(() => {\r\n                setBulkEdit(false);\r\n                setBulkEditWorking(false);\r\n            })\r\n        } else {\r\n            setBulkEdit(false);\r\n            setBulkEditWorking(false);\r\n        }\r\n    }\r\n\r\n    const doBreakSigning = () => {\r\n        signFileRef.current = null;\r\n        breakSigning();\r\n    }\r\n\r\n    const onSignDocument = (row) => {\r\n        if (signFileRef.current != null) {\r\n            return;\r\n        }\r\n        signFileRef.current = row;\r\n\r\n        doSignDocContent(\r\n            section.signatureTypes.filter(x => [SignatureType.QUALIFIED, SignatureType.PERSONAL_ID].includes(x)),\r\n            async (sigType) => {\r\n                let fileUrl;\r\n                if (roundType === RoundType.BASE) {\r\n                    fileUrl = await DemandOffersOfferService.getDownloadOfferFileUrl(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId);\r\n                } else if (roundType === RoundType.ADDITIONAL_OFFERS) {\r\n                    fileUrl = await DemandAdditionalOffersOfferService.getDownloadOfferFileUrl(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId);\r\n                } else {\r\n                    console.error(\"Sign document unavilable for roundType: +\" + roundType)\r\n                }\r\n                if (!fileUrl) {\r\n                    breakSigning();\r\n                    return;\r\n                }\r\n                const result = await DemandOffersOfferService.getDocumentBase64EncodedToSignDocument(fileUrl);\r\n                if (!result)\r\n                    doBreakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature) => {\r\n                doBreakSigning();\r\n                showLoadingScreen();\r\n                const data = {signatureType, signature}\r\n                if (roundType === RoundType.BASE) {\r\n                    DemandOffersOfferService.signFile(params.id, params.stageId, row.identity, data)\r\n                        .then((resp) => {if(resp === true) simpleAlert(\"sign_document_completed\")}).finally(hideLoadingScreen);\r\n                } else if (roundType === RoundType.ADDITIONAL_OFFERS) {\r\n                    DemandAdditionalOffersOfferService.signFile(params.id, params.stageId, row.identity, data)\r\n                        .then((resp) => {if(resp === true) simpleAlert(\"sign_document_completed\")}).finally(hideLoadingScreen);\r\n                }\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                doBreakSigning();\r\n            },\r\n            () => {\r\n                doBreakSigning();\r\n            },\r\n            async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n            row.signatureConfiguration\r\n        )\r\n    }\r\n\r\n    const getButtons = (formikProps) => {\r\n        const buttons = [];\r\n        if (bulkEdit) {\r\n            buttons.push(createButton(Tr('discard_changes'), () => {\r\n                formikProps.resetForm();\r\n                setBulkEdit(false);\r\n            }, \"outlined\", bulkEditWorking, undefined, false, undefined));\r\n\r\n            buttons.push(createButton(Tr('operator.modify.update_files'), () => formikProps.submitForm(),\r\n                undefined, bulkEditWorking, undefined, bulkEditWorking, SaveIcon));\r\n\r\n        } else {\r\n            buttons.push(createButton(Tr('change_files_type'), () => setBulkEdit(true),\r\n                undefined, disabled || bulkEdit, undefined, false, EditIcon));\r\n        }\r\n        return buttons;\r\n\r\n    }\r\n\r\n    return (<div>\r\n        {!offerEdit.offerFiles.length ?\r\n            <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            :\r\n            <>\r\n\r\n                <Form\r\n                    id={CONTRACTOR_OFFER_EDIT_FILES_FORM_ID}\r\n                    initialValues={{\r\n                        form: offerEdit.offerFiles\r\n                    }}\r\n                    validationSchema={VS.any()}\r\n                    onSubmit={onBulkSubmit}\r\n                >{(formikProps) => (<>\r\n                    {\r\n                        (purchaserOfferContext && mode === OfferMode.PLACED) &&\r\n                        <MultiButton buttons={getButtons(formikProps)}/>\r\n                    }\r\n                    <Table>\r\n                        <TableHead>\r\n                            <TableRow>\r\n                                <TableCell>{Tr(\"name\")}</TableCell>\r\n                                <TableCell className={classes.dateColumn}>{Tr(\"add_data\")}</TableCell>\r\n                                <TableCell className={classes.typeColumn}>{Tr(\"contains_rodo\")}</TableCell>\r\n                                <TableCell className={classes.typeColumn}>{Tr(\"type\")}</TableCell>\r\n                                <TableCell className={classes.buttonColumn}>{Tr(\"size\")}</TableCell>\r\n                                {!realOnePositionMode && <TableCell\r\n                                    className={offerEdit.passiveOfferForm ? classes.dateTimeColumn : classes.dateColumn}>{Tr(\"assignment\")}</TableCell>}\r\n                                {(!purchaserOfferContext && (!!contextSection.digitalSign || offerEdit.passiveOfferForm)) &&\r\n                                    <TableCell colSpan={signFileAvailable ? 2 : 1} className={classes.buttonColumn}>{Tr(\"file_sign_status\")}</TableCell>}\r\n                                <TableCell className={classes.buttonColumn}>\r\n                                    {mode === OfferMode.PLACED && roundType !== RoundType.AUCTION && purchaserOfferContext?.supplierId\r\n                                        && offerEdit.offerFiles.some(doc => !doc.inaccessible) && <WorkableIconDownloadButton\r\n                                            onClick={onDownloadZip}\r\n                                            disabled={iconWorks.anyWorks}\r\n                                            working={iconWorks.download}\r\n                                        />}\r\n                                </TableCell>\r\n                                {!disabled && (!purchaserOfferContext || mode === OfferMode.EDIT) && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                {!disabled && (!purchaserOfferContext || mode === OfferMode.EDIT) && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                            </TableRow>\r\n                        </TableHead>\r\n                        <TableBody>\r\n                            {\r\n                                offerEdit.offerFiles.map((doc, index) => (\r\n                                    <OfferFilesTableRow\r\n                                        formikProps={formikProps}\r\n                                        index={index}\r\n                                        classes={classes}\r\n                                        key={doc.identity}\r\n                                        row={doc}\r\n                                        disabled={disabled}\r\n                                        onePositionMode={realOnePositionMode}\r\n                                        positionIdToOrderMap={positionIdToOrderMap}\r\n                                        mode={mode}\r\n                                        roundType={roundType}\r\n                                        bulkEdit={bulkEdit}\r\n                                        passiveOfferForm={offerEdit.passiveOfferForm}\r\n                                        signFileAvailable={signFileAvailable}\r\n                                        onSignDocument={onSignDocument}\r\n                                    />))\r\n                            }\r\n                        </TableBody>\r\n                    </Table>\r\n                </>)\r\n                }\r\n                </Form>\r\n            </>\r\n        }\r\n    </div>)\r\n}\r\n\r\nOfferFilesTable.propTypes = {\r\n    offerEdit: PropTypes.shape({\r\n        offerFiles: PropTypes.array.isRequired,\r\n        positions: PropTypes.array.isRequired\r\n    }).isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired\r\n};\r\nexport default OfferFilesTable;","import React, {useContext, useState} from 'react'\r\nimport UploadFile from 'components/UploadFile';\r\nimport SelectOfferFilesType from \"./SelectOfferFilesType\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {useParams} from \"react-router\";\r\nimport OfferFilesTable from \"./OfferFilesTable\";\r\nimport PropTypes from \"prop-types\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\n\r\nfunction OfferFiles(\r\n    {\r\n        offerEdit,\r\n        section,\r\n        disabled,\r\n        mode,\r\n        roundType,\r\n    }) {\r\n    const params = useParams();\r\n    const [selectedFiles, setSelectedFiles] = useState(null);\r\n    const [configuredFiles, setConfiguredFiles] = useState(null);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const supportMode = useContext(SupportModeContext)\r\n    const realOnePositionMode = section.onePositionMode || offerEdit.passiveOfferForm || offerEdit.positions.length === 1\r\n    const [portFilesWorking, setPostFilesWorking] = useState(false);\r\n\r\n    const handleSendFiles = (uploadedFiles, config) => {\r\n        setConfiguredFiles(null);\r\n        if(uploadedFiles.length) {\r\n            const tab = uploadedFiles.map((x, i) => ({\r\n                identity: -1,\r\n                supplierId: offerEdit.supplierId,\r\n                positionId: realOnePositionMode ? offerEdit.positions[0].positionId : (config[`position${x.originalIndex}`] === 0 ? null : config[`position${x.originalIndex}`]),\r\n                documentType: config[`type${x.originalIndex}`],\r\n                containsRodo: config[`containsRodo${x.originalIndex}`],\r\n                file: x\r\n            }));\r\n\r\n            switch (roundType) {\r\n                case RoundType.BASE:\r\n                    setPostFilesWorking(true);\r\n                   DemandOffersOfferService.postOfferFiles(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, tab).finally(()=> setPostFilesWorking(false))\r\n                    break;\r\n                case RoundType.ADDITIONAL_OFFERS:\r\n                    setPostFilesWorking(true);\r\n                    DemandAdditionalOffersOfferService.postOfferFiles(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, tab).finally(()=> setPostFilesWorking(false))\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unknown roundType: \" + roundType)\r\n            }\r\n\r\n        }\r\n    };\r\n\r\n    const handleSubmitSelectDocumentTypes = (values) => {\r\n        setConfiguredFiles({files: selectedFiles, config: values})\r\n        setSelectedFiles(null);\r\n    };\r\n\r\n    return (\r\n        <>\r\n\r\n            {!disabled && mode === OfferMode.EDIT &&\r\n                <UploadFile\r\n                    onOpenConfigureFiles={(files) => setSelectedFiles(files)}\r\n                    configuredFiles={configuredFiles}\r\n                    onUploadPopupClosed={handleSendFiles}\r\n                    encryptRoundId={section.encryptionEnabled ? section.roundId : undefined}\r\n                    disabled={supportMode || purchaserOfferContext?.preview}\r\n                    working={portFilesWorking}\r\n                />\r\n            }\r\n\r\n            <OfferFilesTable\r\n                mode={mode}\r\n                disabled={disabled}\r\n                offerEdit={offerEdit}\r\n                section={section}\r\n                roundType={roundType}\r\n            />\r\n\r\n            {!!selectedFiles && <SelectOfferFilesType\r\n                items={selectedFiles}\r\n                onCancel={() => setSelectedFiles(null)}\r\n                onSubmit={handleSubmitSelectDocumentTypes}\r\n\r\n                isPublished={false}\r\n                positions={offerEdit.positions}\r\n                onePositionMode={realOnePositionMode}\r\n                roundType={roundType}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nOfferFiles.propTypes = {\r\n    disabled: PropTypes.bool.isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n    mode: PropTypes.oneOf(Object.keys(OfferMode)).isRequired,\r\n    section: PropTypes.shape({\r\n        onePositionMode: PropTypes.bool.isRequired,\r\n        digitalSign: PropTypes.bool.isRequired\r\n    }).isRequired\r\n};\r\n\r\nexport default OfferFiles;","import Tr from 'translations/Translations';\r\n\r\nexport const OfferEspdType = {\r\n    EXTERNAL: \"EXTERNAL\",\r\n    INTERNAL: \"INTERNAL\"\r\n}\r\nconst _TR_PREFIX = 'offer_espd_type_';\r\nexport const OfferEspdTypeLabel = (type) => (Tr(_TR_PREFIX + type.toLowerCase()));\r\n","import React from \"react\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport ToggleButtonGroup from \"@material-ui/lab/ToggleButtonGroup\";\r\nimport ToggleButton from \"@material-ui/lab/ToggleButton\";\r\nimport PropTypes from \"prop-types\";\r\nimport {OfferEspdType, OfferEspdTypeLabel} from \"./constants/OfferEspdType\";\r\nimport clsx from \"clsx\";\r\nimport Tr from \"translations/Translations\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n      marginTop: theme.spacing(2),\r\n      marginBottom: theme.spacing(2)\r\n    },\r\n    button: {\r\n        width: 560,\r\n    },\r\n    help: {\r\n        position: 'absolute',\r\n        right: 70,\r\n        color: theme.palette.text.button\r\n    },\r\n    helpNotSelected: {\r\n        color: theme.palette.primary.main\r\n    }\r\n}));\r\n\r\nfunction OfferEspdTypeSwitch(\r\n    {\r\n        espdType,\r\n        setEspdType,\r\n        disabled\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const onChange = (event, newEspdProcedure) => {\r\n        if (newEspdProcedure)\r\n            setEspdType(newEspdProcedure);\r\n    };\r\n\r\n    return (<GridBlock justify=\"center\" className={classes.root}>\r\n                <ToggleButtonGroup size=\"medium\" value={espdType} exclusive onChange={onChange}>\r\n                    <ToggleButton classes={{root: classes.button}} value={OfferEspdType.INTERNAL} disabled={disabled}>\r\n                        {OfferEspdTypeLabel(OfferEspdType.INTERNAL)}\r\n                        <HelpTooltip className={clsx(classes.help, {[classes.helpNotSelected]: espdType !== OfferEspdType.INTERNAL})}\r\n                                     text={Tr('offer_espd_type_internal_help')}/>\r\n                    </ToggleButton>\r\n                    <ToggleButton classes={{root: classes.button}} value={OfferEspdType.EXTERNAL} disabled={disabled}>\r\n                        {OfferEspdTypeLabel(OfferEspdType.EXTERNAL)}\r\n                        <HelpTooltip className={clsx(classes.help, {[classes.helpNotSelected]: espdType !== OfferEspdType.EXTERNAL})}\r\n                                     text={Tr('offer_espd_type_external_help')}/>\r\n                    </ToggleButton>\r\n                </ToggleButtonGroup>\r\n            </GridBlock>\r\n    )\r\n}\r\n\r\nOfferEspdTypeSwitch.propTypes = {\r\n    espdType: PropTypes.string.isRequired,\r\n    setEspdType: PropTypes.func.isRequired,\r\n    disabled: PropTypes.bool\r\n}\r\n\r\nexport default OfferEspdTypeSwitch;\r\n\r\n","import React, {useMemo, useState} from 'react'\r\nimport {CircularProgress, makeStyles, MenuItem, TextField} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    progress: {\r\n        position: 'absolute',\r\n        right: 2,\r\n        top: 'calc(50% - 10px)'\r\n    },\r\n    root: {\r\n        position: 'relative'\r\n    },\r\n    item: {\r\n        minHeight: theme.spacing(4)\r\n    }\r\n}));\r\n\r\nfunction SimpleSelect(\r\n    {\r\n        className,\r\n        menuItemClassName,\r\n        items,\r\n        value = '',\r\n        onChange = () => {\r\n        },\r\n        label,\r\n        disabled,\r\n        working,\r\n        error\r\n    }) {\r\n    const classes = useStyles();\r\n    const getItemProps = (item) => {\r\n        const isStr = typeof item === 'string';\r\n        const value = isStr ? item : item.value;\r\n        const label = isStr ? item : item.label;\r\n        return {value, label};\r\n    }\r\n    // eslint-disable-next-line\r\n    const [fieldValue, setFieldValue] = useState(value);\r\n\r\n    const fieldValueInput = useMemo(() => {\r\n        const elem = items.find(x => {\r\n            const isStr = typeof x === 'string';\r\n            const xVal = isStr ? x : x.value;\r\n            return value === xVal;\r\n        });\r\n        return elem ? getItemProps(elem).value : (items.length > 0 ? getItemProps(items[0]).value : null);\r\n    }, [value, items]);\r\n    const handleChange = event => {\r\n        setFieldValue(event.target.value)\r\n        onChange(event)\r\n    }\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <TextField\r\n                select\r\n                helperText={error}\r\n                error={!!error}\r\n                fullWidth\r\n                value={fieldValueInput}\r\n                onChange={handleChange}\r\n                label={label}\r\n                className={className}\r\n                disabled={disabled}\r\n            >\r\n                {items.map((item, i) => {\r\n                    const {value, label} = getItemProps(item);\r\n                    return (\r\n                        <MenuItem key={i} className={clsx(classes.item, menuItemClassName)} value={value}>\r\n                            {label}\r\n                        </MenuItem>\r\n                    )\r\n                })}\r\n\r\n            </TextField>\r\n            {working && <CircularProgress className={classes.progress} size={20}/>}\r\n        </div>\r\n    )\r\n}\r\n\r\nSimpleSelect.propTypes = {\r\n    classes: PropTypes.any,\r\n    items: PropTypes.arrayOf(\r\n        PropTypes.oneOfType([\r\n            PropTypes.shape({\r\n                value: PropTypes.any.isRequired,\r\n                label: PropTypes.string.isRequired,\r\n            }),\r\n            PropTypes.string.isRequired,\r\n        ])\r\n    ),\r\n    onChange: PropTypes.func,\r\n    label: PropTypes.string,\r\n    error: PropTypes.string\r\n}\r\n\r\nSimpleSelect.defaultProps = {}\r\n\r\nexport default SimpleSelect;","import React, {useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Tr from \"translations/Translations\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"components/Typography\";\r\nimport clsx from \"clsx\";\r\nimport PropTypes from \"prop-types\";\r\nimport TitledComponent from \"../../../../../../../../../../components/TitledComponent\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    hidden: {\r\n        display: \"none\"\r\n    },\r\n    select: {\r\n        width: 400,\r\n    },\r\n    menuItemClassName: {\r\n        whiteSpace: 'normal'\r\n    },\r\n    column: {\r\n        display: \"flex\",\r\n        flexDirection: \"column\",\r\n        flex: 1,\r\n        flexBasis: '100%',\r\n        padding: theme.spacing(2)\r\n    },\r\n    button: {\r\n        marginTop: theme.spacing(1),\r\n        marginLeft: theme.spacing(2),\r\n    }\r\n}))\r\n\r\nfunction OfferEspdInternal(\r\n    {\r\n        offerEdit,\r\n        disabled,\r\n        positionItems,\r\n        visible\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const [positionId, setPositionId] = useState(\"\");\r\n    const [error, setError] = useState();\r\n    const [working, setWorking] = useState(false);\r\n\r\n    const goToEspd = () => {\r\n        if (offerEdit.espdOnPositions && positionId === \"\") {\r\n            setError(Tr(\"choose_position\"))\r\n            return;\r\n        }\r\n        setWorking(true);\r\n        DemandOffersOfferService.redirectContractorESPDMpAppUrl(params.id, params.stageId, positionId).finally(() => setWorking(false));\r\n    }\r\n\r\n\r\n    return (\r\n        <GridBlock\r\n            className={clsx({[classes.hidden]: !visible})}\r\n            wrap='nowrap'\r\n            itemClassName={classes.column}\r\n        >\r\n            <div>\r\n                <Typography>{Tr('offer_espd_type_internal_help')}</Typography>\r\n            </div>\r\n            <TitledComponent\r\n                title={Tr(\"go_to_form\")}\r\n            >\r\n                <GridBlock>\r\n                    {\r\n                        offerEdit.espdOnPositions &&\r\n                        <SimpleSelect\r\n                            label={Tr('choose_position')}\r\n                            className={classes.select}\r\n                            menuItemClassName={classes.menuItemClassName}\r\n                            items={positionItems}\r\n                            value={positionId}\r\n                            onChange={(e) => {\r\n                                setError()\r\n                                setPositionId(e.target.value)\r\n                            }}\r\n                            error={error}\r\n                            disabled={disabled || working}\r\n                        />\r\n                    }\r\n                    <WorkableButton className={classes.button} disabled={disabled} working={working} onClick={goToEspd}>{Tr(\"go\")}</WorkableButton>\r\n                </GridBlock>\r\n            </TitledComponent>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nOfferEspdInternal.propTypes = {\r\n    visible: PropTypes.bool.isRequired\r\n};\r\n\r\nexport default OfferEspdInternal;","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport Select from 'components/Select';\r\nimport VS from 'constants/ValidationShema';\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    text: {\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    gridContainer: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    fileName: {\r\n        width: 300\r\n    },\r\n    select: {\r\n        width: 200,\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    parentSelect: {\r\n        width: 200,\r\n    }\r\n}));\r\n\r\nfunction OfferEspdExternalUploadFileTypes(\r\n    {\r\n        items,\r\n        onCancel,\r\n        onSubmit,\r\n        formSubmit,\r\n        positionItems,\r\n        dealingId\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const formId = useId();\r\n    const positionId = 'position';\r\n\r\n    const generateItems = (formikProps) => {\r\n        if (items.length === 0) {\r\n            return <Typography>{Tr(\"file_extension_error\")}</Typography>\r\n        }\r\n        return items.map((item, i) => {\r\n            return (\r\n                <GridBlock key={i} justify=\"space-between\" alignItems=\"center\">\r\n                    <Typography className={classes.fileName}> {item.name}</Typography>\r\n\r\n                    <Select\r\n                        id={positionId + i}\r\n                        formikProps={formikProps}\r\n                        items={positionItems}\r\n                        label={Tr('assignment')}\r\n                        className={classes.select}\r\n                    />\r\n\r\n                </GridBlock>\r\n            )\r\n        })\r\n    };\r\n\r\n    const submitForm = () => {\r\n        formSubmit[formId]()\r\n    };\r\n\r\n    const handleSubmit = (values, items) => onSubmit(values, items);\r\n\r\n    const generateInitialValues = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[positionId + i] = dealingId;\r\n        }\r\n        return obj\r\n    };\r\n\r\n    const generateValidationSchema = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[positionId + i] = VS.number();\r\n        }\r\n\r\n        return VS.object(obj)\r\n    };\r\n\r\n    if (items === undefined) return '';\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('choose_position')}\r\n            titleCentered\r\n            maxWidth={'xl'}\r\n            fullWidth={false}\r\n            paperClassName={classes.paperClassName}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr('add')}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={submitForm}\r\n            />}\r\n        >\r\n            <Form\r\n                onSubmit={handleSubmit}\r\n                id={formId}\r\n                initialValues={generateInitialValues()}\r\n                validationSchema={generateValidationSchema()}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <GridBlock column className={classes.gridContainer}>\r\n                            {generateItems(formikProps)}\r\n                        </GridBlock>\r\n                    </>\r\n                )}\r\n            </Form>\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nOfferEspdExternalUploadFileTypes.propTypes = {\r\n    items: PropTypes.arrayOf(PropTypes.shape({\r\n        name: PropTypes.string.isRequired\r\n    })).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n}), {})(OfferEspdExternalUploadFileTypes);","import React, {useContext, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport PropTypes from \"prop-types\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport OfferEspdExternalUploadFileTypes from \"./OfferEspdExternalUploadFileTypes\";\r\nimport Tr from \"translations/Translations\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\n\r\n\r\nfunction OfferEspdExternalUploadFile(\r\n    {\r\n        dealingId,\r\n        positionItems,\r\n        offerEdit,\r\n        disabled\r\n    }) {\r\n    const params = useParams();\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const [selectedFiles, setSelectedFiles] = useState(null);\r\n    const [configuredFiles, setConfiguredFiles] = useState(null);\r\n    const [portFilesWorking, setPostFilesWorking] = useState(false);\r\n\r\n    const section = useContext(OfferSectionContext);\r\n\r\n    const handleSendFiles = (uploadedFiles, config) => {\r\n        setConfiguredFiles(null);\r\n        if (uploadedFiles.length) {\r\n            const tab = uploadedFiles.map((x, i) => ({\r\n                positionId: !config || !config[`position${x.originalIndex}`] ? null : config[`position${x.originalIndex}`],\r\n                file: x\r\n            }));\r\n            setPostFilesWorking(true);\r\n            DemandOffersOfferService.postOfferEspdFiles(params.id, params.stageId, purchaserOfferContext?.supplierId, tab)\r\n                .finally(()=> setPostFilesWorking(false));\r\n        }\r\n    }\r\n\r\n    const handleSubmitSelectDocumentTypes = (values) => {\r\n        setConfiguredFiles({files: selectedFiles, config: values})\r\n        setSelectedFiles(null);\r\n    };\r\n\r\n    return (\r\n        <>\r\n            {\r\n                offerEdit.espdOnPositions ?\r\n                    <UploadFile\r\n                        label={Tr('espd_external_step_2')}\r\n                        onOpenConfigureFiles={(files) => setSelectedFiles(files)}\r\n                        configuredFiles={configuredFiles}\r\n                        onUploadPopupClosed={handleSendFiles}\r\n                        encryptRoundId={section.encryptionEnabled ? section.roundId : undefined}\r\n                        disabled={disabled}\r\n                        working={portFilesWorking}\r\n                    /> :\r\n                    <UploadFile\r\n                        label={Tr('espd_external_step_2')}\r\n                        onUploadPopupClosed={handleSendFiles}\r\n                        encryptRoundId={section.encryptionEnabled ? section.roundId : undefined}\r\n                        disabled={disabled}\r\n                        working={portFilesWorking}\r\n                    />\r\n            }\r\n\r\n            {!!selectedFiles && <OfferEspdExternalUploadFileTypes\r\n                items={selectedFiles}\r\n                onCancel={() => setSelectedFiles(null)}\r\n                onSubmit={handleSubmitSelectDocumentTypes}\r\n                isPublished={false}\r\n                positionItems={positionItems}\r\n                dealingId={dealingId}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nOfferEspdExternalUploadFile.propTypes = {\r\n    positionItems: PropTypes.arrayOf(PropTypes.shape({\r\n        label: PropTypes.string.isRequired,\r\n        value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired\r\n    })).isRequired,\r\n};\r\n\r\nexport default OfferEspdExternalUploadFile;","import React, {useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"components/Typography\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport OfferEspdExternalUploadFile from \"./OfferEspdExternalUploadFile\";\r\nimport TitledComponent from \"components/TitledComponent\";\r\nimport {Link} from \"@material-ui/core\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    hidden: {\r\n        display: \"none\"\r\n    },\r\n    select: {\r\n        width: 400,\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    menuItemClassName: {\r\n        whiteSpace: 'normal'\r\n    },\r\n    column: {\r\n        display: \"flex\",\r\n        flexDirection: \"column\",\r\n        flex: 1,\r\n        flexBasis: '100%',\r\n        padding: theme.spacing(2)\r\n    },\r\n    button: {\r\n        marginBottom: theme.spacing(2),\r\n        marginTop: theme.spacing(1),\r\n        marginLeft: theme.spacing(2),\r\n    }\r\n}))\r\n\r\nfunction OfferEspdExternal(\r\n    {\r\n        offerEdit,\r\n        disabled,\r\n        positionItems,\r\n        visible\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const [positionId, setPositionId] = useState(\"\");\r\n    const [error, setError] = useState();\r\n    const [working, setWorking] = useState(false);\r\n\r\n\r\n    const downloadEspd = () => {\r\n        if (offerEdit.espdOnPositions && positionId === \"\") {\r\n            setError(Tr(\"choose_position\"))\r\n            return\r\n        }\r\n        setWorking(true);\r\n        DemandOffersOfferService.downloadContractorESPDExportFile(params.id, params.stageId, positionId).finally(() => setWorking(false));\r\n    }\r\n\r\n    return (<GridBlock\r\n            className={clsx({[classes.hidden]: !visible})}\r\n            wrap='nowrap'\r\n            itemClassName={classes.column}\r\n        >\r\n            <div>\r\n                <Typography>{Tr('offer_espd_type_external_help')}</Typography>\r\n                <Typography>{Tr('offer_espd_type_external_help2')}\r\n                    <Link target=\"_blank\" href=\"https://espd.uzp.gov.pl/filter?lang=pl\">https://espd.uzp.gov.pl/filter?lang=pl</Link>\r\n                </Typography>\r\n\r\n            </div>\r\n            <div>\r\n                <TitledComponent\r\n                    title={Tr('espd_external_step_1')}\r\n                >\r\n                    <GridBlock>\r\n                    {\r\n                        offerEdit.espdOnPositions &&\r\n                        <SimpleSelect\r\n                            label={Tr('choose_position')}\r\n                            className={classes.select}\r\n                            menuItemClassName={classes.menuItemClassName}\r\n                            items={positionItems}\r\n                            value={positionId}\r\n                            onChange={(e) => {\r\n                                setError()\r\n                                setPositionId(e.target.value)\r\n                            }}\r\n                            error={error}\r\n                            disabled={disabled || working}\r\n                        />\r\n                    }\r\n                    <WorkableButton className={classes.button} disabled={disabled} working={working} onClick={downloadEspd}>{Tr(\"download\")}</WorkableButton>\r\n                    </GridBlock>\r\n                </TitledComponent>\r\n                <OfferEspdExternalUploadFile disabled={disabled} positionItems={positionItems} dealingId={positionId} offerEdit={offerEdit}/>\r\n            </div>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nOfferEspdExternal.propTypes = {\r\n    visible: PropTypes.bool.isRequired\r\n};\r\n\r\nexport default OfferEspdExternal;","import React, {useContext, useReducer, useState} from 'react'\r\nimport {TableCell, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport moment from \"moment\";\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconDownloadButton from 'components/button/WorkableIconDownloadButton';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {useParams} from \"react-router\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport OfferFilesTableSignStatus from \"../files/OfferFilesTableSignStatus\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\nimport {ContractorDocumentTypeLabel, ContractorDocumentTypeSelectItems} from \"constants/ContractorDocumentType\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport EditFilePopup from \"../files/EditFilePopup\";\r\nimport Select from \"components/Select\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {TrueFalseWithEmpty} from \"constants/TrueFalseItems\";\r\nimport HelpComponent from \"../../../../../../../../../../components/HelpComponent\";\r\n\r\nfunction OfferEspdTableRow(\r\n    {\r\n        row,\r\n        disabled,\r\n        espdOnPositions,\r\n        positionIdToOrderMap,\r\n        mode,\r\n        classes,\r\n        roundType,\r\n        passiveOfferForm,\r\n        signFileAvailable,\r\n        onSignDocument,\r\n        bulkEdit,\r\n        formikProps,\r\n        index\r\n    }) {\r\n    const params = useParams();\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const [editFile, setEditFile] = useState(null);\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        edit: false,\r\n        delete: false,\r\n    });\r\n\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        let promise;\r\n\r\n\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.getDownloadEspdFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId);\r\n            break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.getDownloadEspdFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId);\r\n            break;\r\n            case RoundType.AUCTION:\r\n                promise = DemandOffersAuctionService.getDownloadEspdFile(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId);\r\n            break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n\r\n        promise.finally(() => {\r\n            dispatchIconWorks({type: 'download', works: false});\r\n        })\r\n    }\r\n\r\n    const onDelete = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        DemandOffersOfferService.deleteEspdFile(params.id, params.stageId, row.identity, purchaserOfferContext?.supplierId)\r\n            .catch(() => dispatchIconWorks({type: 'delete', works: false}));\r\n    }\r\n\r\n    const updateFile = (data) => {\r\n        dispatchIconWorks({type: 'edit', works: true});\r\n        let promise;\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.editEspdFile(params.id, params.stageId, row.identity, mode, purchaserOfferContext?.supplierId, data)\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n        promise.finally(() => dispatchIconWorks({type: 'edit', works: false}));\r\n        setEditFile(null);\r\n    }\r\n\r\n    return (<TableRow>\r\n        <TableCell>{row.file.name}</TableCell>\r\n        <TableCell>{moment(row.file.insertDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n        <TableCell className={classes.typeColumn}>\r\n            {bulkEdit ?\r\n                <Select\r\n                    className={classes.typeColumn}\r\n                    id={`form.${index}.containsRodo`}\r\n                    formikProps={formikProps}\r\n                    items={TrueFalseWithEmpty}\r\n                    disabled={disabled}\r\n                />\r\n                : TrueFalseWithEmpty.find(x => x.value === row.containsRodo).label}\r\n        </TableCell>\r\n        <TableCell className={classes.typeColumn}>{bulkEdit ?\r\n            <Select\r\n                className={classes.typeColumn}\r\n                id={`form.${index}.documentType`}\r\n                formikProps={formikProps}\r\n                items={ContractorDocumentTypeSelectItems(getObjectValue(`form.${index}.documentType`, formikProps.values, null))}\r\n                disabled={disabled}\r\n            />\r\n            : ContractorDocumentTypeLabel(row.documentType)}\r\n        </TableCell>\r\n        <TableCell><HelpComponent text={`${row.file.fileSize}, SHA256: ${row.file.sha256}`}></HelpComponent></TableCell>\r\n        {espdOnPositions &&\r\n            <TableCell>{Tr('part_x', {x: positionIdToOrderMap[`positionId_${row.positionId}`]})}</TableCell>}\r\n\r\n        {(!purchaserOfferContext && (!!contextSection.digitalSign || passiveOfferForm)) && <TableCell className={classes.buttonColumn}>\r\n            <OfferFilesTableSignStatus row={row} />\r\n        </TableCell>}\r\n        {\r\n            signFileAvailable && <TableCell className={classes.buttonColumn}>\r\n                {!!row.signatureConfiguration &&\r\n                    <WorkableIconButton\r\n                        tooltip={Tr('sign_document')}\r\n                        Icon={SignatureIcon}\r\n                        onClick={() => onSignDocument(row)}\r\n                        disabled={supportMode}\r\n                    />\r\n                }\r\n            </TableCell>\r\n        }\r\n\r\n        <TableCell className={classes.buttonColumn}>\r\n            {!row.inaccessible && <WorkableIconDownloadButton\r\n                onClick={() => onDownload()}\r\n                disabled={iconWorks.anyWorks || supportMode}\r\n                working={iconWorks.download}\r\n            />}\r\n        </TableCell>\r\n        {!(disabled || mode === OfferMode.PLACED) && (!purchaserOfferContext || mode === OfferMode.EDIT) && <TableCell className={classes.buttonColumn}>\r\n            {!row.inaccessible && <WorkableIconEditButton\r\n                tooltip={Tr('edit_type')}\r\n                disabled={iconWorks.anyWorks || (disabled || mode === OfferMode.PLACED) || supportMode}\r\n                working={iconWorks.edit}\r\n                onClick={() => setEditFile(row)}\r\n            />}\r\n            {!!editFile &&\r\n                <EditFilePopup\r\n                    file={editFile}\r\n                    onCancel={() => setEditFile(null)}\r\n                    onUpdate={(data) => updateFile(data)}\r\n                />\r\n            }\r\n        </TableCell>}\r\n        {!(disabled || mode === OfferMode.PLACED) && <TableCell className={classes.buttonColumn}>\r\n            {!row.inaccessible && <WorkableIconDeleteButton\r\n                tooltip={Tr('delete')}\r\n                onClick={onDelete}\r\n                disabled={iconWorks.anyWorks || (disabled || mode === OfferMode.PLACED) || supportMode}\r\n                working={iconWorks.delete}\r\n            />}\r\n        </TableCell>}\r\n    </TableRow>)\r\n}\r\n\r\nOfferEspdTableRow.propTypes = {};\r\n\r\nexport default OfferEspdTableRow;","import React, {useContext, useMemo, useRef, useState} from 'react'\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from 'prop-types';\r\nimport OfferEspdTableRow from \"./OfferEspdTableRow\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {SignatureType} from \"constants/SignatureType\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport {useParams} from \"react-router\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Form from \"components/Form\";\r\nimport SaveIcon from \"@material-ui/icons/Save\";\r\nimport EditIcon from \"@material-ui/icons/Edit\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    typeColumn: {\r\n        width: 180,\r\n        '& .MuiFormHelperText-root': {\r\n            display: 'none'\r\n        }\r\n    }\r\n}));\r\n\r\nexport const CONTRACTOR_OFFER_EDIT_ESPD_FILES_FORM_ID = \"cont_offer_edit_espd_files\";\r\n\r\nfunction OfferEspdTable(\r\n    {\r\n        disabled,\r\n        mode,\r\n        section,\r\n        offerEdit,\r\n        roundType,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const signFileRef = useRef(null);\r\n    const params = useParams();\r\n    const {doSignDocContent, breakSigning} = useSignature();\r\n    const {hideLoadingScreen, showLoadingScreen} = useLoadingScreen();\r\n    const [bulkEdit, setBulkEdit] = useState(false);\r\n    const [bulkEditWorking, setBulkEditWorking] = useState(false);\r\n    const positionIdToOrderMap = useMemo(() => offerEdit.positions.reduce((prev, cur) => {\r\n        prev[`positionId_${cur.positionId}`] = cur.order;\r\n        return prev;\r\n    }, {}), [offerEdit.positions]);\r\n\r\n    const signFileAvailable = useMemo(() => !purchaserOfferContext && offerEdit.espdFiles.some(x => x.signatureConfiguration !== null), [offerEdit.espdFiles, purchaserOfferContext]);\r\n\r\n    const doBreakSigning = () => {\r\n        signFileRef.current = null;\r\n        breakSigning();\r\n    }\r\n\r\n    const onSignDocument = (row) => {\r\n        if (signFileRef.current != null) {\r\n            return;\r\n        }\r\n        signFileRef.current = row;\r\n\r\n        doSignDocContent(\r\n            section.signatureTypes.filter(x => [SignatureType.QUALIFIED, SignatureType.PERSONAL_ID].includes(x)),\r\n            async (sigType) => {\r\n                let fileUrl;\r\n                if (roundType === RoundType.BASE) {\r\n                    fileUrl = await DemandOffersOfferService.getDownloadEspdFileUrl(params.id, params.stageId, mode, row.identity, purchaserOfferContext?.supplierId);\r\n                } else {\r\n                    console.error(\"Sign document unavilable for roundType: +\" + roundType)\r\n                }\r\n                if (!fileUrl) {\r\n                    breakSigning();\r\n                    return;\r\n                }\r\n                const result = await DemandOffersOfferService.getDocumentBase64EncodedToSignDocument(fileUrl);\r\n                if (!result)\r\n                    doBreakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature) => {\r\n                doBreakSigning();\r\n                showLoadingScreen();\r\n                const data = {signatureType, signature}\r\n                if (roundType === RoundType.BASE) {\r\n                    DemandOffersOfferService.signEspdFile(params.id, params.stageId, row.identity, data)\r\n                        .then((resp) => {\r\n                            if (resp === true) simpleAlert(\"sign_document_completed\")\r\n                        }).finally(hideLoadingScreen);\r\n                }\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                doBreakSigning();\r\n            },\r\n            () => {\r\n                doBreakSigning();\r\n            },\r\n            async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n            row.signatureConfiguration\r\n        )\r\n    }\r\n\r\n    const onBulkSubmit = ({form}, actions) => {\r\n        setBulkEditWorking(true);\r\n        const filtered = form.filter((x, i) => offerEdit.espdFiles[i].documentType !== x.documentType || offerEdit.espdFiles[i].containsRodo !== x.containsRodo).map(x => ({\r\n            fileId: x.identity,\r\n            documentType: x.documentType,\r\n            containsRodo: x.containsRodo\r\n        }))\r\n\r\n        if (filtered.length > 0) {\r\n            let promise;\r\n            switch (roundType) {\r\n                case RoundType.BASE:\r\n                    promise = DemandOffersOfferService.editEspdFiles(params.id, params.stageId, mode, purchaserOfferContext?.supplierId, {files: filtered})\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unsupported roundType: \" + roundType)\r\n            }\r\n\r\n            promise.finally(() => {\r\n                setBulkEdit(false);\r\n                setBulkEditWorking(false);\r\n            })\r\n        } else {\r\n            setBulkEdit(false);\r\n            setBulkEditWorking(false);\r\n        }\r\n    }\r\n\r\n    const getButtons = (formikProps) => {\r\n        const buttons = [];\r\n        if (bulkEdit) {\r\n            buttons.push(createButton(Tr('discard_changes'), () => {\r\n                formikProps.resetForm();\r\n                setBulkEdit(false);\r\n            }, \"outlined\", bulkEditWorking, undefined, false, undefined));\r\n\r\n            buttons.push(createButton(Tr('operator.modify.update_files'), () => formikProps.submitForm(),\r\n                undefined, bulkEditWorking, undefined, bulkEditWorking, SaveIcon));\r\n\r\n        } else {\r\n            buttons.push(createButton(Tr('change_files_type'), () => setBulkEdit(true),\r\n                undefined, disabled || bulkEdit, undefined, false, EditIcon));\r\n        }\r\n        return buttons;\r\n    }\r\n\r\n    return (<div>\r\n        {!offerEdit.espdFiles.length ?\r\n            <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            :\r\n            <Form\r\n                id={CONTRACTOR_OFFER_EDIT_ESPD_FILES_FORM_ID}\r\n                initialValues={{\r\n                    form: offerEdit.espdFiles\r\n                }}\r\n                validationSchema={VS.any()}\r\n                onSubmit={onBulkSubmit}\r\n            >{(formikProps) => (<>\r\n                {\r\n                    (purchaserOfferContext && mode === OfferMode.PLACED && roundType === RoundType.BASE) &&\r\n                    <MultiButton buttons={getButtons(formikProps)}/>\r\n                }\r\n\r\n                <Table>\r\n                    <TableHead>\r\n                        <TableRow>\r\n                            <TableCell>{Tr(\"name\")}</TableCell>\r\n                            <TableCell className={classes.dateColumn}>{Tr(\"add_data\")}</TableCell>\r\n                            <TableCell className={classes.typeColumn}>{Tr(\"contains_rodo\")}</TableCell>\r\n                            <TableCell className={classes.typeColumn}>{Tr(\"type\")}</TableCell>\r\n                            <TableCell className={classes.buttonColumn}>{Tr(\"size\")}</TableCell>\r\n                            {offerEdit.espdOnPositions && <TableCell className={classes.dateColumn}>{Tr(\"assignment\")}</TableCell>}\r\n                            {(!purchaserOfferContext && (!!contextSection.digitalSign || offerEdit.passiveOfferForm)) &&\r\n                                <TableCell colSpan={signFileAvailable ? 2 : 1} className={classes.buttonColumn}>{Tr(\"file_sign_status\")}</TableCell>}\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                            {!(disabled || mode === OfferMode.PLACED)  && (!purchaserOfferContext || mode === OfferMode.EDIT) && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                            {!(disabled || mode === OfferMode.PLACED) && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                        </TableRow>\r\n                    </TableHead>\r\n                    <TableBody>\r\n                        {\r\n                            offerEdit.espdFiles.map((doc, index) => (\r\n                                <OfferEspdTableRow\r\n                                    classes={classes}\r\n                                    key={doc.identity}\r\n                                    row={doc}\r\n                                    disabled={disabled}\r\n                                    espdOnPositions={offerEdit.espdOnPositions}\r\n                                    positionIdToOrderMap={positionIdToOrderMap}\r\n                                    mode={mode}\r\n                                    roundType={roundType}\r\n                                    passiveOfferForm={offerEdit.passiveOfferForm}\r\n                                    signFileAvailable={signFileAvailable}\r\n                                    onSignDocument={onSignDocument}\r\n                                    bulkEdit={bulkEdit}\r\n                                    formikProps={formikProps}\r\n                                    index={index}\r\n                                />))\r\n                        }\r\n                    </TableBody>\r\n                </Table>\r\n            </>)}\r\n            </Form>\r\n        }\r\n    </div>)\r\n}\r\n\r\nOfferEspdTable.propTypes = {\r\n    offerEdit: PropTypes.shape({\r\n        offerFiles: PropTypes.array.isRequired,\r\n        positions: PropTypes.array.isRequired\r\n    }).isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired\r\n};\r\nexport default OfferEspdTable;","import React, {useContext, useMemo, useState} from 'react'\r\nimport OfferEspdTypeSwitch from \"./OfferEspdTypeSwitch\";\r\nimport {OfferEspdType} from \"./constants/OfferEspdType\";\r\nimport OfferEspdInternal from \"./OfferEspdInternal\";\r\nimport OfferEspdExternal from \"./OfferEspdExternal\";\r\nimport {createSelectItem} from \"components/Select\";\r\nimport Tr from \"translations/Translations\";\r\nimport OfferEspdTable from \"./OfferEspdTable\";\r\nimport PropTypes from \"prop-types\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\n\r\nfunction OfferEspd(\r\n    {\r\n        offerEdit,\r\n        mode,\r\n        disabled,\r\n        roundType,\r\n        section,\r\n    }) {\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const [espdType, setEspdType] = useState(offerEdit.envelopeOffer ? OfferEspdType.EXTERNAL : OfferEspdType.INTERNAL);\r\n    const modifyDisabled = disabled || mode === OfferMode.PLACED;\r\n\r\n    const positionItems = useMemo(() => {\r\n        const pos = offerEdit.espdOnPositions ? offerEdit.positions.map(x => createSelectItem(x.positionId, Tr(\"part_x\", {x: x.order}) + ': ' + x.name)) : [];\r\n        pos.unshift(createSelectItem(\"\", \"\"));\r\n        return pos;\r\n    }, [offerEdit.positions, offerEdit.espdOnPositions]);\r\n\r\n    return (\r\n        <>\r\n            {\r\n                !modifyDisabled && <>\r\n                    <OfferEspdTypeSwitch setEspdType={setEspdType} espdType={espdType} disabled={offerEdit.envelopeOffer}/>\r\n                    <OfferEspdInternal disabled={purchaserOfferContext?.preview || supportMode} offerEdit={offerEdit} visible={espdType === OfferEspdType.INTERNAL} positionItems={positionItems}/>\r\n                    <OfferEspdExternal disabled={purchaserOfferContext?.preview || supportMode} offerEdit={offerEdit} visible={espdType === OfferEspdType.EXTERNAL} positionItems={positionItems}/>\r\n                </>\r\n            }\r\n\r\n            <OfferEspdTable roundType={roundType} disabled={disabled} offerEdit={offerEdit} mode={mode} section={section} />\r\n        </>\r\n    )\r\n}\r\n\r\nOfferEspd.propTypes = {\r\n    disabled: PropTypes.bool.isRequired,\r\n    mode: PropTypes.oneOf(Object.keys(OfferMode)).isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired\r\n};\r\n\r\nexport default OfferEspd;","export const ContractorOfferEspdType = {\r\n    NO: \"NO\",\r\n    OPTIONAL: \"OPTIONAL\",\r\n    YES: \"YES\"\r\n}\r\n","import VS from 'constants/ValidationShema';\r\nimport {VARIANT_CODE} from \"components/popup/newCriteria/constants/criteria.variants\";\r\nimport {PriceType} from \"constants/PriceTypes\";\r\nimport VatType from \"constants/VatType\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst criterionValidation = (criterion, priceType, criterions) => {\r\n    if (criterion.criterium.disabled)\r\n        return VS.any();\r\n    let shape = {};\r\n    switch (criterion.criterium.uiType) {\r\n        case VARIANT_CODE.NUMBER:\r\n        case VARIANT_CODE.INTERVAL:\r\n            shape.value = VS.string();\r\n            break;\r\n        case VARIANT_CODE.PRICE: {\r\n\r\n            switch (priceType) {\r\n                case PriceType.NET:\r\n                case PriceType.NET_VAT:\r\n                    shape.value = VS.string().test('more_than_0', Tr('v_number_min_0'), () => {\r\n                        return parseFloat(criterion.value) > 0\r\n                    })\r\n                    break;\r\n                case PriceType.NET_GROSS:\r\n                    shape.value = VS.string().test('more_than_0', Tr('v_number_min_0'), () => {\r\n                        return parseFloat(criterion.value) > 0\r\n                    })\r\n                    shape.grossValue = VS.any().when(\"vatType\",\r\n                        {\r\n                            is: (vatType) => vatType === VatType.MIXED,\r\n                            then: VS.any().test('gross_less', Tr('gross_less'), () => {\r\n                                const gVal = parseFloat(criterion.grossValue);\r\n                                return gVal > 0 && gVal>= parseFloat(criterion.value)\r\n                            }),\r\n                            otherwise: VS.any()\r\n                        }\r\n                    )\r\n                    break;\r\n                case PriceType.GROSS:\r\n                case PriceType.GROSS_VAT:\r\n                    shape.grossValue = VS.string().test('more_than_0', Tr('v_number_min_0'), () => {\r\n                        return parseFloat(criterion.grossValue) > 0\r\n                    })\r\n                    break;\r\n                default:\r\n            }\r\n\r\n            switch (priceType) {\r\n                case PriceType.NET_VAT:\r\n                case PriceType.NET_GROSS:\r\n                case PriceType.GROSS_VAT:\r\n\r\n                    shape.vatType = VS.string()\r\n                    shape.vatValue = VS.any().when('vatType',\r\n                        {\r\n                            is: (val) => (val === VatType.OTHER || val === VatType.STANDARD),\r\n                            then: VS.decimalNumber(\"\")\r\n                        }\r\n                    )\r\n                    break;\r\n                default:\r\n            }\r\n\r\n            if (criterion.quantity !== null && criterion.quantity !== undefined) {\r\n                const quantityShape = {\r\n                    value: VS.numberMin0(),\r\n                    uom: VS.string()\r\n                };\r\n                if (!!criterion.criterium.baseItemId) {\r\n                    quantityShape.uom = VS.string().test('offer_option_uom_must_match_base_item', Tr('offer_option_uom_must_match_base_item'), () => {\r\n                       const baseCriterion = criterions.filter(c => c.criterium.identity === criterion.criterium.baseItemId)[0];\r\n                       const quantity = !!baseCriterion.quantity ? baseCriterion.quantity : baseCriterion.criterium.quantity;\r\n                       return quantity.uom === criterion.quantity.uom;\r\n                    });\r\n                } else if (!!criterion.criterium.optionalItemId) {\r\n                    quantityShape.uom = VS.string().test('offer_base_uom_must_match_option_item', Tr('offer_base_uom_must_match_option_item'), () => {\r\n                        const optionCriterion = criterions.filter(c => c.criterium.identity === criterion.criterium.optionalItemId)[0];\r\n                        const quantity = !!optionCriterion.quantity ? optionCriterion.quantity : optionCriterion.criterium.quantity;\r\n                        return quantity.uom === criterion.quantity.uom;\r\n                    });\r\n                }\r\n                shape.quantity = VS.object(quantityShape);\r\n            }\r\n\r\n            shape.parameterOffers =  VS.arrayOf(VS.object({offerValue: VS.string()}))\r\n\r\n            break;\r\n        }\r\n        case VARIANT_CODE.YESNO:\r\n        case VARIANT_CODE.LIST:\r\n        case VARIANT_CODE.TEXT:\r\n        default:\r\n            shape.value = VS.string();\r\n    }\r\n\r\n    if (criterion.criterium.showComment) {\r\n        shape.comment = VS.string()\r\n    }\r\n\r\n\r\n    return VS.object(shape)\r\n}\r\n\r\n\r\nexport const offerValidation = VS.lazy(form => {\r\n    return VS.object({\r\n        consorciants: form.consorciumOnPosition ?  VS.arrayRequired(\"consorciant_required\") : VS.any(),\r\n        conditions: VS.arrayOf(VS.lazy(criterion => criterionValidation(criterion, form.priceType))),\r\n        criteriums: VS.arrayOf(VS.lazy(criterion => criterionValidation(criterion, form.priceType))),\r\n        parameters: VS.arrayOf(VS.lazy(criterion => criterionValidation(criterion, form.priceType))),\r\n        itemOffers: VS.arrayOf(VS.lazy(criterion => criterionValidation(criterion, form.priceType, form.itemOffers)))\r\n    })\r\n});\r\n","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: 200\r\n    }\r\n}))\r\n\r\n\r\nconst YESNO_ITEMS = [\r\n    createSelectItem('yes', Tr('yes')),\r\n    createSelectItem('no', Tr('no')),\r\n]\r\n\r\nfunction OfferYesNoInput(\r\n    {\r\n        id,\r\n        formikProps,\r\n        disabled\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <Select\r\n            className={classes.root}\r\n            id={id + \".value\"}\r\n            formikProps={formikProps}\r\n            label={Tr('choose_value')}\r\n            items={YESNO_ITEMS}\r\n            disabled={disabled}\r\n        />\r\n    )\r\n\r\n\r\n}\r\n\r\nOfferYesNoInput.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default OfferYesNoInput;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport TextInput from \"components/TextInput\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: 800\r\n    }\r\n}))\r\n\r\n\r\nfunction OfferTextInput(\r\n    {\r\n        id,\r\n        formikProps,\r\n        disabled\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    return (\r\n        <TextInput\r\n            className={classes.root}\r\n            id={id + \".value\"}\r\n            label={Tr('enter_value_text')}\r\n            formikProps={formikProps}\r\n            multiline\r\n            disabled={disabled}\r\n        />\r\n    )\r\n\r\n\r\n}\r\n\r\nOfferTextInput.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default OfferTextInput;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"../../../../../../../../../constants/INPUT_TYPE\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: 300\r\n    }\r\n}))\r\n\r\n\r\nfunction OfferNumberInput(\r\n    {\r\n        id,\r\n        formikProps,\r\n        disabled\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <TextInput\r\n            className={classes.root}\r\n            id={id + \".value\"}\r\n            label={Tr('enter_value_number')}\r\n            formikProps={formikProps}\r\n            type={INPUT_TYPE.NUMBER_19_WITH_NEGATIVE}\r\n            disabled={disabled}\r\n        />\r\n    )\r\n\r\n\r\n}\r\n\r\nOfferNumberInput.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default OfferNumberInput;","import React, {useMemo} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport {SELECT_VALUE} from \"constants/VATItems\";\r\nimport {InputAdornment} from \"@material-ui/core\";\r\nimport CloseIcon from \"@material-ui/icons/Close\";\r\nimport {createSelectItem} from \"components/Select\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {NetSumPriceVisible, PriceType, PriceTypeGrossFieldVisible, PriceTypeNetFieldVisible, PriceTypeVatFieldVisible} from \"constants/PriceTypes\";\r\nimport VatType from \"constants/VatType\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport ImportExportIcon from '@material-ui/icons/ImportExport';\r\nimport IconButton from \"components/button/IconButton\";\r\nimport clsx from \"clsx\";\r\nimport {simpleConfirm} from \"../../../../../../../../../libs/ConfirmNotification\";\r\nimport toNumberType from \"../../../../../../../../../libs/toNumberType\";\r\nimport HelpComponent from \"../../../../../../../../../components/HelpComponent\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    netValue: {\r\n        width: 230,\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    vat: {\r\n        width: 200,\r\n    },\r\n    grossValue: {\r\n        width: 200,\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    currency: {\r\n        width: 70\r\n    },\r\n    marginRight: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    text: {\r\n        width: 250,\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    gridBlock: {\r\n        justifyContent: 'end'\r\n    },\r\n    marginTop: {\r\n        marginTop: theme.spacing(1)\r\n    }\r\n}))\r\n\r\n\r\nconst VAT_TYPE_ITEMS = [\r\n    createSelectItem(\"\", Tr('select')),\r\n    createSelectItem(VatType.NOT_APPLICABLE, Tr('not_applicable')),\r\n    createSelectItem(VatType.EXEMPTED, Tr('released')),\r\n    createSelectItem(VatType.REVERSED, Tr('reversed')),\r\n    createSelectItem(VatType.STANDARD + \"_0\", \"0%\"),\r\n    createSelectItem(VatType.STANDARD + \"_3\", \"3%\"),\r\n    createSelectItem(VatType.STANDARD + \"_5\", \"5%\"),\r\n    createSelectItem(VatType.STANDARD + \"_7\", \"7%\"),\r\n    createSelectItem(VatType.STANDARD + \"_8\", \"8%\"),\r\n    createSelectItem(VatType.STANDARD + \"_23\", \"23%\"),\r\n    createSelectItem(VatType.MIXED, Tr('different_vat_rates')),\r\n    createSelectItem(VatType.OTHER, Tr('other_vat_value')),\r\n]\r\n\r\nconst calculateGrossValue = (values) => {\r\n    let newGrossValue = null;\r\n    if (!!values.netValue && !!values.vatType) {\r\n        const netValue = parseFloat(values.netValue);\r\n        if (!isNaN(netValue)) {\r\n            switch (values.vatType) {\r\n                case VatType.STANDARD:\r\n                case VatType.OTHER:\r\n                    if (values.vatValue != null) {\r\n                        const vatValue = parseFloat(values.vatValue);\r\n                        let vatMultipler = vatValue / 100\r\n                        let newGross = netValue + netValue * vatMultipler;\r\n                        if (!isNaN(newGross))\r\n                            newGrossValue = newGross;\r\n                    }\r\n                    break\r\n                case VatType.MIXED:\r\n                    break;\r\n                default:\r\n                    newGrossValue = values.netValue;\r\n            }\r\n        }\r\n    }\r\n    return newGrossValue;\r\n}\r\n\r\nexport const calcNetGros = (values, quantity, priceType) => {\r\n    let sumNet = null;\r\n    let sumGross = null;\r\n    switch (priceType) {\r\n        case PriceType.NET:\r\n            if (values.netValue)\r\n                sumNet = parseFloat(values.netValue) * quantity.value;\r\n            break;\r\n        case PriceType.NET_VAT:\r\n            if (values.netValue) {\r\n                sumNet = parseFloat(values.netValue) * quantity.value;\r\n                if (values.vatType) {\r\n                    const gross = calculateGrossValue(values);\r\n                    if (gross != null) {\r\n                        sumGross = gross * quantity.value;\r\n                    }\r\n                }\r\n            }\r\n            break;\r\n        case PriceType.NET_GROSS:\r\n            if (values.vatType === VatType.MIXED) {\r\n                if (values.grossValue != null) {\r\n                    sumGross = parseFloat(values.grossValue) * quantity.value;\r\n                }\r\n                if (values.netValue != null) {\r\n                    sumNet = parseFloat(values.netValue) * quantity.value;\r\n                }\r\n            } else {\r\n                if (values.netValue != null) {\r\n                    sumNet = parseFloat(values.netValue) * quantity.value;\r\n                    if (values.vatType) {\r\n                        const gross = calculateGrossValue(values);\r\n                        if (gross != null) {\r\n                            sumGross = gross * quantity.value;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            break;\r\n        case PriceType.GROSS_VAT:\r\n        case PriceType.GROSS:\r\n            if (values.grossValue != null) {\r\n                sumGross = parseFloat(values.grossValue) * quantity.value;\r\n            }\r\n            break;\r\n        default:\r\n    }\r\n    let roundedGross = null;\r\n    if (sumGross !== null) {\r\n        roundedGross = (Math.round(sumGross * 100) / 100);\r\n    }\r\n    let roundedNet = null;\r\n    if (sumNet !== null) {\r\n        roundedNet = (Math.round(sumNet * 100) / 100);\r\n    }\r\n    return [roundedNet, roundedGross];\r\n}\r\n\r\n\r\nfunction OfferPriceInput(\r\n    {\r\n        id,\r\n        formikProps,\r\n        criterium,\r\n        priceType,\r\n        quantity,\r\n        disabled\r\n    }) {\r\n    const classes = useStyle();\r\n    const parsedQuantity = !!quantity ? { value: Number(toNumberType(quantity.value)), uom: quantity.uom } : null;\r\n\r\n    const show = useMemo(() => ({\r\n        netField: PriceTypeNetFieldVisible(priceType),\r\n        grossField: PriceTypeGrossFieldVisible(priceType),\r\n        vatField: PriceTypeVatFieldVisible(priceType),\r\n        quantity: !!quantity,\r\n        copyVat: PriceTypeVatFieldVisible(priceType) && id.startsWith(\"itemOffers\") && formikProps.values.itemOffers.length > 1\r\n        // eslint-disable-next-line\r\n    }), [priceType, quantity, id])\r\n\r\n    const keys = useMemo(() => ({\r\n        netValue: id + \".value\",\r\n        grossValue: id + \".grossValue\",\r\n        vatType: id + \".vatType\",\r\n        vatValue: id + \".vatValue\",\r\n        totalGross: id + \".totalGross\",\r\n        totalNet: id + \".totalNet\",\r\n        parameterOffers: id + \".parameterOffers\",\r\n        quantityDisabled: id + \".quantityDisabled\"\r\n    }), [id]);\r\n\r\n    const values = {\r\n        netValue: show.netField ? getObjectValue(keys.netValue, formikProps.values, null) : null,\r\n        grossValue: show.grossField ? getObjectValue(keys.grossValue, formikProps.values, null) : null,\r\n        vatType: show.vatField ? getObjectValue(keys.vatType, formikProps.values, null) : null,\r\n        vatValue: show.vatField ? getObjectValue(keys.vatValue, formikProps.values, null) : null,\r\n        parameterOffers: getObjectValue(keys.parameterOffers, formikProps.values, null),\r\n        quantityDisabled: getObjectValue(keys.quantityDisabled, formikProps.values, false)\r\n    }\r\n\r\n\r\n    useDebouncedEffect(() => {\r\n        const offer = getObjectValue(id, formikProps.values);\r\n        let grossValue = offer.grossValue;\r\n        let totalGross = offer.totalGross;\r\n        let totalNet = offer.totalNet;\r\n        if (priceType === PriceType.NET_GROSS) {\r\n            grossValue = calculateGrossValue(values);\r\n            if (grossValue)\r\n                grossValue = Math.round(grossValue * 100) / 100;\r\n        }\r\n        if (show.quantity) {\r\n            const [roundedNet, roundedGross] = calcNetGros(values, parsedQuantity, priceType);\r\n            totalGross = roundedGross;\r\n            totalNet = roundedNet;\r\n        }\r\n        formikProps.setFieldValue(id, {\r\n            ...offer,\r\n            grossValue,\r\n            totalGross,\r\n            totalNet\r\n        }, false);\r\n\r\n        if (!!criterium.optionalItemId) {\r\n            const formikValues = formikProps.values;\r\n            const optionalItemIndex = formikValues.itemOffers.map(x => x.criterium.identity).indexOf(criterium.optionalItemId);\r\n            const optionalItemId = `itemOffers.${optionalItemIndex}`;\r\n\r\n            const optionalItem = getObjectValue(optionalItemId, formikProps.values, null);\r\n            if (optionalItem) {\r\n                formikProps.setFieldValue(optionalItemId, {\r\n                    ...optionalItem,\r\n                    value: values.netValue,\r\n                    vatType: values.vatType,\r\n                    vatValue: values.vatValue,\r\n                    grossValue: values.grossValue\r\n                });\r\n            }\r\n        }\r\n\r\n    }, {timeout: 500, ignoreInitialCall: true}, [values.netValue, values.vatValue, values.vatType, quantity])\r\n\r\n    useDebouncedEffect(() => {\r\n        const offer = getObjectValue(id, formikProps.values);\r\n        if ((priceType === PriceType.GROSS || priceType === PriceType.GROSS_VAT || (priceType === PriceType.NET_GROSS && offer.vatType === VatType.MIXED)) && show.quantity) {\r\n            const netAndGross = calcNetGros(values, parsedQuantity, priceType);\r\n            const totalGross = netAndGross[1];\r\n            formikProps.setFieldValue(id, {\r\n                ...offer,\r\n                totalGross\r\n            }, false);\r\n\r\n            if (!!criterium.optionalItemId && offer.grossValue) {\r\n                const formikValues = formikProps.values;\r\n                const optionalItemIndex = formikValues.itemOffers.map(x => x.criterium.identity).indexOf(criterium.optionalItemId);\r\n                const optionalItemId = `itemOffers.${optionalItemIndex}`;\r\n\r\n                const optionalItem = getObjectValue(optionalItemId, formikProps.values, null);\r\n                if (optionalItem) {\r\n                    formikProps.setFieldValue(optionalItemId, {\r\n                        ...optionalItem,\r\n                        grossValue: values.grossValue\r\n                    });\r\n                }\r\n            }\r\n        }\r\n    }, {timeout: show.quantity ? 500 : 10000000, ignoreInitialCall: true}, [values.grossValue])\r\n\r\n    useDebouncedEffect(() => {\r\n        if (!!criterium.optionalItemId) {\r\n            const formikValues = formikProps.values;\r\n            const optionalItemIndex = formikValues.itemOffers.map(x => x.criterium.identity).indexOf(criterium.optionalItemId);\r\n            const optionalItemId = `itemOffers.${optionalItemIndex}`;\r\n\r\n            const optionalItem = getObjectValue(optionalItemId, formikProps.values, null);\r\n            if (optionalItem) {\r\n                const parameterOffers = optionalItem.parameterOffers;\r\n                formikProps.setFieldValue(`${optionalItemId}.parameterOffers`, parameterOffers.map(x => {\r\n                    const baseParameterOffer = values.parameterOffers.filter(o => o.parameterId === x.parameterId)[0];\r\n                    return {\r\n                        ...x,\r\n                        offerValue: baseParameterOffer.offerValue\r\n                    }\r\n                }));\r\n            }\r\n        }\r\n\r\n    }, {timeout: show.quantity ? 500 : 10000000, ignoreInitialCall: true}, [values.parameterOffers])\r\n\r\n    const vatError = getObjectValue(keys.vatType, formikProps.touched, false) ? getObjectValue(keys.vatType, formikProps.errors, null) : null;\r\n\r\n    const closeTextInput = () => {\r\n        formikProps.setFieldValue(keys.vatValue, null);\r\n        formikProps.setFieldValue(keys.vatType, null);\r\n    }\r\n\r\n    const handleVatTypeChange = (e) => {\r\n        const selValue = e.target.value;\r\n        if (selValue === \"\") {\r\n            formikProps.setFieldValue(keys.vatType, null);\r\n            formikProps.setFieldValue(keys.vatValue, null);\r\n        } else if (selValue.startsWith(VatType.STANDARD)) {\r\n            formikProps.setFieldValue(keys.vatType, VatType.STANDARD);\r\n            formikProps.setFieldValue(keys.vatValue, selValue.substring(VatType.STANDARD.length + 1));\r\n        } else {\r\n            formikProps.setFieldValue(keys.vatType, selValue);\r\n            formikProps.setFieldValue(keys.vatValue, null);\r\n        }\r\n    }\r\n\r\n    const getSelectValue = () => {\r\n        let val = \"\";\r\n        if (values.vatType === VatType.STANDARD || values.vatType === VatType.OTHER) {\r\n            if (values.vatValue !== null) {\r\n                val = values.vatType + \"_\" + values.vatValue\r\n            }\r\n        } else {\r\n            val = values.vatType;\r\n        }\r\n        return val;\r\n    }\r\n\r\n    const copyVats = () => {\r\n        const values = formikProps.values;\r\n        const vatValue = getObjectValue(keys.vatValue, values, null);\r\n        const vatType = getObjectValue(keys.vatType, values, null);\r\n        formikProps.setValues({\r\n            ...values,\r\n            itemOffers: values.itemOffers.map(x => {\r\n                if (x.criterium.offerVatPredefined)\r\n                    return x;\r\n                else\r\n                    return {...x, vatValue, vatType};\r\n            })\r\n        })\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock className={classes.gridBlock}>\r\n                {\r\n                    show.netField && <TextInput\r\n                        className={classes.netValue}\r\n                        id={keys.netValue}\r\n                        formikProps={formikProps}\r\n                        label={Tr('enter_value_net')}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        fullWidth={false}\r\n                        disabled={disabled || criterium.offerValuesPredefined}\r\n                    />\r\n                }\r\n\r\n                {show.vatField && <>\r\n                    {\r\n                        values.vatType === SELECT_VALUE.OTHER ?\r\n                            <TextInput\r\n                                className={clsx(classes.vat, {[classes.marginRight]: !show.copyVat})}\r\n                                id={keys.vatValue}\r\n                                formikProps={formikProps}\r\n                                label={Tr('other_vat_value')}\r\n                                type={INPUT_TYPE.NUMBER_POSITIVE_AMOUNT}\r\n                                fullWidth={false}\r\n                                endAdornment={\r\n                                    <InputAdornment position='end'>\r\n                                        %\r\n                                        {!criterium.offerVatPredefined && <IconButton\r\n                                            onClick={closeTextInput}\r\n                                            className={classes.iconButton}\r\n                                            Icon={CloseIcon}\r\n                                        />}\r\n                                    </InputAdornment>\r\n                                }\r\n                                disabled={disabled || criterium.offerVatPredefined}\r\n                            />\r\n                            :\r\n                            <SimpleSelect\r\n                                className={clsx(classes.vat, {[classes.marginRight]: !show.copyVat})}\r\n                                items={VAT_TYPE_ITEMS}\r\n                                label={Tr('choose_vat_value')}\r\n                                value={getSelectValue()}\r\n                                onChange={handleVatTypeChange}\r\n                                error={vatError}\r\n                                disabled={disabled || criterium.offerVatPredefined}\r\n                            />\r\n                    }\r\n                </>}\r\n\r\n                {show.copyVat &&\r\n                    <IconButton\r\n                        tooltip={Tr(\"vat_copy_to_items\")}\r\n                        Icon={ImportExportIcon}\r\n                        onClick={() => simpleConfirm(\"vat_copy_to_items_confirm\", copyVats)}\r\n                        disabled={criterium.offerVatPredefined}\r\n                    />\r\n                }\r\n\r\n                {\r\n                    show.grossField && <TextInput\r\n                        className={classes.grossValue}\r\n                        id={keys.grossValue}\r\n                        formikProps={formikProps}\r\n                        label={Tr('gross_unit_value')}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        step=\"0.01\"\r\n                        fullWidth={false}\r\n                        disabled={disabled || (priceType === PriceType.NET_GROSS && values.vatType !== VatType.MIXED) || criterium.offerValuesPredefined}\r\n                    />\r\n                }\r\n\r\n                {\r\n                    show.quantity &&\r\n                    <TextInput\r\n                        className={classes.grossValue}\r\n                        id={NetSumPriceVisible(priceType) ? keys.totalNet : keys.totalGross}\r\n                        formikProps={formikProps}\r\n                        label={Tr(NetSumPriceVisible(priceType) ? 'items_value_net' : 'items_value_gross')}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        step=\"0.01\"\r\n                        fullWidth={false}\r\n                        disabled\r\n                    />\r\n                }\r\n\r\n                <SimpleSelect\r\n                    className={classes.currency}\r\n                    label={Tr('currency')}\r\n                    fullWidth={false}\r\n                    items={[createSelectItem(\"PLN\", \"PLN\")]}\r\n                    value=\"PLN\"\r\n                    disabled\r\n                />\r\n            </GridBlock>\r\n            {getObjectValue(`${keys.parameterOffers}`, formikProps.values, []).length > 0 &&\r\n                <GridBlock className={clsx(classes.gridBlock, classes.marginTop)}>\r\n                    {getObjectValue(`${keys.parameterOffers}`, formikProps.values, []).map((po, index) => {\r\n                        return (\r\n                        <HelpComponent key={`po_${index}`} dangerouslySetTextHTML={getObjectValue(`${keys.parameterOffers}.${index}.parameterDescription`, formikProps.values, Tr('no_description'))}>\r\n                            <TextInput\r\n                                className={classes.text}\r\n                                id={`${keys.parameterOffers}.${index}.offerValue`}\r\n                                formikProps={formikProps}\r\n                                label={getObjectValue(`${keys.parameterOffers}.${index}.parameterName`, formikProps.values)}\r\n                                multiline\r\n                                disabled={disabled || !!values.quantityDisabled}\r\n                            />\r\n                        </HelpComponent>)\r\n                        }\r\n                    )}\r\n                </GridBlock>\r\n            }\r\n        </>\r\n    )\r\n\r\n\r\n}\r\n\r\nOfferPriceInput.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default OfferPriceInput;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport Select from \"components/Select\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: 300\r\n    }\r\n}))\r\n\r\nfunction OfferListInput(\r\n    {\r\n        id,\r\n        formikProps,\r\n        listValues,\r\n        disabled\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <Select\r\n            className={classes.root}\r\n            id={id + \".value\"}\r\n            formikProps={formikProps}\r\n            label={Tr('choose_value')}\r\n            items={listValues}\r\n            disabled={disabled}\r\n        />\r\n    )\r\n\r\n\r\n}\r\n\r\nOfferListInput.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    listValues: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n\r\n}\r\n\r\nexport default OfferListInput;","import React, {useEffect, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport TextInput from 'components/TextInput';\r\nimport Select from 'components/Select';\r\nimport GridBlock from 'components/GridBlock';\r\nimport MeasureUnitService from 'services/MeasureUnitService';\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE';\r\nimport Loading from \"components/Loading\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            marginLeft: theme.spacing(2)\r\n        }\r\n    },\r\n})\r\n\r\nfunction OfferUnits({\r\n    classes,\r\n    formikProps,\r\n    id,\r\n    disabled\r\n}) {\r\n    const quantityId = `${id}.quantity.value`;\r\n    const unitId = `${id}.quantity.uom`;\r\n    const [measureUnits, setMeasureUnits] = useState(null);\r\n\r\n    useEffect(() => {\r\n        MeasureUnitService.getRequired().then((resp) => setMeasureUnits(resp));\r\n    }, []);\r\n\r\n    if (!measureUnits) {\r\n        return (\r\n            <Loading/>\r\n        )\r\n    }\r\n\r\n    return (\r\n        <GridBlock className={classes.root}>\r\n            <TextInput\r\n                id={quantityId}\r\n                formikProps={formikProps}\r\n                type={INPUT_TYPE.NUMBER_POSITIVE_AMOUNT}\r\n                required\r\n                disabled={disabled}\r\n            />\r\n            <Select\r\n                formikProps={formikProps}\r\n                id={unitId}\r\n                required\r\n                disabled={disabled}\r\n                items={measureUnits}\r\n            />\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nOfferUnits.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(OfferUnits);","import React, {useMemo} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport VatType from \"constants/VatType\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Typography from \"components/Typography\";\r\nimport {VARIANT_CODE} from \"components/popup/newCriteria/constants/criteria.variants\";\r\nimport OfferYesNoInput from \"./OfferYesNoInput\";\r\nimport OfferTextInput from \"./OfferTextInput\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport OfferNumberInput from \"./OfferNumberInput\";\r\nimport OfferPriceInput from \"./OfferPriceInput\";\r\nimport {PriceType} from \"constants/PriceTypes\";\r\nimport OfferListInput from \"./OfferListInput\";\r\nimport TextInput from \"components/TextInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport OfferUnits from \"./OfferUnits\"\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        border: `solid 2px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        padding: theme.spacing(2),\r\n        marginTop: theme.spacing()\r\n    },\r\n    marginTop1: {\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    marginTop2: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    text: {\r\n        width: 800\r\n    }\r\n}))\r\n\r\nconst offerInput = (uiType) => {\r\n    switch (uiType) {\r\n        case VARIANT_CODE.YESNO:\r\n            return OfferYesNoInput;\r\n        case VARIANT_CODE.NUMBER:\r\n        case VARIANT_CODE.INTERVAL:\r\n            return OfferNumberInput;\r\n        case VARIANT_CODE.PRICE:\r\n            return OfferPriceInput;\r\n        case VARIANT_CODE.LIST:\r\n            return OfferListInput;\r\n        default:\r\n            return OfferTextInput;\r\n    }\r\n}\r\n\r\n\r\nfunction OfferInput(\r\n    {\r\n        id,\r\n        criterion,\r\n        priceType,\r\n        formikProps,\r\n        disabled,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const customQuantity = getObjectValue(id + \".quantity\", formikProps.values, null) !== null;\r\n\r\n    const Input = offerInput(criterion.criterium.uiType);\r\n    const inpDisabled = useMemo(() => disabled || getObjectValue(id + \".disabled\", formikProps.initialValues, false), [id, formikProps.initialValues, disabled])\r\n    const quantityDisabled = useMemo(() => getObjectValue(id + \".quantityDisabled\", formikProps.initialValues, false), [id, formikProps.initialValues])\r\n    const canEditQuantity = useMemo(() => getObjectValue(id + \".criterium.allowQuantityEditInOffer\", formikProps.initialValues, false), [id, formikProps.initialValues])\r\n\r\n    const turnOnEditQuantity = () => {\r\n        formikProps.setFieldValue(id + '.quantity', {\r\n            value: getObjectValue(id + '.criterium.quantity.value', formikProps.values, null),\r\n            uom: getObjectValue(id + \".criterium.quantity.uom\", formikProps.values, null)\r\n        });\r\n    }\r\n\r\n    const turnOffEditQuantity = () => {\r\n        formikProps.setFieldValue(id + '.quantity', null);\r\n    }\r\n\r\n    return (<div className={classes.root}>\r\n        <BoldTypography>{criterion.criterium.name}</BoldTypography>\r\n        {!!criterion.criterium.description && <Typography>{criterion.criterium.description}</Typography>}\r\n\r\n\r\n        {!!criterion.criterium.quantity && !customQuantity &&\r\n        <Typography className={clsx({[classes.marginTop1]: !canEditQuantity})}>\r\n            {`${Tr('quantity')}: ${criterion.criterium.quantity.value} ${criterion.criterium.uom}`}\r\n            {!disabled && canEditQuantity && <WorkableIconEditButton onClick={() => turnOnEditQuantity()}/>}\r\n        </Typography>}\r\n\r\n        {!!criterion.criterium.quantity && customQuantity &&\r\n        <GridBlock>\r\n            <Typography className={classes.marginTop1}>\r\n                {`${Tr('quantity')}: `}\r\n            </Typography>\r\n            <OfferUnits\r\n                id={id}\r\n                formikProps={formikProps}\r\n                disabled={inpDisabled || quantityDisabled}\r\n            />\r\n            {!inpDisabled && !quantityDisabled && <WorkableIconDeleteButton onClick={() => turnOffEditQuantity()}/>}\r\n        </GridBlock>\r\n        }\r\n\r\n\r\n        {criterion.criterium.weight !== null && <Typography>{`${Tr('weight')}: ${criterion.criterium.weight}`}</Typography>}\r\n        {!!criterion.criterium.uom && !criterion.criterium.quantity && <Typography>{`${Tr('measure_unit')}: ${criterion.criterium.uom}`}</Typography>}\r\n        {!!criterion.criterium.baseItemId && <Typography>{Tr('position_type.optional.offer')}</Typography>}\r\n        {!!criterion.criterium.offerValuesPredefined && <Typography>{Tr('offerSourceType.initiator.offer')}</Typography>}\r\n        {!criterion.criterium.offerValuesPredefined && !!criterion.criterium.offerVatPredefined && <Typography>{Tr('offerVatPredefined.offer')}</Typography>}\r\n        <GridBlock\r\n            className={classes.marginTop2}\r\n            justify=\"flex-end\"\r\n        >\r\n            <Input\r\n                formikProps={formikProps}\r\n                id={id}\r\n                criterium={criterion.criterium}\r\n                listValues={criterion.criterium.listValues}\r\n                priceType={priceType}\r\n                quantity={getObjectValue(id + '.quantity', formikProps.values, criterion.criterium.quantity)}\r\n                disabled={inpDisabled || !!criterion.criterium.baseItemId}\r\n            />\r\n        </GridBlock>\r\n        {\r\n            criterion.criterium.showComment &&\r\n            <GridBlock\r\n                justify=\"flex-end\"\r\n            >\r\n                <TextInput\r\n                    className={classes.text}\r\n                    id={`${id}.comment`}\r\n                    formikProps={formikProps}\r\n                    label={Tr('position_additional_comment')}\r\n                    disabled={inpDisabled}\r\n                    multiline\r\n                />\r\n            </GridBlock>\r\n        }\r\n    </div>)\r\n\r\n\r\n}\r\n\r\nOfferInput.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    priceType: PropTypes.oneOf(Object.values(PriceType)).isRequired,\r\n    criterion: PropTypes.shape({\r\n        criterium: PropTypes.shape({\r\n            identity: PropTypes.number.isRequired,\r\n            name: PropTypes.string.isRequired,\r\n            description: PropTypes.string,\r\n            uiType: PropTypes.string.isRequired,\r\n            uom: PropTypes.string,\r\n            listValues: PropTypes.arrayOf(PropTypes.string.isRequired),\r\n            weight: PropTypes.number,\r\n            showComment: PropTypes.bool.isRequired,\r\n            quantity: PropTypes.shape({\r\n                value: PropTypes.number.isRequired,\r\n                uom: PropTypes.string.isRequired\r\n            })\r\n        }),\r\n        value: PropTypes.any,\r\n        vatType: PropTypes.oneOf(Object.values(VatType)),\r\n        vatValue: PropTypes.any,\r\n        grossValue: PropTypes.any,\r\n        comment: PropTypes.string,\r\n        quantity: PropTypes.shape({\r\n            value: PropTypes.any,\r\n            uom: PropTypes.string\r\n        })\r\n    })\r\n\r\n}\r\n\r\nexport default OfferInput;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport GeneralInfoEntry from \"../../panels/generalInfo/components/GeneralInfoEntry\";\r\nimport Typography from \"components/Typography\";\r\nimport OfferInput from \"./inputs/OfferInput\";\r\n\r\n\r\nfunction OfferPositionConditions(\r\n    {\r\n        formikProps,\r\n        conditions,\r\n        priceType,\r\n        disabled\r\n    }) {\r\n\r\n    return (\r\n        <GeneralInfoEntry biggerLabel label={Tr('conditions')} collapsible defaultCollapsed={false}>\r\n            {\r\n                conditions.length === 0 ?\r\n                    <Typography>{Tr('conditions_specifed_in_SIWZ_offer_form')}</Typography>\r\n                    :\r\n                    conditions.map((condition, index) => (\r\n                        <OfferInput\r\n                            key={condition.criterium.identity}\r\n                            id={`conditions.${index}`}\r\n                            criterion={condition}\r\n                            formikProps={formikProps}\r\n                            priceType={priceType}\r\n                            disabled={disabled}\r\n                        />\r\n                    ))}\r\n        </GeneralInfoEntry>)\r\n\r\n}\r\n\r\nOfferPositionConditions.propTypes = {\r\n    conditions: PropTypes.array.isRequired\r\n}\r\n\r\nexport default OfferPositionConditions;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport GeneralInfoEntry from \"../../panels/generalInfo/components/GeneralInfoEntry\";\r\nimport OfferInput from \"./inputs/OfferInput\";\r\n\r\n\r\nfunction OfferPositionCriteriums(\r\n    {\r\n        formikProps,\r\n        criteriums,\r\n        priceType,\r\n        disabled\r\n    }) {\r\n\r\n    if (criteriums.length === 0)\r\n        return null;\r\n\r\n    return (\r\n        <GeneralInfoEntry biggerLabel label={Tr('criteria_desc')} collapsible defaultCollapsed={false}>\r\n            {\r\n                criteriums.map((criterion, index) => (\r\n                    <OfferInput\r\n                        key={criterion.criterium.identity}\r\n                        id={`criteriums.${index}`}\r\n                        criterion={criterion}\r\n                        formikProps={formikProps}\r\n                        priceType={priceType}\r\n                        disabled={disabled}\r\n                    />\r\n                ))}\r\n        </GeneralInfoEntry>)\r\n\r\n}\r\n\r\nOfferPositionCriteriums.propTypes = {\r\n    criteriums: PropTypes.array.isRequired\r\n}\r\n\r\nexport default OfferPositionCriteriums;","import React, {useEffect, useRef} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport GeneralInfoEntry from \"../../panels/generalInfo/components/GeneralInfoEntry\";\r\nimport OfferInput from \"./inputs/OfferInput\";\r\nimport {TotalPriceTypeGrossFieldVisible, TotalPriceTypeNetFieldVisible} from \"constants/PriceTypes\";\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport {OfferMode} from \"../constants/OfferMode\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    sum: {\r\n        marginTop: theme.spacing(2),\r\n    },\r\n    sumElem: {\r\n        margin: theme.spacing(1, 2, 1, 0)\r\n    }\r\n}))\r\n\r\n\r\nfunction OfferPositionItems(\r\n    {\r\n        formikProps,\r\n        itemOffers,\r\n        priceType,\r\n        disabled,\r\n        mode\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    //const [sum, setSum] = useState({net: 0, gross: 0});\r\n    const semaphore = useRef(false);\r\n    const showOptionSumValues = itemOffers.filter(i => !!i.criterium.baseItemId).length > 0;\r\n\r\n    useEffect(() => {\r\n        if (semaphore.current) {\r\n            const totalValues = {\r\n                positionOfferValue: null,\r\n                positionOfferGrossValue: null,\r\n                positionOptionOfferValue: null,\r\n                positionOptionOfferGrossValue: null,\r\n                positionTotalOfferValue: null,\r\n                positionTotalOfferGrossValue: null\r\n            };\r\n            const newSum = formikProps.values.itemOffers.filter(i => !i.criterium.baseItemId).reduce((prev, crit) => {\r\n                if (crit.totalNet !== null)\r\n                    prev.net += parseFloat(crit.totalNet);\r\n                if (crit.totalGross !== null)\r\n                    prev.gross += parseFloat(crit.totalGross);\r\n                return prev;\r\n            }, {net: 0, gross: 0});\r\n            totalValues.positionOfferValue = newSum.net;\r\n            totalValues.positionOfferGrossValue = newSum.gross;\r\n\r\n            if (showOptionSumValues) {\r\n                const newOptionSum = formikProps.values.itemOffers.filter(i => !!i.criterium.baseItemId).reduce((prev, crit) => {\r\n                    if (crit.totalNet !== null)\r\n                        prev.net += parseFloat(crit.totalNet);\r\n                    if (crit.totalGross !== null)\r\n                        prev.gross += parseFloat(crit.totalGross);\r\n                    return prev;\r\n                }, {net: 0, gross: 0});\r\n                totalValues.positionOptionOfferValue = newOptionSum.net;\r\n                totalValues.positionOptionOfferGrossValue = newOptionSum.gross;\r\n\r\n                totalValues.positionTotalOfferValue = newSum.net + newOptionSum.net;\r\n                totalValues.positionTotalOfferGrossValue = newSum.gross + newOptionSum.gross;\r\n            }\r\n\r\n            formikProps.setFieldValue(\"totalValues\", totalValues);\r\n        } else {\r\n            semaphore.current = true;\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [formikProps.values.itemOffers, showOptionSumValues])\r\n\r\n    if (itemOffers.length === 0)\r\n        return null;\r\n\r\n    return (\r\n        <GeneralInfoEntry biggerLabel label={Tr('items_list')} collapsible defaultCollapsed={false}>\r\n            {\r\n                itemOffers.map((item, index) => (\r\n                    <OfferInput\r\n                        key={item.criterium.identity}\r\n                        id={`itemOffers.${index}`}\r\n                        criterion={item}\r\n                        formikProps={formikProps}\r\n                        priceType={priceType}\r\n                        disabled={disabled}\r\n                    />\r\n                ))\r\n            }\r\n            {\r\n                <GridBlock className={classes.sum} justify=\"flex-end\">\r\n                    <BoldTypography className={classes.sumElem}>{Tr(\"sum\")}: </BoldTypography>\r\n                    <div>\r\n                        {\r\n                            TotalPriceTypeNetFieldVisible(priceType) && <>\r\n                                {\r\n                                    mode === OfferMode.EDIT || !formikProps.values.placingType ?\r\n                                        <Typography\r\n                                            className={classes.sumElem}>{`${Tr('offer_value_net')}: ${formikProps.values.totalValues.positionOfferValue != null ? parseFloat(formikProps.values.totalValues.positionOfferValue).toFixed(2).replace(\".\", \",\") : \"_\"} PLN`}</Typography>\r\n                                        : <GridBlock>\r\n                                            <Typography className={classes.sumElem}>{`${Tr('offer_value_net')}: `}</Typography>\r\n                                            <TextInput\r\n                                                id=\"totalValues.positionOfferValue\"\r\n                                                formikProps={formikProps}\r\n                                                endAdornment={<Typography>PLN</Typography>}\r\n                                                disabled={disabled}\r\n                                                type={INPUT_TYPE.NUMBER_19}\r\n                                            />\r\n                                        </GridBlock>\r\n                                }\r\n                            </>\r\n                        }\r\n                        {\r\n                            TotalPriceTypeGrossFieldVisible(priceType) && <>\r\n                                {\r\n                                    mode === OfferMode.EDIT || !formikProps.values.placingType ?\r\n                                        <Typography\r\n                                            className={classes.sumElem}>{`${Tr('offer_value_gross')}: ${formikProps.values.totalValues.positionOfferGrossValue != null ? parseFloat(formikProps.values.totalValues.positionOfferGrossValue).toFixed(2).replace(\".\", \",\") : \"_\"} PLN`}</Typography>\r\n                                        : <GridBlock>\r\n                                            <Typography className={classes.sumElem}>{`${Tr('offer_value_gross')}: `}</Typography>\r\n                                            <TextInput\r\n                                                id=\"totalValues.positionOfferGrossValue\"\r\n                                                disabled={disabled}\r\n                                                endAdornment={<Typography>PLN</Typography>}\r\n                                                formikProps={formikProps}\r\n                                                type={INPUT_TYPE.NUMBER_19}\r\n                                            />\r\n                                        </GridBlock>\r\n                                }\r\n                            </>\r\n                        }\r\n                        {showOptionSumValues && TotalPriceTypeNetFieldVisible(priceType) &&\r\n                            <>\r\n                                {\r\n                                    mode === OfferMode.EDIT || !formikProps.values.placingType ?\r\n                                        <Typography\r\n                                            className={classes.sumElem}>{`${Tr('offer_option_value_net')}: ${formikProps.values.totalValues.positionOptionOfferValue != null ? parseFloat(formikProps.values.totalValues.positionOptionOfferValue).toFixed(2).replace(\".\", \",\") : \"_\"} PLN`}</Typography>\r\n                                        : <GridBlock>\r\n                                            <Typography className={classes.sumElem}>{`${Tr('offer_option_value_net')}: `}</Typography>\r\n                                            <TextInput\r\n                                                id=\"totalValues.positionOptionOfferValue\"\r\n                                                formikProps={formikProps}\r\n                                                endAdornment={<Typography>PLN</Typography>}\r\n                                                disabled={disabled}\r\n                                                type={INPUT_TYPE.NUMBER_19}\r\n                                            />\r\n                                        </GridBlock>\r\n                                }\r\n                            </>\r\n                        }\r\n                        {showOptionSumValues && TotalPriceTypeGrossFieldVisible(priceType) &&\r\n                        <>\r\n                            {\r\n                                mode === OfferMode.EDIT || !formikProps.values.placingType ?\r\n                                    <Typography\r\n                                        className={classes.sumElem}>{`${Tr('offer_option_value_gross')}: ${formikProps.values.totalValues.positionOptionOfferGrossValue != null ? parseFloat(formikProps.values.totalValues.positionOptionOfferGrossValue).toFixed(2).replace(\".\", \",\") : \"_\"} PLN`}</Typography>\r\n                                    : <GridBlock>\r\n                                        <Typography className={classes.sumElem}>{`${Tr('offer_option_value_gross')}: `}</Typography>\r\n                                        <TextInput\r\n                                            id=\"totalValues.positionOptionOfferGrossValue\"\r\n                                            formikProps={formikProps}\r\n                                            endAdornment={<Typography>PLN</Typography>}\r\n                                            disabled={disabled}\r\n                                            type={INPUT_TYPE.NUMBER_19}\r\n                                        />\r\n                                    </GridBlock>\r\n                            }\r\n                        </>\r\n                        }\r\n                        {showOptionSumValues && TotalPriceTypeNetFieldVisible(priceType) &&\r\n                        <>\r\n                            <Typography className={classes.sumElem}>{`${Tr('offer_total_value_net')}: ${formikProps.values.totalValues.positionTotalOfferValue != null ? parseFloat(formikProps.values.totalValues.positionTotalOfferValue).toFixed(2).replace(\".\", \",\") : \"_\"} PLN`}</Typography>\r\n                        </>\r\n                        }\r\n                        {showOptionSumValues && TotalPriceTypeGrossFieldVisible(priceType) &&\r\n                        <>\r\n                            <Typography className={classes.sumElem}>{`${Tr('offer_total_value_gross')}: ${formikProps.values.totalValues.positionTotalOfferGrossValue != null ? parseFloat(formikProps.values.totalValues.positionTotalOfferGrossValue).toFixed(2).replace(\".\", \",\") : \"_\"} PLN`}</Typography>\r\n                        </>\r\n                        }\r\n                    </div>\r\n                </GridBlock>\r\n            }\r\n\r\n        </GeneralInfoEntry>)\r\n\r\n}\r\n\r\nOfferPositionItems.propTypes = {\r\n    itemOffers: PropTypes.array.isRequired\r\n}\r\n\r\nexport default OfferPositionItems;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport GeneralInfoEntry from \"../../panels/generalInfo/components/GeneralInfoEntry\";\r\nimport OfferInput from \"./inputs/OfferInput\";\r\n\r\n\r\nfunction OfferPositionParameters(\r\n    {\r\n        formikProps,\r\n        parameters,\r\n        priceType,\r\n        disabled\r\n    }) {\r\n\r\n    if (parameters.length === 0)\r\n        return null;\r\n\r\n    return (\r\n        <GeneralInfoEntry biggerLabel label={Tr('parameters')} collapsible defaultCollapsed={false}>\r\n            {\r\n                parameters.map((parameter, index) => (\r\n                    <OfferInput\r\n                        key={parameter.criterium.identity}\r\n                        id={`parameters.${index}`}\r\n                        criterion={parameter}\r\n                        formikProps={formikProps}\r\n                        priceType={priceType}\r\n                        disabled={disabled}\r\n                    />\r\n                ))}\r\n        </GeneralInfoEntry>)\r\n\r\n}\r\n\r\nOfferPositionParameters.propTypes = {\r\n    parameters: PropTypes.array.isRequired\r\n}\r\n\r\nexport default OfferPositionParameters;","import Tr from 'translations/Translations';\r\n\r\nexport const ContractorConsorciumTypesOnePosition = {\r\n    NONE: \"NONE\",\r\n    ALL:\"ALL\"\r\n}\r\nexport const ContractorConsorciumTypes = {\r\n    NONE: \"NONE\",\r\n    ALL:\"ALL\",\r\n    POSITION:\"POSITION\"\r\n}\r\n\r\nconst _TR_PREFIX = 'contractor_consorcium_type_';\r\nexport const ContractorConsorciumTypesLabel = (type) => (Tr(_TR_PREFIX + type.toLowerCase()));\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const ContractorCompanySize = {\r\n    MICRO: \"MICRO\",\r\n    SMALL: \"SMALL\",\r\n    MEDIUM: \"MEDIUM\",\r\n    SELFTRADER: \"SELFTRADER\",\r\n    NONBUSINESSINDIVIDUAL: \"NONBUSINESSINDIVIDUAL\",\r\n    OTHERSIZE: \"OTHERSIZE\",\r\n    LARGE: \"LARGE\",\r\n    IGNORE: \"IGNORE\",\r\n}\r\n\r\nconst _TR_PREFIX = 'contractor_company_size_';\r\nexport const ContractorCompanySizeLabel = (size) => (Tr(_TR_PREFIX + size.toLowerCase()));\r\n","import Endpoints from 'constants/Endpoints';\r\nimport { RestRequestPOST, RestRequestGET } from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport { DemandValidation } from 'constants/DemandValidation';\r\nimport { setSaveStatusLoading, setSaveStatusDialog } from 'redux/actions'\r\nimport validateSection from './helpers/validateSection';\r\n\r\nconst CONTRACTOR_LIST_ID = 'contractorList';\r\nconst CONTRACTOR_ONE_PLACE_ID = 'onePlaceContractor';\r\nconst NIP_LIST_RESOURCE_ID = 'nipList';\r\n\r\nconst __get = async (url, reduxId) => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(url)\r\n\t\treduxStore.dispatch(setResource(reduxId, res))\r\n\t} catch (error) { }\r\n}\r\n\r\nconst getList = async (id) => {\r\n\tconst url = Endpoints.CONTRACTOR_GET_LIST(id);\r\n\tawait __get(url, CONTRACTOR_LIST_ID)\r\n}\r\n\r\nconst getContractorDetails = async (id, contractorDepartmentId) => {\r\n\treturn await RestRequestGET(Endpoints.CONTRACTOR_GET_DETAILS(id, contractorDepartmentId))\r\n}\r\n\r\nconst getOnePlace = async (id) => {\r\n\tconst url = Endpoints.CONTRACTOR_ONEPLACE(id);\r\n\tawait __get(url, CONTRACTOR_ONE_PLACE_ID)\r\n}\r\n\r\nconst __appendContractors = (list) => {\r\n\tconst { resources } = reduxStore.getState();\r\n\tconst { items } = resources[CONTRACTOR_LIST_ID];\r\n\r\n\treduxStore.dispatch(setResource(CONTRACTOR_LIST_ID, {\r\n\t\titems: [\r\n\t\t\t...items,\r\n\t\t\t...list,\r\n\t\t]\r\n\t}))\r\n}\r\n\r\nconst __removeContractor = (element) => {\r\n\tconst { resources } = reduxStore.getState();\r\n\tconst { items } = resources[CONTRACTOR_LIST_ID];\r\n\treduxStore.dispatch(setResource(CONTRACTOR_LIST_ID, {\r\n\t\titems: items.filter(x => x.contractor.identity !== element.contractor.identity)\r\n\t}))\r\n}\r\n\r\nconst sendTabContractor = async (id, data) => {\r\n\tconst url = Endpoints.CONTRACTOR_ADD(id);\r\n\ttry {\r\n\t\tconst res = await RestRequestPOST(url, data);\r\n\t\t__appendContractors(res.contractors);\r\n\t\tawait validateSection(DemandValidation.CONTRACTOR, id, false)\r\n\t} catch (error) { }\r\n}\r\n\r\nconst invite = async (id, values) => {\r\n\ttry {\r\n\t\tconst res = await RestRequestPOST(Endpoints.CONTRACTOR_INVITE(id), values)\r\n\t\t__appendContractors(res.contractors);\r\n\t\tawait validateSection(DemandValidation.CONTRACTOR, id, false);\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst deleteUser = async (id, data) => {\r\n\tconst url = Endpoints.CONTRACTOR_REMOVE(id);\r\n\ttry {\r\n\t\tconst res = await RestRequestPOST(url, data);\r\n\t\tif (res.success) {\r\n\t\t\t__removeContractor(data)\r\n\t\t\tawait validateSection(DemandValidation.CONTRACTOR, id,false);\r\n\t\t} else {\r\n\t\t\tawait getList(id)\r\n\t\t}\r\n\t} catch (error) { }\r\n}\r\n\r\nconst save = async (demandId) => {\r\n\treduxStore.dispatch(setSaveStatusLoading());\r\n\r\n\ttry {\r\n\t\treduxStore.dispatch(setSaveStatusDialog());\r\n\t\tawait validateSection(DemandValidation.CONTRACTOR, demandId);\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst validate = async (id) => {\r\n\treturn RestRequestGET(Endpoints.CONTRACTOR_VALIDATE(id));\r\n}\r\n\r\nconst getNipList = async (demandId) => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(\r\n\t\t\tEndpoints.CONTRACTOR_GET_NIP_LIST(demandId)\r\n\t\t)\r\n\t\treduxStore.dispatch(setResource(NIP_LIST_RESOURCE_ID, res))\r\n\t} catch (error) {\r\n\t}\r\n}\r\nconst check = async (demandId, prefix, number) => {\r\n\tconst params = {\r\n\t\tprefix, number\r\n\t}\r\n\treturn await RestRequestGET(Endpoints.CONTRACTOR_CHECK(demandId), {params});\r\n}\r\n\r\nconst clearResources = (resource) => {\r\n\treduxStore.dispatch(clearResource(resource));\r\n}\r\n\r\nexport default {\r\n\tgetList,\r\n\tgetOnePlace,\r\n\tsendTabContractor,\r\n\tinvite,\r\n\tgetNipList,\r\n\tdeleteUser,\r\n\tsave,\r\n\tvalidate,\r\n\tclearResources,\r\n\tgetContractorDetails,\r\n\tCONTRACTOR_ONE_PLACE_ID,\r\n\tNIP_LIST_RESOURCE_ID,\r\n\tCONTRACTOR_LIST_ID,\r\n\tcheck\r\n}","import React, {memo, useMemo} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Select from 'components/Select';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport {connect} from 'react-redux'\r\nimport ContractorService from \"services/ContractorService\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*:last-child': {\r\n            flexGrow: 1,\r\n            marginLeft: theme.spacing(2),\r\n        }\r\n    },\r\n})\r\n\r\nfunction NipRow(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        limit,\r\n        defaultValue,\r\n        nipList,\r\n        prefix,\r\n        required = true,\r\n        onBlur\r\n    }) {\r\n\r\n    const listSorted = useMemo(()=> {\r\n        const list = [...nipList]\r\n        list.sort((a, b) => {\r\n\r\n            if (a === \"PL\" || a < b) {\r\n                return -1;\r\n            }\r\n            if ( a > b) {\r\n                return 1;\r\n            }\r\n            return 0;\r\n        })\r\n        return list;\r\n    }, [nipList])\r\n\r\n    return (\r\n        <GridBlock\r\n            wrap='nowrap'\r\n            alignItems='baseline'\r\n            className={classes.root}\r\n        >\r\n            <Select\r\n                formikProps={formikProps}\r\n                id='vatin.prefix'\r\n                items={listSorted}\r\n                label=' '\r\n            />\r\n            <TextInput\r\n                id='vatin.number'\r\n                formikProps={formikProps}\r\n                label={Tr('nip_pesel')}\r\n                onBlur={onBlur}\r\n                required\r\n            />\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nNipRow.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    nipList: state.resources[ContractorService.NIP_LIST_RESOURCE_ID]\r\n}), {})(withStyles(style)(memo(NipRow)))","\r\nimport React, { memo } from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport InputMask from 'react-input-mask';\r\nimport getObjectValue from 'libs/getObjectValue'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t}\r\n})\r\n\r\nfunction MaskedTextInput({\r\n\tchildren,\r\n\tformikProps,\r\n\tid,\r\n\tmask,\r\n}) {\r\n\tconst value = getObjectValue(id, formikProps.values, '')\r\n\treturn (\r\n\t\t<InputMask\r\n\t\t\tmask={mask}\r\n\t\t\tvalue={value}\r\n\t\t\tmaskChar={null}\r\n\t\t\tonBlur\r\n\t\t>\r\n\t\t\t{() => children}\r\n\t\t</InputMask>\r\n\t)\r\n}\r\n\r\nexport default withStyles(style)(memo(MaskedTextInput, (prevProps, nextProps) => {\r\n\tconst prevFormikProps = prevProps.formikProps;\r\n\tconst nextFormikProps = nextProps.formikProps;\r\n\tif (JSON.stringify(getObjectValue(prevProps.id, prevFormikProps.values)) !==\r\n\t\tJSON.stringify(getObjectValue(nextProps.id, nextFormikProps.values))\r\n\t) return false;\r\n\tif (JSON.stringify(getObjectValue(prevProps.id, prevFormikProps.errors)) !==\r\n\t\tJSON.stringify(getObjectValue(nextProps.id, nextFormikProps.errors))\r\n\t) return false;\r\n\tif (JSON.stringify(getObjectValue(prevProps.id, prevFormikProps.touched)) !==\r\n\t\tJSON.stringify(getObjectValue(nextProps.id, nextFormikProps.touched))\r\n\t) return false;\r\n\treturn true\r\n}))","import React, { useEffect } from 'react'\r\nimport MaskedTextInput from 'components/MaskedTextInput';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\n\r\n\r\nfunction PostCodeRow({\r\n\tdefaultValue,\r\n\tformikProps,\r\n\tlimits,\r\n\trequired,\r\n\tprefix\r\n}) {\r\n\tconst postCodeId = `postCode`\r\n\tconst postCodeValue = formikProps.values.postCode;\r\n\r\n\tuseEffect(() => {\r\n\t\tif (prefix === defaultValue) {\r\n\t\t\tif (postCodeValue.includes('-')) {\r\n\t\t\t\tconst newValue = postCodeValue.slice(0,6)\r\n\t\t\t\tformikProps.setFieldValue(postCodeId, newValue)\r\n\t\t\t} else {\r\n\t\t\t\tconst FirstPart = postCodeValue.substr(0, 2)\r\n\t\t\t\tconst SecondPart = postCodeValue.substr(2, 3)\r\n\r\n\t\t\t\tif (postCodeValue.length > 0) {\r\n\t\t\t\t\tformikProps.setFieldValue(postCodeId, `${FirstPart}-${SecondPart}`)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//eslint-disable-next-line\r\n\t}, [prefix])\r\n\r\n\treturn prefix === defaultValue ?\r\n\t\t<MaskedTextInput\r\n\t\t\tid='postCode'\r\n\t\t\tformikProps={formikProps}\r\n\t\t\tmask=\"99-999\"\r\n\t\t>\r\n\t\t\t<TextInput\r\n\t\t\t\tid='postCode'\r\n\t\t\t\tlabel={Tr('zip_code')}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\trequired={required}\r\n\t\t\t/>\r\n\t\t</MaskedTextInput>\r\n\t\t:\r\n\t\t<TextInput\r\n\t\t\tid='postCode'\r\n\t\t\tlabel={Tr('zip_code')}\r\n\t\t\tformikProps={formikProps}\r\n\t\t\trequired={required}\r\n\t\t\tlimit={limits.POSTCODE}\r\n\t\t/>\r\n}\r\n\r\nexport default PostCodeRow","import React, {memo, useState} from 'react'\r\nimport {withStyles, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport NipRow from './components/NipRow';\r\nimport TextInput from 'components/TextInput';\r\nimport Tr from 'translations/Translations';\r\nimport * as Yup from 'yup'\r\nimport validation from 'constants/ValidationShema'\r\nimport InputLimits from 'constants/InputLimits';\r\nimport PostCodeRow from './components/PostCodeRow';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport ContractorService from \"services/ContractorService\";\r\nimport Select, {createSelectItem} from \"../../Select\";\r\nimport {ContractorCompanySize, ContractorCompanySizeLabel} from \"../../../constants/ContractorCompanySize\";\r\n\r\nconst limits = InputLimits.procedure.contractor\r\n\r\nconst style = theme => ({\r\n    nameExist: {\r\n        fontSize: '0.75rem'\r\n    }\r\n})\r\n\r\nconst PL_PREFIX = \"PL\"\r\n\r\nconst translationsMap = {\r\n    \"vatin\": \"pesel_exist\",\r\n    \"email\": \"email_exist\",\r\n    \"postCode\": \"post_code_exist\"\r\n}\r\n\r\nfunction InviteContactorForm(\r\n    {\r\n        classes,\r\n        onSubmit,\r\n        id,\r\n        contractorList,\r\n        defaultValues = {},\r\n        collectPostCode,\r\n        collectAddress,\r\n        addressRequired = true,\r\n        collectCity,\r\n        cityRequired = true,\r\n        collectRegon,\r\n        collectCompanySize,\r\n        collectIdentity,\r\n        checkForExistingVatins,\r\n        demandId\r\n    }) {\r\n    const handleSubmit = (value) => onSubmit(value);\r\n\r\n    const [ctrMap, setCtrMap] = useState({});\r\n\r\n    const onBlurNip = (e,formikProps) => {\r\n        const number = getObjectValue('vatin.number', formikProps.values, '');\r\n        const prefix = getObjectValue('vatin.prefix', formikProps.values, 'PL');\r\n        const key = prefix + number;\r\n\r\n        if(ctrMap[key] === undefined) {\r\n            if(number && number.length >= limits.NIP_MIN && number.length <= limits.NIP_MAX) {\r\n                ContractorService.check(demandId, prefix, number).then((resp) => {\r\n                    if(resp.success) {\r\n                        setCtrMap(x => ({...x, [key]: resp.result}))\r\n                    }\r\n                })\r\n            }\r\n        }\r\n    }\r\n\r\n\r\n\r\n    return (\r\n        <Form\r\n            className={classes.root}\r\n            id={id}\r\n            onSubmit={handleSubmit}\r\n            initialValues={(() => {\r\n                const initValues = {\r\n                    name: getObjectValue('name', defaultValues, ''),\r\n                    email: getObjectValue('email', defaultValues, ''),\r\n                    vatin: {\r\n                        number: getObjectValue('vatin.number', defaultValues, ''),\r\n                        prefix: getObjectValue('vatin.prefix', defaultValues, 'PL'),\r\n                    }\r\n                };\r\n\r\n                if (collectPostCode)\r\n                    initValues.postCode = getObjectValue('postCode', defaultValues, '');\r\n\r\n                if (collectAddress)\r\n                    initValues.address = getObjectValue('address', defaultValues, '');\r\n\r\n                if (collectCity)\r\n                    initValues.city = getObjectValue('city', defaultValues, '');\r\n\r\n                if (collectRegon)\r\n                    initValues.regon = getObjectValue('regon', defaultValues, '');\r\n\r\n                if (collectCompanySize)\r\n                    initValues.companySize = getObjectValue('companySize', defaultValues, '');\r\n\r\n                if(collectIdentity)\r\n                    initValues.identity = getObjectValue('identity', defaultValues, '');\r\n\r\n                return initValues;\r\n            })()}\r\n            validationSchema={Yup.lazy((value) => {\r\n                let errorList = {}\r\n                let nipAndPostCodeError = {}\r\n                const numberLength = value.vatin?.number ? value.vatin.number.length : 0;\r\n                if (contractorList?.items) {\r\n                    contractorList.items.forEach(item => {\r\n                        Object.keys(value).forEach(valueKey => {\r\n                            if ((!collectIdentity || value.identity !== item.contractor.identity) && valueKey === 'vatin' && typeof value[valueKey] === 'object') {\r\n                                Object.keys(value[valueKey]).forEach(innerItem => {\r\n                                    if (innerItem === \"number\" &&\r\n                                        value[valueKey][innerItem] === item.contractor[valueKey][innerItem].replace(/\\s+/gm, '')) {\r\n                                        if (numberLength === 11) errorList[valueKey] = valueKey\r\n                                        else nipAndPostCodeError[valueKey] = valueKey\r\n                                    }\r\n                                })\r\n                            }\r\n                            if (translationsMap[valueKey] && value[valueKey] === item.contractor[valueKey]\r\n                                && (!collectIdentity || value.identity !== item.contractor.identity)) {\r\n\r\n                                if (valueKey === \"postCode\") nipAndPostCodeError[valueKey] = valueKey\r\n                                else errorList[valueKey] = valueKey\r\n                            }\r\n                        });\r\n                    });\r\n                }\r\n\r\n                const validateObj = {\r\n                    name: validation.stringMax(limits.NAME),\r\n                    email: validation.emailMax(limits.EMAIL)\r\n                };\r\n\r\n                if (collectAddress)\r\n                    validateObj.address = addressRequired ? validation.stringMax(limits.ADDRESS) : validation.stringMaxNoRq(limits.ADDRESS);\r\n\r\n                if (collectCity)\r\n                    validateObj.city = cityRequired ? validation.stringMax(limits.CITY) : validation.stringMaxNoRq(limits.CITY);\r\n\r\n                if (collectPostCode || value?.vatin?.number) {\r\n                    validateObj.vatin = validation.object({\r\n                        number: value.vatin.prefix === PL_PREFIX ?\r\n                            validation.vatinOrPeselPL(Tr('invalid_vatin_for_country', {countryCode: value.vatin.prefix}))\r\n                            : validation.stringMinAndMax(limits.NIP_MIN, limits.NIP_MAX)\r\n                    });\r\n                }\r\n\r\n                if (collectPostCode) {\r\n                    validateObj.postCode = value.vatin.prefix === PL_PREFIX ? validation.stringMin(limits.POSTCODE_PL) : validation.stringMax(limits.EMAIL);\r\n                }\r\n\r\n                if(collectRegon)\r\n                    validateObj.regon = validation.stringMaxNoRq(limits.EMAIL);\r\n\r\n                if(collectCompanySize)\r\n                    validateObj.companySize = validation.string()\r\n\r\n                let objShape = {}\r\n                Object.keys(validateObj).forEach(item => {\r\n                    if (errorList[item] === item) {\r\n                        if (item === 'vatin') {\r\n                            objShape[item] = validation.object({\r\n                                number: validation.immediatelyError(Tr(translationsMap[item]))\r\n                            })\r\n                        } else objShape[item] = validation.immediatelyError(Tr(translationsMap[item]))\r\n                    } else objShape[item] = validateObj[item]\r\n                });\r\n                if (Object.keys(nipAndPostCodeError).length === 2 && numberLength !== 11) {\r\n                    objShape = {\r\n                        ...objShape,\r\n                        \"vatin\": validation.object({\r\n                            number: validation.immediatelyError(Tr(\"repeat_nip_and_postCode_error\"))\r\n                        }),\r\n                        \"postCode\": validation.immediatelyError(Tr(\"repeat_nip_and_postCode_error\"))\r\n                    }\r\n                }\r\n\r\n                return Yup.object().shape({\r\n                    ...objShape\r\n                })\r\n            })}\r\n        >\r\n            {(formikProps) => {\r\n\r\n                const number = getObjectValue('vatin.number', formikProps.values, '');\r\n                const prefix = getObjectValue('vatin.prefix', formikProps.values, 'PL');\r\n                const key = prefix + number;\r\n                const fixedname = ctrMap[key];\r\n\r\n                if(!!fixedname) {\r\n                    const name = getObjectValue('name', formikProps.values, null);\r\n                    if(fixedname !== name) {\r\n                        formikProps.setFieldValue(\"name\", fixedname)\r\n                    }\r\n                }\r\n\r\n                return <>\r\n                    <NipRow\r\n                        formikProps={formikProps}\r\n                        limit={limits.PESEL}\r\n                        defaultValue={PL_PREFIX}\r\n                        prefix={formikProps.values.vatin.prefix}\r\n                        required={collectPostCode}\r\n                        onBlur={checkForExistingVatins ? (e) => onBlurNip(e, formikProps) : undefined}\r\n                    />\r\n                    {!!fixedname && <Typography className={classes.nameExist} color=\"primary\">{Tr('invitation_contractor_exist')}</Typography>}\r\n                    <TextInput\r\n                        id='name'\r\n                        label={Tr('name')}\r\n                        formikProps={formikProps}\r\n                        required\r\n                        limit={limits.NAME}\r\n                        multiline\r\n                        disabled={!!fixedname}\r\n                    />\r\n\r\n                    {collectAddress && <TextInput\r\n                        id='address'\r\n                        label={Tr('address')}\r\n                        formikProps={formikProps}\r\n                        limit={limits.ADDRESS}\r\n                        required={addressRequired}\r\n                    />}\r\n\r\n                    {collectPostCode && <PostCodeRow\r\n                        formikProps={formikProps}\r\n                        limits={limits}\r\n                        defaultValue={PL_PREFIX}\r\n                        required\r\n                        prefix={formikProps.values.vatin.prefix}\r\n                    />}\r\n\r\n                    {collectCity && <TextInput\r\n                        id='city'\r\n                        label={Tr('city')}\r\n                        formikProps={formikProps}\r\n                        limit={limits.CITY}\r\n                        required={cityRequired}\r\n                    />}\r\n\r\n                    {collectRegon && <TextInput\r\n                        id='regon'\r\n                        label={Tr('regon')}\r\n                        formikProps={formikProps}\r\n                    />}\r\n\r\n                    {collectCompanySize &&\r\n                        <Select\r\n                            id='companySize'\r\n                            label={Tr('contractor_company_size')}\r\n                            formikProps={formikProps}\r\n                            items={Object.keys(ContractorCompanySize).map(x=> createSelectItem(x, ContractorCompanySizeLabel(x)))}\r\n                            required\r\n                        />\r\n                    }\r\n\r\n                    <TextInput\r\n                        id='email'\r\n                        label={Tr('email')}\r\n                        formikProps={formikProps}\r\n                        required\r\n                        limit={limits.EMAIL}\r\n                    />\r\n                </>\r\n            }}\r\n        </Form>\r\n    )\r\n}\r\n\r\nInviteContactorForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(memo(InviteContactorForm));","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport InviteContactorForm from './InviteContactorForm';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport ContractorService from 'services/ContractorService';\r\nimport Loading from \"../../Loading\";\r\n\r\nfunction InviteContactor(\r\n    {\r\n        demandId,\r\n        onClose = () => {\r\n        },\r\n        open = false,\r\n        handleInvite = () => {\r\n        },\r\n        collectPostCode = false,\r\n        collectAddress = false,\r\n        addressRequired = true,\r\n        collectCity = false,\r\n        cityRequired = true,\r\n        collectRegon = false,\r\n        collectCompanySize = false,\r\n        collectIdentity = false,\r\n        checkForExistingVatins = true,\r\n        defaultValues = {},\r\n        title,\r\n        formSubmit,\r\n        contractorList,\r\n        submitButtonLabel = 'add'\r\n    }) {\r\n\r\n    const formId = useId();\r\n\r\n    const [loading, setLoading] = useState(true);\r\n\r\n    useEffect(() => {\r\n        ContractorService.getNipList(demandId).then(() => setLoading(false));\r\n        return () => ContractorService.clearResources(ContractorService.NIP_LIST_RESOURCE_ID)\r\n    }, [demandId])\r\n\r\n\r\n    const handleClose = () => {\r\n        onClose();\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        formSubmit[formId]()\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={title}\r\n            open={open}\r\n            fullWidth\r\n            onClose={handleClose}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr(submitButtonLabel)}\r\n                onClickFirst={handleClose}\r\n                onClickSecond={handleSubmit}\r\n            />}\r\n        >\r\n            {loading ? <Loading/> :\r\n                <InviteContactorForm\r\n                    onSubmit={handleInvite}\r\n                    id={formId}\r\n                    contractorList={contractorList}\r\n                    defaultValues={defaultValues}\r\n                    collectPostCode={collectPostCode}\r\n                    collectAddress={collectAddress}\r\n                    addressRequired={addressRequired}\r\n                    collectCity={collectCity}\r\n                    cityRequired={cityRequired}\r\n                    collectRegon={collectRegon}\r\n                    collectCompanySize={collectCompanySize}\r\n                    collectIdentity={collectIdentity}\r\n                    checkForExistingVatins={checkForExistingVatins}\r\n                    demandId={demandId}\r\n                />}\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nInviteContactor.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func,\r\n    open: PropTypes.bool,\r\n    handleInvite: PropTypes.func,\r\n    collectPostCode: PropTypes.bool,\r\n    collectAddress: PropTypes.bool,\r\n    collectCity: PropTypes.bool,\r\n    collectRegon: PropTypes.bool,\r\n    collectCompanySize: PropTypes.bool,\r\n    collectIdentity: PropTypes.bool,\r\n    checkForExistingVatins: PropTypes.bool,\r\n    defaultValues: PropTypes.object,\r\n    title: PropTypes.string,\r\n    contractorList: PropTypes.object,\r\n    submitButtonLabel: PropTypes.string,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(InviteContactor);","import React, {useState} from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {ContractorCompanySizeLabel} from \"constants/ContractorCompanySize\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport Typography from \"components/Typography\";\r\nimport InviteContactor from \"components/popup/inviteContactor/InviteContactor\";\r\nimport Button from \"components/Button\";\r\nimport {useParams} from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        tableLayout: 'fixed',\r\n\r\n        '& td, th': {\r\n            overflow: 'hidden',\r\n        }\r\n    },\r\n    cell: {\r\n        padding: theme.spacing(1)\r\n    },\r\n    emailColumn: theme.components.table.emailColumn,\r\n    commonColumn: theme.components.table.dateColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    addButton: {\r\n        marginTop: theme.spacing(),\r\n        marginBottom: theme.spacing(2),\r\n    }\r\n}));\r\n\r\nfunction ConsorciumTable(\r\n    {\r\n        id,\r\n        formikProps,\r\n        contractor,\r\n        companySize,\r\n        disabled\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const params = useParams();\r\n    const [invitePopup, setInvitePopup] = useState(null);\r\n\r\n    const handleInvite = (formikProps, data) => {\r\n        if (!data.identity) {\r\n            let identity = -1;\r\n            if (Array.isArray(formikProps.values.consorciants) && formikProps.values.consorciants.length > 0) {\r\n                const lastId = formikProps.values.consorciants[formikProps.values.consorciants.length - 1].identity;\r\n                if (lastId < 0) {\r\n                    identity = lastId - 1;\r\n                }\r\n            }\r\n\r\n            formikProps.setFieldValue(\"consorciants\", [...(formikProps.values.consorciants || []), {\r\n                ...data,\r\n                identity: identity,\r\n                supplierId: 0,\r\n                positionId: null,\r\n                status: \"NEW\"\r\n            }])\r\n        } else\r\n            formikProps.setFieldValue(\"consorciants\", formikProps.values.consorciants.map(x => data.identity === x.identity ? {...x, ...data} : x))\r\n        setInvitePopup(null);\r\n    }\r\n\r\n\r\n    const removeContractor = (c) => {\r\n        formikProps.setFieldValue(id, formikProps.values[id].filter(x => x.identity !== c.identity))\r\n    }\r\n\r\n    const error = getObjectValue(id, formikProps.errors, null);\r\n\r\n    return (<>\r\n\r\n            <TableContainer>\r\n                <Table className={clsx(classes.table)}>\r\n                    <TableHead>\r\n                        <TableRow>\r\n                            <TableCell className={clsx(classes.cell)}>{Tr(\"consorciant_name\")}</TableCell>\r\n                            <TableCell className={clsx(classes.cell, classes.emailColumn)}>{Tr(\"address\")}</TableCell>\r\n                            <TableCell className={clsx(classes.cell, classes.commonColumn)}>{Tr(\"nip_pesel\")}</TableCell>\r\n                            <TableCell className={clsx(classes.cell, classes.commonColumn)}>{Tr(\"regon\")}</TableCell>\r\n                            <TableCell className={clsx(classes.cell, classes.commonColumn)}>{Tr(\"contractor_company_size\")}</TableCell>\r\n                            <TableCell className={clsx(classes.cell, classes.emailColumn)}>{Tr(\"email\")}</TableCell>\r\n                            {!disabled && <TableCell className={clsx(classes.cell, classes.buttonColumn)}></TableCell>}\r\n                            {!disabled && <TableCell className={clsx(classes.cell, classes.buttonColumn)}></TableCell>}\r\n                        </TableRow>\r\n                    </TableHead>\r\n                    <TableBody>\r\n                        <TableRow>\r\n                            <TableCell className={classes.cell}>{contractor.name}</TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {contractor.address}<br/>\r\n                                {contractor.postCode} {contractor.city}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {contractor.vatin?.prefix} {contractor.vatin?.number}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {contractor.regon}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {!!companySize && ContractorCompanySizeLabel(companySize)}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {contractor.email}\r\n                            </TableCell>\r\n                            {!disabled && <TableCell className={classes.buttonColumn}>\r\n                                <WorkableIconEditButton disabled/>\r\n                            </TableCell>}\r\n                            {!disabled && <TableCell className={classes.buttonColumn}>\r\n                                <WorkableIconDeleteButton disabled/>\r\n                            </TableCell>}\r\n                        </TableRow>\r\n                        {!!formikProps.values[id] && formikProps.values[id].map(c => (<TableRow key={c.identity}>\r\n                            <TableCell className={classes.cell}>{c.name}</TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {c.address}<br/>\r\n                                {c.postCode} {c.city}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {c.vatin.prefix} {c.vatin.number}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {c.regon}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {!!c.companySize && ContractorCompanySizeLabel(c.companySize)}\r\n                            </TableCell>\r\n                            <TableCell className={classes.cell}>\r\n                                {c.email}\r\n                            </TableCell>\r\n                            {!disabled && <TableCell className={classes.buttonColumn}>\r\n                                <WorkableIconEditButton onClick={() => setInvitePopup(c)}/>\r\n                            </TableCell>}\r\n                            {!disabled && <TableCell className={classes.buttonColumn}>\r\n                                <WorkableIconDeleteButton onClick={() => removeContractor(c)}/>\r\n                            </TableCell>}\r\n                        </TableRow>))\r\n                        }\r\n                    </TableBody>\r\n                </Table>\r\n                {!!error && <Typography className={'MuiFormHelperText-root Mui-error'} color='error'>{error}</Typography>}\r\n            </TableContainer>\r\n            {!disabled && <Button className={classes.addButton}  onClick={() => setInvitePopup({})}>{Tr('add_consorciant')}</Button>}\r\n            {!!invitePopup && <InviteContactor\r\n                demandId={params.id}\r\n                open={true}\r\n                onClose={() => setInvitePopup(null)}\r\n                handleInvite={(data) => handleInvite(formikProps, data)}\r\n                defaultValues={invitePopup}\r\n                checkForExistingVatins={false}\r\n                collectCity\r\n                collectAddress\r\n                collectRegon\r\n                collectCompanySize\r\n                collectPostCode\r\n                collectIdentity\r\n                contractorList={{\r\n                    items: formikProps.values.consorciants ? formikProps.values.consorciants.map(x => ({\r\n                        id: x.identity,\r\n                        contractor: {\r\n                            ...x\r\n                        }\r\n                    })) : []\r\n                }}\r\n                submitButtonLabel={!invitePopup.identity ? 'add' : 'zapisz'}\r\n                title={Tr('consorcium')}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nConsorciumTable.propTypes = {\r\n    id: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired,\r\n    contractor: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default ConsorciumTable\r\n// memo(ConsorciumTable, (prevProps, nextProps) => {\r\n//     if (prevProps.formikProps.values !== nextProps.formikProps.values) return false;\r\n//     if (prevProps.formikProps.errors !== nextProps.formikProps.errors) return false;\r\n//     return true;\r\n// })","import React from 'react'\r\nimport {FormControl, FormHelperText, FormLabel} from '@material-ui/core';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport Tr from 'translations/Translations';\r\nimport ToggleButton from \"@material-ui/lab/ToggleButton\";\r\nimport ToggleButtonGroup from \"@material-ui/lab/ToggleButtonGroup\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    button: {\r\n        width: 150\r\n    },\r\n    toggle: {\r\n        marginTop: theme.spacing()\r\n    }\r\n}))\r\n\r\nfunction YesNo(\r\n    {\r\n        formikProps,\r\n        id,\r\n        label,\r\n        disabled,\r\n        className,\r\n        required,\r\n        noError,\r\n        onChange = () => {\r\n        },\r\n        skipCheckTouched\r\n    }) {\r\n    const classes = useStyle();\r\n    const value = getObjectValue(id, formikProps.values, null)\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    const touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const isError = !noError && (!!errorValue && touched)\r\n\r\n    const helperText = (isError && errorValue) || ' ';\r\n\r\n    let _label = label;\r\n    if (required) _label += '*';\r\n\r\n    return <div data-id={id}>\r\n        <FormControl\r\n            disabled={!editable}\r\n            error={isError}\r\n            className={className}>\r\n            <FormLabel>{_label}</FormLabel>\r\n            <ToggleButtonGroup className={classes.toggle} size=\"small\" value={value} exclusive onChange={(event, newProcedure) => {\r\n                formikProps.setFieldValue(id, newProcedure)\r\n                onChange(newProcedure)\r\n            }}>\r\n                <ToggleButton classes={{root: classes.button}} value={true} disabled={!editable || disabled}>\r\n                    {Tr('yes')}\r\n                </ToggleButton>\r\n                <ToggleButton classes={{root: classes.button}} value={false} disabled={!editable || disabled}>\r\n                    {Tr('no')}\r\n                </ToggleButton>\r\n            </ToggleButtonGroup>\r\n            <FormHelperText className={classes.error}>{helperText}</FormHelperText>\r\n        </FormControl>\r\n    </div>\r\n\r\n}\r\n\r\nexport default YesNo\r\n","import React from \"react\"\r\nimport Tr from \"translations/Translations\";\r\nimport GeneralInfoEntry from \"../../panels/generalInfo/components/GeneralInfoEntry\";\r\nimport {ContractorConsorciumTypes, ContractorConsorciumTypesLabel} from \"constants/ContractorConsorciumTypes\";\r\nimport ConsorciumTable from \"../commonData/ConsorciumTable\";\r\nimport YesNo from \"components/YesNo\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyle = makeStyles(theme=> ({\r\n    marginTop: {\r\n        marginTop: theme.spacing()\r\n    }\r\n}))\r\n\r\nfunction OfferPositionConsorciants(\r\n    {\r\n        formikProps,\r\n        disabled,\r\n        offerEdit\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (offerEdit.commonData.consorciumType !== ContractorConsorciumTypes.POSITION) {\r\n            formikProps.setFieldValue(\"consorciumOnPosition\", false);\r\n            formikProps.setFieldValue(\"consorciants\", null);\r\n        }\r\n    }, [offerEdit.commonData.consorciumType])\r\n\r\n    const consorciumEnabled = !!getObjectValue(\"consorciumOnPosition\", formikProps.values, false);\r\n    return (\r\n        <GeneralInfoEntry biggerLabel label={`${Tr('consorcium')}: ${ContractorConsorciumTypesLabel(offerEdit.commonData.consorciumType)}`}\r\n                          collapsible={offerEdit.commonData.consorciumType === ContractorConsorciumTypes.POSITION} defaultCollapsed={false}>\r\n            {\r\n                offerEdit.commonData.consorciumType === ContractorConsorciumTypes.POSITION && <>\r\n                    <YesNo\r\n                        label={Tr('consorciant_position_label')}\r\n                        id='consorciumOnPosition'\r\n                        formikProps={formikProps}\r\n                        disabled={disabled}\r\n                        className={classes.marginTop}\r\n                    />\r\n\r\n                    {consorciumEnabled &&\r\n                        <ConsorciumTable\r\n                            id=\"consorciants\"\r\n                            formikProps={formikProps}\r\n                            contractor={offerEdit.contractor}\r\n                            companySize={offerEdit.commonData.companySize}\r\n                            disabled={disabled}\r\n                        />\r\n                    }\r\n                </>\r\n            }\r\n        </GeneralInfoEntry>)\r\n\r\n}\r\n\r\nOfferPositionConsorciants.propTypes = {\r\n\r\n}\r\n\r\nexport default OfferPositionConsorciants;","export const APIOfferPlacingType = {\r\n    UPDATE: \"UPDATE\",\r\n    CORRECTION: \"CORRECTION\"\r\n}","import React, {useContext, useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations'\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport Loading from \"components/Loading\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport moment from \"moment/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport {getUserFullNameWithEmailAndDeputy} from \"libs/userNameGetter\";\r\nimport WorkableIconDownloadButton from \"components/button/WorkableIconDownloadButton\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport {Typography} from \"@material-ui/core\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: {\r\n        width: 200\r\n    },\r\n    dateColumn: theme.components.table.dateTimeColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n}))\r\n\r\nexport const getConfig = (demandId, stageId, supplierId, roundType, positionId) => ({demandId, stageId, supplierId, roundType, positionId})\r\n\r\nfunction SnapshotListPopup(\r\n    {\r\n        onClose,\r\n        config\r\n    }) {\r\n    const classes = useStyle();\r\n    const [snapshotList, setSnapshotList] = useState(null);\r\n    const [workingId, setWorkingId] = useState(null);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n\r\n    useEffect(() => {\r\n        let promise;\r\n        switch (config.roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.getSnapshots(config.demandId, config.stageId, config.supplierId);\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.getSnapshots(config.demandId, config.stageId, config.positionId, config.supplierId);\r\n                break;\r\n            case RoundType.AUCTION:\r\n                promise = DemandOffersAuctionService.getSnapshots(config.demandId, config.stageId, config.positionId, config.supplierId);\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + config.roundType);\r\n        }\r\n        promise.then((resp) => {\r\n            if (resp)\r\n                setSnapshotList(resp);\r\n            else\r\n                onClose();\r\n        })\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    const downloadSnapshot = (snapshotId) => {\r\n        setWorkingId(snapshotId);\r\n\r\n        let promise;\r\n        switch (config.roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.downloadSnapshot(config.demandId, config.stageId, snapshotId, config.supplierId)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.downloadSnapshot(config.demandId, config.stageId, config.positionId, snapshotId, config.supplierId);\r\n                break;\r\n            case RoundType.AUCTION:\r\n                promise = DemandOffersAuctionService.downloadSnapshot(config.demandId, config.stageId, config.positionId, snapshotId, config.supplierId);\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + config.roundType);\r\n        }\r\n        promise.finally(() => setWorkingId(null))\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('change_history')}\r\n            titleCentered\r\n            maxWidth='lg'\r\n            onClose={onClose}\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={Tr('close')}\r\n                onClick={onClose}/>}\r\n        >\r\n            {\r\n                !snapshotList ? <Loading/> : <GridBlock\r\n                    column\r\n                    alignItems='center'\r\n                >\r\n                    <SimpleTable\r\n                        headers={\r\n                            [\r\n                                Tr('date'),\r\n                                Tr('author'),\r\n                                Tr('signature'),\r\n                                Tr('offer_status'),\r\n                                ''\r\n                            ]\r\n                        }\r\n                        items={\r\n                            snapshotList.map((elem, i, arr) => ([\r\n                                <>\r\n                                    {moment(elem.offerSubmitDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                                    {elem.offerPlacedInTime && <Typography variant=\"body2\">({stageTr(\"offer_placed_in_time\")})</Typography>}\r\n                                </>,\r\n                                getUserFullNameWithEmailAndDeputy(elem.author),\r\n                                <>\r\n                                    {elem.digitalSignature ? Tr('yes') : Tr('no')}\r\n                                    {!!elem.digitalSignatureDate && <Typography\r\n                                        variant=\"body2\">({moment(elem.digitalSignatureDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)})</Typography>}\r\n                                </>,\r\n                                elem.offerStatus,\r\n                                !elem.empty && <WorkableIconDownloadButton onClick={() => downloadSnapshot(elem.identity)} disabled={!!workingId}\r\n                                                            working={workingId === elem.identity}/>\r\n                            ]))\r\n                        }\r\n                        columnClasses={[\r\n                            classes.lpColumn,\r\n                            undefined,\r\n                            classes.lpColumn,\r\n                            classes.dateColumn,\r\n                            classes.buttonColumn\r\n                        ]}\r\n                    />\r\n\r\n                    {snapshotList.length === 0 && <Typography>{Tr('empty_history')}</Typography>}\r\n\r\n                </GridBlock>\r\n            }\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSnapshotListPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    config: PropTypes.shape({\r\n        demandId: PropTypes.string.isRequired,\r\n        stageId: PropTypes.string.isRequired,\r\n        supplierId: PropTypes.number,\r\n        roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n        positionId: PropTypes.number,\r\n    })\r\n}\r\n\r\nexport default SnapshotListPopup;\r\n","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations'\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport Form from \"components/Form\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport useId from \"hooks/useId\";\r\nimport * as Yup from \"yup\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport {connect} from \"react-redux\";\r\nimport Typography from \"components/Typography\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment from \"libs/moment\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport TextField from \"@material-ui/core/TextField/TextField\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    verificationDate: {\r\n        marginLeft: theme.spacing(2),\r\n        fontStyle: \"italic\"\r\n    },\r\n    search: {\r\n        width: '90%'\r\n    },\r\n}))\r\n\r\nexport const getVerificationConfig = (demandId, stageId, supplierId, roundType, positionId) => ({demandId, stageId, supplierId, roundType, positionId})\r\n\r\nfunction VerificationsPopup(\r\n    {\r\n        onClose,\r\n        config,\r\n        formSubmit\r\n    }) {\r\n    const classes = useStyle();\r\n    const [verificationsList, setVerificationsList] = useState(null);\r\n    const [verificationsListFiltered, setVerificationsListFiltered] = useState(null);\r\n    const formId = useId();\r\n    const [working, setWorking] = useState(false);\r\n    const [searchText, setSearchText] = useState(\"\");\r\n\r\n    const fillFilteredList = (verificationsList) => {\r\n        if (!searchText || searchText === \"\") {\r\n            if (verificationsList !== verificationsListFiltered) {\r\n                setVerificationsListFiltered(verificationsList);\r\n            }\r\n        } else {\r\n            const reg = new RegExp(searchText.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), \"i\");\r\n            setVerificationsListFiltered(verificationsList.filter(pos => pos.search.search(reg) > -1));\r\n        }\r\n    }\r\n\r\n    const getVerifications = () => {\r\n        let promise;\r\n        switch (config.roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.getVerifications(config.demandId, config.stageId, config.supplierId);\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.getVerifications(config.demandId, config.stageId, config.positionId, config.supplierId);\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + config.roundType);\r\n        }\r\n        promise.then((resp) => {\r\n            if (resp) {\r\n                const respMapped = resp.map((x, i) => ({\r\n                    ...x,\r\n                    identity: \"_\" + i,\r\n                    name: <>{x.positionName}\r\n                        {x.verificationDate && <Typography component=\"span\" variant=\"body2\" className={classes.verificationDate}>\r\n                            {Tr(\"verification_date\")}: {moment(x.verificationDate).format(DateFormats.DATETIME_FORMAT)}\r\n                        </Typography>}\r\n                    </>,\r\n                    search: x.positionName,\r\n                }))\r\n                setVerificationsList(respMapped);\r\n                fillFilteredList(respMapped);\r\n            } else\r\n                onClose();\r\n        }).finally(() => setWorking(false))\r\n    }\r\n    useEffect(() => {\r\n        getVerifications();\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    useDebouncedEffect(() => {\r\n        fillFilteredList(verificationsList);\r\n    }, {timeout: 800, ignoreInitialCall: true}, [searchText])\r\n\r\n    const downloadVerifications = (positionIds) => {\r\n        setWorking(true);\r\n\r\n        let promise;\r\n        switch (config.roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.downloadVerifications(config.demandId, config.stageId, config.supplierId, positionIds)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.downloadVerifications(config.demandId, config.stageId, config.positionId, config.supplierId, positionIds);\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + config.roundType);\r\n        }\r\n        promise.finally(() => {\r\n            getVerifications();\r\n        })\r\n    }\r\n\r\n    const onSubmit = (values) => {\r\n        let posIds = verificationsList.filter(x => values.list[x.identity]).map(x => x.positionId)\r\n        downloadVerifications(posIds)\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={<TextField className={classes.search} value={searchText} onChange={(e) => setSearchText(e.target.value)} label={Tr('search2')}/>}\r\n            maxWidth='lg'\r\n            onClose={onClose}\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify=\"flex-end\"\r\n                    labelFirst={Tr('close')}\r\n                    onClickFirst={onClose}\r\n                    labelSecond={Tr(\"verify_documents\")}\r\n                    onClickSecond={() => formSubmit[formId]()}\r\n                    disabledSecond={working}\r\n                    workingSecond={working}\r\n                />\r\n            }\r\n        >\r\n            {\r\n                !verificationsListFiltered ? <Loading/> : <GridBlock\r\n                    column\r\n                >\r\n                    <Form\r\n                        initialValues={{\r\n                            list: verificationsList.reduce((prev, cur) => {\r\n                                prev[cur.positionId] = false;\r\n                                return prev;\r\n                            }, {})\r\n                        }}\r\n                        validationSchema={Yup.object().shape({\r\n                            list: VS.any().test('partSelected', Tr('choose_at_least_one'), (e) => {\r\n                                const selIndex = Object.keys(e).findIndex(x => e[x] === true);\r\n                                return selIndex > -1;\r\n                            })\r\n                        })}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <GridBlock\r\n                                column\r\n                            >\r\n                                <PartsTable\r\n                                    label={Tr(\"documents_verification\")}\r\n                                    required={false}\r\n                                    id='list'\r\n                                    formikProps={formikProps}\r\n                                    elementList={verificationsListFiltered}\r\n                                    disabled={working}\r\n                                />\r\n                                {\r\n                                    !(verificationsListFiltered.length) &&\r\n                                    <BoldTypography variant='body1'>\r\n                                        {\r\n                                            Tr('no_options')\r\n                                        }\r\n                                    </BoldTypography>\r\n                                }\r\n                            </GridBlock>\r\n                        )}\r\n                    </Form>\r\n\r\n                </GridBlock>\r\n            }\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nVerificationsPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    config: PropTypes.shape({\r\n        demandId: PropTypes.string.isRequired,\r\n        stageId: PropTypes.string.isRequired,\r\n        supplierId: PropTypes.number,\r\n        roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n        positionId: PropTypes.number,\r\n    })\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(VerificationsPopup);\r\n","import reduxStore from 'redux/store'\r\nimport {setSalesNotification} from \"../redux/actions\";\r\n\r\nfunction useSalesNotification(functionality, successCallback) {\r\n    return () => {\r\n        const state = reduxStore.getState();\r\n        if (state.resources?.demandHeader?.applicationClientSettings?.[functionality]) {\r\n            if (state.resources.demandHeader.applicationClientSettings[functionality].active) {\r\n                successCallback();\r\n            } else {\r\n                reduxStore.dispatch(setSalesNotification(state.resources.demandHeader.applicationClientSettings[functionality].functionalityName));\r\n            }\r\n        } else {\r\n            console.error(`state.resources.demandHeader.applicationClientSettings.${functionality} not found`)\r\n        }\r\n    }\r\n}\r\n\r\nexport default useSalesNotification;","const values = {\r\n    PAPERS_GENERATOR: 'papersGenerator',\r\n    SIGNATURE_VERIFICATOR: 'signatureVerificator'\r\n}\r\n\r\nexport default values;","import React, {useContext, useEffect, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport {useParams} from \"react-router\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport Loading from \"components/Loading\";\r\nimport Form from \"components/Form\";\r\nimport {offerValidation} from \"../constants/validation.form\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport OfferPositionConditions from \"../../../../../common/positions/OfferPositionConditions\";\r\nimport OfferPositionCriteriums from \"../../../../../common/positions/OfferPositionCriteriums\";\r\nimport OfferPositionItems from \"../../../../../common/positions/OfferPositionItems\";\r\nimport OfferPositionParameters from \"../../../../../common/positions/OfferPositionParameters\";\r\nimport OfferPositionConsorciants from \"../../../../../common/positions/OfferPositionConsorciants\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport {ContractorConsorciumTypes} from \"constants/ContractorConsorciumTypes\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport {APIOfferPlacingType} from \"../constants/APIOfferPlacingType\";\r\nimport EditIcon from '@material-ui/icons/Edit';\r\nimport SpellcheckIcon from '@material-ui/icons/Spellcheck';\r\nimport {OfferMode} from \"../../../../../common/constants/OfferMode\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport SnapshotListPopup, {getConfig} from \"../../SnapshotListPopup\";\r\nimport HistoryIcon from \"@material-ui/icons/History\";\r\nimport VerificationsPopup, {getVerificationConfig} from \"../../VerificationsPopup\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport useSalesNotification from \"hooks/useSalesNotification\";\r\nimport salesNotificationKeys from \"components/popup/salesNotification/constants/salesNotification.keys\";\r\nimport VatType from \"constants/VatType\";\r\nimport {PriceTypeGrossFieldVisible, PriceTypeNetFieldVisible, PriceTypeVatFieldVisible} from \"constants/PriceTypes\";\r\nimport {calcNetGros} from \"../../../../../common/positions/inputs/OfferPriceInput\";\r\n\r\nfunction OfferPositionForm(\r\n    {\r\n        position,\r\n        loadedPosition,\r\n        expanded,\r\n        setExpanded,\r\n        working,\r\n        setWorking,\r\n        disabled,\r\n        formId,\r\n        mode,\r\n        roundType,\r\n        offerEdit\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const [loadedPositionCounted, setLoadedPositionCounted] = useState(null);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const [chooseSnapshotPopup, setChooseSnapshotPopup] = useState(null);\r\n    const [verifyPopup, setVerifyPopup] = useState(null);\r\n\r\n    const getOfferPosition = () => {\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                DemandOffersOfferService.getOfferPosition(demandId, stageId, mode, position.positionId, purchaserOfferContext?.supplierId, purchaserOfferContext?.preview);\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                DemandAdditionalOffersOfferService.getOfferPosition(demandId, stageId, mode, position.positionId, purchaserOfferContext?.supplierId);\r\n                break;\r\n            case RoundType.AUCTION:\r\n                DemandOffersAuctionService.getOfferPosition(demandId, stageId, mode, position.positionId, purchaserOfferContext?.supplierId);\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (expanded && !loadedPosition) {\r\n            getOfferPosition();\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [expanded, loadedPosition, position, demandId, stageId, mode, roundType, purchaserOfferContext])\r\n\r\n    const handleSubmit = (values, actions) => {\r\n        setWorking(true);\r\n        let promise;\r\n        switch (roundType) {\r\n            case RoundType.BASE:\r\n                promise = DemandOffersOfferService.postSavePositionData(demandId, stageId, purchaserOfferContext?.supplierId, mode, values)\r\n                break;\r\n            case RoundType.ADDITIONAL_OFFERS:\r\n                promise = DemandAdditionalOffersOfferService.postSavePositionData(demandId, stageId, purchaserOfferContext?.supplierId, mode, values)\r\n                break;\r\n            case RoundType.AUCTION:\r\n                promise = DemandOffersAuctionService.postSavePositionData(demandId, stageId, purchaserOfferContext?.supplierId, mode, values)\r\n                break;\r\n            default:\r\n                throw new Error(\"Unknown roundType: \" + roundType)\r\n        }\r\n\r\n        promise.then((errors) => {\r\n            if (errors) {\r\n                Object.keys(errors).forEach((key) => {\r\n                    actions.setFieldError(key.replaceAll(\"[\", \".\").replaceAll(\"]\", \"\"), errors[key]);\r\n                })\r\n                setTimeout((formId) => scrollTo(\"#\" + formId + \" .MuiFormHelperText-root.Mui-error\", 200), 100, formId);\r\n            } else {\r\n                setLoadedPositionCounted(null)\r\n                getOfferPosition();\r\n                setExpanded(false);\r\n                setTimeout((formId) => scrollTo(\"#wrap_\" + formId, 0), 100, formId);\r\n            }\r\n        }).finally(() => setWorking(false))\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (!!loadedPosition) {\r\n\r\n            const show = {\r\n                netField: PriceTypeNetFieldVisible(loadedPosition.priceType),\r\n                grossField: PriceTypeGrossFieldVisible(loadedPosition.priceType),\r\n                vatField: PriceTypeVatFieldVisible(loadedPosition.priceType),\r\n            }\r\n\r\n\r\n\r\n\r\n            const counted = {\r\n                ...loadedPosition,\r\n                consorciumOnPosition: !!loadedPosition.consorciumOnPosition,\r\n                itemOffers: loadedPosition.itemOffers.map((x, i) => {\r\n                    const values = {\r\n                        netValue: show.netField ? x.value : null,\r\n                        grossValue: show.grossField ? x.grossValue : null,\r\n                        vatType: show.vatField ? x.vatType : null,\r\n                        vatValue: show.vatField ? x.vatValue : null\r\n                    }\r\n                    const [roundedNet, roundedGross] = calcNetGros(values, !!x.quantity ? x.quantity : x.criterium.quantity, loadedPosition.priceType);\r\n\r\n                    return {\r\n                        ...x,\r\n                        vatType: x.vatType === VatType.STANDARD && x.vatValue === null ? null : x.vatType,\r\n                        totalNet: roundedNet,\r\n                        totalGross: roundedGross\r\n                    }\r\n                }),\r\n                criteriums: loadedPosition.criteriums.map(x => ({\r\n                    ...x,\r\n                    vatType: x.vatType === VatType.STANDARD && x.vatValue === null ? null : x.vatType\r\n                }))\r\n            }\r\n            setLoadedPositionCounted(counted);\r\n        }\r\n    }, [loadedPosition])\r\n    const printVerificationSalesCheck = useSalesNotification(salesNotificationKeys.SIGNATURE_VERIFICATOR, () => setVerifyPopup(getVerificationConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.ADDITIONAL_OFFERS, position.positionId)));\r\n    const getButtons = (formikProps) => {\r\n        const buttons = [];\r\n        if (!!purchaserOfferContext && mode === OfferMode.PLACED && !offerEdit.passiveOfferForm && !!loadedPosition && !loadedPosition.disabled) {\r\n            buttons.push(createButton(Tr('operator.modify.correct'), () => formikProps.setFieldValue(\"placingType\", APIOfferPlacingType.CORRECTION, false),\r\n                undefined, working || disabled || !!formikProps.values.placingType, undefined, false, SpellcheckIcon));\r\n            buttons.push(createButton(Tr('operator.modify.update'), () => formikProps.setFieldValue(\"placingType\", APIOfferPlacingType.UPDATE, false),\r\n                undefined, working || disabled || !!formikProps.values.placingType, undefined, false, EditIcon));\r\n        }\r\n\r\n        if (!contextSection.additionalOfferAltMode) {\r\n            if (!!purchaserOfferContext && mode === OfferMode.PLACED && roundType !== RoundType.BASE) {\r\n                buttons.push(createButton(Tr(\"verify_documents\"), printVerificationSalesCheck, undefined, false, undefined, false, SignatureIcon));\r\n            }\r\n            if (roundType !== RoundType.BASE) {\r\n                buttons.push(createButton(Tr(\"change_history\"), () => setChooseSnapshotPopup(getConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.ADDITIONAL_OFFERS, position.positionId)),\r\n                    \"outlined\", false, undefined, false, HistoryIcon));\r\n            }\r\n\r\n        }\r\n        return buttons;\r\n    }\r\n\r\n    return (<>\r\n        {\r\n            !loadedPositionCounted ?\r\n                <Loading/>\r\n                :\r\n                <Form\r\n                    id={formId}\r\n                    htmlFormId={formId}\r\n                    initialValues={loadedPositionCounted}\r\n                    validationSchema={offerValidation}\r\n                    validateOnChange={false}\r\n                    onSubmit={handleSubmit}\r\n                    onReset={() => setExpanded(false)}\r\n                >\r\n                    {(formikProps) => {\r\n                        const formDisabled = working || disabled || !loadedPositionCounted || loadedPositionCounted.disabled ||\r\n                            (purchaserOfferContext && !formikProps.values.placingType && mode === OfferMode.PLACED)\r\n\r\n\r\n                        return (<>\r\n\r\n                                <MultiButton justify=\"flex-end\" buttons={getButtons(formikProps)}/>\r\n\r\n                                {!offerEdit.passiveOfferForm && <>\r\n                                    <SaveFormikValues\r\n                                        formikProps={formikProps}\r\n                                        id={formId}\r\n                                    />\r\n                                    {offerEdit.commonData.consorciumType === ContractorConsorciumTypes.POSITION &&\r\n                                        <OfferPositionConsorciants\r\n                                            disabled={formDisabled || roundType !== RoundType.BASE || loadedPositionCounted.hadStageWithOffer}\r\n                                            formikProps={formikProps} offerEdit={offerEdit}/>\r\n                                    }\r\n\r\n                                    <OfferPositionConditions disabled={formDisabled} conditions={loadedPositionCounted.conditions}\r\n                                                             formikProps={formikProps} priceType={loadedPositionCounted.priceType}/>\r\n                                    <OfferPositionCriteriums disabled={formDisabled} criteriums={loadedPositionCounted.criteriums}\r\n                                                             formikProps={formikProps} priceType={loadedPositionCounted.priceType}/>\r\n                                    <OfferPositionItems disabled={formDisabled} itemOffers={loadedPositionCounted.itemOffers}\r\n                                                        formikProps={formikProps} priceType={loadedPositionCounted.priceType} mode={mode}/>\r\n                                    <OfferPositionParameters disabled={formDisabled} parameters={loadedPositionCounted.parameters}\r\n                                                             formikProps={formikProps} priceType={loadedPositionCounted.priceType}/>\r\n                                </>}\r\n                                {\r\n                                    !!chooseSnapshotPopup && <SnapshotListPopup\r\n                                        onClose={() => setChooseSnapshotPopup(null)}\r\n                                        config={chooseSnapshotPopup}\r\n                                    />\r\n                                }\r\n                                {\r\n                                    !!verifyPopup && <VerificationsPopup\r\n                                        onClose={() => setVerifyPopup(null)}\r\n                                        config={verifyPopup}\r\n                                    />\r\n                                }\r\n                            </>\r\n                        )\r\n                    }\r\n                    }\r\n                </Form>\r\n        }\r\n\r\n    </>)\r\n\r\n\r\n}\r\n\r\nOfferPositionForm.propTypes = {\r\n    position: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        positionId: PropTypes.number.isRequired\r\n    }),\r\n    expanded: PropTypes.bool.isRequired,\r\n    setExpanded: PropTypes.func.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    setWorking: PropTypes.func.isRequired,\r\n    formId: PropTypes.string.isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n    offerEdit: PropTypes.shape({\r\n        contractor: PropTypes.shape({}),\r\n        commonData: PropTypes.shape({\r\n            consorciumType: PropTypes.oneOf(Object.keys(ContractorConsorciumTypes)).isRequired\r\n        }).isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default OfferPositionForm;","import React, {useContext, useRef, useState} from 'react'\r\nimport {makeStyles, Tooltip, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ExpansionPanel from 'components/ExpansionPanel';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowUp'\r\nimport clsx from 'clsx';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport OfferPositionForm from \"./components/OfferPositionForm\";\r\nimport {connect} from \"react-redux\";\r\nimport Button from \"components/Button\";\r\nimport {OfferPositionStatusToAvatar} from \"../../../../common/constants/OfferPositionStatusType\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {useParams} from \"react-router\";\r\nimport PrintIcon from '@material-ui/icons/Print';\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        // backgroundColor: theme.palette.background.default,\r\n        marginBottom: theme.spacing(),\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n        '&.MuiAccordion-rounded:first-child .MuiAccordionSummary-root': {\r\n            borderRadius: theme.spacing(1.5, 1.5, 0, 0)\r\n        },\r\n        '&.MuiAccordion-rounded:last-child ': {\r\n            marginBottom: 0,\r\n        },\r\n        '&.MuiAccordion-rounded:last-child .MuiAccordionSummary-root': {\r\n            borderRadius: theme.spacing(0, 0, 1.5, 1.5)\r\n        },\r\n        '&.MuiAccordion-rounded:only-child .MuiAccordionSummary-root': {\r\n            borderRadius: theme.spacing(1.5)\r\n        }\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    rootGrid: {\r\n        '&>*:last-child': {\r\n            flexGrow: 1,\r\n        }\r\n    },\r\n    adornmentGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(2)\r\n        }\r\n    },\r\n    title: {\r\n        top: 105,\r\n        zIndex: theme.zIndex.appBar - 2,\r\n        position: \"sticky\",\r\n        background: theme.palette.background.default,\r\n    },\r\n    titleGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 10000,\r\n        }\r\n    },\r\n    discardButton: {\r\n        marginRight: theme.spacing(2),\r\n        whiteSpace: \"nowrap\"\r\n\r\n    }\r\n}))\r\n\r\nfunction OfferMultiPositions(\r\n    {\r\n        position,\r\n        positionsLoaded,\r\n        mode,\r\n        disabled,\r\n        formValues,\r\n        formSubmit,\r\n        roundType,\r\n        offerEdit,\r\n        hide,\r\n    }) {\r\n    const classes = useStyle();\r\n    const panelRef = useRef();\r\n    const FORM_ID = \"offerPositionForm_\" + position.positionId\r\n    const [expanded, setExpanded] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const params = useParams();\r\n\r\n    const handleClick = position => {\r\n        setExpanded(x => !x)\r\n    }\r\n\r\n    const printOfferPosition = () => {\r\n        DemandOffersOfferService.printOfferPosition(params.id, params.stageId, mode, position.positionId, purchaserOfferContext?.supplierId, purchaserOfferContext?.preview)\r\n    }\r\n\r\n    const createTitle = (variant, label, position) => {\r\n        return (<div>\r\n\r\n                <GridBlock alignItems=\"center\" justify=\"space-between\" className={classes.rootGrid}>\r\n                    <GridBlock alignItems=\"center\" wrap=\"nowrap\">\r\n                        <ExpansionPanelTitleAvatar variant={variant} title={position.statusTranslated}/>\r\n                        <Typography variant='h6'>\r\n                            {label}\r\n                        </Typography>\r\n                    </GridBlock>\r\n\r\n                    <GridBlock\r\n                        wrap='nowrap'\r\n                        className={classes.adornmentGrid}\r\n                        alignItems='center'\r\n                        justify=\"flex-end\"\r\n                    >\r\n                        {!disabled && !offerEdit.passiveOfferForm && <GridBlock justify=\"flex-end\">\r\n                            {\r\n                                purchaserOfferContext?.preview && <WorkableButton\r\n                                    className={classes.discardButton}\r\n                                    onClick={(e) => {\r\n                                        e.stopPropagation();\r\n                                        printOfferPosition();\r\n                                    }} Icon={PrintIcon} working={working}>{Tr('download_print')}</WorkableButton>\r\n                            }\r\n\r\n\r\n                            {formValues[FORM_ID + \"_dirty\"] &&\r\n                                <Button className={classes.discardButton} variant=\"outlined\" onClick={(e) => {\r\n                                    e.stopPropagation();\r\n                                    simpleConfirm(\"discard_changes_confirm\", formSubmit[FORM_ID + \"_reset\"]);\r\n                                }} disabled={working || !expanded}>{Tr('discard_changes')}</Button>}\r\n\r\n                            <WorkableButton\r\n                                onClick={(e) => {\r\n                                    e.stopPropagation();\r\n                                    formSubmit[FORM_ID]()\r\n\r\n                                    setTimeout((formId) => scrollTo(\"#\" + formId + \" .MuiFormHelperText-root.Mui-error\", 200), 100, FORM_ID);\r\n                                }} disabled={working || !expanded || (!formValues[FORM_ID + \"_dirty\"] && positionsLoaded[DemandOffersOfferService.getLoadedPositionKey(position.positionId)]?.status !== 'PLACED_OUT_OF_DATE') || supportMode || purchaserOfferContext?.preview}\r\n                                working={working}>{Tr('save')}</WorkableButton>\r\n\r\n\r\n                        </GridBlock>}\r\n\r\n                        <Tooltip title={expanded ? Tr('collapse') : Tr('expand')} placement='top'>\r\n                            <ArrowIcon\r\n                                className={clsx({\r\n                                    [classes.rotate]: !expanded\r\n                                })}\r\n                            />\r\n                        </Tooltip>\r\n                    </GridBlock>\r\n                </GridBlock>\r\n                {(!!position.endDate || !!position.offerTmpDate || !!position.offerDate) &&\r\n                    <GridBlock justify=\"space-between\">\r\n                        {!!position.endDate && <Typography>\r\n                            {Tr(RoundType.AUCTION === roundType ? 'additional_round_end_date_auction' : 'additional_round_end_date')}: {moment(position.endDate).format(DateFormats.DATETIME_FORMAT)}\r\n                        </Typography>\r\n                        }\r\n                        {(mode === OfferMode.EDIT) && !!position.offerTmpDate && <Typography>\r\n                            {Tr('offer_tmp_date_additional')}: {moment(position.offerTmpDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                        </Typography>\r\n                        }\r\n                        {(mode === OfferMode.PLACED) && !!position.offerDate && <Typography>\r\n                            {Tr(RoundType.AUCTION === roundType ? 'offer_date_additional_auction' : 'offer_date_additional')}: {moment(position.offerDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                        </Typography>\r\n                        }\r\n                    </GridBlock>\r\n                }\r\n\r\n            </div>\r\n        )\r\n    }\r\n\r\n\r\n    const variant = OfferPositionStatusToAvatar(position.status, mode);\r\n    const _label = position.name;\r\n    return (\r\n        <ExpansionPanel\r\n            id={`wrap_${FORM_ID}`}\r\n            hide={hide}\r\n            classesObj={classes}\r\n            panelRef={panelRef}\r\n            disabled={variant === 'Wait'}\r\n            title={createTitle(variant, _label, position)}\r\n            expanded={expanded}\r\n            onChange={() => handleClick(position)}\r\n        >\r\n            <OfferPositionForm\r\n                working={working}\r\n                setWorking={setWorking}\r\n                expanded={expanded}\r\n                setExpanded={setExpanded}\r\n                position={position}\r\n                loadedPosition={positionsLoaded[DemandOffersOfferService.getLoadedPositionKey(position.positionId)]}\r\n                formId={FORM_ID}\r\n                mode={mode}\r\n                disabled={disabled}\r\n                roundType={roundType}\r\n                offerEdit={offerEdit}\r\n            />\r\n        </ExpansionPanel>\r\n\r\n    )\r\n\r\n}\r\n\r\nOfferMultiPositions.propTypes = {\r\n    position: PropTypes.any,\r\n    positionsLoaded: PropTypes.object.isRequired,\r\n    mode: PropTypes.oneOf(Object.keys(OfferMode)).isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formValues: state.formValues,\r\n    formSubmit: state.form,\r\n}), {})(OfferMultiPositions);","import React, {useContext, useState} from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport OfferPositionForm from \"./components/OfferPositionForm\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport {connect} from \"react-redux\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    title: {\r\n        top: 105,\r\n        zIndex: theme.zIndex.appBar - 2,\r\n        position: \"sticky\",\r\n        background: theme.palette.background.default,\r\n        borderRadius: theme.spacing(1.5, 1.5, 0, 0),\r\n        padding: theme.spacing(2, 0, 2, 0),\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n        borderBottom: \"none\"\r\n    },\r\n    content: {\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n        padding: theme.spacing(2),\r\n        borderTop: \"none\",\r\n        marginTop: 0,\r\n        borderRadius: theme.spacing(0, 0, 1.5, 1.5),\r\n    }\r\n}))\r\n\r\nfunction OfferSinglePosition(\r\n    {\r\n        position,\r\n        positionsLoaded,\r\n        mode,\r\n        formValues,\r\n        formSubmit,\r\n        disabled,\r\n        roundType,\r\n        offerEdit,\r\n    }) {\r\n    const classes = useStyle();\r\n    const FORM_ID = \"offerPositionForm_\" + position.positionId\r\n    const [working, setWorking] = useState(false);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (formValues[FORM_ID + \"_dirty\"]) {\r\n            buttons.push(createButton(Tr('discard_changes'), () => simpleConfirm(\"discard_changes_confirm\", formSubmit[FORM_ID + \"_reset\"]), \"outlined\", working))\r\n        }\r\n        if (!offerEdit.disabled) {\r\n            buttons.push(createButton(Tr('save'), (e) => {\r\n                e.stopPropagation();\r\n                formSubmit[FORM_ID]()\r\n\r\n                setTimeout((formId) => scrollTo(\"#\" + formId + \" .MuiFormHelperText-root.Mui-error\", 210), 100, FORM_ID);\r\n            }, undefined, working || (!formValues[FORM_ID + \"_dirty\"] && positionsLoaded[DemandOffersOfferService.getLoadedPositionKey(position.positionId)]?.status !== 'PLACED_OUT_OF_DATE') || supportMode || purchaserOfferContext?.preview, undefined, working))\r\n        }\r\n        return buttons;\r\n    }\r\n\r\n    return (<>\r\n        <MultiButton className={classes.title} buttons={getButtons()}/>\r\n        <div className={classes.content}>\r\n            <OfferPositionForm\r\n                expanded\r\n                setExpanded={() => false}\r\n                working={working}\r\n                setWorking={setWorking}\r\n                position={position}\r\n                loadedPosition={positionsLoaded[DemandOffersOfferService.getLoadedPositionKey(position.positionId)]}\r\n                formId={FORM_ID}\r\n                mode={mode}\r\n                roundType={roundType}\r\n                offerEdit={offerEdit}\r\n                disabled={disabled}\r\n            />\r\n        </div>\r\n    </>)\r\n\r\n}\r\n\r\nOfferSinglePosition.propTypes = {\r\n    positionsLoaded: PropTypes.object.isRequired,\r\n    mode: PropTypes.oneOf(Object.keys(OfferMode)).isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formValues: state.formValues,\r\n    formSubmit: state.form,\r\n}), {})(OfferSinglePosition);","import React, {useContext, useEffect, useRef, useState} from 'react'\r\nimport OfferMultiPositions from \"./OfferMultiPositions\";\r\nimport OfferSinglePosition from \"./OfferSinglePosition\";\r\nimport TitledComponent from \"components/TitledComponent\";\r\nimport {connect} from \"react-redux\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {makeStyles, TextField} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\nimport {OfferMode} from \"../../../../common/constants/OfferMode\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport purchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {Visibility, VisibilityOff} from '@material-ui/icons';\r\nimport {OfferPositionStatusType} from \"../../../../common/constants/OfferPositionStatusType\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        height: '100%',\r\n        // '&>*:not(:first-child)': {\r\n        //     marginTop: theme.spacing(2)\r\n        // }\r\n    },\r\n    floatingMenu: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        bottom: 0\r\n    },\r\n    menuBarPaper: {\r\n        background: theme.palette.background.default,\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n    },\r\n    search: {\r\n        marginBottom: theme.spacing(2),\r\n        width: 470,\r\n    }\r\n}))\r\n\r\n\r\nfunction OfferPositions(\r\n    {\r\n        offerEdit,\r\n        positionsLoaded = {},\r\n        disabled,\r\n        mode,\r\n        positionsRef,\r\n        roundType\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const [searchReg, setSearchReg] = useState(null);\r\n    const [hideNoOfferPositionsOperator, setHideNoOfferPositionsOperator] = useState(purchaserOfferContext && mode === OfferMode.PLACED);\r\n    const searchText = useRef();\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            switch (roundType) {\r\n                case RoundType.BASE:\r\n                    DemandOffersOfferService.clearResources(DemandOffersOfferService.OFFER_POSITIONS_LOADED);\r\n                    break;\r\n                case RoundType.ADDITIONAL_OFFERS:\r\n                    DemandAdditionalOffersOfferService.clearResources(DemandAdditionalOffersOfferService.ADDITIONAL_OFFER_POSITIONS_LOADED);\r\n                    break;\r\n                case RoundType.AUCTION:\r\n                    DemandOffersAuctionService.clearResources(DemandOffersAuctionService.AUCTIONS_OFFER_POSITIONS_LOADED)\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unknown roundType: \" + roundType)\r\n            }\r\n\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const handleKeyUp = (e) => {\r\n        if (e.key === 'Enter') {\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    const handleSubmit = (clear) => {\r\n        if (clear) {\r\n            searchText.current.value = \"\"\r\n        }\r\n        if (searchText.current.value && searchText.current.value !== \"\") {\r\n            setSearchReg(new RegExp(searchText.current.value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), \"i\"));\r\n        } else {\r\n            setSearchReg(null)\r\n        }\r\n    }\r\n\r\n    return (<TitledComponent componentRef={positionsRef} className={classes.root}>\r\n\r\n        {!contextSection.onePositionMode ? <>\r\n                {\r\n                    offerEdit.positions.length > 1 && <GridBlock className={classes.root}>\r\n\r\n                        <TextField\r\n                            className={classes.search}\r\n                            label={Tr('search_part')}\r\n                            fullWidth\r\n                            inputProps={{onKeyPress: handleKeyUp}}\r\n                            inputRef={searchText}\r\n                        />\r\n\r\n\r\n                        <div>\r\n                            <WorkableIconButton Icon={SearchIcon} onClick={() => handleSubmit()} tooltip={Tr('search')}/>\r\n                            <IconButton Icon={ClearIcon} tooltip={Tr('clear')} onClick={() => handleSubmit(true)}/>\r\n                            {\r\n                                purchaserOfferContext && mode === OfferMode.PLACED && offerEdit.positions.some(x => x.status === OfferPositionStatusType.NO_OFFER) &&\r\n                                <IconButton color=\"primary\" Icon={hideNoOfferPositionsOperator ? VisibilityOff: Visibility} onClick={() => setHideNoOfferPositionsOperator(x => !x)}\r\n                                            tooltip={hideNoOfferPositionsOperator ? Tr(\"show_no_offer_parts\") : Tr(\"hide_no_offer_parts\")}/>\r\n                            }\r\n                        </div>\r\n\r\n                    </GridBlock>\r\n                }\r\n                <div>\r\n                    {\r\n                        offerEdit.positions.map(x => (<OfferMultiPositions\r\n                            key={x.identity}\r\n                            mode={mode}\r\n                            position={x}\r\n                            positionsLoaded={positionsLoaded}\r\n                            disabled={disabled}\r\n                            roundType={roundType}\r\n                            offerEdit={offerEdit}\r\n                            hide={(hideNoOfferPositionsOperator && x.status === OfferPositionStatusType.NO_OFFER) || (!!searchReg && (Tr('part_x', {x: x.order}) + \": \" + x.name).search(searchReg) === -1)}\r\n                        />))\r\n                    }\r\n                </div>\r\n            </>\r\n            : <OfferSinglePosition\r\n                mode={mode}\r\n                position={offerEdit.positions[0]}\r\n                positionsLoaded={positionsLoaded}\r\n                disabled={disabled}\r\n                roundType={roundType}\r\n                offerEdit={offerEdit}\r\n            />\r\n        }\r\n\r\n    </TitledComponent>)\r\n}\r\n\r\nOfferPositions.propTypes = {\r\n    mode: PropTypes.oneOf(Object.keys(OfferMode)).isRequired,\r\n    roundType: PropTypes.oneOf(Object.keys(RoundType)).isRequired,\r\n};\r\n\r\nexport default connect((state, ownProps) => ({\r\n    positionsLoaded: state.resources[ownProps.roundType === RoundType.BASE ? DemandOffersOfferService.OFFER_POSITIONS_LOADED : (ownProps.roundType === RoundType.ADDITIONAL_OFFERS ? DemandAdditionalOffersOfferService.ADDITIONAL_OFFER_POSITIONS_LOADED : DemandOffersAuctionService.AUCTIONS_OFFER_POSITIONS_LOADED)],\r\n}), {})(OfferPositions);","import React, {useMemo} from 'react'\r\nimport {Grid, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport Button from 'components/Button';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            flexShrink: 0,\r\n        }\r\n    },\r\n    separator: {\r\n        flexGrow: 1,\r\n    },\r\n    button: {\r\n        width: theme.components.progressBar.buttons.width\r\n    },\r\n    buttonList: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    buttonListLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    icon: {\r\n        marginRight: theme.spacing(1),\r\n    }\r\n})\r\n\r\nconst getButtons = (buttons) => {\r\n    const bb = {\r\n        before: [],\r\n        after: []\r\n    }\r\n\r\n    if (buttons)\r\n        buttons.forEach((b) => {\r\n            (b.toLeft ? bb.before : bb.after).push(b);\r\n        })\r\n\r\n    return bb;\r\n};\r\n\r\nfunction ButtonsBar(\r\n    {\r\n        classes,\r\n        buttons\r\n    }) {\r\n\r\n    const button = ({variant, label, onClick, Icon, color, disabled, toLeft}) => (\r\n        <Grid key={label} item>\r\n            <Button\r\n                className={toLeft ? classes.buttonListLeft : classes.buttonList}\r\n                color={color}\r\n                variant={variant}\r\n                onClick={onClick}\r\n                disabled={disabled}\r\n            >\r\n                {Boolean(Icon) && <Icon className={classes.icon}/>}\r\n                {label}\r\n            </Button>\r\n        </Grid>\r\n    )\r\n\r\n    const memoButtons = useMemo(() => getButtons(buttons), [buttons]);\r\n\r\n    return (\r\n        <Grid\r\n            container\r\n        >\r\n            {\r\n                memoButtons.before.length ? memoButtons.before.map(b => button(b)) : undefined\r\n            }\r\n            <Grid item className={classes.separator}>\r\n            </Grid>\r\n            {\r\n                memoButtons.after.length ? memoButtons.after.map(b => button(b)) : undefined\r\n            }\r\n\r\n        </Grid>\r\n    )\r\n}\r\n\r\nButtonsBar.propTypes = {\r\n    className: PropTypes.string,\r\n    buttons: PropTypes.arrayOf(PropTypes.shape({\r\n        label: PropTypes.string.isRequired,\r\n        onClick: PropTypes.func,\r\n        variant: PropTypes.oneOf(['outlined', 'contained', 'text'])\r\n    }))\r\n}\r\n\r\nButtonsBar.propDefault = {}\r\n\r\nexport default withStyles(style)(ButtonsBar)\r\n","import React from 'react'\r\nimport {Grid, makeStyles, Paper} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport ButtonsBar from './ButtonsBar';\r\nimport clsx from 'clsx';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    paper: {\r\n        padding: theme.spacing(1)\r\n    },\r\n}));\r\n\r\nfunction NavigationBar(\r\n    {\r\n        classesObj = {},\r\n        buttons\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n\r\n    return buttons && buttons.length > 0 ?\r\n        <div\r\n            className={clsx(\r\n                classes.root,\r\n                classesObj.menuBar,\r\n            )}\r\n        >\r\n            <Paper className={clsx(classes.paper, classesObj.menuBarPaper)}>\r\n                <Grid\r\n                    container\r\n                    direction={'column'}\r\n                >\r\n                    <Grid item>\r\n                        <ButtonsBar\r\n                            buttons={buttons}\r\n                        />\r\n                    </Grid>\r\n                </Grid>\r\n            </Paper>\r\n        </div> : null\r\n}\r\n\r\nNavigationBar.propTypes = {\r\n    classesObj: PropTypes.object,\r\n    buttons: PropTypes.arrayOf(PropTypes.shape({\r\n        label: PropTypes.string.isRequired,\r\n        onClick: PropTypes.func,\r\n        variant: PropTypes.oneOf(['outlined', 'contained', 'text'])\r\n    }))\r\n}\r\n\r\nNavigationBar.propDefault = {}\r\n\r\nexport default NavigationBar;\r\n","import Tr from 'translations/Translations';\r\nimport { redirect } from 'libs/RouterPath';\r\nimport reduxStore from 'redux/store'\r\nimport {setStepperState} from \"redux/actions\";\r\n\r\nexport const createButton = (trKey, onClick, variant, Icon, color, disabled = false, toLeft = false, translateLabel = true) => ({\r\n\tlabel: translateLabel === true ? Tr(trKey) : trKey,\r\n\tonClick,\r\n\tvariant,\r\n\tIcon,\r\n\tcolor,\r\n\tdisabled,\r\n\ttoLeft\r\n})\r\n\r\nexport const createHrefButton = (trKey, href, variant, Icon, color) => (\r\n\tcreateButton(\r\n\t\ttrKey,\r\n\t\t() => { redirect(href) },\r\n\t\tvariant,\r\n\t\tIcon,\r\n\t\tcolor\r\n\t)\r\n)\r\n\r\nexport const createSubmitFormButton = (trKey, variant, Icon, color, disabled, isSaveButton) => {\r\n\tconst { form, stepper } = reduxStore.getState();\r\n\tconst formId = stepper.state;\r\n\tconst func = isSaveButton ? form[formId] : ()=>reduxStore.dispatch(setStepperState());\r\n\r\n\treturn createButton(\r\n\t\ttrKey,\r\n\t\t() => func ? func() : {},\r\n\t\tvariant,\r\n\t\tIcon,\r\n\t\tcolor,\r\n\t\tdisabled || !func\r\n\t)\r\n}\r\n\r\n\r\nexport default createButton;","import React from 'react'\r\nimport {RadioGroup as RadioGroupUI, FormHelperText, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport SimpleTable from 'components/complex/simpleTable/SimpleTable';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport clsx from \"clsx\";\r\nimport RadioGroupElement from \"./RadioGroupElement\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    textBold: {\r\n        fontWeight: theme.typography.fontWeightBold,\r\n        marginBottom: theme.spacing()\r\n    },\r\n    samllColumn: theme.components.table.lpColumn,\r\n    orderColumn: theme.components.table.ipColumn,\r\n    checkboxColumn: {\r\n        width: theme.spacing(),\r\n        paddingTop: 0,\r\n        paddingBottom: 0\r\n    },\r\n    nameColumn: {\r\n        paddingTop: theme.spacing(),\r\n        paddingBottom: theme.spacing(),\r\n    },\r\n    checkbox: {\r\n        padding: 0,\r\n    },\r\n    cursor: {\r\n        cursor: \"pointer\"\r\n    }\r\n})\r\n\r\nfunction PartsRadioTable(\r\n    {\r\n        classes,\r\n        className,\r\n        formikProps,\r\n        id,\r\n        elementList = [],\r\n        label,\r\n        orderLabel = \"part_number\",\r\n        editable = true,\r\n        required = true,\r\n        disabled\r\n    }) {\r\n    const value = getObjectValue(id, formikProps.values, null);\r\n    const errorValue = getObjectValue(id, formikProps.errors, '');\r\n    const touched = getObjectValue(id, formikProps.touched, false);\r\n\r\n    const isError = editable && !!errorValue && Boolean(touched);\r\n    const helperText = errorValue || ' ';\r\n    const hasOrder = !!(elementList?.[0]?.order);\r\n    return (\r\n        <GridBlock\r\n            className={clsx(classes.root, className)}\r\n            column\r\n        >\r\n            <Typography\r\n                variant='body1'\r\n                className={classes.textBold}\r\n            >\r\n                {label ? label : Tr('assign_to_part')}{required ? '*' : ''}\r\n            </Typography>\r\n            <RadioGroupUI\r\n                name={id}\r\n                onChange={(event) => {\r\n                    formikProps.handleChange(event);\r\n                }}\r\n                onBlur={formikProps.handleBlur}\r\n                value={value}\r\n            >\r\n                <SimpleTable\r\n                    headers={[\r\n                        undefined,\r\n                        (hasOrder ? Tr(orderLabel) : Tr('column_lp')),\r\n                        Tr('name')\r\n                    ]}\r\n                    items={elementList.map((x, i) => {\r\n                        return [\r\n                            <RadioGroupElement\r\n                                htmlId={`${id}.${x.identity}`}\r\n                                key={i}\r\n                                value={x.value}\r\n                                disabled={!editable || disabled}\r\n                            />,\r\n                            <label className={classes.cursor} htmlFor={`${id}.${x.identity}`}>{!!x.order ? x.order : i + 1}</label>,\r\n                            <label className={classes.cursor} htmlFor={`${id}.${x.identity}`}>{x.name}</label>,\r\n                        ]\r\n                    })}\r\n                    columnClasses={[\r\n                        classes.checkboxColumn,\r\n                        hasOrder ? classes.orderColumn : classes.samllColumn,\r\n                        classes.nameColumn\r\n                    ]}\r\n                />\r\n            </RadioGroupUI>\r\n            {isError && <FormHelperText error>{helperText}</FormHelperText>}\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nPartsRadioTable.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(PartsRadioTable);\r\n","import React, {useContext, useMemo, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport {connect} from \"react-redux\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport {\r\n    OfferPositionStatusesReadyToDelete,\r\n    OfferPositionStatusesReadyToOffering,\r\n    OfferPositionStatusesReadyToOfferSign,\r\n    OfferPositionStatusesReadyToWithdraw,\r\n    OfferPositionStatusesReadyToWithdrawSign\r\n} from \"./constants/OfferPositionStatusType\";\r\nimport * as Yup from \"yup\";\r\nimport Typography from \"components/Typography\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {OfferStatusType} from \"./constants/OfferStatusType\";\r\nimport TextField from \"@material-ui/core/TextField/TextField\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport PartsRadioTable from \"components/PartsRadioTable\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    info: {\r\n        fontSize: \"small\",\r\n        fontWeight: \"bold\",\r\n        textAlign: \"center\",\r\n        marginTop: theme.spacing()\r\n    },\r\n    search: {\r\n        width: \"90%\"\r\n    },\r\n}))\r\n\r\nexport const POPUP_MODE = {\r\n    OFFER: \"OFFER\",\r\n    OFFER_SIGN: \"OFFER_SIGN\",\r\n    OFFER_BREAK: \"OFFER_BREAK\",\r\n    WITHDRAW: \"WITHDRAW\",\r\n    WITHDRAW_SIGN: \"WITHDRAW_SIGN\",\r\n    WITHDRAW_BREAK: \"WITHDRAW_BREAK\",\r\n    OPERATOR_PLACE: \"OPERATOR_PLACE\",\r\n    DELETE_OFFER: \"DELETE_OFFER\",\r\n}\r\n\r\nconst isSupported = (mode, position) => {\r\n    switch (mode) {\r\n        case POPUP_MODE.OFFER:\r\n        case POPUP_MODE.OPERATOR_PLACE:\r\n            return OfferPositionStatusesReadyToOffering.includes(position.status)\r\n        case POPUP_MODE.OFFER_SIGN:\r\n        case POPUP_MODE.OFFER_BREAK:\r\n            return OfferPositionStatusesReadyToOfferSign.includes(position.status);\r\n        case POPUP_MODE.WITHDRAW:\r\n            return OfferPositionStatusesReadyToWithdraw.includes(position.status);\r\n        case POPUP_MODE.WITHDRAW_SIGN:\r\n        case POPUP_MODE.WITHDRAW_BREAK:\r\n            return OfferPositionStatusesReadyToWithdrawSign.includes(position.status);\r\n        case POPUP_MODE.DELETE_OFFER:\r\n            return (!position.contractorOfferStatus && OfferPositionStatusesReadyToDelete.includes(position.status))\r\n                || (position.contractorOfferStatus === OfferStatusType.NORMAL && position.offerDate === null && position.offerTmpDate !== null)\r\n        default:\r\n            throw new Error(\"Unknown PopupMode: \" + mode)\r\n    }\r\n\r\n}\r\nconst getButtonText = (mode, digitalSign, stageTr) => {\r\n    switch (mode) {\r\n        case POPUP_MODE.OFFER:\r\n        case POPUP_MODE.OFFER_SIGN:\r\n            return stageTr(digitalSign ? \"sign_offer_form\" : \"place_offer\")\r\n        case POPUP_MODE.OPERATOR_PLACE:\r\n            return stageTr(\"place_offer_operator\")\r\n        case POPUP_MODE.OFFER_BREAK:\r\n            return stageTr(\"sign_offer_form_stop\")\r\n        case POPUP_MODE.WITHDRAW:\r\n        case POPUP_MODE.WITHDRAW_SIGN:\r\n            return stageTr(digitalSign ? \"sign_withdraw_form\" : \"withdraw_offer\")\r\n        case POPUP_MODE.WITHDRAW_BREAK:\r\n            return stageTr(\"sign_withdraw_form_stop\")\r\n        case POPUP_MODE.DELETE_OFFER:\r\n            return stageTr(\"delete_offer\")\r\n        default:\r\n            throw new Error(\"Unknown PopupMode: \" + mode)\r\n    }\r\n}\r\nconst getListText = (mode, stageTr) => {\r\n    switch (mode) {\r\n        case POPUP_MODE.OFFER:\r\n        case POPUP_MODE.OFFER_SIGN:\r\n            return stageTr(\"choose_positions_to_offer\")\r\n        case POPUP_MODE.OPERATOR_PLACE:\r\n            return stageTr(\"choose_positions_to_offer_operator\")\r\n        case POPUP_MODE.WITHDRAW:\r\n        case POPUP_MODE.WITHDRAW_SIGN:\r\n            return stageTr(\"choose_positions_to_withdraw\")\r\n        case POPUP_MODE.OFFER_BREAK:\r\n        case POPUP_MODE.WITHDRAW_BREAK:\r\n        case POPUP_MODE.DELETE_OFFER:\r\n            return Tr(\"choose_position\")\r\n        default:\r\n            throw new Error(\"Unknown PopupMode: \" + mode)\r\n    }\r\n}\r\n\r\n\r\nconst OfferPositionsSelectPopup = (\r\n    {\r\n        onCancel,\r\n        onSuccess,\r\n        offerEdit,\r\n        popupMode,\r\n        additionalOffers = false,\r\n        digitalSign,\r\n        formSubmit\r\n    }) => {\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const positions = useMemo(() => offerEdit.positions.filter(x => isSupported(popupMode, x))\r\n        .map(x => ({\r\n            ...x,\r\n            value: \"_\" + x.identity,\r\n            label: Tr(\"part_x\", {x: x.order}) + \": \" + x.name,\r\n            search: Tr(\"part_x\", {x: x.order}) + \": \" + x.name,\r\n        })), [offerEdit, popupMode]);\r\n\r\n    const [positionsFiltered, setPositionsFiltered] = useState(positions);\r\n    const [searchText, setSearchText] = useState(\"\");\r\n\r\n    const onSubmit = (values) => {\r\n        let posIds;\r\n        if (additionalOffers) {\r\n            posIds = positions.filter(x => x.value === values.part).map(x => x.positionId)\r\n        } else {\r\n            posIds = positions.filter(x => values.parts[x.identity]).map(x => x.positionId)\r\n        }\r\n        onSuccess(posIds);\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr(\"cancel\"), onCancel, \"outlined\"));\r\n        buttons.push(createButton(getButtonText(popupMode, digitalSign, stageTr), handleSubmit, undefined, !positions.length));\r\n        return buttons;\r\n    }\r\n\r\n    const validationSchema = Yup.object().shape({\r\n        parts: !additionalOffers ? VS.any().test(\"partSelected\", Tr(\"choose_at_least_one_position\"), (e) => {\r\n            const selIndex = Object.keys(e).findIndex(x => e[x] === true);\r\n            return selIndex > -1;\r\n        }) : VS.any(),\r\n        part: additionalOffers ? VS.string(undefined, \"choose_position\") : VS.any()\r\n    })\r\n\r\n    useDebouncedEffect(() => {\r\n        if (!searchText || searchText === \"\") {\r\n            if (positions !== positionsFiltered) {\r\n                setPositionsFiltered(positions);\r\n            }\r\n        } else {\r\n            const reg = new RegExp(searchText.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"), \"i\");\r\n            setPositionsFiltered(positions.filter(pos => pos.search.search(reg) > -1));\r\n        }\r\n    }, {timeout: 800, ignoreInitialCall: true}, [searchText])\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={<TextField className={classes.search} value={searchText} onChange={(e) => setSearchText(e.target.value)} label={Tr(\"search2\")}/>}\r\n            dialogActions={<>\r\n                <GridBlock column>\r\n                    <MultiButton buttons={getButtons()}/>\r\n                    {POPUP_MODE.OFFER === popupMode &&\r\n                        <Typography className={classes.info}>*{stageTr(\"place_offer_confirm\")}</Typography>\r\n                    }\r\n                </GridBlock>\r\n            </>}\r\n            maxWidth=\"md\"\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                <Form\r\n                    initialValues={{\r\n                        parts: !additionalOffers ? positions.reduce((prev, cur) => {\r\n                            prev[cur.identity] = false;\r\n                            return prev;\r\n                        }, {}) : null,\r\n                        part: null\r\n                    }}\r\n                    validationSchema={validationSchema}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock\r\n                            column\r\n                        >\r\n                            {\r\n                                additionalOffers ?\r\n                                    <PartsRadioTable\r\n                                        label={getListText(popupMode, stageTr)}\r\n                                        id=\"part\"\r\n                                        formikProps={formikProps}\r\n                                        elementList={positionsFiltered}\r\n                                    /> :\r\n                                    <PartsTable\r\n                                        label={getListText(popupMode, stageTr)}\r\n                                        id=\"parts\"\r\n                                        formikProps={formikProps}\r\n                                        elementList={positionsFiltered}\r\n                                    />\r\n                            }\r\n                            {\r\n                                !(positionsFiltered.length) &&\r\n                                <BoldTypography variant=\"body1\">\r\n                                    {\r\n                                        Tr(\"no_options\")\r\n                                    }\r\n                                </BoldTypography>\r\n                            }\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n\r\n            </GridBlock>\r\n        </Dialog>)\r\n}\r\n\r\nOfferPositionsSelectPopup.propTypes = {\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    offerEdit: PropTypes.shape({\r\n        positions: PropTypes.arrayOf(PropTypes.shape({\r\n            identity: PropTypes.number.isRequired,\r\n            positionId: PropTypes.number.isRequired,\r\n            order: PropTypes.number.isRequired,\r\n            name: PropTypes.string.isRequired,\r\n        })).isRequired\r\n    }).isRequired,\r\n    digitalSign: PropTypes.bool.isRequired,\r\n    popupMode: PropTypes.oneOf(Object.keys(POPUP_MODE)),\r\n    additionalOffers: PropTypes.bool\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(OfferPositionsSelectPopup)","import React, {useContext} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Form from \"components/Form\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Tr from \"translations/Translations\";\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport {ContractorConsorciumTypes, ContractorConsorciumTypesLabel, ContractorConsorciumTypesOnePosition} from \"constants/ContractorConsorciumTypes\";\r\nimport ConsorciumTable from \"./ConsorciumTable\";\r\nimport {ContractorCompanySize, ContractorCompanySizeLabel} from \"constants/ContractorCompanySize\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport {connect} from \"react-redux\";\r\nimport Typography from \"components/Typography\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\n\r\nfunction OfferCommonDataForm(\r\n    {\r\n        offerEdit,\r\n        section,\r\n        onSubmit,\r\n        formId,\r\n        working,\r\n        disabled,\r\n        formSubmit\r\n    }) {\r\n\r\n    const handleSubmit = () => formSubmit[formId]();\r\n    const supportMode = useContext(SupportModeContext);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n\r\n    const validationSchema = () => VS.lazy((value) => {\r\n\r\n        const shape = {\r\n            consorciumType: VS.string(),\r\n            companySize: VS.string(),\r\n        }\r\n\r\n        if (value.consorciumType === ContractorConsorciumTypes.ALL) {\r\n            shape.consorciants = VS.arrayRequired(\"consorciant_required\")\r\n        }\r\n\r\n        if (section.digitalSign)\r\n            shape.requiredSignatures = VS.integerMinMax(1, 99)\r\n        return VS.object(shape);\r\n    })\r\n\r\n\r\n    return (<Form\r\n        initialValues={offerEdit.commonData}\r\n        validationSchema={validationSchema()}\r\n        onSubmit={onSubmit}\r\n        id={formId}\r\n    >\r\n        {(formikProps) => (<>\r\n\r\n            {!disabled && (section.digitalSign || !offerEdit.commonData.hadStageWithOffer) ?\r\n                <GridBlock justify='space-between'>\r\n                    <Typography\r\n                        color='error'>{offerEdit.commonData.status === DemandValidationSectionStatus.ERROR ? Tr(\"fill_missing_data_x\", {name: 'contractor_company_data'}, true) : null}</Typography>\r\n                    <WorkableButton working={working} disabled={working || !formikProps.dirty || supportMode || purchaserOfferContext?.preview} onClick={handleSubmit}>{Tr('save_changes')}</WorkableButton>\r\n                </GridBlock> : <br/>\r\n            }\r\n\r\n            <SaveFormikValues\r\n                formikProps={formikProps}\r\n                id={formId}\r\n            />\r\n\r\n            <Select\r\n                formikProps={formikProps}\r\n                id=\"consorciumType\"\r\n                label={Tr('consorcium')}\r\n                items={Object.keys(section.onePositionMode ? ContractorConsorciumTypesOnePosition : ContractorConsorciumTypes).map(key => createSelectItem(key, ContractorConsorciumTypesLabel(key)))}\r\n                required\r\n                disabled={disabled || offerEdit.commonData.hadStageWithOffer}\r\n\r\n            />\r\n            {formikProps.values.consorciumType === ContractorConsorciumTypes.ALL && <>\r\n                <ConsorciumTable\r\n                    disabled={disabled || offerEdit.commonData.hadStageWithOffer}\r\n                    formikProps={formikProps}\r\n                    id='consorciants'\r\n                    contractor={offerEdit.contractor}\r\n                    companySize={getObjectValue(\"companySize\", formikProps.values, null)}\r\n                />\r\n                <br/>\r\n            </>}\r\n\r\n            <Select\r\n                formikProps={formikProps}\r\n                id=\"companySize\"\r\n                label={Tr('contractor_company_size')}\r\n                items={Object.keys(ContractorCompanySize).map(key => createSelectItem(key, ContractorCompanySizeLabel(key)))}\r\n                required\r\n                disabled={disabled || offerEdit.commonData.hadStageWithOffer}\r\n            />\r\n\r\n            {section.digitalSign &&\r\n                <TextInput\r\n                    formikProps={formikProps}\r\n                    label={Tr('required_signatures_count')}\r\n                    id='requiredSignatures'\r\n                    type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n                    required\r\n                    disabled={disabled}\r\n                />\r\n            }\r\n\r\n\r\n        </>)}\r\n    </Form>)\r\n\r\n}\r\n\r\nOfferCommonDataForm.propTypes = {\r\n    offerEdit: PropTypes.shape({\r\n        commonData: PropTypes.shape({\r\n            consorciumType: PropTypes.string.isRequired,\r\n            consorciants: PropTypes.array,\r\n            companySize: PropTypes.string,\r\n            requiredSignatures: PropTypes.number\r\n        })\r\n    }),\r\n    section: PropTypes.shape({\r\n        onePositionMode: PropTypes.bool.isRequired,\r\n        digitalSign: PropTypes.bool.isRequired\r\n    }).isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n    formId: PropTypes.string.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n}\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n}), {})(OfferCommonDataForm);","import React, {useContext, useState} from \"react\"\r\nimport {useParams} from \"react-router\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport OfferCommonDataForm from \"../../../../common/commonData/OfferCommonDataForm\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {ContractorConsorciumTypes} from \"constants/ContractorConsorciumTypes\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport scrollTo from \"libs/scrollTo\";\r\n\r\nexport const CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID = \"cont_offer_edit_common_data\";\r\n\r\nfunction OfferCommonData(\r\n    {\r\n        offerEdit,\r\n        disabled,\r\n        section\r\n    }) {\r\n    const params = useParams();\r\n    const [working, setWorking] = useState(false)\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n\r\n\r\n    const onSubmit = (values, actions) => {\r\n        setWorking(true);\r\n\r\n        DemandOffersOfferService.postSaveCommonData(params.id, params.stageId, purchaserOfferContext?.supplierId, values).then((resp) => {\r\n            if (resp) {\r\n                if (offerEdit.commonData.consorciumType !== ContractorConsorciumTypes.POSITION && values.consorciumType === ContractorConsorciumTypes.POSITION) {\r\n                    simpleAlert(stageTr(\"consorcium_on_position_info\"), false);\r\n                    scrollTo(\"#wrap_offerPositionForm_\" + offerEdit.positions[0].positionId, 60);\r\n                }\r\n\r\n                actions.resetForm({\r\n                    values: values\r\n                });\r\n            }\r\n        }).finally(() => setWorking(false))\r\n\r\n\r\n    }\r\n\r\n    return <OfferCommonDataForm\r\n        disabled={disabled}\r\n        offerEdit={offerEdit}\r\n        section={section}\r\n        onSubmit={onSubmit}\r\n        formId={CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID}\r\n        working={working}\r\n    />\r\n}\r\n\r\nOfferCommonData.propTypes = {}\r\nexport default OfferCommonData;","import React from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport {connect} from \"react-redux\";\r\nimport Typography from \"components/Typography\";\r\n\r\nfunction OfferContractorData(\r\n    {\r\n        offerEdit\r\n    }) {\r\n    return (<>\r\n        <Typography><strong>{Tr(\"name\")}</strong>: {offerEdit.contractor.name}</Typography>\r\n        <Typography><strong>{Tr(\"contractor_address\")}</strong>: {offerEdit.contractor.address ? offerEdit.contractor.address + ',' : ''} {offerEdit.contractor.postCode} {offerEdit.contractor.city}\r\n        </Typography>\r\n        <Typography><strong>{Tr(\"contractor_nip\")}</strong>: {offerEdit.contractor.vatin?.prefix} {offerEdit.contractor.vatin?.number}\r\n        </Typography>\r\n        <Typography><strong>{Tr(\"email\")}</strong>: {offerEdit.contractor.email}</Typography>\r\n    </>)\r\n\r\n}\r\n\r\nOfferContractorData.propTypes = {\r\n    offerEdit: PropTypes.shape({\r\n        contractor: PropTypes.shape({\r\n            name: PropTypes.string.isRequired,\r\n            address: PropTypes.string.isRequired,\r\n            postCode: PropTypes.string.isRequired,\r\n            city: PropTypes.string.isRequired,\r\n            email: PropTypes.string.isRequired,\r\n            vatin: PropTypes.shape({\r\n                prefix: PropTypes.string.isRequired,\r\n                number: PropTypes.string.isRequired,\r\n            }).isRequired\r\n        }).isRequired\r\n    }),\r\n}\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(OfferContractorData);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations'\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {Table, TableBody, TableCell, TableHead, TableRow, Typography} from \"@material-ui/core\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    headColumn: {\r\n        borderBottomColor: \"none\",\r\n        paddingBottom: 0,\r\n        fontSize: \"1.1rem\",\r\n        backgroundColor: theme.palette.background.greyBackground,\r\n    },\r\n    column: {\r\n        backgroundColor: theme.palette.background.greyBackground,\r\n        width: \"50%\",\r\n        padding: theme.spacing(0.5, 2, 0.5, 2),\r\n        fontSize: \"0.9rem\",\r\n    }\r\n}))\r\n\r\nexport const getVerificationBeforePlaceOfferPopupConfig = (list, positionIds) => ({list, positionIds})\r\n\r\nfunction VerificationBeforePlaceOfferPopup(\r\n    {\r\n        onCancel,\r\n        onConfirm,\r\n        config\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('verification_before_place_popup_title')}\r\n            maxWidth='lg'\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr(\"cancel\")}\r\n                labelSecond={Tr(\"confirm2\")}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={()=> onConfirm(config.positionIds)}\r\n            />}\r\n        >\r\n            <Table>\r\n                {config.list.map((elem, i) => <React.Fragment key={i}><TableHead>\r\n                    <TableRow>\r\n                        <TableCell colSpan={2} className={classes.headColumn}>\r\n                            {elem.positionName}\r\n                        </TableCell>\r\n                    </TableRow>\r\n                    <TableRow>\r\n                        <TableCell className={classes.column}>\r\n                            {Tr(\"source_file_name\")}\r\n                        </TableCell>\r\n                        <TableCell className={classes.column}>\r\n                            {Tr(\"signed_file_name\")}\r\n                        </TableCell>\r\n                    </TableRow>\r\n                </TableHead>\r\n                    <TableBody>\r\n                        {\r\n                            elem.files.map((file, j) => <TableRow key={j}>\r\n                                <TableCell>\r\n                                    <Typography color={!file.signedFile ? \"error\" : undefined}>\r\n                                        {!file.signedFile ? Tr('source_file_name_error') : file.signedFile.name}\r\n                                    </Typography>\r\n                                </TableCell>\r\n                                <TableCell>\r\n                                    <Typography color={file.signatureFiles.length === 0 ? \"error\" : undefined}>\r\n                                    {file.signatureFiles.length === 0 ? Tr('signed_file_name_error') :\r\n                                        file.signatureFiles.map(sFile => <React.Fragment key={sFile.identity}>{sFile.name}<br/></React.Fragment>)}\r\n                                    </Typography>\r\n                                </TableCell>\r\n                            </TableRow>)\r\n                        }\r\n                    </TableBody>\r\n                </React.Fragment>)}\r\n            </Table>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nVerificationBeforePlaceOfferPopup.propTypes = {\r\n    onCancel: PropTypes.func.isRequired,\r\n    onConfirm: PropTypes.func.isRequired,\r\n    config: PropTypes.shape({\r\n        list: PropTypes.array.isRequired,\r\n        positionIds: PropTypes.any\r\n    })\r\n}\r\n\r\nexport default VerificationBeforePlaceOfferPopup;\r\n","import React, {useReducer, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations'\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport GetAppIcon from '@material-ui/icons/GetApp';\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport {useParams} from \"react-router\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {OfferMode} from \"../../../common/constants/OfferMode\";\r\nimport Dropzone from \"components/Dropzone\";\r\nimport UploadService from \"services/UploadService\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport Typography from \"components/Typography\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport {Table, TableBody, TableCell, TableContainer, TableRow} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport BoldTypography from \"../../../../../../../../../components/BoldTypography\";\r\nimport RouterPath from \"../../../../../../../../../libs/RouterPath\";\r\nimport {StageSections} from \"../../../../constants/StageSections\";\r\nimport DemandOffersService from \"../../../../../../../../../services/DemandOffersService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n\r\n\r\n    partColumn: {\r\n        width: 70,\r\n        padding: theme.spacing(0.5, 2, 0.5, 2),\r\n        borderTop: \"solid 2px #333\",\r\n        borderBottom: \"none\",\r\n    },\r\n    nameColumn: {\r\n        width: \"50%\",\r\n        padding: theme.spacing(0.5, 2, 0.5, 2),\r\n        borderTop: \"solid 2px #333\"\r\n    },\r\n    errorColumn: {\r\n        padding: theme.spacing(0.5, 2, 0.5, 2),\r\n        borderTop: \"solid 2px #333\",\r\n    },\r\n\r\n    entryLpColumn: {\r\n        borderBottom: \"none\"\r\n    },\r\n    entryColumn: {\r\n        padding: theme.spacing(0.5, 2, 0.5, 2),\r\n    },\r\n\r\n    step: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    fontSize: {\r\n        fontSize: \"0.9rem\",\r\n    },\r\n    bold: {\r\n        fontWeight: \"bold\",\r\n    },\r\n    success: {color: theme.palette.common.success},\r\n    error: {color: theme.palette.error.main},\r\n}))\r\n\r\nfunction ImportOfferFormPopup(\r\n    {\r\n        onClose,\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const [result, setResult] = useState();\r\n    const {enqueueErrorSnackbar, enqueueWarningSnackbar, enqueueSuccessSnackbar} = useSnackbar();\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        upload: false\r\n    });\r\n\r\n    const downloadTemplate = () => {\r\n        dispatchIconWorks({type: 'download', works: true})\r\n        DemandOffersOfferService.getDownloadOfferTemplate(params.id, params.stageId, undefined, OfferMode.EDIT)\r\n            .finally(() => dispatchIconWorks({type: 'download', works: false}))\r\n    }\r\n\r\n    const handleBrowserFileSelect = (selectedFiles) => {\r\n        dispatchIconWorks({type: 'upload', works: true})\r\n        setResult(null)\r\n        UploadService.upload(selectedFiles[0], () => {\r\n        }, Endpoints.DEMAND_OFFERS_OFFER_MODE_TEMPLATE(params.id, params.stageId, OfferMode.EDIT, undefined)).then(response => {\r\n            if (isResponseValid(response, enqueueErrorSnackbar)) {\r\n                const data = response.result;\r\n                if (data.length > 0) {\r\n                    if (data.some(x => !x.success)) {\r\n                        setResult(data)\r\n                    } else {\r\n                        enqueueSuccessSnackbar(Tr(\"offer_form_import_export_success\"));\r\n                        DemandOffersService.getStageSection(params.id, params.stageId, StageSections.OFFER_EDIT)\r\n                        onClose();\r\n                        const href = RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID, {\r\n                            id: params.id,\r\n                            stageId: params.stageId\r\n                        });\r\n                        RouterPath.redirectWithoutHistory(href);\r\n                    }\r\n                } else {\r\n                    enqueueWarningSnackbar(Tr(\"fill_at_least_one_position\"));\r\n                }\r\n            }\r\n        }).catch((e) => {\r\n            console.error(e);\r\n        }).finally(() => dispatchIconWorks({type: 'upload', works: false}))\r\n\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr(\"offer_form_import_export\")}\r\n            maxWidth='lg'\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={Tr(\"close\")}\r\n                onClick={onClose}\r\n                disabled={iconWorks.anyWorks}\r\n            />}\r\n        >\r\n            <GridBlock column>\r\n\r\n                <Typography dangerouslySetInnerHTML={{__html: Tr(\"offer_form_import_export_step1\")}}/>\r\n\r\n                <WorkableButton Icon={GetAppIcon} onClick={downloadTemplate} working={iconWorks.download}\r\n                                disabled={iconWorks.anyWorks}>{Tr(\"offer_form_download\")}</WorkableButton>\r\n                <Typography className={classes.step} dangerouslySetInnerHTML={{__html: Tr(\"offer_form_import_export_step2\")}}/>\r\n                <Typography className={classes.step} dangerouslySetInnerHTML={{__html: Tr(\"offer_form_import_export_step3\")}}/>\r\n\r\n                <Dropzone\r\n                    className={classes.dropzone}\r\n                    onChange={handleBrowserFileSelect}\r\n                    multiple={false}\r\n                    acceptExtensionList={['xlsx']}\r\n                    working={iconWorks.upload}\r\n                    disabled={iconWorks.anyWorks}\r\n                />\r\n\r\n                {\r\n                    !!result && <TableContainer className={clsx(classes.step)}>\r\n                        <BoldTypography align=\"center\" variant=\"h6\">{Tr(\"offer_form_import_export_summary\")}</BoldTypography>\r\n                        <Table>\r\n                            <TableBody>\r\n                                {\r\n                                    result.map(pos => {\r\n                                        const errors = [];\r\n                                        if (!pos.success && pos.errors) {\r\n                                            Object.keys(pos.errors).forEach(sectionName => {\r\n                                                const section = pos.errors[sectionName];\r\n                                                Object.keys(section).forEach((critName) => {\r\n                                                    section[critName].forEach((err) => errors.push({\r\n                                                        ...err,\r\n                                                        name: critName\r\n                                                    }))\r\n                                                })\r\n                                            })\r\n                                        }\r\n                                        return (<>\r\n                                            <TableRow>\r\n                                                <TableCell className={clsx(classes.partColumn, classes.bold)}>{Tr(\"part_x\", {x: pos.ordinalNumber})}</TableCell>\r\n                                                <TableCell className={classes.nameColumn}>{pos.positionName}</TableCell>\r\n                                                <TableCell\r\n                                                    className={clsx(classes.errorColumn, classes.bold, pos.success ? classes.success : classes.error)}>{pos.status}</TableCell>\r\n                                            </TableRow>\r\n                                            {\r\n                                                errors.length > 0 && errors.map(error => (<TableRow>\r\n                                                    <TableCell className={clsx(classes.entryLpColumn, classes.bold)}></TableCell>\r\n                                                    <TableCell className={classes.entryColumn}>\r\n                                                        {Tr(\"excel_cell\")}: <span className={classes.bold}>{error.cellAddress}</span> - {error.name}\r\n                                                    </TableCell>\r\n                                                    <TableCell className={clsx(classes.entryColumn, classes.bold, pos.success ? classes.success : classes.error)}>\r\n                                                        {error.error}\r\n                                                    </TableCell>\r\n                                                </TableRow>))\r\n                                            }\r\n                                        </>)\r\n                                    })\r\n\r\n\r\n                                }\r\n                            </TableBody>\r\n                        </Table>\r\n                    </TableContainer>\r\n                }\r\n\r\n            </GridBlock>\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nImportOfferFormPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default ImportOfferFormPopup;\r\n","import React, {useContext, useEffect, useRef, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {connect} from \"react-redux\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport GeneralInfoEntry from \"../generalInfo/components/GeneralInfoEntry\";\r\nimport Tr from 'translations/Translations'\r\nimport OfferFiles from \"./components/files/OfferFiles\";\r\nimport OfferEspd from \"./components/espd/OfferEspd\";\r\nimport {ContractorOfferEspdType} from \"constants/ContractorOfferEspdType\";\r\nimport OfferPositions from \"./components/positions/OfferPositions\";\r\nimport NavigationBar from \"components/complex/floatingMenu/NavigationBar\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport createButton from \"components/complex/floatingMenu/createButton\";\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\r\nimport CancelIcon from '@material-ui/icons/Cancel';\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport {\r\n    OfferPositionStatusesReadyToDelete,\r\n    OfferPositionStatusesReadyToOffering,\r\n    OfferPositionStatusesReadyToWithdraw\r\n} from \"../../common/constants/OfferPositionStatusType\";\r\nimport OfferPositionsSelectPopup, {POPUP_MODE} from \"../../common/OfferPositionsSelectPopup\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport {OfferStatusType} from \"../../common/constants/OfferStatusType\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport PropTypes from \"prop-types\";\r\nimport {StageSectionsUrlParams} from \"../../../constants/StageSections\";\r\nimport {OfferMode} from \"../../common/constants/OfferMode\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport OfferCommonData, {CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID} from \"./components/commonData/OfferCommonData\";\r\nimport OfferContractorData from \"../../common/contractorData/OfferContractorData\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport SnapshotListPopup, {getConfig} from \"./components/SnapshotListPopup\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport VerificationsPopup, {getVerificationConfig} from \"./components/VerificationsPopup\";\r\nimport MultiButton, {createButton as createMultiButton} from \"components/popup/components/MultiButton\";\r\nimport HistoryIcon from \"@material-ui/icons/History\";\r\nimport useSalesNotification from \"hooks/useSalesNotification\";\r\nimport salesNotificationKeys from \"components/popup/salesNotification/constants/salesNotification.keys\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport VerificationBeforePlaceOfferPopup, {getVerificationBeforePlaceOfferPopupConfig} from \"./components/VerificationBeforePlaceOfferPopup\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\nimport ImportExportIcon from '@material-ui/icons/ImportExport';\r\nimport ImportOfferFormPopup from \"./components/ImportOfferFormPopup\";\r\nimport PrintIcon from '@material-ui/icons/Print';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    floatingMenu: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        bottom: 0,\r\n        marginTop: theme.spacing()\r\n    },\r\n    menuBarPaper: {\r\n        background: theme.palette.background.default,\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction OfferEditPanel(\r\n    {\r\n        panelRef,\r\n        demandHeader,\r\n        offerEdit,\r\n        formSubmit,\r\n        formValues,\r\n    }) {\r\n\r\n\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const section = params.section;\r\n    const mode = section === StageSectionsUrlParams.OFFER_EDIT ? OfferMode.EDIT : OfferMode.PLACED;\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const disabled = offerEdit ? offerEdit.disabled : true;\r\n    const dataLoading = !offerEdit || !demandHeader;\r\n    const positionsRef = useRef();\r\n    const {showLoadingScreen, hideLoadingScreen} = useLoadingScreen();\r\n    const [choosePositionPopup, setChoosePositionPopup] = useState(null);\r\n    const [chooseSnapshotPopup, setChooseSnapshotPopup] = useState(null);\r\n    const [importTemplatePopup, setImportTemplatePopup] = useState(false);\r\n    const [verifyPopup, setVerifyPopup] = useState(null);\r\n    const [verifyBeforePlacePopup, setVerifyBeforePlacePopup] = useState(null);\r\n\r\n    useStepperStateCloseValidator(CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID, () => {\r\n        return !(formValues[CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID + \"_dirty\"] || offerEdit.positions.findIndex(x => !!formValues[\"offerPositionForm_\" + x.positionId + \"_dirty\"]) > -1)\r\n\r\n    })\r\n\r\n    const {doSignDocContent, breakSigning} = useSignature()\r\n\r\n    useEffect(() => {\r\n            if (!dataLoading) {\r\n                setTimeout((elem) => scrollTo(elem), 100, panelRef.current);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n        , [dataLoading])\r\n\r\n    useEffect(() => {\r\n        DemandOffersOfferService.getOfferEdit(demandId, stageId, mode, purchaserOfferContext?.supplierId, purchaserOfferContext?.preview);\r\n        return () => {\r\n            DemandOffersOfferService.clearResources(DemandOffersOfferService.OFFER_EDIT);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandId, stageId, section])\r\n\r\n\r\n    const placeOffer = () => {\r\n        if (formValues[CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID + \"_dirty\"]) {\r\n            simpleAlert(Tr(\"save_form_x\", {name: 'contractor_company_data'}, true), false)\r\n            scrollTo(panelRef.current);\r\n        } else if (offerEdit.commonData.status !== DemandValidationSectionStatus.OK) {\r\n            simpleAlert(Tr(\"fill_missing_data_x\", {name: 'contractor_company_data'}, true), false);\r\n            scrollTo(panelRef.current);\r\n        } else {\r\n            const unsavedPos = offerEdit.positions.find(x => !!formValues[\"offerPositionForm_\" + x.positionId + \"_dirty\"])\r\n            if (unsavedPos) {\r\n                simpleAlert(Tr(\"save_form_x\", {name: Tr(\"part_x\", {x: unsavedPos.order}) + \": \" + unsavedPos.name}), false)\r\n                scrollTo(\"#offerPositionForm_\" + unsavedPos.positionId, 60);\r\n            } else {\r\n\r\n                const readyPositions = offerEdit.positions.filter(x => OfferPositionStatusesReadyToOffering.includes(x.status));\r\n                if (readyPositions.length === 0) {\r\n                    simpleAlert(\"fill_at_least_one_position\");\r\n                    scrollTo(positionsRef.current);\r\n                } else {\r\n                    if (contextSection.onePositionMode) {\r\n                        simpleConfirmNoTranslate(stageTr(!purchaserOfferContext ? \"place_offer_confirm\" : \"place_offer_confirm_operator\"), () => submitChoosePositions([readyPositions[0].positionId]))\r\n                    } else {\r\n                        setChoosePositionPopup(purchaserOfferContext ? POPUP_MODE.OPERATOR_PLACE : POPUP_MODE.OFFER);\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    const withdrawOffer = () => {\r\n        if (contextSection.onePositionMode) {\r\n            simpleConfirmNoTranslate(stageTr(\"withdraw_offer_confirm\"), () => submitChoosePositionsWithdraw([offerEdit.positions[0].positionId]))\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.WITHDRAW);\r\n        }\r\n    }\r\n\r\n    const deleteOffer = () => {\r\n        if (contextSection.onePositionMode) {\r\n            simpleConfirmNoTranslate(stageTr(\"delete_offer_confirm\"), () => submitDeleteOffer([offerEdit.positions[0].positionId]))\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.DELETE_OFFER);\r\n        }\r\n    }\r\n\r\n    const submitChoosePositions = (positionIds) => {\r\n        //walidacja dodania espd\r\n        let espdComplete = true;\r\n        if (offerEdit.offerEspdType === ContractorOfferEspdType.YES) {\r\n            if (offerEdit.espdOnPositions) {\r\n                const missing = positionIds.filter(posId => offerEdit.espdFiles.findIndex(f => f.positionId === posId) < 0);\r\n                if (missing.length > 0) {\r\n                    espdComplete = false;\r\n                    const missingPos = offerEdit.positions.find(x => x.positionId === missing[0]) || {};\r\n                    simpleAlert(Tr(\"save_espd_form_x\", {name: Tr(\"part_x\", {x: missingPos.order}) + \": \" + missingPos.name}), false)\r\n                }\r\n            } else {\r\n                const espd = offerEdit.espdFiles.findIndex(x => !x.positionId);\r\n                if (espd < 0) {\r\n                    espdComplete = false;\r\n                    simpleAlert(\"save_espd_form\")\r\n                }\r\n            }\r\n        }\r\n        if (espdComplete) {\r\n            if (!purchaserOfferContext && contextSection.digitalSign) {\r\n                DemandOffersOfferService.verifyBeforePlaceOffer(demandId, stageId, undefined, positionIds).then((resp) => {\r\n                    if (resp.success && resp.result.length > 0) {\r\n                        setVerifyBeforePlacePopup(getVerificationBeforePlaceOfferPopupConfig(resp.result, positionIds))\r\n                    } else {\r\n                        doSubmitChoosePositions(positionIds)\r\n                    }\r\n                }).catch((e) => {\r\n                    doSubmitChoosePositions(positionIds);\r\n                    console.error(e)\r\n                })\r\n\r\n            } else {\r\n                doSubmitChoosePositions(positionIds)\r\n            }\r\n        }\r\n    }\r\n\r\n    const doSubmitChoosePositions = (positionIds) => {\r\n        if (!purchaserOfferContext && contextSection.digitalSign) {\r\n            doSignDocContent(\r\n                contextSection.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandOffersOfferService.getDocumentToSign(demandId, stageId, {positionIds, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitPlaceOffer(positionIds, signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n            )\r\n        } else {\r\n            submitPlaceOffer(positionIds);\r\n        }\r\n\r\n    }\r\n\r\n    const submitChoosePositionsWithdraw = (positionIds) => {\r\n        if (contextSection.digitalSign) {\r\n            doSignDocContent(\r\n                contextSection.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandOffersOfferService.getDocumentToWithdraw(demandId, stageId, {positionIds, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitWithdrawOffer(positionIds, signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => {\r\n                    const result = await DemandOffersOfferService.requireWithdrawEncryption(demandId, stageId, positionIds);\r\n                    if (!result) {\r\n                        breakSigning();\r\n                    } else if (result.requireEncryption) {\r\n                        return result.roundId;\r\n                    } else {\r\n                        return null;\r\n                    }\r\n                }\r\n            )\r\n        } else {\r\n            submitWithdrawOffer(positionIds);\r\n        }\r\n    }\r\n\r\n    const signOffer = () => {\r\n        doSignDocContent(\r\n            contextSection.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandOffersOfferService.getDocumentToSign(demandId, stageId, {positionIds: null, signatureType: sigType});\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen();\r\n                DemandOffersOfferService.signOffer(demandId, stageId, {\r\n                    positionIds: null,\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, contextSection.onePositionMode, stageTr).finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n        )\r\n    }\r\n\r\n    const printOfferPosition = () => {\r\n        DemandOffersOfferService.printOfferPosition(demandId, stageId, mode, offerEdit.positions[0].positionId, purchaserOfferContext?.supplierId, purchaserOfferContext?.preview)\r\n    }\r\n    const signWithdrawOffer = () => {\r\n        doSignDocContent(\r\n            contextSection.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandOffersOfferService.getDocumentToWithdraw(demandId, stageId, {positionIds: null, signatureType: sigType});\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen()\r\n                DemandOffersOfferService.signWithdraw(demandId, stageId, {\r\n                    positionIds: null,\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, contextSection.onePositionMode, stageTr)\r\n                    .finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => {\r\n                const result = await DemandOffersOfferService.requireWithdrawEncryption(demandId, stageId, null);\r\n                if (!result) {\r\n                    breakSigning();\r\n                } else if (result.requireEncryption) {\r\n                    return result.roundId;\r\n                } else {\r\n                    return null;\r\n                }\r\n            }\r\n        )\r\n    }\r\n\r\n\r\n    const submitPlaceOffer = (positionIds, signatureType, signature, signatureFileId) => {\r\n        showLoadingScreen();\r\n        DemandOffersOfferService.placeOffer(demandId, stageId, purchaserOfferContext?.supplierId, contextSection.onePositionMode, {\r\n            positions: positionIds ? positionIds.map(positionId => ({\r\n                positionId\r\n            })) : null,\r\n            signatureType,\r\n            signature,\r\n            signatureFileId\r\n        }, stageTr).finally(hideLoadingScreen)\r\n    }\r\n\r\n    const submitWithdrawOffer = (positionIds, signatureType, signature, signatureFileId) => {\r\n        showLoadingScreen()\r\n        DemandOffersOfferService.withdrawOffer(demandId, stageId, {\r\n                positions: positionIds ? positionIds.map(positionId => ({\r\n                    positionId\r\n                })) : null,\r\n                signatureType,\r\n                signature,\r\n                signatureFileId\r\n            },\r\n            contextSection.onePositionMode, stageTr).finally(hideLoadingScreen)\r\n    }\r\n\r\n    const submitDeleteOffer = (positionIds) => {\r\n        showLoadingScreen()\r\n        DemandOffersOfferService.deleteOffer(demandId, stageId, positionIds, stageTr).finally(hideLoadingScreen)\r\n    }\r\n\r\n    const stopSigningOperation = (placingOffer) => {\r\n        simpleConfirmNoTranslate(stageTr(placingOffer ? \"sign_offer_form_stop_confirm\" : \"sign_withdraw_form_stop_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandOffersOfferService.stopSigningOperation(demandId, stageId).finally(hideLoadingScreen)\r\n            }\r\n        )\r\n    }\r\n\r\n    const navigationBarButtons = () => {\r\n        const buttons = [];\r\n        if (!disabled && offerEdit.offerStatus === OfferStatusType.NORMAL) {\r\n            if (!purchaserOfferContext && !contextSection.onePositionMode && offerEdit.positions.findIndex(x => OfferPositionStatusesReadyToDelete.includes(x.status)) > -1) {\r\n                buttons.push(createButton(stageTr(\"delete_offer_position\"), deleteOffer, 'outlined', HighlightOffIcon, undefined, supportMode, false, false));\r\n            }\r\n            if (!purchaserOfferContext && offerEdit.positions.findIndex(x => OfferPositionStatusesReadyToWithdraw.includes(x.status)) > -1) {\r\n                buttons.push(createButton(stageTr(\"withdraw_offer_position\"), withdrawOffer, 'outlined', HighlightOffIcon, undefined, supportMode, false, false));\r\n            }\r\n            buttons.push(createButton(stageTr(!purchaserOfferContext ? \"place_offer\" : \"place_offer_operator\"), placeOffer, undefined, CheckCircleIcon, 'primary', supportMode || purchaserOfferContext?.preview, false, false));\r\n        }\r\n\r\n        if (offerEdit.offerStatus === OfferStatusType.WAITING_SIGNATURE) {\r\n            buttons.push(createButton(stageTr(\"sign_offer_form_stop\"), () => stopSigningOperation(true), 'outlined', CancelIcon, undefined, supportMode, false, false));\r\n            buttons.push(createButton(stageTr(\"sign_offer_form\"), signOffer, undefined, SignatureIcon, 'primary', supportMode, false, false));\r\n\r\n        }\r\n        if (offerEdit.offerStatus === OfferStatusType.WAITING_WITHDRAW_SIGNATURE) {\r\n            buttons.push(createButton(stageTr(\"sign_withdraw_form_stop\"), () => stopSigningOperation(false), \"outlined\", CancelIcon, 'primary', supportMode, false, false));\r\n            buttons.push(createButton(stageTr(\"sign_withdraw_form\"), signWithdrawOffer, undefined, SignatureIcon, 'primary', supportMode, false, false));\r\n        }\r\n        if(purchaserOfferContext?.preview && !offerEdit.passiveOfferForm && offerEdit.positions.length === 1) {\r\n            buttons.push(createButton(\"download_print\", printOfferPosition, undefined, PrintIcon, 'primary', false, true, true));\r\n        }\r\n\r\n        return buttons;\r\n    }\r\n\r\n    const successPositionsSelectPopup = (positionIds) => {\r\n        ((mode, posIds) => {\r\n            setChoosePositionPopup(null)\r\n            switch (mode) {\r\n                case POPUP_MODE.OFFER:\r\n                case POPUP_MODE.OPERATOR_PLACE:\r\n                    submitChoosePositions(posIds);\r\n                    break;\r\n                case POPUP_MODE.WITHDRAW:\r\n                    submitChoosePositionsWithdraw(posIds);\r\n                    break;\r\n                case POPUP_MODE.DELETE_OFFER:\r\n                    submitDeleteOffer(posIds);\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unsupported popup mode: \" + mode);\r\n\r\n            }\r\n        })(choosePositionPopup, positionIds)\r\n    }\r\n    const printVerificationSalesCheck = useSalesNotification(salesNotificationKeys.SIGNATURE_VERIFICATOR, () => setVerifyPopup(getVerificationConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.BASE)));\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (!purchaserOfferContext?.preview) {\r\n            if (!!purchaserOfferContext && mode === OfferMode.PLACED) {\r\n                buttons.push(createMultiButton(Tr(\"verify_documents\"), printVerificationSalesCheck, undefined, false, undefined, false, SignatureIcon));\r\n            }\r\n\r\n            if(!purchaserOfferContext && mode === OfferMode.EDIT && !offerEdit.passiveOfferForm) {\r\n                buttons.push(createMultiButton(Tr(\"offer_form_import_export\"), () => setImportTemplatePopup(true),\r\n                    undefined, disabled, undefined, false, ImportExportIcon));\r\n            }\r\n\r\n            buttons.push(createMultiButton(Tr(\"change_history\"), () => setChooseSnapshotPopup(getConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.BASE)),\r\n                \"outlined\", false, undefined, false, HistoryIcon));\r\n\r\n        }\r\n        return buttons;\r\n    }\r\n\r\n    return dataLoading ? <Loading/> :\r\n        <div className={classes.root}>\r\n            <GridBlock column>\r\n                <MultiButton buttons={getButtons()}/>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_data')}>\r\n                    <OfferContractorData offerEdit={offerEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_company_data')}>\r\n                    <OfferCommonData disabled={disabled || mode === OfferMode.PLACED} offerEdit={offerEdit} section={contextSection}/>\r\n                </GeneralInfoEntry>\r\n\r\n                {\r\n                    offerEdit.offerEspdType !== ContractorOfferEspdType.NO &&\r\n                    <GeneralInfoEntry biggerLabel label={Tr('jedz_full')}>\r\n                        <OfferEspd roundType={RoundType.BASE} mode={mode} disabled={disabled} offerEdit={offerEdit} section={contextSection} />\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                <GeneralInfoEntry biggerLabel label={<>\r\n                    {stageTr(\"offer_documents\")}\r\n                    {(offerEdit.passiveOfferForm || contextSection.digitalSign) &&\r\n                        <HelpTooltip className={classes.marginLeft} dangerouslySetTextHTML={Tr(\"offer_documents_signature_tooltip_html\")}/>}\r\n                </>}>\r\n                    <OfferFiles roundType={RoundType.BASE} mode={mode} disabled={disabled} offerEdit={offerEdit} section={contextSection}/>\r\n                </GeneralInfoEntry>\r\n\r\n                {\r\n                    !offerEdit.passiveOfferForm &&\r\n                    <OfferPositions roundType={RoundType.BASE} positionsRef={positionsRef} offerEdit={offerEdit} mode={mode} disabled={disabled}/>\r\n                }\r\n\r\n            </GridBlock>\r\n\r\n            {\r\n                (!purchaserOfferContext || mode === OfferMode.EDIT) && <div className={classes.floatingMenu}>\r\n                    <NavigationBar buttons={navigationBarButtons()} classesObj={classes}/>\r\n                </div>\r\n            }\r\n            {\r\n                !!choosePositionPopup && <OfferPositionsSelectPopup\r\n                    popupMode={choosePositionPopup}\r\n                    offerEdit={offerEdit}\r\n                    onCancel={() => setChoosePositionPopup(null)}\r\n                    onSuccess={successPositionsSelectPopup}\r\n                    digitalSign={contextSection.digitalSign}\r\n                />\r\n            }\r\n            {\r\n                !!chooseSnapshotPopup && <SnapshotListPopup\r\n                    onClose={() => setChooseSnapshotPopup(null)}\r\n                    config={chooseSnapshotPopup}\r\n                />\r\n            }\r\n            {\r\n                !!verifyPopup && <VerificationsPopup\r\n                    onClose={() => setVerifyPopup(null)}\r\n                    config={verifyPopup}\r\n                />\r\n            }\r\n            {\r\n                !!verifyBeforePlacePopup && <VerificationBeforePlaceOfferPopup\r\n                    onCancel={() => setVerifyBeforePlacePopup(null)}\r\n                    onConfirm={(positionIds) => {\r\n                        setVerifyBeforePlacePopup(null);\r\n                        doSubmitChoosePositions(positionIds);\r\n                    }}\r\n                    config={verifyBeforePlacePopup}\r\n                />\r\n            }\r\n            {\r\n                !!importTemplatePopup && <ImportOfferFormPopup\r\n                    onClose={() => setImportTemplatePopup(false)}\r\n                />\r\n            }\r\n        </div>\r\n}\r\n\r\nOfferEditPanel.propTypes = {\r\n    sectionId: PropTypes.string.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    offerEdit: state.resources[DemandOffersOfferService.OFFER_EDIT],\r\n    formSubmit: state.form,\r\n    formValues: state.formValues,\r\n}), {})(OfferEditPanel);","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport {getSectionVariant} from \"../../constants/StageSections\";\r\n\r\n\r\nfunction OfferExpansionSectionTitle(\r\n    {\r\n        section\r\n    }) {\r\n\r\n    return (\r\n        <GridBlock alignItems=\"center\">\r\n            <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n            <Typography variant='h6'>\r\n                {section.name}\r\n            </Typography>\r\n        </GridBlock>\r\n    )\r\n\r\n}\r\n\r\nOfferExpansionSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default OfferExpansionSectionTitle;","import React, {useContext} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport {getSectionVariant} from \"../../../../constants/StageSections\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport Button from \"components/Button\";\r\nimport {OfferStatusType} from \"../../../common/constants/OfferStatusType\";\r\nimport CancelIcon from \"@material-ui/icons/Cancel\";\r\nimport DeleteIcon from '@material-ui/icons/Delete';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {useParams} from \"react-router\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport {ContractorPasswordState} from \"constants/ContractorPasswordState\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    marginRight: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    offerDate: {\r\n        marginLeft: theme.spacing(4),\r\n        fontStyle: \"italic\"\r\n    }\r\n}))\r\n\r\n\r\nfunction OfferEditSectionTitle(\r\n    {\r\n        section,\r\n        expanded\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const {hideLoadingScreen, showLoadingScreen} = useLoadingScreen();\r\n    const {doSignDocContent, breakSigning} = useSignature();\r\n    const stopSigningOperation = (e) => {\r\n        e.stopPropagation();\r\n        simpleConfirmNoTranslate(stageTr(\"sign_offer_form_stop_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandOffersOfferService.stopSigningOperation(demandId, stageId).finally(hideLoadingScreen);\r\n            }\r\n        )\r\n    }\r\n    const deleteOffer = (e) => {\r\n        e.stopPropagation();\r\n        simpleConfirmNoTranslate(stageTr(\"delete_offer_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandOffersOfferService.deleteOffer(demandId, stageId, undefined, stageTr).finally(hideLoadingScreen);\r\n            }\r\n        )\r\n    }\r\n\r\n    const signPlaceOffer = (e) => {\r\n        e.stopPropagation();\r\n\r\n        (async () => {\r\n            try {\r\n                const passResp = await DemandOffersService.getPasswordStatus(demandId, stageId);\r\n                if (isResponseValid((passResp))) {\r\n                    if (passResp.result.state === ContractorPasswordState.HAS_PASSWORD_STORED) {\r\n                        signOffer();\r\n                    } else {\r\n                        DemandOffersService.openContractorPasswordPopup(() => signOffer, () => null)\r\n                    }\r\n                }\r\n            } catch (e) {\r\n                console.error(e);\r\n            }\r\n            hideLoadingScreen();\r\n        })();\r\n\r\n    }\r\n\r\n    const signOffer = () => {\r\n        doSignDocContent(\r\n            section.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandOffersOfferService.getDocumentToSign(demandId, stageId, {positionIds: null, signatureType: sigType});\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen();\r\n                DemandOffersOfferService.signOffer(demandId, stageId, {\r\n                    positionIds: null,\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, section.onePositionMode, stageTr)\r\n                    .finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => section.roundId\r\n        )\r\n    }\r\n\r\n    return (\r\n        <GridBlock alignItems=\"center\" justify=\"space-between\">\r\n            <GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n                <Typography variant='h6'>\r\n                    {section.name}\r\n                </Typography>\r\n                {!!section.offerTmpDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {stageTr(\"offer_tmp_date\")}: {moment(section.offerTmpDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                    </Typography>\r\n                }\r\n            </GridBlock>\r\n\r\n            {\r\n                (!purchaserOfferContext && section.contractorOfferStatus === OfferStatusType.NORMAL && section.offerDate === null && section.offerTmpDate !== null && section.editable) &&\r\n                <Button Icon={DeleteIcon} onClick={deleteOffer} variant='outlined' disabled={supportMode}>{stageTr(\"delete_offer\")}</Button>\r\n            }\r\n\r\n            {(!expanded && section.contractorOfferStatus === OfferStatusType.WAITING_SIGNATURE) &&\r\n                <div>\r\n                    <Button Icon={CancelIcon} onClick={stopSigningOperation} variant='outlined' disabled={supportMode}\r\n                            className={classes.marginRight}>{stageTr(\"sign_offer_form_stop\")}</Button>\r\n                    <Button Icon={SignatureIcon} onClick={signPlaceOffer} disabled={supportMode}>{stageTr(\"sign_offer_form\")}</Button>\r\n                </div>\r\n            }\r\n        </GridBlock>\r\n    )\r\n\r\n}\r\n\r\nOfferEditSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default OfferEditSectionTitle;","import React from 'react'\r\nimport OfferEditPanel from \"../offerEdit/OfferEditPanel\";\r\n\r\nfunction OfferPlacedPanel(\r\n    {\r\n        panelRef,\r\n        sectionId\r\n    }) {\r\n    return <OfferEditPanel panelRef={panelRef} sectionId={sectionId} />\r\n}\r\n\r\nexport default OfferPlacedPanel;","import React, {useContext} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport Button from \"components/Button\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {useParams} from \"react-router\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport {getSectionVariant} from \"../../../../constants/StageSections\";\r\nimport {OfferStatusType} from \"../../../common/constants/OfferStatusType\";\r\nimport HighlightOffIcon from \"@material-ui/icons/HighlightOff\";\r\nimport CancelIcon from \"@material-ui/icons/Cancel\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport {ContractorPasswordState} from \"constants/ContractorPasswordState\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    marginRight: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    offerDate: {\r\n        marginLeft: theme.spacing(4),\r\n        fontStyle: \"italic\"\r\n    }\r\n}))\r\n\r\nfunction OfferPlacedSectionTitle(\r\n    {\r\n        section,\r\n        expanded,\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const {doSignDocContent, breakSigning} = useSignature();\r\n    const {hideLoadingScreen, showLoadingScreen} = useLoadingScreen();\r\n\r\n    const withdrawWholeOffer = (e) => {\r\n        e.stopPropagation();\r\n        if (section.digitalSign) {\r\n            doSignDocContent(\r\n                section.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandOffersOfferService.getDocumentToWithdraw(demandId, stageId, {positionIds: null, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitWithdrawOffer(null, signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => {\r\n                    const result = await DemandOffersOfferService.requireWithdrawEncryption(demandId, stageId, null);\r\n                    if (!result) {\r\n                        breakSigning();\r\n                    } else if (result.requireEncryption) {\r\n                        return result.roundId;\r\n                    } else {\r\n                        return null;\r\n                    }\r\n                }\r\n            )\r\n        } else {\r\n            simpleConfirmNoTranslate(stageTr(\"withdraw_offer_confirm\"), submitWithdrawOffer)\r\n\r\n        }\r\n    }\r\n\r\n    const submitWithdrawOffer = (positionIds, signatureType, signature, signatureFileId) => {\r\n        showLoadingScreen();\r\n        DemandOffersOfferService.withdrawOffer(demandId, stageId, {positionIds, signatureType, signature, signatureFileId}, section.onePositionMode, stageTr)\r\n            .finally(hideLoadingScreen)\r\n    }\r\n\r\n    const stopSigningOperation = (e) => {\r\n        e.stopPropagation();\r\n        simpleConfirmNoTranslate(stageTr(\"sign_withdraw_form_stop_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandOffersOfferService.stopSigningOperation(demandId, stageId).finally(hideLoadingScreen)\r\n            }\r\n        )\r\n    }\r\n\r\n    const signWithdrawOffer = (e) => {\r\n        e.stopPropagation();\r\n\r\n        (async () => {\r\n            showLoadingScreen();\r\n            const result = await DemandOffersOfferService.requireWithdrawEncryption(demandId, stageId, null);\r\n            if (!result) {\r\n                hideLoadingScreen();\r\n            } else if (result.requireEncryption) {\r\n                try {\r\n                    const passResp = await DemandOffersService.getPasswordStatus(demandId, stageId);\r\n                    if (isResponseValid((passResp))) {\r\n                        if (passResp.result.state === ContractorPasswordState.HAS_PASSWORD_STORED) {\r\n                            submitSignWithdrawOffer(result.roundId);\r\n                        } else {\r\n                            DemandOffersService.openContractorPasswordPopup(() => submitSignWithdrawOffer(result.roundId), () => null)\r\n                        }\r\n                    }\r\n                } catch (e) {\r\n                    console.error(e);\r\n                }\r\n                hideLoadingScreen();\r\n            } else {\r\n                submitSignWithdrawOffer(null);\r\n                hideLoadingScreen();\r\n            }\r\n\r\n\r\n        })()\r\n    }\r\n\r\n    const submitSignWithdrawOffer = (encryptionRoundId) => {\r\n\r\n        doSignDocContent(\r\n            section.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandOffersOfferService.getDocumentToWithdraw(demandId, stageId, {positionIds: null, signatureType: sigType});\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen()\r\n                DemandOffersOfferService.signWithdraw(demandId, stageId, {\r\n                    positionIds: null,\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, section.onePositionMode, stageTr)\r\n                    .finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => encryptionRoundId\r\n        )\r\n\r\n    }\r\n\r\n    return (\r\n        <GridBlock alignItems=\"center\" justify=\"space-between\">\r\n            <GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n                <Typography variant='h6'>\r\n                    {section.name}\r\n                </Typography>\r\n                {!!section.offerDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {stageTr(\"offer_date\")}: {moment(section.offerDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                    </Typography>\r\n                }\r\n            </GridBlock>\r\n            {(section.status !== DemandValidationSectionStatus.DISABLED && !section.offerCollectionEnded && section.contractorOfferStatus === OfferStatusType.WAITING_WITHDRAW_SIGNATURE) && <>\r\n                <Button Icon={CancelIcon} onClick={stopSigningOperation} variant='outlined' disabled={supportMode}\r\n                        className={classes.marginRight}>{stageTr(\"sign_withdraw_form_stop\")}</Button>\r\n                <Button Icon={SignatureIcon} onClick={signWithdrawOffer} disabled={supportMode}>{stageTr(\"sign_withdraw_form\")}</Button>\r\n            </>\r\n            }\r\n            {(section.status !== DemandValidationSectionStatus.DISABLED && !section.offerCollectionEnded && section.contractorOfferStatus === OfferStatusType.NORMAL) &&\r\n                <Button onClick={withdrawWholeOffer} variant=\"outlined\" Icon={HighlightOffIcon} disabled={supportMode}>{stageTr(\"withdraw_offer_full\")}</Button>\r\n            }\r\n        </GridBlock>\r\n    )\r\n\r\n}\r\n\r\nOfferPlacedSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default OfferPlacedSectionTitle;","import React from \"react\"\r\nimport OfferCommonDataForm from \"../../../../common/commonData/OfferCommonDataForm\";\r\n\r\nconst CONTRACTOR_ADDITIONAL_OFFER_EDIT_COMMON_DATA_FORM_ID = \"cont_additional_offer_edit_common_data\";\r\n\r\nfunction AdditionalOfferCommonData(\r\n    {\r\n        offerEdit,\r\n        section\r\n    }) {\r\n\r\n    return <OfferCommonDataForm\r\n        offerEdit={offerEdit}\r\n        section={section}\r\n        onSubmit={() => void 0}\r\n        formId={CONTRACTOR_ADDITIONAL_OFFER_EDIT_COMMON_DATA_FORM_ID}\r\n        working={false}\r\n        disabled\r\n    />\r\n}\r\n\r\nAdditionalOfferCommonData.propTypes = {}\r\nexport default AdditionalOfferCommonData;","import React from 'react'\r\nimport {connect} from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport PropTypes from 'prop-types'\r\nimport moment from \"libs/moment\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport DateFormats from \"constants/DateFormats\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    disabledEmpty: {\r\n        fontStyle: 'italic'\r\n    },\r\n    textField: {\r\n        wordBreak: \"break-word\",\r\n        whiteSpace: 'pre-line',\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\n\r\nfunction EnvelopeOfferDatePopup(\r\n    {\r\n        positions,\r\n        onCancel,\r\n        onSubmit,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('register_envelope')}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('confirm')}\r\n                    onClickFirst={onCancel}\r\n                    onClickSecond={handleSubmit}\r\n                />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    envelopeOfferDate: moment(positions[0].offerDate),\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    envelopeOfferDate: VS.lazy((offerDate) => {\r\n                        if (!offerDate)\r\n                            return VS.anyRequired();\r\n                        const startMoment = moment(positions[0].startDate);\r\n                        if (offerDate.isBefore(startMoment))\r\n                            return VS.immediatelyError(Tr(\"v_data_cannot_be_before\", {min: startMoment.format(DateFormats.DATETIME_FORMAT)}))\r\n                        const endMoment = moment(positions[0].endDate);\r\n                        if (offerDate.isAfter(endMoment))\r\n                            return VS.immediatelyError(Tr(\"v_data_cannot_be_after\", {max: endMoment.format(DateFormats.DATETIME_FORMAT)}))\r\n                        return VS.any();\r\n                    }),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <DateTimePicker\r\n                            id=\"envelopeOfferDate\"\r\n                            formikProps={formikProps}\r\n                            label={Tr(\"offer_date\")}\r\n                            className={classes.select}\r\n                        />\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nEnvelopeOfferDatePopup.propTypes = {\r\n    positions: PropTypes.arrayOf(PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        endDate: PropTypes.string.isRequired,\r\n        startDate: PropTypes.string.isRequired,\r\n        offerDate: PropTypes.string.isRequired,\r\n    })).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(EnvelopeOfferDatePopup);","import React, {useContext, useEffect, useRef, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {connect} from \"react-redux\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport GeneralInfoEntry from \"../generalInfo/components/GeneralInfoEntry\";\r\nimport Tr from 'translations/Translations'\r\nimport {ContractorOfferEspdType} from \"constants/ContractorOfferEspdType\";\r\nimport NavigationBar from \"components/complex/floatingMenu/NavigationBar\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport createButton from \"components/complex/floatingMenu/createButton\";\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\r\nimport CancelIcon from '@material-ui/icons/Cancel';\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport {OfferPositionStatusesReadyToOffering, OfferPositionStatusType} from \"../../common/constants/OfferPositionStatusType\";\r\nimport OfferPositionsSelectPopup, {POPUP_MODE} from \"../../common/OfferPositionsSelectPopup\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport {StageSectionsUrlParams} from \"../../../constants/StageSections\";\r\nimport {OfferMode} from \"../../common/constants/OfferMode\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport AdditionalOfferCommonData from \"./components/commonData/AdditionalOfferCommonData\";\r\nimport OfferPositions from \"../offerEdit/components/positions/OfferPositions\";\r\nimport OfferEspd from \"../offerEdit/components/espd/OfferEspd\";\r\nimport OfferFiles from \"../offerEdit/components/files/OfferFiles\";\r\nimport OfferContractorData from \"../../common/contractorData/OfferContractorData\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport EnvelopeOfferDatePopup from \"./components/EnvelopeOfferDatePopup\";\r\nimport {OfferStatusType} from \"../../common/constants/OfferStatusType\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport MultiButton, {createButton as createMultiButton} from \"components/popup/components/MultiButton\";\r\nimport SnapshotListPopup, {getConfig} from \"../offerEdit/components/SnapshotListPopup\";\r\nimport HistoryIcon from \"@material-ui/icons/History\";\r\nimport VerificationsPopup, {getVerificationConfig} from \"../offerEdit/components/VerificationsPopup\";\r\nimport useSalesNotification from \"hooks/useSalesNotification\";\r\nimport salesNotificationKeys from \"components/popup/salesNotification/constants/salesNotification.keys\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport {CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID} from \"../offerEdit/components/commonData/OfferCommonData\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport VerificationBeforePlaceOfferPopup, {getVerificationBeforePlaceOfferPopupConfig} from \"../offerEdit/components/VerificationBeforePlaceOfferPopup\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    floatingMenu: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        bottom: 0,\r\n        marginTop: theme.spacing()\r\n    },\r\n    menuBarPaper: {\r\n        background: theme.palette.background.default,\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction AdditionalOfferEditPanel(\r\n    {\r\n        panelRef,\r\n        demandHeader,\r\n        additionalOfferEdit,\r\n        formSubmit,\r\n        formValues,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const section = params.section;\r\n    const mode = section === StageSectionsUrlParams.ADDITIONAL_OFFER_EDIT ? OfferMode.EDIT : OfferMode.PLACED;\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const realOnePositionMode = contextSection.onePositionMode || !additionalOfferEdit || additionalOfferEdit.positions.length === 1;\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const disabled = additionalOfferEdit ? additionalOfferEdit.disabled : true;\r\n    const dataLoading = !additionalOfferEdit || !demandHeader;\r\n    const positionsRef = useRef();\r\n    const {showLoadingScreen, hideLoadingScreen} = useLoadingScreen();\r\n    const [choosePositionPopup, setChoosePositionPopup] = useState(null);\r\n    const [chooseEnvelopeOfferDatePopup, setChooseEnvelopeOfferDatePopup] = useState(null);\r\n    const [chooseSnapshotPopup, setChooseSnapshotPopup] = useState(null);\r\n    const [verifyPopup, setVerifyPopup] = useState(null);\r\n    const [verifyBeforePlacePopup, setVerifyBeforePlacePopup] = useState(null);\r\n\r\n    const {doSignDocContent, breakSigning} = useSignature();\r\n\r\n    useStepperStateCloseValidator(CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID, () => {\r\n        return !(additionalOfferEdit.positions.findIndex(x => !!formValues[\"offerPositionForm_\" + x.positionId + \"_dirty\"]) > -1)\r\n    })\r\n\r\n    useEffect(() => {\r\n            if (!dataLoading) {\r\n                setTimeout((elem) => scrollTo(elem), 100, panelRef.current);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n        , [dataLoading])\r\n\r\n    useEffect(() => {\r\n        DemandAdditionalOffersOfferService.getOfferEdit(demandId, stageId, mode, purchaserOfferContext?.supplierId);\r\n        return () => {\r\n            DemandAdditionalOffersOfferService.clearResources(DemandAdditionalOffersOfferService.ADDITIONAL_OFFER_EDIT);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandId, stageId, section])\r\n\r\n\r\n    const placeOffer = () => {\r\n        if (additionalOfferEdit.commonData.status !== DemandValidationSectionStatus.OK) {\r\n            simpleAlert(Tr(\"fill_missing_data_x\", {name: 'contractor_company_data'}, true), false);\r\n            scrollTo(panelRef.current);\r\n        } else {\r\n            const unsavedPos = additionalOfferEdit.positions.find(x => !!formValues[\"offerPositionForm_\" + x.positionId + \"_dirty\"])\r\n            if (unsavedPos) {\r\n                simpleAlert(Tr(\"save_form_x\", {name: Tr(\"part_x\", {x: unsavedPos.order}) + \": \" + unsavedPos.name}), false)\r\n                scrollTo(\"#offerPositionForm_\" + unsavedPos.positionId, 60);\r\n            } else {\r\n\r\n                const readyPositions = additionalOfferEdit.positions.filter(x => OfferPositionStatusesReadyToOffering.includes(x.status));\r\n                if (readyPositions.length === 0) {\r\n                    simpleAlert(\"fill_at_least_one_position\");\r\n                    scrollTo(positionsRef.current);\r\n                } else {\r\n                    if (realOnePositionMode) {\r\n                        simpleConfirmNoTranslate(stageTr(!purchaserOfferContext ? \"place_offer_confirm\" : \"place_offer_confirm_operator\"), () => submitChoosePositions([readyPositions[0].positionId]))\r\n                    } else {\r\n                        setChoosePositionPopup(purchaserOfferContext ? POPUP_MODE.OPERATOR_PLACE : POPUP_MODE.OFFER);\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    const withdrawOffer = () => {\r\n        if (realOnePositionMode) {\r\n            simpleConfirmNoTranslate(stageTr(\"withdraw_offer_confirm\"), () => submitChoosePositionsWithdraw([additionalOfferEdit.positions[0].positionId]))\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.WITHDRAW);\r\n        }\r\n    }\r\n\r\n    const submitChoosePositions = (positionIds) => {\r\n        if (!purchaserOfferContext && contextSection.digitalSign) {\r\n            DemandAdditionalOffersOfferService.verifyBeforePlaceOffer(demandId, stageId, undefined, positionIds).then((resp) => {\r\n                if (resp.success && resp.result.length > 0) {\r\n                    setVerifyBeforePlacePopup(getVerificationBeforePlaceOfferPopupConfig(resp.result, positionIds))\r\n                } else {\r\n                    doSubmitChoosePositions(positionIds)\r\n                }\r\n            }).catch((e) => {\r\n                doSubmitChoosePositions(positionIds);\r\n                console.error(e)\r\n            })\r\n\r\n        } else {\r\n            doSubmitChoosePositions(positionIds)\r\n        }\r\n    }\r\n    const doSubmitChoosePositions = (positionIds) => {\r\n        if (!purchaserOfferContext && contextSection.digitalSign) {\r\n            doSignDocContent(\r\n                contextSection.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandAdditionalOffersOfferService.getDocumentToSign(demandId, stageId, {positionIds, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitPlaceOffer(positionIds[0], signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n            )\r\n        } else {\r\n            submitPlaceOffer(positionIds[0]);\r\n        }\r\n    }\r\n\r\n    const submitChoosePositionsWithdraw = (positionIds) => {\r\n        if (contextSection.digitalSign) {\r\n            doSignDocContent(\r\n                contextSection.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandAdditionalOffersOfferService.getDocumentToWithdraw(demandId, stageId, {positionIds, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitWithdrawOffer(positionIds, signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => {\r\n                    const result = await DemandAdditionalOffersOfferService.requireWithdrawEncryption(demandId, stageId, positionIds);\r\n                    if (!result) {\r\n                        breakSigning();\r\n                    } else if (result.requireEncryption) {\r\n                        return result.roundId;\r\n                    } else {\r\n                        return null;\r\n                    }\r\n                }\r\n            )\r\n        } else {\r\n            submitWithdrawOffer(positionIds);\r\n        }\r\n    }\r\n\r\n    const signOffer = () => {\r\n        if (realOnePositionMode) {\r\n            doSignOffer([additionalOfferEdit.positions[0].positionId])\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.OFFER_SIGN);\r\n        }\r\n    }\r\n\r\n    const doSignOffer = (positionIds) => {\r\n        doSignDocContent(\r\n            contextSection.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandAdditionalOffersOfferService.getDocumentToSign(demandId, stageId, {\r\n                    positionIds: positionIds,\r\n                    signatureType: sigType\r\n                });\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen();\r\n                DemandAdditionalOffersOfferService.signOffer(demandId, stageId, {\r\n                    positions: [{positionId: positionIds[0]}],\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, realOnePositionMode, stageTr).finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n        )\r\n    }\r\n\r\n\r\n    const deleteOffer = () => {\r\n        if (realOnePositionMode) {\r\n            doDeleteOffer([additionalOfferEdit.positions[0].positionId])\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.DELETE_OFFER)\r\n        }\r\n\r\n    }\r\n\r\n    const doDeleteOffer = (positionId) => {\r\n        simpleConfirmNoTranslate(stageTr(\"delete_offer_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandAdditionalOffersOfferService.deleteOffer(demandId, stageId, positionId).finally(hideLoadingScreen)\r\n            }\r\n        )\r\n    }\r\n\r\n\r\n    const signWithdrawOffer = () => {\r\n        if (realOnePositionMode) {\r\n            doSignWithdrawOffer([additionalOfferEdit.positions[0].positionId])\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.WITHDRAW_SIGN)\r\n        }\r\n\r\n    }\r\n\r\n    const doSignWithdrawOffer = (positionIds) => {\r\n\r\n        doSignDocContent(\r\n            contextSection.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandAdditionalOffersOfferService.getDocumentToWithdraw(demandId, stageId, {\r\n                    positionIds: positionIds,\r\n                    signatureType: sigType\r\n                });\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen()\r\n                DemandAdditionalOffersOfferService.signWithdraw(demandId, stageId, {\r\n                    positions: [{positionId: positionIds[0]}],\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, realOnePositionMode, stageTr)\r\n                    .finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => {\r\n                const result = await DemandAdditionalOffersOfferService.requireWithdrawEncryption(demandId, stageId, null);\r\n                if (!result) {\r\n                    breakSigning();\r\n                } else if (result.requireEncryption) {\r\n                    return result.roundId;\r\n                } else {\r\n                    return null;\r\n                }\r\n            }\r\n        )\r\n    }\r\n\r\n\r\n    const submitPlaceOffer = (positionId, signatureType, signature, signatureFileId, envelopeOfferDate) => {\r\n\r\n        if (purchaserOfferContext && additionalOfferEdit.envelopeOffer && !envelopeOfferDate) {\r\n            setChooseEnvelopeOfferDatePopup({\r\n                positionId, signatureType, signature, signatureFileId,\r\n                position: additionalOfferEdit.positions.find(x => x.positionId === positionId)\r\n            })\r\n            return;\r\n        }\r\n        showLoadingScreen();\r\n        DemandAdditionalOffersOfferService.placeOffer(demandId, stageId, purchaserOfferContext?.supplierId, realOnePositionMode, {\r\n            positions: [{positionId, envelopeOfferDate}],\r\n            signatureType,\r\n            signature,\r\n            signatureFileId\r\n        }, stageTr).finally(hideLoadingScreen)\r\n    }\r\n\r\n    const submitWithdrawOffer = (positionIds, signatureType, signature, signatureFileId) => {\r\n        showLoadingScreen()\r\n        DemandAdditionalOffersOfferService.withdrawOffer(demandId, stageId, {\r\n            positions: positionIds.map(positionId => ({positionId})),\r\n            signatureType,\r\n            signature,\r\n            signatureFileId\r\n        }, realOnePositionMode, stageTr).catch(() => {\r\n        })\r\n            .finally(hideLoadingScreen)\r\n    }\r\n\r\n\r\n    const stopSigningOperation = (placingOffer) => {\r\n        if (realOnePositionMode) {\r\n            doStopSigningOperation(placingOffer, [additionalOfferEdit.positions[0].positionId])\r\n        } else if (placingOffer) {\r\n            setChoosePositionPopup(POPUP_MODE.OFFER_BREAK);\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.WITHDRAW_BREAK);\r\n        }\r\n    }\r\n\r\n    const doStopSigningOperation = (placingOffer, positionId) => {\r\n        simpleConfirmNoTranslate(stageTr(placingOffer ? \"sign_offer_form_stop_confirm\" : \"sign_withdraw_form_stop_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandAdditionalOffersOfferService.stopSigningOperation(demandId, stageId, positionId).finally(hideLoadingScreen)\r\n            }\r\n        )\r\n    }\r\n\r\n    const navigationBarButtons = () => {\r\n        const buttons = [];\r\n\r\n        if (!purchaserOfferContext && additionalOfferEdit.positions.findIndex(x => x.contractorOfferStatus === OfferStatusType.NORMAL && x.offerDate === null && x.offerTmpDate !== null) > -1) {\r\n            buttons.push(createButton(stageTr(\"delete_offer\"), deleteOffer, \"outlined\", DeleteIcon, 'primary', supportMode, false, false));\r\n        }\r\n\r\n        if (!purchaserOfferContext && !(additionalOfferEdit.passiveOfferForm && mode === OfferMode.PLACED) && additionalOfferEdit.positions.findIndex(x => x.status === OfferPositionStatusType.PLACED) > -1) {\r\n            buttons.push(createButton(stageTr(\"withdraw_offer_position\"), withdrawOffer, undefined, HighlightOffIcon, 'primary', supportMode, false, false));\r\n        }\r\n\r\n        if (!disabled) {\r\n            buttons.push(createButton(stageTr(!purchaserOfferContext ? \"place_offer\" : \"place_offer_operator\"), placeOffer, undefined, CheckCircleIcon, 'primary', supportMode, false, false));\r\n        }\r\n\r\n        if (additionalOfferEdit.positions.findIndex(x => x.status === OfferPositionStatusType.WAITING_SIGNATURE) > -1) {\r\n            buttons.push(createButton(stageTr(\"sign_offer_form_stop\"), () => stopSigningOperation(true), 'outlined', CancelIcon, undefined, supportMode, false, false));\r\n            buttons.push(createButton(stageTr(\"sign_offer_form\"), signOffer, undefined, SignatureIcon, 'primary', supportMode, false, false));\r\n\r\n        }\r\n        if (additionalOfferEdit.positions.findIndex(x => x.status === OfferPositionStatusType.WAITING_WITHDRAW_SIGNATURE) > -1) {\r\n            buttons.push(createButton(stageTr(\"sign_withdraw_form_stop\"), () => stopSigningOperation(false), \"outlined\", CancelIcon, 'primary', supportMode, false, false));\r\n            buttons.push(createButton(stageTr(\"sign_withdraw_form\"), signWithdrawOffer, undefined, SignatureIcon, 'primary', supportMode, false, false));\r\n        }\r\n\r\n\r\n        return buttons;\r\n    }\r\n\r\n    const successPositionsSelectPopup = (positionIds) => {\r\n        ((mode, posIds) => {\r\n            setChoosePositionPopup(null)\r\n            switch (mode) {\r\n                case POPUP_MODE.OFFER:\r\n                case POPUP_MODE.OPERATOR_PLACE:\r\n                    submitChoosePositions(posIds);\r\n                    break;\r\n                case POPUP_MODE.OFFER_SIGN:\r\n                    doSignOffer(posIds);\r\n                    break;\r\n                case POPUP_MODE.OFFER_BREAK:\r\n                    doStopSigningOperation(true, posIds);\r\n                    break;\r\n                case POPUP_MODE.WITHDRAW:\r\n                    submitChoosePositionsWithdraw(posIds);\r\n                    break;\r\n                case POPUP_MODE.WITHDRAW_SIGN:\r\n                    doSignWithdrawOffer(posIds);\r\n                    break;\r\n                case POPUP_MODE.WITHDRAW_BREAK:\r\n                    doStopSigningOperation(false, posIds);\r\n                    break;\r\n                case POPUP_MODE.DELETE_OFFER:\r\n                    doDeleteOffer(posIds);\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unsupported popup mode: \" + mode);\r\n\r\n            }\r\n        })(choosePositionPopup, positionIds)\r\n    }\r\n    const printVerificationSalesCheck = useSalesNotification(salesNotificationKeys.SIGNATURE_VERIFICATOR, () => setVerifyPopup(getVerificationConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.ADDITIONAL_OFFERS, additionalOfferEdit.positions[0].positionId)));\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (contextSection.additionalOfferAltMode) {\r\n            if (!!purchaserOfferContext && mode === OfferMode.PLACED) {\r\n                buttons.push(createMultiButton(Tr(\"verify_documents\"), printVerificationSalesCheck,\r\n                    undefined, false, undefined, false, SignatureIcon));\r\n            }\r\n            buttons.push(createMultiButton(Tr(\"change_history\"), () => setChooseSnapshotPopup(getConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.ADDITIONAL_OFFERS, additionalOfferEdit.positions[0].positionId)),\r\n                \"outlined\", false, undefined, false, HistoryIcon));\r\n        }\r\n        return buttons;\r\n    }\r\n\r\n    return dataLoading ? <Loading/> : additionalOfferEdit.positions.length > 0 &&\r\n        <div className={classes.root}>\r\n            <GridBlock column>\r\n                <MultiButton buttons={getButtons()}/>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_data')}>\r\n                    <OfferContractorData offerEdit={additionalOfferEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_company_data')}>\r\n                    <AdditionalOfferCommonData section={contextSection} offerEdit={additionalOfferEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                {\r\n                    additionalOfferEdit.offerEspdType !== ContractorOfferEspdType.NO &&\r\n                    <GeneralInfoEntry biggerLabel label={Tr('jedz_full')}>\r\n                        <OfferEspd roundType={RoundType.ADDITIONAL_OFFERS} mode={mode} disabled offerEdit={additionalOfferEdit} section={contextSection}/>\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                {\r\n                    (!purchaserOfferContext && mode === OfferMode.EDIT) &&\r\n                    <BoldTypography variant=\"h6\" align=\"center\">{Tr(\"additional_offer_supplier_info\")}</BoldTypography>\r\n                }\r\n\r\n                <GeneralInfoEntry biggerLabel label={<>\r\n                    {stageTr(\"offer_documents\")}\r\n                    { (additionalOfferEdit.passiveOfferForm || contextSection.digitalSign) && <HelpTooltip className={classes.marginLeft} dangerouslySetTextHTML={Tr(\"offer_documents_signature_tooltip_html\")} />}\r\n                </>}>\r\n                    <OfferFiles roundType={RoundType.ADDITIONAL_OFFERS} mode={mode} disabled={disabled} offerEdit={additionalOfferEdit} section={contextSection} />\r\n                </GeneralInfoEntry>\r\n\r\n                {!(additionalOfferEdit.passiveOfferForm && mode === OfferMode.EDIT) &&\r\n                    <OfferPositions roundType={RoundType.ADDITIONAL_OFFERS} positionsRef={positionsRef} offerEdit={additionalOfferEdit} mode={mode}\r\n                                    disabled={disabled}/>\r\n                }\r\n\r\n            </GridBlock>\r\n            {\r\n                (!purchaserOfferContext || mode === OfferMode.EDIT) &&\r\n                <div className={classes.floatingMenu}>\r\n                    <NavigationBar buttons={navigationBarButtons()} classesObj={classes}/>\r\n                </div>\r\n            }\r\n            {\r\n                !!choosePositionPopup && <OfferPositionsSelectPopup\r\n                    popupMode={choosePositionPopup}\r\n                    offerEdit={additionalOfferEdit}\r\n                    onCancel={() => setChoosePositionPopup(null)}\r\n                    onSuccess={successPositionsSelectPopup}\r\n                    digitalSign={contextSection.digitalSign}\r\n                    additionalOffers={!contextSection.additionalOfferAltMode}\r\n                />\r\n            }\r\n            {\r\n                !!chooseEnvelopeOfferDatePopup && <EnvelopeOfferDatePopup\r\n                    positions={[chooseEnvelopeOfferDatePopup.position]}\r\n                    onCancel={() => setChooseEnvelopeOfferDatePopup(null)}\r\n                    onSubmit={(values) => {\r\n                        setChooseEnvelopeOfferDatePopup(null);\r\n                        submitPlaceOffer(chooseEnvelopeOfferDatePopup.positionId, chooseEnvelopeOfferDatePopup.signatureType, chooseEnvelopeOfferDatePopup.signature, chooseEnvelopeOfferDatePopup.signatureFileId, values.envelopeOfferDate)\r\n                    }}\r\n                />\r\n            }\r\n            {\r\n                !!chooseSnapshotPopup && <SnapshotListPopup\r\n                    onClose={() => setChooseSnapshotPopup(null)}\r\n                    config={chooseSnapshotPopup}\r\n                />\r\n            }\r\n            {\r\n                !!verifyPopup && <VerificationsPopup\r\n                    onClose={() => setVerifyPopup(null)}\r\n                    config={verifyPopup}\r\n                />\r\n            }\r\n            {\r\n                !!verifyBeforePlacePopup && <VerificationBeforePlaceOfferPopup\r\n                    onCancel={() => setVerifyBeforePlacePopup(null)}\r\n                    onConfirm={(positionIds) => {\r\n                        setVerifyBeforePlacePopup(null);\r\n                        doSubmitChoosePositions(positionIds);\r\n                    }}\r\n                    config={verifyBeforePlacePopup}\r\n                />\r\n            }\r\n        </div>\r\n}\r\n\r\nAdditionalOfferEditPanel.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    additionalOfferEdit: state.resources[DemandAdditionalOffersOfferService.ADDITIONAL_OFFER_EDIT],\r\n    formSubmit: state.form,\r\n    formValues: state.formValues,\r\n}), {})(AdditionalOfferEditPanel);","import React from 'react'\r\nimport AdditionalOfferEditPanel from \"../additionalOfferEdit/AdditionalOfferEditPanel\";\r\n\r\nfunction AdditionalOfferPlacedPanel(\r\n    {\r\n        panelRef,\r\n        sectionId\r\n    }) {\r\n    return <AdditionalOfferEditPanel panelRef={panelRef} sectionId={sectionId} />\r\n}\r\n\r\nexport default AdditionalOfferPlacedPanel;","import Tr from 'translations/Translations';\r\nimport {createSelectItem} from \"components/Select\";\r\n\r\nexport const AuctionRule = {\r\n    ENGLISH: \"eng\",\r\n    DYNAMIC: \"dyn\",\r\n    JAPANESE: \"jap\",\r\n    DUTCH: \"den\"\r\n}\r\nconst _TR_PREFIX = 'auction_rule_';\r\n\r\nexport const AuctionRuleLabel = (status) => (Tr(_TR_PREFIX + status));\r\n\r\nexport const AuctionTypeRuleItems = (available) => available.map(rule => createSelectItem(rule, AuctionRuleLabel(rule)));\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const AuctionStatus = {\r\n    INCOMPLETE: \"INCOMPLETE\",\r\n    PENDING: \"PENDING\",\r\n    OPEN: \"OPEN\",\r\n    PAUSED: \"PAUSED\",\r\n    FINISHED: \"FINISHED\",\r\n    ACCEPTED: \"ACCEPTED\",\r\n    CANCELLED: \"CANCELLED\"\r\n}\r\nconst _TR_PREFIX = 'auction_status_';\r\n\r\nexport const AuctionStatusLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import Tr from 'translations/Translations';\r\nimport {createSelectItem} from \"components/Select\";\r\n\r\nexport const AuctionType = {\r\n    TEST: \"TEST\",\r\n    PROD: \"PROD\"\r\n}\r\nconst _TR_PREFIX = 'auction_type_';\r\n\r\nexport const AuctionTypeLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n\r\nexport const AuctionTypeItems = [\r\n    createSelectItem(AuctionType.PROD, AuctionTypeLabel(AuctionType.PROD)),\r\n    createSelectItem(AuctionType.TEST, AuctionTypeLabel(AuctionType.TEST))\r\n]\r\n\r\n","import previewFile from \"./previewFile\";\r\n\r\nexport default (url) => previewFile({url});","import React, {useState} from \"react\";\r\nimport {TableCell, TableRow, Typography} from \"@material-ui/core\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconForwardButton from \"components/button/WorkableIconForwardButton\";\r\nimport WorkableIconConfirmButton from \"components/button/WorkableIconConfirmButton\";\r\nimport HelpOutlineIcon from '@material-ui/icons/HelpOutline';\r\nimport {AuctionRule, AuctionRuleLabel} from \"constants/AuctionRule\";\r\nimport {AuctionStatusLabel} from \"constants/AuctionStatus\";\r\nimport {AuctionTypeLabel} from \"constants/AuctionType\";\r\nimport TooltipIcon from \"components/icon/TooltipIcon\";\r\nimport Tr from \"translations/Translations\";\r\nimport {getUserFullNameWithEmail} from \"libs/userNameGetter\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport openInNewTab from \"libs/openInNewTab\";\r\n\r\n\r\nfunction TooltipRow(\r\n    {\r\n        label,\r\n        value\r\n    }) {\r\n    return <Typography><strong>{Tr(label)}</strong>: {value}</Typography>\r\n}\r\n\r\n\r\nfunction AuctionRow(\r\n    {\r\n        auction,\r\n        handleAssignToAuction,\r\n        classes,\r\n    }) {\r\n\r\n    const [confirmOpened, setConfirmOpened] = useState(false);\r\n\r\n    return (<TableRow>\r\n        <TableCell>{auction.auctionId}</TableCell>\r\n        <TableCell>{auction.name}</TableCell>\r\n        <TableCell>{AuctionTypeLabel(auction.type)}</TableCell>\r\n        <TableCell>{getUserFullNameWithEmail(auction.user)}</TableCell>\r\n        <TableCell>{moment(auction.startDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n        <TableCell>{AuctionStatusLabel(auction.status)}</TableCell>\r\n        <TableCell>\r\n            <TooltipIcon tooltipClasses={{tooltip: classes.customWidth}} Icon={HelpOutlineIcon} tooltip={<>\r\n                <TooltipRow label={'auction_overtime'} value={auction.overtime}/>\r\n                <TooltipRow label={'auction_overtime_count'} value={auction.overtimeCount}/>\r\n                <TooltipRow label={'auction_rule'} value={AuctionRuleLabel(auction.rule)}/>\r\n                {[AuctionRule.JAPANESE, AuctionRule.DUTCH].includes(auction.rule) && <TooltipRow label={'auction_decision_time'} value={auction.decisionTime}/>}\r\n                <TooltipRow label={'auction_end_date'} value={moment(auction.endDate).format(DateFormats.DATETIME_FORMAT)}/>\r\n            </>}></TooltipIcon>\r\n        </TableCell>\r\n        <TableCell className={classes.buttonColumn}>\r\n            {!!auction.user && !!auction.url &&\r\n                <WorkableIconForwardButton onClick={() => openInNewTab(auction.url)}/>\r\n            }\r\n            {!auction.user &&\r\n                <WorkableIconConfirmButton tooltip={Tr('auction_assign_to_auction')} onClick={() => setConfirmOpened(true)}/>\r\n            }\r\n            {!auction.user &&\r\n                <Confirm confirmText='auction_assign_to_auction_confirm'\r\n                         onCancel={() => setConfirmOpened(false)}\r\n                         onConfirm={() => handleAssignToAuction(auction.auctionId)}\r\n                         open={confirmOpened}\r\n                />\r\n            }\r\n        </TableCell>\r\n    </TableRow>)\r\n}\r\n\r\nAuctionRow.propTypes = {};\r\n\r\nexport default AuctionRow;\r\n\r\n","import React from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport AuctionRow from \"./AuctionRow\";\r\nimport {AuctionType} from \"constants/AuctionType\";\r\nimport {AuctionStatus} from \"constants/AuctionStatus\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport reduxStore from \"redux/store\";\r\nimport {setResource, setSaveStatusInfo, setSaveStatusError} from \"redux/actions\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    idColumn: {\r\n        width: 100,\r\n    },\r\n    userColumn: {\r\n        width: 200,\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    customWidth: {\r\n        maxWidth: 500\r\n    }\r\n}));\r\n\r\nfunction AuctionsTable(\r\n    {\r\n        demandId,\r\n        stageId,\r\n        auctions\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const assignToAuction = (auctionId) => {\r\n        DemandOffersAuctionService.assignToAuction(demandId, stageId, auctionId).then(resp => {\r\n            const {resources} = reduxStore.getState();\r\n            const auctionWrapper = resources[DemandOffersAuctionService.OFFER_AUCTIONS_LIST_DATA]\r\n            const edit = {\r\n                ...auctionWrapper,\r\n                auctions: auctionWrapper.auctions.map(x => x.auctionId === resp.result.auctionId ? resp.result : x)\r\n            }\r\n            reduxStore.dispatch(setResource(DemandOffersAuctionService.OFFER_AUCTIONS_LIST_DATA, edit));\r\n\r\n            if (resp.success) {\r\n                reduxStore.dispatch(setSaveStatusInfo(Tr(\"auction_assign_to_auction_success\")))\r\n            } else {\r\n                reduxStore.dispatch(setSaveStatusError(Tr(\"auction_assign_to_auction_error\")))\r\n            }\r\n        });\r\n    }\r\n\r\n    return (<TableContainer>\r\n        <Table className={clsx(classes.table)}>\r\n            <TableHead>\r\n                <TableRow>\r\n                    <TableCell className={clsx(classes.idColumn)}>{Tr(\"id\")}</TableCell>\r\n                    <TableCell>{Tr(\"auction_name\")}</TableCell>\r\n                    <TableCell className={classes.dateColumn}>{Tr(\"auction_type\")}</TableCell>\r\n                    <TableCell className={classes.userColumn}>{Tr(\"auction_user\")}</TableCell>\r\n                    <TableCell className={classes.dateColumn}>{Tr(\"auction_start_date\")}</TableCell>\r\n                    <TableCell className={classes.dateColumn}>{Tr(\"status\")}</TableCell>\r\n                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {auctions.map((auction) =>\r\n                    <AuctionRow\r\n                        classes={classes}\r\n                        key={auction.auctionId}\r\n                        auction={auction}\r\n                        handleAssignToAuction={assignToAuction}\r\n                    />\r\n                )}\r\n            </TableBody>\r\n        </Table>\r\n    </TableContainer>)\r\n}\r\n\r\nAuctionsTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    auctions: PropTypes.arrayOf(PropTypes.shape({\r\n        auctionId: PropTypes.number.isRequired,\r\n        name: PropTypes.string.isRequired,\r\n        url: PropTypes.string.isRequired,\r\n        status: PropTypes.oneOf(Object.keys(AuctionStatus)).isRequired,\r\n        type: PropTypes.oneOf(Object.keys(AuctionType)).isRequired\r\n    })).isRequired\r\n}\r\n\r\nexport default AuctionsTable;\r\n\r\n","import React, {useEffect} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {connect} from \"react-redux\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport PropTypes from \"prop-types\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport {StageSectionsUrlParams} from \"../../../constants/StageSections\";\r\nimport {OfferMode} from \"../../common/constants/OfferMode\";\r\nimport GeneralInfoEntry from \"../generalInfo/components/GeneralInfoEntry\";\r\nimport Tr from \"translations/Translations\";\r\nimport OfferContractorData from \"../../common/contractorData/OfferContractorData\";\r\nimport AuctionsTable from \"./components/AuctionsTable\";\r\n\r\n\r\nfunction AuctionOfferEditPanel(\r\n    {\r\n        panelRef,\r\n        sectionId,\r\n        demandHeader,\r\n        offerAuctionsListData\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const section = params.section;\r\n    const mode = section === StageSectionsUrlParams.AUCTION_OFFER_EDIT ? OfferMode.EDIT : OfferMode.PLACED;\r\n\r\n    const dataLoading = !offerAuctionsListData || !demandHeader;\r\n    useEffect(() => {\r\n            if (!dataLoading) {\r\n                setTimeout((elem) => scrollTo(elem), 100, panelRef.current);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n        , [dataLoading])\r\n\r\n    useEffect(() => {\r\n        DemandOffersAuctionService.getOfferAuctionsList(demandId, stageId, mode)\r\n        return () => {\r\n            DemandOffersAuctionService.clearResources(DemandOffersAuctionService.OFFER_AUCTIONS_LIST_DATA);\r\n        }\r\n    }, [demandId, stageId, section, mode])\r\n\r\n\r\n    return dataLoading ? <Loading/> :\r\n        <GridBlock column>\r\n            <GeneralInfoEntry label={Tr('contractor_data')}>\r\n                <OfferContractorData offerEdit={offerAuctionsListData}/>\r\n            </GeneralInfoEntry>\r\n\r\n            <AuctionsTable auctions={offerAuctionsListData.auctions} demandId={demandId} stageId={stageId} />\r\n\r\n        </GridBlock>\r\n}\r\n\r\nAuctionOfferEditPanel.propTypes = {\r\n    sectionId: PropTypes.string.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    offerAuctionsListData: state.resources[DemandOffersAuctionService.OFFER_AUCTIONS_LIST_DATA],\r\n}), {})(AuctionOfferEditPanel);","import React, {useContext, useEffect, useRef} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {connect} from \"react-redux\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport GeneralInfoEntry from \"../generalInfo/components/GeneralInfoEntry\";\r\nimport Tr from 'translations/Translations'\r\nimport {ContractorOfferEspdType} from \"constants/ContractorOfferEspdType\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport {StageSectionsUrlParams} from \"../../../constants/StageSections\";\r\nimport {OfferMode} from \"../../common/constants/OfferMode\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport OfferPositions from \"../offerEdit/components/positions/OfferPositions\";\r\nimport OfferEspd from \"../offerEdit/components/espd/OfferEspd\";\r\nimport OfferFiles from \"../offerEdit/components/files/OfferFiles\";\r\nimport OfferContractorData from \"../../common/contractorData/OfferContractorData\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport DemandOffersAuctionService from \"services/DemandOffersAuctionService\";\r\nimport AdditionalOfferCommonData from \"../additionalOfferEdit/components/commonData/AdditionalOfferCommonData\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    floatingMenu: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        bottom: 0,\r\n        marginTop: theme.spacing()\r\n    },\r\n    menuBarPaper: {\r\n        background: theme.palette.background.default,\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction AuctionOfferPlacedPanel(\r\n    {\r\n        panelRef,\r\n        demandHeader,\r\n        offerEdit,\r\n        formSubmit,\r\n        formValues\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const section = params.section;\r\n    const mode = section === StageSectionsUrlParams.ADDITIONAL_OFFER_EDIT ? OfferMode.EDIT : OfferMode.PLACED;\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const disabled = offerEdit ? offerEdit.disabled : true;\r\n    const dataLoading = !offerEdit || !demandHeader;\r\n    const positionsRef = useRef();\r\n\r\n    useEffect(() => {\r\n            if (!dataLoading) {\r\n                setTimeout((elem) => scrollTo(elem), 100, panelRef.current);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n        , [dataLoading])\r\n\r\n    useEffect(() => {\r\n        DemandOffersAuctionService.getOfferEdit(demandId, stageId, mode, purchaserOfferContext?.supplierId);\r\n        return () => {\r\n            DemandOffersAuctionService.clearResources(DemandOffersAuctionService.AUCTIONS_OFFER_EDIT);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandId, stageId, section])\r\n\r\n\r\n    return dataLoading ? <Loading/> : offerEdit.positions.length > 0 &&\r\n        <div className={classes.root}>\r\n            <GridBlock column>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_data')}>\r\n                    <OfferContractorData offerEdit={offerEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_company_data')}>\r\n                    <AdditionalOfferCommonData section={contextSection} offerEdit={offerEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                {\r\n                    offerEdit.offerEspdType !== ContractorOfferEspdType.NO &&\r\n                    <GeneralInfoEntry biggerLabel label={Tr('jedz_full')}>\r\n                        <OfferEspd roundType={RoundType.AUCTION} mode={mode} disabled offerEdit={offerEdit} section={contextSection} />\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                <GeneralInfoEntry biggerLabel label={<>\r\n                    {stageTr(\"offer_documents\")}\r\n                    { (offerEdit.passiveOfferForm || contextSection.digitalSign) && <HelpTooltip className={classes.marginLeft} dangerouslySetTextHTML={Tr(\"offer_documents_signature_tooltip_html\")} />}\r\n                </>}>\r\n                    <OfferFiles roundType={RoundType.AUCTION} mode={mode} disabled offerEdit={offerEdit} section={contextSection}/>\r\n                </GeneralInfoEntry>\r\n\r\n                {!offerEdit.passiveOfferForm &&\r\n                    <OfferPositions roundType={RoundType.AUCTION} positionsRef={positionsRef} offerEdit={offerEdit} mode={mode} disabled={disabled}/>\r\n                }\r\n\r\n            </GridBlock>\r\n\r\n        </div>\r\n}\r\n\r\nAuctionOfferPlacedPanel.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    offerEdit: state.resources[DemandOffersAuctionService.AUCTIONS_OFFER_EDIT],\r\n    formSubmit: state.form,\r\n    formValues: state.formValues\r\n}), {})(AuctionOfferPlacedPanel);","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport Tr from \"translations/Translations\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {getSectionVariant} from \"../../../../constants/StageSections\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    offerDate: {\r\n        marginLeft: theme.spacing(5),\r\n        fontStyle: \"italic\"\r\n    }\r\n}))\r\n\r\nfunction AdditionalOfferPlacedSectionTitle(\r\n    {\r\n        section\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <div>\r\n            <GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n                <Typography variant='h6'>\r\n                    {section.name}\r\n                </Typography>\r\n            </GridBlock>\r\n            <GridBlock justify=\"space-between\">\r\n                {!!section.endDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {Tr('additional_round_end_date')}: {moment(section.endDate).format(DateFormats.DATETIME_FORMAT)}\r\n                    </Typography>\r\n                }\r\n                {!!section.offerDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {Tr('offer_date_additional')}: {moment(section.offerDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                    </Typography>\r\n                }\r\n            </GridBlock>\r\n        </div>\r\n    )\r\n\r\n}\r\n\r\nAdditionalOfferPlacedSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default AdditionalOfferPlacedSectionTitle;","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport Tr from \"translations/Translations\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {getSectionVariant} from \"../../../../constants/StageSections\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    offerDate: {\r\n        marginLeft: theme.spacing(5),\r\n        fontStyle: \"italic\"\r\n    }\r\n}))\r\n\r\nfunction AdditionalOfferEditSectionTitle(\r\n    {\r\n        section\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (<div>\r\n            <GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n                <Typography variant='h6'>\r\n                    {section.name}\r\n                </Typography>\r\n            </GridBlock>\r\n            <GridBlock justify=\"space-between\">\r\n                {!!section.endDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {Tr('additional_round_end_date')}: {moment(section.endDate).format(DateFormats.DATETIME_FORMAT)}\r\n                    </Typography>\r\n                }\r\n                {!!section.offerTmpDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {Tr('offer_tmp_date_additional')}: {moment(section.offerTmpDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                    </Typography>\r\n                }\r\n\r\n            </GridBlock>\r\n        </div>\r\n    )\r\n\r\n}\r\n\r\nAdditionalOfferEditSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default AdditionalOfferEditSectionTitle;","import React, {useContext, useEffect, useRef, useState} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {connect} from \"react-redux\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport GeneralInfoEntry from \"../generalInfo/components/GeneralInfoEntry\";\r\nimport Tr from 'translations/Translations'\r\nimport {ContractorOfferEspdType} from \"constants/ContractorOfferEspdType\";\r\nimport NavigationBar from \"components/complex/floatingMenu/NavigationBar\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport createButton from \"components/complex/floatingMenu/createButton\";\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\r\nimport CancelIcon from '@material-ui/icons/Cancel';\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport {\r\n    OfferPositionStatusesReadyToOffering,\r\n    OfferPositionStatusesReadyToWithdraw,\r\n    OfferPositionStatusType\r\n} from \"../../common/constants/OfferPositionStatusType\";\r\nimport OfferPositionsSelectPopup, {POPUP_MODE} from \"../../common/OfferPositionsSelectPopup\";\r\nimport useSignature from \"hooks/useSignature\";\r\nimport SignatureIcon from \"components/icon/SignatureIcon\";\r\nimport {StageSectionsUrlParams} from \"../../../constants/StageSections\";\r\nimport {OfferMode} from \"../../common/constants/OfferMode\";\r\nimport OfferSectionContext from \"context/OfferSectionContext\";\r\nimport useLoadingScreen from \"hooks/useLoadingScreen\";\r\nimport {simpleAlert} from \"libs/AlertNotification\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport DemandAdditionalOffersOfferService from \"services/DemandAdditionalOffersOfferService\";\r\nimport OfferPositions from \"../offerEdit/components/positions/OfferPositions\";\r\nimport OfferEspd from \"../offerEdit/components/espd/OfferEspd\";\r\nimport OfferFiles from \"../offerEdit/components/files/OfferFiles\";\r\nimport OfferContractorData from \"../../common/contractorData/OfferContractorData\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {OfferStatusType} from \"../../common/constants/OfferStatusType\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport AdditionalOfferCommonData from \"../additionalOfferEdit/components/commonData/AdditionalOfferCommonData\";\r\nimport EnvelopeOfferDatePopup from \"../additionalOfferEdit/components/EnvelopeOfferDatePopup\";\r\nimport MultiButton, {createButton as createMultiButton} from \"components/popup/components/MultiButton\";\r\nimport SnapshotListPopup, {getConfig} from \"../offerEdit/components/SnapshotListPopup\";\r\nimport HistoryIcon from \"@material-ui/icons/History\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport {CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID} from \"../offerEdit/components/commonData/OfferCommonData\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport VerificationBeforePlaceOfferPopup, {getVerificationBeforePlaceOfferPopupConfig} from \"../offerEdit/components/VerificationBeforePlaceOfferPopup\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport SupportModeContext from \"context/SupportModeContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    floatingMenu: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        bottom: 0,\r\n        marginTop: theme.spacing()\r\n    },\r\n    menuBarPaper: {\r\n        background: theme.palette.background.default,\r\n        border: `solid 1px ${theme.palette.border.dark}`,\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction AdditionalOfferEditAltPanel(\r\n    {\r\n        panelRef,\r\n        demandHeader,\r\n        additionalOfferEdit,\r\n        formSubmit,\r\n        formValues,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const section = params.section;\r\n    const mode = section === StageSectionsUrlParams.ADDITIONAL_OFFER_EDIT_ALT ? OfferMode.EDIT : OfferMode.PLACED;\r\n    const contextSection = useContext(OfferSectionContext);\r\n    const supportMode = useContext(SupportModeContext);\r\n    const realOnePositionMode = contextSection.onePositionMode || !additionalOfferEdit || additionalOfferEdit.positions.length === 1;\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const disabled = additionalOfferEdit ? additionalOfferEdit.disabled : true;\r\n    const dataLoading = !additionalOfferEdit || !demandHeader;\r\n    const positionsRef = useRef();\r\n    const {showLoadingScreen, hideLoadingScreen} = useLoadingScreen();\r\n    const [choosePositionPopup, setChoosePositionPopup] = useState(null);\r\n    const [chooseEnvelopeOfferDatePopup, setChooseEnvelopeOfferDatePopup] = useState(null);\r\n    const [chooseSnapshotPopup, setChooseSnapshotPopup] = useState(null);\r\n    const [verifyBeforePlacePopup, setVerifyBeforePlacePopup] = useState(null);\r\n\r\n    const {doSignDocContent, breakSigning} = useSignature();\r\n\r\n    useStepperStateCloseValidator(CONTRACTOR_OFFER_EDIT_COMMON_DATA_FORM_ID, () => {\r\n        return !(additionalOfferEdit.positions.findIndex(x => !!formValues[\"offerPositionForm_\" + x.positionId + \"_dirty\"]) > -1)\r\n    })\r\n\r\n    useEffect(() => {\r\n            if (!dataLoading) {\r\n                setTimeout((elem) => scrollTo(elem), 100, panelRef.current);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n        , [dataLoading])\r\n\r\n    useEffect(() => {\r\n        DemandAdditionalOffersOfferService.getOfferEdit(demandId, stageId, mode, purchaserOfferContext?.supplierId);\r\n        return () => {\r\n            DemandAdditionalOffersOfferService.clearResources(DemandAdditionalOffersOfferService.ADDITIONAL_OFFER_EDIT);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandId, stageId, section])\r\n\r\n\r\n    const placeOffer = () => {\r\n        if (additionalOfferEdit.commonData.status !== DemandValidationSectionStatus.OK) {\r\n            simpleAlert(Tr(\"fill_missing_data_x\", {name: 'contractor_company_data'}, true), false);\r\n            scrollTo(panelRef.current);\r\n        } else {\r\n            const unsavedPos = additionalOfferEdit.positions.find(x => !!formValues[\"offerPositionForm_\" + x.positionId + \"_dirty\"])\r\n            if (unsavedPos) {\r\n                simpleAlert(Tr(\"save_form_x\", {name: Tr(\"part_x\", {x: unsavedPos.order}) + \": \" + unsavedPos.name}), false)\r\n                scrollTo(\"#offerPositionForm_\" + unsavedPos.positionId, 60);\r\n            } else {\r\n\r\n                const readyPositions = additionalOfferEdit.positions.filter(x => OfferPositionStatusesReadyToOffering.includes(x.status));\r\n                if (readyPositions.length === 0) {\r\n                    simpleAlert(\"fill_at_least_one_position\");\r\n                    scrollTo(positionsRef.current);\r\n                } else {\r\n                    if (realOnePositionMode) {\r\n                        simpleConfirmNoTranslate(stageTr(!purchaserOfferContext ? \"place_offer_confirm\" : \"place_offer_confirm_operator\"), () => submitChoosePositions([readyPositions[0].positionId]))\r\n                    } else {\r\n                        setChoosePositionPopup(purchaserOfferContext ? POPUP_MODE.OPERATOR_PLACE : POPUP_MODE.OFFER);\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    const withdrawOffer = () => {\r\n        if (realOnePositionMode) {\r\n            simpleConfirmNoTranslate(stageTr(\"withdraw_offer_confirm\"), () => submitChoosePositionsWithdraw([additionalOfferEdit.positions[0].positionId]))\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.WITHDRAW);\r\n        }\r\n    }\r\n\r\n    const submitChoosePositions = (positionIds) => {\r\n        if (!purchaserOfferContext && contextSection.digitalSign) {\r\n            DemandAdditionalOffersOfferService.verifyBeforePlaceOffer(demandId, stageId, undefined, positionIds).then((resp) => {\r\n                if (resp.success && resp.result.length > 0) {\r\n                    setVerifyBeforePlacePopup(getVerificationBeforePlaceOfferPopupConfig(resp.result, positionIds))\r\n                } else {\r\n                    doSubmitChoosePositions(positionIds)\r\n                }\r\n            }).catch((e) => {\r\n                doSubmitChoosePositions(positionIds);\r\n                console.error(e)\r\n            })\r\n\r\n        } else {\r\n            doSubmitChoosePositions(positionIds)\r\n        }\r\n    }\r\n\r\n    const doSubmitChoosePositions = (positionIds) => {\r\n        if (!purchaserOfferContext && contextSection.digitalSign) {\r\n            doSignDocContent(\r\n                contextSection.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandAdditionalOffersOfferService.getDocumentToSign(demandId, stageId, {positionIds, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitPlaceOffer(positionIds, signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n            )\r\n        } else {\r\n            submitPlaceOffer(positionIds);\r\n        }\r\n    }\r\n\r\n    const submitChoosePositionsWithdraw = (positionIds) => {\r\n        if (contextSection.digitalSign) {\r\n            doSignDocContent(\r\n                contextSection.signatureTypes,\r\n                async (sigType) => {\r\n                    const result = await DemandAdditionalOffersOfferService.getDocumentToWithdraw(demandId, stageId, {positionIds, signatureType: sigType});\r\n                    if (!result)\r\n                        breakSigning();\r\n                    return result;\r\n\r\n                },\r\n                (signatureType, signature, signatureFileId) => {\r\n                    breakSigning();\r\n                    submitWithdrawOffer(positionIds, signatureType, signature, signatureFileId)\r\n                },\r\n                (error) => {\r\n                    console.error(error)\r\n                    simpleAlert(\"signature_error\");\r\n                    breakSigning();\r\n                },\r\n                () => {\r\n                    breakSigning();\r\n                },\r\n                async () => {\r\n                    const result = await DemandAdditionalOffersOfferService.requireWithdrawEncryption(demandId, stageId, positionIds);\r\n                    if (!result) {\r\n                        breakSigning();\r\n                    } else if (result.requireEncryption) {\r\n                        return result.roundId;\r\n                    } else {\r\n                        return null;\r\n                    }\r\n                }\r\n            )\r\n        } else {\r\n            submitWithdrawOffer(positionIds);\r\n        }\r\n    }\r\n\r\n    const signOffer = () => {\r\n        const positionIds = additionalOfferEdit.positions.filter(x => x.status === OfferPositionStatusType.WAITING_SIGNATURE).map(x => x.positionId);\r\n        doSignDocContent(\r\n            contextSection.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandAdditionalOffersOfferService.getDocumentToSign(demandId, stageId, {\r\n                    positionIds,\r\n                    signatureType: sigType\r\n                });\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen();\r\n                DemandAdditionalOffersOfferService.signOffer(demandId, stageId, {\r\n                    positions: positionIds.map(x => ({positionId: x})),\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, realOnePositionMode, stageTr).finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => contextSection.encryptionEnabled ? contextSection.roundId : null,\r\n        )\r\n    }\r\n\r\n\r\n    const deleteOffer = () => {\r\n        if (realOnePositionMode) {\r\n            doDeleteOffer([additionalOfferEdit.positions[0].positionId])\r\n        } else {\r\n            setChoosePositionPopup(POPUP_MODE.DELETE_OFFER)\r\n        }\r\n\r\n    }\r\n\r\n    const doDeleteOffer = (positionIds) => {\r\n        simpleConfirmNoTranslate(stageTr(\"delete_offer_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandAdditionalOffersOfferService.deleteOffer(demandId, stageId, positionIds).finally(hideLoadingScreen)\r\n            }\r\n        )\r\n    }\r\n\r\n    const signWithdrawOffer = () => {\r\n        const positionIds = additionalOfferEdit.positions.filter(x => x.status === OfferPositionStatusType.WAITING_WITHDRAW_SIGNATURE).map(x => x.positionId);\r\n        doSignDocContent(\r\n            contextSection.signatureTypes,\r\n            async (sigType) => {\r\n                const result = await DemandAdditionalOffersOfferService.getDocumentToWithdraw(demandId, stageId, {\r\n                    positionIds: positionIds,\r\n                    signatureType: sigType\r\n                });\r\n                if (!result)\r\n                    breakSigning();\r\n                return result;\r\n\r\n            },\r\n            (signatureType, signature, signatureFileId) => {\r\n                breakSigning();\r\n                showLoadingScreen()\r\n                DemandAdditionalOffersOfferService.signWithdraw(demandId, stageId, {\r\n                    positions: positionIds.map(x => ({positionId: x})),\r\n                    signatureType,\r\n                    signature,\r\n                    signatureFileId\r\n                }, contextSection.onePositionMode, stageTr)\r\n                    .finally(hideLoadingScreen)\r\n            },\r\n            (error) => {\r\n                console.error(error)\r\n                simpleAlert(\"signature_error\");\r\n                breakSigning();\r\n            },\r\n            () => {\r\n                breakSigning();\r\n            },\r\n            async () => {\r\n                const result = await DemandAdditionalOffersOfferService.requireWithdrawEncryption(demandId, stageId, positionIds);\r\n                if (!result) {\r\n                    breakSigning();\r\n                } else if (result.requireEncryption) {\r\n                    return result.roundId;\r\n                } else {\r\n                    return null;\r\n                }\r\n            }\r\n        )\r\n    }\r\n\r\n\r\n    const submitPlaceOffer = (positionIds, signatureType, signature, signatureFileId, envelopeOfferDate) => {\r\n\r\n        if (purchaserOfferContext && additionalOfferEdit.envelopeOffer && !envelopeOfferDate) {\r\n            setChooseEnvelopeOfferDatePopup({\r\n                positionIds, signatureType, signature, signatureFileId,\r\n                positions: additionalOfferEdit.positions.filter(x => positionIds.includes(x.positionId))\r\n            })\r\n            return;\r\n        }\r\n        showLoadingScreen();\r\n        DemandAdditionalOffersOfferService.placeOffer(demandId, stageId, purchaserOfferContext?.supplierId, contextSection.onePositionMode, {\r\n            positions: positionIds.map(x => ({positionId: x, envelopeOfferDate})),\r\n            signatureType,\r\n            signature,\r\n            signatureFileId\r\n        }, stageTr).finally(hideLoadingScreen)\r\n    }\r\n\r\n    const submitWithdrawOffer = (positionIds, signatureType, signature, signatureFileId) => {\r\n        showLoadingScreen()\r\n        DemandAdditionalOffersOfferService.withdrawOffer(demandId, stageId, {\r\n            positions: positionIds.map(positionId => ({positionId})),\r\n            signatureType,\r\n            signature,\r\n            signatureFileId\r\n        }, contextSection.onePositionMode, stageTr).catch(() => {\r\n        })\r\n            .finally(hideLoadingScreen)\r\n    }\r\n\r\n    const stopSigningOperation = (placingOffer) => {\r\n        const positionId = additionalOfferEdit.positions.filter(x => (placingOffer && x.status === OfferPositionStatusType.WAITING_SIGNATURE) || (!placingOffer && x.status === OfferPositionStatusType.WAITING_WITHDRAW_SIGNATURE))[0].positionId;\r\n        simpleConfirmNoTranslate(stageTr(placingOffer ? \"sign_offer_form_stop_confirm\" : \"sign_withdraw_form_stop_confirm\"), () => {\r\n                showLoadingScreen();\r\n                DemandAdditionalOffersOfferService.stopSigningOperation(demandId, stageId, positionId).finally(hideLoadingScreen)\r\n            }\r\n        )\r\n    }\r\n\r\n    const navigationBarButtons = () => {\r\n        const buttons = [];\r\n        if (!disabled && additionalOfferEdit.offerStatus === OfferStatusType.NORMAL) {\r\n\r\n            if (!purchaserOfferContext && additionalOfferEdit.positions.findIndex(x => x.contractorOfferStatus === OfferStatusType.NORMAL && x.offerDate === null && x.offerTmpDate !== null) > -1) {\r\n                buttons.push(createButton(stageTr(\"delete_offer\"), deleteOffer, \"outlined\", DeleteIcon, 'primary', supportMode, false, false));\r\n            }\r\n\r\n            if (!purchaserOfferContext && !(additionalOfferEdit.passiveOfferForm && mode === OfferMode.PLACED) && additionalOfferEdit.positions.findIndex(x => OfferPositionStatusesReadyToWithdraw.includes(x.status)) > -1) {\r\n                buttons.push(createButton(stageTr(\"withdraw_offer_position\"), withdrawOffer, undefined, HighlightOffIcon, 'primary', supportMode, false, false));\r\n            }\r\n            buttons.push(createButton(stageTr(!purchaserOfferContext ? \"place_offer\" : \"place_offer_operator\"), placeOffer, undefined, CheckCircleIcon, 'primary', supportMode, false, false));\r\n\r\n        }\r\n\r\n        if (additionalOfferEdit.offerStatus === OfferStatusType.WAITING_SIGNATURE) {\r\n            buttons.push(createButton(stageTr(\"sign_offer_form_stop\"), () => stopSigningOperation(true), 'outlined', CancelIcon, undefined, supportMode, false, false));\r\n            buttons.push(createButton(stageTr(\"sign_offer_form\"), signOffer, undefined, SignatureIcon, 'primary', supportMode, false, false));\r\n        }\r\n        if (additionalOfferEdit.offerStatus === OfferStatusType.WAITING_WITHDRAW_SIGNATURE) {\r\n            buttons.push(createButton(stageTr(\"sign_withdraw_form_stop\"), () => stopSigningOperation(false), \"outlined\", CancelIcon, 'primary', supportMode, false, false));\r\n            buttons.push(createButton(stageTr(\"sign_withdraw_form\"), signWithdrawOffer, undefined, SignatureIcon, 'primary', supportMode, false, false));\r\n        }\r\n        return buttons;\r\n    }\r\n\r\n    const successPositionsSelectPopup = (positionIds) => {\r\n        ((mode, posIds) => {\r\n            setChoosePositionPopup(null)\r\n            switch (mode) {\r\n                case POPUP_MODE.OFFER:\r\n                case POPUP_MODE.OPERATOR_PLACE:\r\n                    submitChoosePositions(posIds);\r\n                    break;\r\n                case POPUP_MODE.WITHDRAW:\r\n                    submitChoosePositionsWithdraw(posIds);\r\n                    break;\r\n                case POPUP_MODE.DELETE_OFFER:\r\n                    doDeleteOffer(posIds);\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Unsupported popup mode: \" + mode);\r\n\r\n            }\r\n        })(choosePositionPopup, positionIds)\r\n    }\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createMultiButton(Tr(\"change_history\"), () => setChooseSnapshotPopup(getConfig(demandId, stageId, purchaserOfferContext?.supplierId, RoundType.ADDITIONAL_OFFERS, additionalOfferEdit.positions[0].positionId)),\r\n            \"outlined\", false, undefined, false, HistoryIcon));\r\n        return buttons;\r\n    }\r\n\r\n    return dataLoading ? <Loading/> : additionalOfferEdit.positions.length > 0 &&\r\n        <div className={classes.root}>\r\n            <GridBlock column>\r\n\r\n                <MultiButton buttons={getButtons()}/>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_data')}>\r\n                    <OfferContractorData offerEdit={additionalOfferEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                <GeneralInfoEntry biggerLabel label={Tr('contractor_company_data')}>\r\n                    <AdditionalOfferCommonData section={contextSection} offerEdit={additionalOfferEdit}/>\r\n                </GeneralInfoEntry>\r\n\r\n                {\r\n                    additionalOfferEdit.offerEspdType !== ContractorOfferEspdType.NO &&\r\n                    <GeneralInfoEntry biggerLabel label={Tr('jedz_full')}>\r\n                        <OfferEspd roundType={RoundType.ADDITIONAL_OFFERS} mode={mode} disabled offerEdit={additionalOfferEdit} section={contextSection} />\r\n                    </GeneralInfoEntry>\r\n                }\r\n\r\n                {\r\n                    (!purchaserOfferContext && mode === OfferMode.EDIT) &&\r\n                    <BoldTypography variant=\"h6\" align=\"center\">{Tr(\"additional_offer_supplier_info\")}</BoldTypography>\r\n                }\r\n\r\n                <GeneralInfoEntry biggerLabel label={<>\r\n                    {stageTr(\"offer_documents\")}\r\n                    { (additionalOfferEdit.passiveOfferForm || contextSection.digitalSign) && <HelpTooltip className={classes.marginLeft} dangerouslySetTextHTML={Tr(\"offer_documents_signature_tooltip_html\")} />}\r\n                </>}>\r\n                    <OfferFiles roundType={RoundType.ADDITIONAL_OFFERS} mode={mode} disabled={disabled} offerEdit={additionalOfferEdit}\r\n                                section={contextSection} />\r\n                </GeneralInfoEntry>\r\n\r\n                {!additionalOfferEdit.passiveOfferForm &&\r\n                    <OfferPositions roundType={RoundType.ADDITIONAL_OFFERS} positionsRef={positionsRef} offerEdit={additionalOfferEdit} mode={mode}\r\n                                    disabled={disabled}/>\r\n                }\r\n\r\n            </GridBlock>\r\n            {\r\n                (!purchaserOfferContext || mode === OfferMode.EDIT) &&\r\n                <div className={classes.floatingMenu}>\r\n                    <NavigationBar buttons={navigationBarButtons()} classesObj={classes}/>\r\n                </div>\r\n            }\r\n            {\r\n                !!choosePositionPopup && <OfferPositionsSelectPopup\r\n                    popupMode={choosePositionPopup}\r\n                    offerEdit={additionalOfferEdit}\r\n                    onCancel={() => setChoosePositionPopup(null)}\r\n                    onSuccess={successPositionsSelectPopup}\r\n                    digitalSign={contextSection.digitalSign}\r\n                />\r\n            }\r\n            {\r\n                !!chooseEnvelopeOfferDatePopup && <EnvelopeOfferDatePopup\r\n                    positions={chooseEnvelopeOfferDatePopup.positions}\r\n                    onCancel={() => setChooseEnvelopeOfferDatePopup(null)}\r\n                    onSubmit={(values) => {\r\n                        setChooseEnvelopeOfferDatePopup(null);\r\n                        submitPlaceOffer(chooseEnvelopeOfferDatePopup.positionIds, chooseEnvelopeOfferDatePopup.signatureType,\r\n                            chooseEnvelopeOfferDatePopup.signature, chooseEnvelopeOfferDatePopup.signatureFileId, values.envelopeOfferDate)\r\n                    }}\r\n                />\r\n            }\r\n            {\r\n                !!chooseSnapshotPopup && <SnapshotListPopup\r\n                    onClose={() => setChooseSnapshotPopup(null)}\r\n                    config={chooseSnapshotPopup}\r\n                />\r\n            }\r\n            {\r\n                !!verifyBeforePlacePopup && <VerificationBeforePlaceOfferPopup\r\n                    onCancel={() => setVerifyBeforePlacePopup(null)}\r\n                    onConfirm={(positionIds) => {\r\n                        setVerifyBeforePlacePopup(null);\r\n                        doSubmitChoosePositions(positionIds);\r\n                    }}\r\n                    config={verifyBeforePlacePopup}\r\n                />\r\n            }\r\n        </div>\r\n}\r\n\r\nAdditionalOfferEditAltPanel.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    additionalOfferEdit: state.resources[DemandAdditionalOffersOfferService.ADDITIONAL_OFFER_EDIT],\r\n    formSubmit: state.form,\r\n    formValues: state.formValues,\r\n}), {})(AdditionalOfferEditAltPanel);","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport {getSectionVariant} from \"../../../../constants/StageSections\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport ErrorOutlineOutlinedIcon from '@material-ui/icons/ErrorOutlineOutlined';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    unreadElements: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction GeneralInfoSectionTitle(\r\n    {\r\n        section\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <GridBlock alignItems=\"center\">\r\n            <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n            <Typography variant='h6'>\r\n                {section.name}\r\n            </Typography>\r\n            {(!!section.unreadDemandDocuments || !!section.unreadRfxMessages) && <div>\r\n                    <ErrorOutlineOutlinedIcon color='error' className={classes.unreadElements} />\r\n                </div>\r\n            }\r\n        </GridBlock>\r\n    )\r\n\r\n}\r\n\r\nGeneralInfoSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default GeneralInfoSectionTitle;","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport Tr from \"translations/Translations\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {getSectionVariant} from \"../../../../constants/StageSections\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    offerDate: {\r\n        marginLeft: theme.spacing(5),\r\n        fontStyle: \"italic\"\r\n    }\r\n}))\r\n\r\nfunction AuctionOfferPlacedSectionTitle(\r\n    {\r\n        section\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <div>\r\n            <GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={getSectionVariant(section)}/>\r\n                <Typography variant='h6'>\r\n                    {section.name}\r\n                </Typography>\r\n            </GridBlock>\r\n            <GridBlock justify=\"space-between\">\r\n                {!!section.endDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {Tr('additional_round_end_date_auction')}: {moment(section.endDate).format(DateFormats.DATETIME_FORMAT)}\r\n                    </Typography>\r\n                }\r\n                {!!section.offerDate &&\r\n                    <Typography className={classes.offerDate}>\r\n                        {Tr('offer_date_additional_auction')}: {moment(section.offerDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}\r\n                    </Typography>\r\n                }\r\n            </GridBlock>\r\n        </div>\r\n    )\r\n\r\n}\r\n\r\nAuctionOfferPlacedSectionTitle.propTypes = {\r\n    expanded: PropTypes.bool.isRequired,\r\n    section: PropTypes.shape({\r\n        section: PropTypes.string.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default AuctionOfferPlacedSectionTitle;","import GeneralInfoPanel from \"../components/panels/generalInfo/GeneralInfoPanel\";\r\nimport OfferEditPanel from \"../components/panels/offerEdit/OfferEditPanel\";\r\nimport OfferExpansionSectionTitle from \"../components/common/OfferExpansionSectionTitle\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport OfferEditSectionTitle from \"../components/panels/offerEdit/components/OfferEditSectionTitle\";\r\nimport OfferPlacedPanel from \"../components/panels/offerPlaced/OfferPlacedPanel\";\r\nimport OfferPlacedSectionTitle from \"../components/panels/offerPlaced/components/OfferPlacedSectionTitle\";\r\nimport AdditionalOfferEditPanel from \"../components/panels/additionalOfferEdit/AdditionalOfferEditPanel\";\r\nimport AdditionalOfferPlacedPanel from \"../components/panels/additionalOfferPlaced/AdditionalOfferPlacedPanel\";\r\nimport AuctionOfferEditPanel from \"../components/panels/auctionOfferEdit/AuctionOfferEditPanel\";\r\nimport AuctionOfferPlacedPanel from \"../components/panels/auctionOfferPlaced/AuctionOfferPlacedPanel\";\r\nimport AdditionalOfferPlacedSectionTitle from \"../components/panels/additionalOfferPlaced/components/AdditionalOfferPlacedSectionTitle\";\r\nimport AdditionalOfferEditSectionTitle from \"../components/panels/additionalOfferEdit/components/AdditionalOfferEditSectionTitle\";\r\nimport AdditionalOfferEditAltPanel from \"../components/panels/additionalOfferEditAlt/AdditionalOfferEditAltPanel\";\r\nimport GeneralInfoSectionTitle from \"../components/panels/generalInfo/components/DeneralInfoSectionTitle\";\r\nimport AuctionOfferPlacedSectionTitle from \"../components/panels/auctionOfferPlaced/components/AuctionOfferPlacedSectionTitle\";\r\n\r\nexport const StageSectionsOrder = [\"GENERAL_INFO\", \"OFFER_EDIT\", \"OFFER_PLACED\", \"ADDITIONAL_OFFER_EDIT\", \"ADDITIONAL_OFFER_EDIT_ALT\", \"ADDITIONAL_OFFER_PLACED\",\r\n    \"AUCTION_OFFER_EDIT\", \"AUCTION_OFFER_PLACED\"];\r\n\r\nexport const StageSections = {\r\n    GENERAL_INFO: \"GENERAL_INFO\",\r\n    OFFER_EDIT: \"OFFER_EDIT\",\r\n    OFFER_PLACED: \"OFFER_PLACED\",\r\n    ADDITIONAL_OFFER_EDIT: \"ADDITIONAL_OFFER_EDIT\",\r\n    ADDITIONAL_OFFER_EDIT_ALT: \"ADDITIONAL_OFFER_EDIT_ALT\",\r\n    ADDITIONAL_OFFER_PLACED: \"ADDITIONAL_OFFER_PLACED\",\r\n    AUCTION_OFFER_EDIT: \"AUCTION_OFFER_EDIT\",\r\n    AUCTION_OFFER_PLACED: \"AUCTION_OFFER_PLACED\",\r\n    DASHBOARD: \"DASHBOARD\"\r\n}\r\n\r\nexport const StageSectionParamToSectionName = {\r\n    \"general-info\": \"GENERAL_INFO\",\r\n    \"offer-edit\": \"OFFER_EDIT\",\r\n    \"offer-placed\": \"OFFER_PLACED\",\r\n    \"additional-offer-edit\": \"ADDITIONAL_OFFER_EDIT\",\r\n    \"additional-offer-edit-alt\": \"ADDITIONAL_OFFER_EDIT_ALT\",\r\n    \"additional-offer-placed\": \"ADDITIONAL_OFFER_PLACED\",\r\n    \"auction-offer-edit\": \"AUCTION_OFFER_EDIT\",\r\n    \"auction-offer-placed\": \"AUCTION_OFFER_PLACED\"\r\n}\r\n\r\nexport const StageSectionsUrlParams = {\r\n    GENERAL_INFO: \"general-info\",\r\n    OFFER_EDIT: \"offer-edit\",\r\n    OFFER_PLACED: \"offer-placed\",\r\n    ADDITIONAL_OFFER_EDIT: \"additional-offer-edit\",\r\n    ADDITIONAL_OFFER_EDIT_ALT: \"additional-offer-edit-alt\",\r\n    ADDITIONAL_OFFER_PLACED: \"additional-offer-placed\",\r\n    AUCTION_OFFER_EDIT: \"auction-offer-edit\",\r\n    AUCTION_OFFER_PLACED: \"auction-offer-placed\"\r\n}\r\n\r\nexport const StageSectionsComponents = {\r\n    GENERAL_INFO: GeneralInfoPanel,\r\n    OFFER_EDIT: OfferEditPanel,\r\n    OFFER_PLACED: OfferPlacedPanel,\r\n    ADDITIONAL_OFFER_EDIT: AdditionalOfferEditPanel,\r\n    ADDITIONAL_OFFER_EDIT_ALT: AdditionalOfferEditAltPanel,\r\n    ADDITIONAL_OFFER_PLACED: AdditionalOfferPlacedPanel,\r\n    AUCTION_OFFER_EDIT: AuctionOfferEditPanel,\r\n    AUCTION_OFFER_PLACED: AuctionOfferPlacedPanel\r\n}\r\n\r\nexport const StageSectionsTitles = {\r\n    GENERAL_INFO: GeneralInfoSectionTitle,\r\n    OFFER_EDIT: OfferEditSectionTitle,\r\n    OFFER_PLACED: OfferPlacedSectionTitle,\r\n    ADDITIONAL_OFFER_EDIT: AdditionalOfferEditSectionTitle,\r\n    ADDITIONAL_OFFER_EDIT_ALT: AdditionalOfferEditSectionTitle,\r\n    ADDITIONAL_OFFER_PLACED: AdditionalOfferPlacedSectionTitle,\r\n    AUCTION_OFFER_EDIT: OfferExpansionSectionTitle,\r\n    AUCTION_OFFER_PLACED: AuctionOfferPlacedSectionTitle\r\n}\r\n\r\nexport const getSectionVariant = (section) => section ? (section.status === DemandValidationSectionStatus.OK ? 'Done' : (section.status === DemandValidationSectionStatus.DISABLED ? 'Wait' : (section.status === DemandValidationSectionStatus.ERROR ? 'Required' : (section.required ? 'Required' : 'Optional')))) : \"Wait\";","import React, {useReducer} from 'react'\r\nimport {makeStyles, TableCell, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport moment from 'moment';\r\nimport {OfferStatusLabel} from \"constants/OfferStatus\";\r\nimport {OfferEncryptionStatuses, OfferEncryptionStatusLabel} from \"constants/OfferEncryptionStatus\";\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport LockOpenOutlinedIcon from '@material-ui/icons/LockOpenOutlined';\r\nimport InsertDriveFileOutlinedIcon from '@material-ui/icons/InsertDriveFileOutlined';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport TooltipIcon from \"components/icon/TooltipIcon\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport OfferAdditionalOffersTable from \"./OfferAdditionalOffersTable\";\r\nimport {getUserFullNameWithEmailAndDeputy} from \"libs/userNameGetter\";\r\nimport RouterPath from \"../../../../libs/RouterPath\";\r\nimport {StageSectionsUrlParams} from \"../../../../pages/contractor/demand/scenes/offer/constants/StageSections\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport WarningRoundedIcon from \"@material-ui/icons/WarningRounded\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {},\r\n    cell: {\r\n        padding: theme.spacing(1)\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    versionsCell: {\r\n        background: theme.palette.background.default,\r\n        paddingLeft: 0,\r\n        paddingRight: 0\r\n    },\r\n    warnIcon: {\r\n        padding: 0,\r\n        color: `${theme.palette.secondary.main} !important`\r\n    }\r\n}));\r\n\r\nfunction OfferTableRow(\r\n    {\r\n        demandId,\r\n        currentRfxRound,\r\n        index,\r\n        offer,\r\n        openEnvelopeEdit,\r\n        collectionFinished,\r\n        demandHeader\r\n    }) {\r\n    const classes = useStyles();\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        addLoading: false\r\n    });\r\n    const {\r\n        id, contractorName, offerUser, contractorAddress, contractorDepartmentId, encryptionStatus, status, offerDate, envelopeId, dateOfEnvelopeReceipt,\r\n        offerDetailsUrl, hasAdditionalRounds, additionalOffers, consorciumOffer, outOfDateOffer\r\n    } = offer;\r\n    let encIcon = encryptionStatus ? (encryptionStatus === OfferEncryptionStatuses.DECRYPTED ? LockOpenOutlinedIcon : LockOutlinedIcon) : InsertDriveFileOutlinedIcon;\r\n\r\n    const dateStr = offerDate ? moment(offerDate).format(DateFormats.DATETIME_FORMAT) : (dateOfEnvelopeReceipt ? moment(dateOfEnvelopeReceipt).format(DateFormats.DATETIME_FORMAT) : '');\r\n\r\n    const onAdditionalOffersExpand = () => {\r\n        dispatchIconWorks({type: 'addLoading', works: true});\r\n\r\n        let func;\r\n        if (!additionalOffers) {\r\n            func = RfxOfferService.getAdditionalRoundsOffers;\r\n        } else {\r\n            func = RfxOfferService.clearAdditionalRoundsOffers;\r\n        }\r\n\r\n        func(currentRfxRound.id, id).finally(() => {\r\n            dispatchIconWorks({type: 'addLoading', works: false});\r\n        })\r\n\r\n\r\n    }\r\n\r\n    const redirectToOffer = (roundType, offerDate) => {\r\n        if (demandHeader && !demandHeader.apiOffers) {\r\n            window.location.href = offerDetailsUrl;\r\n        } else {\r\n\r\n            let section;\r\n            switch (roundType) {\r\n                case RoundType.BASE:\r\n                    section = offerDate ? StageSectionsUrlParams.OFFER_PLACED : StageSectionsUrlParams.OFFER_EDIT;\r\n                    break;\r\n                case RoundType.ADDITIONAL_OFFERS:\r\n                    section = offerDate ? StageSectionsUrlParams.ADDITIONAL_OFFER_PLACED : StageSectionsUrlParams.ADDITIONAL_OFFER_EDIT;\r\n                    break;\r\n                case RoundType.AUCTION:\r\n                    section = StageSectionsUrlParams.AUCTION_OFFER_PLACED;\r\n                    break;\r\n                default:\r\n                    console.error(\"Unknown type: \" + roundType);\r\n                    section = StageSectionsUrlParams.OFFER_PLACED;\r\n            }\r\n\r\n            RouterPath.redirect(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID_SECTION,\r\n                {id: demandId, contractorDepartmentId, stageId: currentRfxRound.stageId, section}));\r\n        }\r\n    }\r\n\r\n\r\n    return (<>\r\n        <TableRow>\r\n            <TableCell className={classes.cell}>{index + 1}</TableCell>\r\n            <TableCell className={classes.cell}>{consorciumOffer ? Tr('consorcium_with_name', {name: contractorName}) : contractorName}</TableCell>\r\n            <TableCell className={classes.cell}>{getUserFullNameWithEmailAndDeputy(offerUser)}</TableCell>\r\n            <TableCell className={classes.cell}>{contractorAddress}</TableCell>\r\n            <TableCell className={classes.cell}>\r\n                <TooltipIcon tooltip={OfferEncryptionStatusLabel(encryptionStatus)} Icon={encIcon}/> {status ? OfferStatusLabel(status) : ''}\r\n                {outOfDateOffer && <TooltipIcon iconClasses={classes.warnIcon} Icon={WarningRoundedIcon} tooltip={Tr('offerOutOfDate_warning')}/>}\r\n            </TableCell>\r\n            <TableCell className={classes.cell}> {dateStr}{!!envelopeId && <WorkableIconEditButton onClick={() => openEnvelopeEdit(envelopeId)}/>}</TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconPreviewButton\r\n                    tooltip={Tr('offer_details')}\r\n                    disabled={!offerDetailsUrl}\r\n                    onClick={offerDetailsUrl ? () => redirectToOffer(RoundType.BASE, offerDate) : undefined}\r\n                />\r\n            </TableCell>\r\n            {collectionFinished && <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconExpandButton\r\n                    tooltip={hasAdditionalRounds ? !additionalOffers ? Tr('expand_additional_offers') : Tr('collapse_additional_offers') : Tr('supplier_has_no_additional_offers')}\r\n                    expanded={!!additionalOffers}\r\n                    onClick={onAdditionalOffersExpand}\r\n                    disabled={!hasAdditionalRounds || iconWorks.anyWorks}\r\n                    working={iconWorks.addLoading}\r\n                />\r\n            </TableCell>}\r\n        </TableRow>\r\n        {!!additionalOffers &&\r\n            <TableRow>\r\n                <TableCell className={classes.versionsCell}></TableCell>\r\n                <TableCell colSpan={6} className={classes.versionsCell}>\r\n                    <OfferAdditionalOffersTable additionalOffers={additionalOffers} redirectToOffer={redirectToOffer}/>\r\n                </TableCell>\r\n                <TableCell className={classes.versionsCell}></TableCell>\r\n            </TableRow>\r\n        }\r\n    </>)\r\n}\r\n\r\nOfferTableRow.propTypes = {\r\n    index: PropTypes.number.isRequired,\r\n    offer: PropTypes.object.isRequired,\r\n    openEnvelopeEdit: PropTypes.func.isRequired,\r\n    collectionFinished: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default OfferTableRow;\r\n","import React, {useMemo} from 'react'\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport OfferTableRow from \"./OfferTableRow\";\r\nimport {isDemandFinishing, isDemandFinished, isDemandOfferEvaluation} from \"../../../../libs/getDemandStatus\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    table: {\r\n        border: `solid 3px ${theme.palette.background.paper}`,\r\n        \"& .MuiTableCell-root\": {\r\n            padding: theme.spacing()\r\n        }\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    dateColumn: {\r\n        ...theme.components.table.buttonColumn,\r\n        width: theme.components.table.dateTimeColumn.width + theme.components.table.buttonColumn.width\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    supplierColumn: {\r\n        paddingRight: theme.spacing(2),\r\n        \"word-break\": \"break-all\"\r\n    },\r\n    authorColumn: {\r\n        width: 250\r\n    },\r\n    addressColumn: {\r\n        width: 160,\r\n        paddingRight: theme.spacing(2),\r\n        whiteSpace: \"pre-line\"\r\n    },\r\n    statusColumn: {\r\n        width: 200,\r\n        paddingRight: theme.spacing(2)\r\n    },\r\n}));\r\n\r\nfunction OfferTable(\r\n    {\r\n        demandId,\r\n        currentRfxRound,\r\n        offers,\r\n        openEnvelopeEdit,\r\n        demandHeader\r\n    }) {\r\n    const classes = useStyle();\r\n    const collectionFinished = useMemo(()=> isDemandOfferEvaluation() || isDemandFinishing() || isDemandFinished(), []);\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <Table className={classes.table}>\r\n                <TableHead>\r\n                    <TableRow className={classes.headRow}>\r\n                        <TableCell className={classes.lpColumn}>{Tr(\"column_lp\")}</TableCell>\r\n                        <TableCell className={classes.supplierColumn}>{Tr(\"contractor\")}</TableCell>\r\n                        <TableCell className={classes.authorColumn}>{Tr(\"author\")}</TableCell>\r\n                        <TableCell className={classes.addressColumn}>{Tr(\"adres\")}</TableCell>\r\n                        <TableCell className={classes.statusColumn}>{Tr(\"status\")}</TableCell>\r\n                        <TableCell className={classes.dateColumn}>{Tr(\"date_of_receipt\")}</TableCell>\r\n                        <TableCell className={classes.buttonColumn}></TableCell>\r\n                        {collectionFinished && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                    </TableRow>\r\n                </TableHead>\r\n                <TableBody>\r\n                    {\r\n                        offers.items.map((item, i) => <OfferTableRow\r\n                            key={item.id}\r\n                            demandId={demandId}\r\n                            currentRfxRound={currentRfxRound}\r\n                            offer={item}\r\n                            index={i}\r\n                            openEnvelopeEdit={openEnvelopeEdit}\r\n                            collectionFinished={collectionFinished}\r\n                            demandHeader={demandHeader}\r\n                        />)\r\n                    }\r\n                </TableBody>\r\n            </Table>\r\n        </div>\r\n    )\r\n}\r\n\r\nOfferTable.propTypes = {\r\n    currentRfxRound: PropTypes.shape({\r\n        id: PropTypes.number.isRequired,\r\n        processId: PropTypes.number.isRequired,\r\n        stageId: PropTypes.number.isRequired,\r\n        offerCollectionEnded: PropTypes.bool.isRequired\r\n    }).isRequired,\r\n    offers: PropTypes.object.isRequired,\r\n    openEnvelopeEdit: PropTypes.func.isRequired\r\n}\r\n\r\nexport default OfferTable;\r\n","import {useEffect} from 'react'\r\n\r\nexport default (id, addContractorsTab, onclose) => {\r\n\r\n    useEffect(() => {\r\n        window.addEventListener(\"message\", receiveMessage, false);\r\n        return () => {\r\n            window.removeEventListener(\"message\", receiveMessage)\r\n        };\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    function receiveMessage(event) {\r\n        if (event.data.action && (typeof event.data.action === 'string' || event.data.action instanceof String)) {\r\n            if (event.data.action === \"refreshSuppliers\") addContractorsTab(event.data)\r\n        }\r\n        if (event.data.action === \"closeSupplierSearch\") closeSupplierSearch()\r\n    }\r\n\r\n\r\n    function closeSupplierSearch() {\r\n        onclose();\r\n    }\r\n\r\n}\r\n\r\n","import React, {useEffect} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport {connect} from 'react-redux'\r\nimport contractorImport from 'libs/contractorImport'\r\nimport ContractorService from \"../../../services/ContractorService\";\r\nimport Loading from \"../../Loading\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    dialog: {\r\n        padding: 0\r\n    },\r\n    iframe: {\r\n        border: \"unset\",\r\n        width: \"100%\",\r\n        height: \"65vh\"\r\n    }\r\n})\r\n\r\nfunction AddContactor(\r\n    {\r\n        classes,\r\n        onClose = () => {\r\n        },\r\n\t\taddContractorsTab = ()=> {},\r\n        demandId,\r\n        onePlaceContractor\r\n    }) {\r\n\r\n\r\n    useEffect(() => {\r\n        ContractorService.getOnePlace(demandId);\r\n        return () => ContractorService.clearResources(ContractorService.CONTRACTOR_ONE_PLACE_ID);\r\n    }, [demandId])\r\n\r\n\r\n    return (\r\n        <>\r\n            <Dialog\r\n                title={Tr('add_contractor')}\r\n                open={true}\r\n                maxWidth='lg'\r\n                contentClassName={classes.dialog}\r\n                onClose={onClose}\r\n            >\r\n                {!onePlaceContractor ?\r\n                    <Loading/>\r\n                    :\r\n                    <iframe src={onePlaceContractor.url} title=\"Contactors\" className={classes.iframe}></iframe>}\r\n            </Dialog>\r\n            {contractorImport(demandId, addContractorsTab, onClose)}\r\n        </>\r\n    )\r\n}\r\n\r\nAddContactor.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    onePlaceContractor: state.resources.onePlaceContractor,\r\n}), {})(withStyles(style)(AddContactor));","import React, {useState} from 'react'\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Loading from \"components/Loading\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport AddContactor from \"components/popup/addContactor/AddContactor\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport InviteContactor from \"components/popup/inviteContactor/InviteContactor\";\r\nimport Chip from \"components/Chip\";\r\nimport ContractorService from \"services/ContractorService\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    inlineBlock: {\r\n        display: 'inline-block',\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    },\r\n    uploadFile: {\r\n        marginBottom: 20\r\n    },\r\n    nameError: {\r\n        fontSize: '0.75rem'\r\n    }\r\n}));\r\n\r\nfunction RegisterEnvelopeForm(\r\n    {\r\n        demandId,\r\n        working,\r\n        error,\r\n        formikProps,\r\n        newEnvelope\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [addPopup, setAddPopup] = useState(false);\r\n    const [invitePopup, setInvitePopup] = useState(false);\r\n\r\n    const getFormButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('add_contractor'), () => setAddPopup(true), undefined, working));\r\n        buttons.push(createButton(Tr('suggest_contractor'), () => setInvitePopup(true), undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n    const getInviteDefaultValues = () => ({\r\n            name: getObjectValue('name', formikProps.values, ''),\r\n            email: getObjectValue('email', formikProps.values, ''),\r\n            postCode: getObjectValue('postCode', formikProps.values, ''),\r\n            city: getObjectValue('city', formikProps.values, ''),\r\n            address: getObjectValue('address', formikProps.values, ''),\r\n            vatin: {\r\n                number: getObjectValue('vatin.number', formikProps.values, ''),\r\n                prefix: getObjectValue('vatin.prefix', formikProps.values, 'PL'),\r\n            }\r\n        }\r\n    )\r\n\r\n\r\n    const handleClearContractor = () => {\r\n\r\n        const values = {\r\n            ...formikProps.values,\r\n            contractorDepartmentId: 0,\r\n            suggestContractor: false,\r\n            contractorName: null,\r\n            name: '',\r\n            email: '',\r\n            postCode: '',\r\n            city: '',\r\n            address: '',\r\n            vatin: {\r\n                number: '',\r\n                prefix: \"PL\"\r\n            }\r\n        };\r\n        formikProps.setValues(values);\r\n    }\r\n\r\n    const handleChipClick = () => {\r\n        if (getObjectValue('suggestContractor', formikProps.values, false)) {\r\n            setInvitePopup(true);\r\n        } else {\r\n            setAddPopup(true);\r\n        }\r\n\r\n    }\r\n    const handleAddContractors = (data) => {\r\n\r\n        if (data && data.platformAdded.length > 0) {\r\n            ContractorService.getContractorDetails(demandId, data.platformAdded[0]).then((resp) => {\r\n                handleClearContractor();\r\n                formikProps.setFieldValue(\"contractorDepartmentId\", data.platformAdded[0]);\r\n                formikProps.setFieldValue(\"contractorName\", resp.name);\r\n            }).finally(() => setAddPopup(false));\r\n        } else {\r\n            setAddPopup(false);\r\n        }\r\n    }\r\n\r\n    const handleInvite = (data) => {\r\n        const values = {\r\n            ...formikProps.values,\r\n            suggestContractor: true,\r\n            contractorDepartmentId: 0,\r\n            contractorName: data.name,\r\n            ...data\r\n        };\r\n        formikProps.setValues(values);\r\n        setInvitePopup(false);\r\n    }\r\n\r\n    const contractorName = getObjectValue('contractorName', formikProps.values, false);\r\n    const contractorNameError = getObjectValue('contractorName', formikProps.errors, '');\r\n\r\n    return (<GridBlock column>\r\n        {working && <Loading className={classes.loading}/>}\r\n\r\n        {newEnvelope && <MultiButton className={classes.margin} buttons={getFormButtons()} justify='space-evenly'/>}\r\n\r\n        <div>\r\n            <Typography color={contractorNameError ? 'error' : undefined} className={classes.inlineBlock}>{Tr('offer_supplier')}*:</Typography>\r\n            {!!contractorName && <Chip value={contractorName} onDelete={!newEnvelope || working ? undefined : handleClearContractor}\r\n                                       onClick={!newEnvelope || working ? undefined : handleChipClick}/>}\r\n            {!!contractorNameError && <Typography color='error' className={classes.nameError}>{contractorNameError}</Typography>}\r\n        </div>\r\n\r\n        {error && <Typography color='error'>{error}</Typography>}\r\n\r\n        <DateTimePicker\r\n            label={Tr(\"offer_date\")}\r\n            formikProps={formikProps}\r\n            id=\"offerDate\"\r\n            required\r\n            //onChange={onChange}\r\n            maxDate={new Date()}\r\n            disabled={working}\r\n        />\r\n\r\n\r\n        {addPopup && <AddContactor\r\n            demandId={demandId}\r\n            onClose={() => setAddPopup(false)}\r\n            addContractorsTab={handleAddContractors}\r\n        />}\r\n\r\n        {invitePopup && <InviteContactor\r\n            demandId={demandId}\r\n            open\r\n            onClose={() => setInvitePopup(false)}\r\n            handleInvite={handleInvite}\r\n            defaultValues={getInviteDefaultValues()}\r\n            collectPostCode\r\n            collectAddress\r\n            collectCity\r\n        />}\r\n\r\n    </GridBlock>)\r\n}\r\n\r\nexport default RegisterEnvelopeForm;","import React, {useEffect, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport RegisterEnvelopeForm from \"./RegisterEnvelopeForm\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport Loading from \"components/Loading\";\r\nimport PropTypes from 'prop-types';\r\nimport moment from \"libs/moment\";\r\n\r\nfunction RegisterEnvelopePopup(\r\n    {\r\n        demandId,\r\n        rfxRoundId,\r\n        onClose,\r\n        envelopeId,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const newEnvelope = envelopeId === -1;\r\n    const [error, setError] = useState('');\r\n    const [working, setWorking] = useState(false);\r\n    const [loading, setLoading] = useState(true);\r\n    const [loadedEnvelope, setLoadedEnvelope] = useState({});\r\n    const formId = useId();\r\n\r\n    useEffect(() => {\r\n        if (newEnvelope) {\r\n            setLoading(false);\r\n        } else {\r\n            RfxOfferService.getEnvelope(rfxRoundId, envelopeId).then((resp) => {\r\n                setLoadedEnvelope(resp);\r\n            }).finally(() => setLoading(false))\r\n        }\r\n    }, [envelopeId, newEnvelope, rfxRoundId])\r\n    const handleSubmit = () => {\r\n        setError('');\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const handleSaveResponse = (response) => {\r\n        if (isResponseValid(response, setError)) {\r\n            onClose();\r\n        }\r\n    }\r\n\r\n    const onSubmit = (envelope) => {\r\n        setWorking(true);\r\n\r\n        const req = {\r\n            identity: envelopeId,\r\n            dateOfReceipt: envelope.offerDate.format(),\r\n            roundId: rfxRoundId\r\n        }\r\n        if (envelope.suggestContractor) {\r\n            req.invitation = {\r\n                name: envelope.name,\r\n                address: envelope.address,\r\n                postCode: envelope.postCode,\r\n                city: envelope.city,\r\n                vatin: {...envelope.vatin},\r\n                email: envelope.email\r\n            }\r\n        } else {\r\n            req.contractor = {\r\n                identity: envelope.contractorDepartmentId\r\n            }\r\n        }\r\n        RfxOfferService.saveEnvelope(rfxRoundId, req).then((resp) => handleSaveResponse(resp)).finally(() => setWorking(false));\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), () => onClose(true), 'outlined', working));\r\n        buttons.push(createButton(Tr('save'), handleSubmit, undefined, working || loading));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"register_envelope\")}\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n        >\r\n            {loading ? <Loading/> :\r\n                <Form\r\n                    initialValues={{\r\n                        suggestContractor: false,\r\n                        contractorName: loadedEnvelope.contractor?.name || '',\r\n                        contractorDepartmentId: 0,\r\n                        name: '',\r\n                        email: '',\r\n                        vatin: {\r\n                            number: \"\",\r\n                            prefix: \"PL\",\r\n                        },\r\n                        offerDate: loadedEnvelope?.dateOfReceipt ? moment(loadedEnvelope.dateOfReceipt) : null\r\n                    }}\r\n                    validationSchema={Yup.object().shape({\r\n                        contractorName: VS.string(),\r\n                        offerDate: VS.dateMax()\r\n                    })}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <RegisterEnvelopeForm\r\n                            demandId={demandId}\r\n                            formikProps={formikProps}\r\n                            error={error}\r\n                            newEnvelope={newEnvelope}\r\n                            working={working}\r\n                        />\r\n                    )}\r\n                </Form>\r\n            }\r\n        </Dialog>\r\n    )\r\n}\r\n\r\n\r\nRegisterEnvelopePopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    rfxRoundId: PropTypes.number.isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    envelopeId: PropTypes.number.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(RegisterEnvelopePopup);","import React, {useEffect, useState} from 'react'\r\nimport Loading from 'components/Loading';\r\nimport MoreButton from \"components/button/MoreButton\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport OfferTable from \"./components/OfferTable\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport useSearch, {getPaginationConfig} from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport GridBlock from \"../../GridBlock\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport RegisterEnvelopePopup from \"./components/envelope/RegisterEnvelopePopup\";\r\nimport {connect} from \"react-redux\";\r\nimport PropTypes from 'prop-types'\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport SplitButton, {createButton as createSplitButton} from \"../../popup/components/SplitButton\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport useSalesNotification from \"../../../hooks/useSalesNotification\";\r\nimport salesNotificationKeys from \"../../popup/salesNotification/constants/salesNotification.keys\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {}\r\n}));\r\n\r\nfunction Offers(\r\n    {\r\n        demandId,\r\n        demandStatistics,\r\n        currentRfxRound,\r\n        offers,\r\n        offersActions,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [offerLoading, setOfferLoading] = useState(true);\r\n    const [registerEnvelopePopupOpened, setRegisterEnvelopePopupOpened] = useState(0);\r\n    const [downloadWorking, setDownloadWorking] = useState(false);\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} = useSearch();\r\n\r\n    const refreshCurrentRows = () => {\r\n        setOfferLoading(true);\r\n        const loadedRows = offers.items.length;\r\n        const {pagination} = searchData;\r\n        let curPageSize = loadedRows < pagination.pageSize ? pagination.pageSize : loadedRows;\r\n        RfxOfferService.getOffers(currentRfxRound.id, getPaginationConfig(1, curPageSize)).then(() => setOfferLoading(false));\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (!!offers && !!demandStatistics) {\r\n            if (offers.totalCount !== demandStatistics.numberOfOffers) {\r\n                refreshCurrentRows();\r\n            }\r\n        }\r\n        //na 2 etapie ma wczytywać gdy zmieni się liczba ofert, na 3 etapie to nie powinno się odpalać.\r\n        // eslint-disable-next-line\r\n    }, [demandStatistics])\r\n\r\n\r\n    useEffect(() => {\r\n        if (currentRfxRound?.id)\r\n            RfxOfferService.getAvailableActions(currentRfxRound.id);\r\n        return () => {\r\n            RfxOfferService.clearResources(RfxOfferService.RESOURCE_ID_RFX_OFFER_LIST)\r\n            RfxOfferService.clearResources(RfxOfferService.RESOURCE_ID_RFX_OFFERS_ACTIONS)\r\n        }\r\n    }, [demandId, currentRfxRound?.id])\r\n\r\n    useEffect(() => {\r\n        if (currentRfxRound?.id) {\r\n            setOfferLoading(true);\r\n            const {pagination, search} = searchData;\r\n            RfxOfferService.getOffers(currentRfxRound.id, pagination, search).then(() => (setOfferLoading(false)));\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [searchData, currentRfxRound?.id])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (offers?.totalCount !== undefined) {\r\n            setTotalCount(offers.totalCount)\r\n        }\r\n    }, [offers?.totalCount]);\r\n\r\n\r\n    const runDownload = (type) => {\r\n        setDownloadWorking(true);\r\n        if (type === 'attachments')\r\n            RfxOfferService.downloadOffersAttachments(currentRfxRound.id, () => setDownloadWorking(false))\r\n        else\r\n            RfxOfferService.downloadOffersSummary(currentRfxRound.id, type, () => setDownloadWorking(false))\r\n    }\r\n\r\n    const runVerify = () => {\r\n        setDownloadWorking(true);\r\n        RfxOfferService.verifyOffersAttachments(currentRfxRound.id, () => setDownloadWorking(false))\r\n    }\r\n\r\n    const printVerificationSalesCheck = useSalesNotification(salesNotificationKeys.SIGNATURE_VERIFICATOR, () => runVerify(), downloadWorking);\r\n\r\n    const getAdditionalButtons = () => {\r\n        const buttons = [];\r\n        if (offersActions.verifyAttachments)\r\n            buttons.push(createSplitButton(offersActions.verifyAttachments.name, printVerificationSalesCheck, downloadWorking));\r\n        if (offersActions.attachments)\r\n            buttons.push(createSplitButton(offersActions.attachments.name, () => runDownload('attachments'), downloadWorking));\r\n        if (offersActions.itemSummaryXls)\r\n            buttons.push(createSplitButton(offersActions.itemSummaryXls.name, () => runDownload('item'), downloadWorking));\r\n        if (offersActions.itemParametersXls)\r\n            buttons.push(createSplitButton(offersActions.itemParametersXls.name, () => runDownload('itemParameters'), downloadWorking));\r\n        if (offersActions.summaryXls)\r\n            buttons.push(createSplitButton(offersActions.summaryXls.name, () => runDownload('xls'), downloadWorking));\r\n        if (offersActions.summaryPdf)\r\n            buttons.push(createSplitButton(offersActions.summaryPdf.name, () => runDownload('pdf'), downloadWorking));\r\n        return (<SplitButton buttonClassName={classes.buttonPrint}\r\n                             working={downloadWorking}\r\n                             buttons={buttons}\r\n                             variant=\"outlined\"\r\n                             hideEmpty\r\n                             label={Tr('additional_actions')}\r\n        />)\r\n    }\r\n\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (offersActions.envelope)\r\n            buttons.push(createButton(offersActions.envelope.name, () => setRegisterEnvelopePopupOpened(-1), undefined));\r\n        return (<MultiButton buttons={buttons} after={getAdditionalButtons()}/>)\r\n    };\r\n\r\n    if (!offers || !offersActions || !currentRfxRound) return <Loading/>\r\n\r\n    return (\r\n        <>\r\n            <GridBlock justify='space-between'>\r\n                <BasicSearch\r\n                    label={Tr('search_supplier')}\r\n                    searchInProgress={offerLoading}\r\n                    doSearch={setSearchConfig}/>\r\n                {getButtons()}\r\n            </GridBlock>\r\n\r\n\r\n            <OfferTable\r\n                demandId={demandId}\r\n                currentRfxRound={currentRfxRound}\r\n                offers={offers}\r\n                openEnvelopeEdit={(envelopeId) => setRegisterEnvelopePopupOpened(envelopeId)}\r\n                demandHeader={demandHeader}\r\n            />\r\n\r\n            <MoreButton\r\n                config={searchData.pagination}\r\n                setConfig={setPaginationConfig}\r\n                totalCount={totalCount}\r\n                loadedCount={offers.items.length}\r\n                captionTrKey='showing_x_of_y_suppliers'\r\n                disabled={offerLoading || !(currentRfxRound?.id)}\r\n            />\r\n\r\n            {!!registerEnvelopePopupOpened &&\r\n            <RegisterEnvelopePopup\r\n                demandId={demandId}\r\n                rfxRoundId={currentRfxRound.id}\r\n                envelopeId={registerEnvelopePopupOpened}\r\n                onClose={(cancel) => {\r\n                    if (!cancel)\r\n                        refreshCurrentRows();\r\n                    setRegisterEnvelopePopupOpened(0);\r\n                }}/>}\r\n        </>\r\n    )\r\n}\r\n\r\nOffers.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    downloadOffers: PropTypes.bool,\r\n    registerEnvelope: PropTypes.bool\r\n}\r\n\r\nexport default connect((state) => ({\r\n    offers: state.resources[RfxOfferService.RESOURCE_ID_RFX_OFFER_LIST],\r\n    offersActions: state.resources[RfxOfferService.RESOURCE_ID_RFX_OFFERS_ACTIONS],\r\n    demandStatistics: state.resources[StatisticsService.DEMAND_STATISTICS_RESOURCE_ID],\r\n    currentRfxRound: state.resources[StatisticsService.CURRENT_RFX_RESOURCE_ID],\r\n    demandHeader: state.resources.demandHeader,\r\n}), {})(Offers);","import React, {useEffect} from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport Offers from \"components/complex/offer/Offers\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport {connect} from \"react-redux\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport validateSection from \"services/helpers/validateSection\";\r\n\r\nfunction OffersPanel(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n    const curDemandValidation = DemandValidation.OFFERS;\r\n    const id = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n\r\n    useEffect(() => {\r\n        StatisticsService.getCurrentRound(id);\r\n        validateSection(curDemandValidation, id, false);\r\n        return () => StatisticsService.clearCurrentRound();\r\n    },[curDemandValidation, id])\r\n\r\n    return (\r\n        <div style={{width: '100%'}}>\r\n            <DemandValidationMessages section={section} editable={editable} />\r\n            <Offers\r\n                demandId={id}\r\n                downloadOffersEnabled\r\n                registerEnvelopeEnabled={editable}\r\n            />\r\n        </div>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(OffersPanel));","import React from 'react'\r\nimport OffersPanel from \"./OffersPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n    return (expanded && <OffersPanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import {ProcedureType} from \"constants/ProcedureType\";\r\n\r\nconst PROCEDURE_TYPES = [ProcedureType.PUBLIC, ProcedureType.SOCIALSERVICES, ProcedureType.NATIONAL_SOCIAL_SERVICES, ProcedureType.NATIONAL_PUBLIC];\r\nexport default (demandHeader) => {\r\n    return demandHeader && demandHeader.noticeOjsType === false && demandHeader.noticeBzpType === false && PROCEDURE_TYPES.includes(demandHeader.procedureType);\r\n}\r\n","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport {isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport Loading from \"components/Loading\";\r\nimport Button from \"components/Button\";\r\nimport DemandService from \"services/DemandService\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    }\r\n}));\r\n\r\nfunction AddBzpNoticePopup(\r\n    {\r\n        demandId,\r\n        onClose,\r\n        formSubmit,\r\n        siwzTypes,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [errorText, setErrorText] = useState();\r\n    const [downloadSuccess, setDownloadSuccess] = useState(false);\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const processResponse = async (resp) => {\r\n        if (resp.success) {\r\n            await DemandService.getValidate(demandId, false)\r\n            await SiwzService.getList(demandId);\r\n            setDownloadSuccess(true);\r\n        } else {\r\n            setErrorText(resp.errors.shift());\r\n        }\r\n\r\n    }\r\n\r\n    const onSubmit = ({bzpNoticeId}) => {\r\n        setWorking(true);\r\n        setErrorText();\r\n        const bzpSiwzType = Object.keys(siwzTypes).find(x => \"notice_changed\" === x || \"noticeAttachments\" === x);\r\n        SiwzService.addBzpNotice(demandId, bzpNoticeId.trim(), bzpSiwzType).then(processResponse).catch(() => {\r\n        }).finally(() => {\r\n            setWorking(false);\r\n        });\r\n    }\r\n\r\n\r\n    if(downloadSuccess) {\r\n        return (\r\n            <Dialog\r\n                title={isDemandPreparing() ? Tr(\"add_bzp_notice\") : Tr(\"add_bzp_notice_update\")}\r\n                maxWidth={'sm'}\r\n                open={true}\r\n                onClose={onClose}\r\n            >\r\n                <Typography>\r\n                    {Tr('bzp_notice_downloaded')}\r\n                </Typography>\r\n                <div className={classes.buttonRow}>\r\n                    <Button\r\n                        onClick={onClose}\r\n                    >\r\n                        {Tr('close')}\r\n                    </Button>\r\n                </div>\r\n            </Dialog>)\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={isDemandPreparing() ? Tr(\"add_bzp_notice\") : Tr(\"add_bzp_notice_update\")}\r\n            open={true}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    bzpNoticeId: \"\",\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    bzpNoticeId: VS.string().test('bzp-nitice', Tr(\"bzp_notice_number_invalid\"), (bzpNoticeId) => {\r\n                        if(!!bzpNoticeId) {\r\n                            bzpNoticeId = bzpNoticeId.trim();\r\n                            if(bzpNoticeId.includes(\"-N-\")) {\r\n                                const split = bzpNoticeId.split(\"-N-\");\r\n                                if(split.length === 2) {\r\n                                    return /^[0-9]{6,9}$/.test(split[0]) && /^[0-9]{4}$/.test(split[1]);\r\n                                }\r\n                            } else if(bzpNoticeId.includes(\"/BZP\")) {\r\n                                return /^[0-9]{4}\\/BZP\\s?[0-9]{8}\\/[0-9]{2}$/.test(bzpNoticeId);\r\n                            }\r\n                        }\r\n                        return false;\r\n                    }),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        {working && <Loading className={classes.loading}/>}\r\n\r\n                        <TextInput\r\n                            id='bzpNoticeId'\r\n                            formikProps={formikProps}\r\n                            label={Tr('bzp_notice_number')}\r\n                            disabled={working}\r\n                        />\r\n\r\n                        {!!errorText && <Typography\r\n                            variant='body1'\r\n                            color='error'\r\n                        >\r\n                            {Tr(errorText)}\r\n                        </Typography>}\r\n\r\n                        <div className={classes.actions}>\r\n                            <DoubleButton\r\n                                justify='flex-end'\r\n                                labelFirst={Tr('cancel')}\r\n                                labelSecond={Tr('confirm')}\r\n                                onClickFirst={onClose}\r\n                                onClickSecond={handleSubmit}\r\n                                disabledFirst={working}\r\n                                disabledSecond={working}\r\n                            />\r\n                        </div>\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAddBzpNoticePopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired\r\n};\r\n\r\nexport default connect((state) => ({\r\n    siwzTypes: state.resources[SiwzService.SIWZ_TYPE_LIST_RESOURCE_ID],\r\n    formSubmit: state.form\r\n}), {})(AddBzpNoticePopup);","import React from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport Select from 'components/Select';\r\nimport VS from 'constants/ValidationShema';\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport {SiwzSourceType} from \"./constants/SiwzSourceType\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    text: {\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    gridContainer: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    fileName: {\r\n        width: 300\r\n    },\r\n    select: {\r\n        width: 200,\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    parentSelect: {\r\n        width: 200,\r\n    }\r\n}));\r\n\r\nfunction SelectSiwzDocumentType(\r\n    {\r\n        items,\r\n        onCancel,\r\n        onSubmit,\r\n        pickAutopublish,\r\n        pickParent,\r\n        formSubmit,\r\n        types,\r\n        siwzList\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const formId = useId();\r\n    const selectId = 'item';\r\n    const parentId = 'parent';\r\n    const autopublishId = 'autopublish';\r\n\r\n    const createSelectTab = () => {\r\n        if (types === undefined) return '';\r\n        return Object.keys(types).map(x => ({value: x, label: types[x]}));\r\n    }\r\n\r\n    const createParentSelectTab = () => {\r\n        if (siwzList === undefined) return '';\r\n        const tab = [];\r\n        tab.push({\r\n            label: Tr('new'),\r\n            value: 0\r\n        });\r\n        siwzList.filter(x => x.source === SiwzSourceType.SIWZ).forEach((x) => {\r\n            tab.push({\r\n                label: x.name,\r\n                value: x.identity\r\n            })\r\n        })\r\n\r\n        return tab\r\n    }\r\n\r\n    const generateItems = (formikProps) => {\r\n        if (items.length === 0) {\r\n            return <Typography>{Tr(\"file_extension_error\")}</Typography>\r\n        }\r\n        return items.map((item, i) => {\r\n            return (\r\n                <GridBlock key={i} justify=\"space-between\" alignItems=\"center\">\r\n                    <Typography className={classes.fileName}> {item.name}</Typography>\r\n\r\n                    {pickParent && <Select\r\n                        id={parentId + i}\r\n                        formikProps={formikProps}\r\n                        items={createParentSelectTab()}\r\n                        label={Tr('parent_document_select')}\r\n                        className={classes.select}\r\n                        onChange={(event) => {if(event.target.value !== 0) formikProps.setFieldValue(selectId + i, '') }}\r\n                    />}\r\n\r\n                    <Select\r\n                        id={selectId + i}\r\n                        formikProps={formikProps}\r\n                        items={createSelectTab()}\r\n                        label={Tr('document_type')}\r\n                        className={classes.select}\r\n                        disabled={formikProps.values[parentId + i] !== 0}\r\n                    />\r\n\r\n                    {pickAutopublish && <Select\r\n                        id={autopublishId + i}\r\n                        formikProps={formikProps}\r\n                        items={BooleanItems}\r\n                        label={Tr('auto_publish')}\r\n                        className={classes.select}\r\n                    />}\r\n\r\n                </GridBlock>\r\n            )\r\n        })\r\n    };\r\n\r\n    const submitForm = () => {\r\n        formSubmit[formId]()\r\n    };\r\n\r\n    const generateInitialValues = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[selectId + i] = \"\";\r\n            obj[parentId + i] = 0;\r\n            obj[autopublishId + i] = false;\r\n        }\r\n        return obj\r\n    };\r\n\r\n    const generateValidationSchema = () => {\r\n        let obj = {};\r\n        for (let i = 0; i < items.length; i++) {\r\n            obj[selectId + i] = VS.stringMaxNoRq(2048)\r\n                .when( parentId+i, (other, schema) => other === 0 ? VS.string() : schema)\r\n        }\r\n\r\n        return VS.object(obj)\r\n    };\r\n\r\n    const handleSubmit = (values) => onSubmit(values, items)\r\n\r\n    if (items === undefined) return '';\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('select_document_type')}\r\n            titleCentered\r\n            maxWidth={'xl'}\r\n            fullWidth={false}\r\n            paperClassName={classes.paperClassName}\r\n        >\r\n            <Form\r\n                onSubmit={handleSubmit}\r\n                id={formId}\r\n                initialValues={generateInitialValues()}\r\n                validationSchema={generateValidationSchema()}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <GridBlock column className={classes.gridContainer}>\r\n                            {generateItems(formikProps)}\r\n                        </GridBlock>\r\n\r\n                        <DoubleButton\r\n                            justify='flex-end'\r\n                            labelFirst={Tr('cancel')}\r\n                            labelSecond={Tr('add')}\r\n                            onClickFirst={onCancel}\r\n                            onClickSecond={submitForm}\r\n                        />\r\n                    </>\r\n                )}\r\n            </Form>\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSelectSiwzDocumentType.propTypes = {\r\n    items: PropTypes.arrayOf(PropTypes.shape({\r\n        name: PropTypes.string.isRequired\r\n    })).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n    pickAutopublish: PropTypes.bool.isRequired,\r\n    pickParent: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n    types: state.resources[SiwzService.SIWZ_TYPE_LIST_RESOURCE_ID],\r\n    siwzList: state.resources[SiwzService.SIWZ_LIST_RESOURCE_ID],\r\n}), {})(SelectSiwzDocumentType);","import React, {useEffect, useState} from 'react';\r\nimport Dialog from \"components/Dialog\";\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport Loading from \"components/Loading\";\r\nimport moment from 'moment';\r\nimport MoreButton from \"components/button/MoreButton\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport PropTypes from 'prop-types';\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    buttonRow: {\r\n        marginTop: theme.spacing(2),\r\n        textAlign: \"end\"\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    ipColumn: theme.components.table.ipColumn,\r\n    dateColumn: theme.components.table.dateColumn\r\n}));\r\n\r\nexport const createDownloadHistoryFile = (fileName, demandId, fileId) => ({fileName, demandId, fileId})\r\n\r\nconst DownloadHistoryPopup = (\r\n    {\r\n        downloadHistoryFile,\r\n        service,\r\n        onClose\r\n    }) => {\r\n\r\n    const classes = useStyle({});\r\n\r\n    const [downloadHistory, setDownloadHistory] = useState(null);\r\n    const [historyLoading, setHistoryLoading] = useState(false);\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig} = useSearch();\r\n\r\n    useEffect(() => {\r\n        setHistoryLoading(true);\r\n        const {pagination} = searchData;\r\n        service.getDownloadHistory(downloadHistoryFile.demandId, downloadHistoryFile.fileId, pagination).then(handleHistoryLoad);\r\n        // eslint-disable-next-line\r\n    }, [searchData, downloadHistoryFile])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (downloadHistory?.totalCount !== undefined) {\r\n            setTotalCount(downloadHistory.totalCount)\r\n        }\r\n    }, [downloadHistory?.totalCount]);\r\n\r\n\r\n    const handleHistoryLoad = (resp) => {\r\n        if (resp.paginator.page > 1) {\r\n            setDownloadHistory((curState) => {\r\n                return {\r\n                    ...resp,\r\n                    items: [...curState.items, ...resp.items]\r\n                }\r\n            });\r\n        } else {\r\n            setDownloadHistory(resp);\r\n        }\r\n        setHistoryLoading(false);\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('download_history_details')}\r\n            open\r\n            titleCentered\r\n            maxWidth={'md'}\r\n            fullWidth={true}\r\n            onClose={onClose}\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={Tr('close')}\r\n                onClick={onClose}\r\n            />}\r\n        >\r\n\r\n            {!downloadHistory && <Loading/>}\r\n\r\n            {downloadHistory && <>\r\n                <Typography>\r\n                    {downloadHistoryFile.fileName}\r\n                </Typography>\r\n                <Typography>\r\n                    {Tr('download_count_x', {downloadCount: downloadHistory.contractorTotalCount})}\r\n                </Typography>\r\n                <SimpleTable\r\n                    columnClasses={[\r\n                        classes.lpColumn,\r\n                        undefined,\r\n                        classes.ipColumn,\r\n                        classes.dateColumn,\r\n                    ]}\r\n                    headers={[Tr('column_lp'), Tr('user_data'), Tr('ip_address'), Tr('download_date')]}\r\n                    items={downloadHistory.items.map((item, index) => [\r\n                        (index + 1),\r\n                        item.downloadUserFullName === 'download.history.list.notloggeduser' ? Tr(item.downloadUserFullName) : item.downloadUserFullName,\r\n                        item.ipAddress,\r\n                        item.downloadDate ? moment(item.downloadDate).format(DateFormats.DATETIME_FORMAT) : ''\r\n                    ])}\r\n                />\r\n\r\n                {historyLoading && <Loading/>}\r\n                <MoreButton\r\n                    config={searchData.pagination}\r\n                    setConfig={setPaginationConfig}\r\n                    totalCount={totalCount}\r\n                    loadedCount={downloadHistory.items.length}\r\n                    disabled={historyLoading}\r\n                />\r\n\r\n            </>}\r\n        </Dialog>\r\n    );\r\n}\r\n\r\n\r\nDownloadHistoryPopup.propTypes = {\r\n    downloadHistoryFile: PropTypes.shape({\r\n        fileName: PropTypes.string.isRequired,\r\n        demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n        fileId: PropTypes.oneOfType([PropTypes.number, PropTypes.object]).isRequired\r\n    }),\r\n    service: PropTypes.shape({\r\n        getDownloadHistory: PropTypes.func.isRequired\r\n    }),\r\n    onClose: PropTypes.func.isRequired\r\n};\r\n\r\nexport default DownloadHistoryPopup;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport CloudDoneIcon from '@material-ui/icons/CloudDone';\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction WorkableIconDownloadCountButton(\r\n    {\r\n        tooltip = Tr('download_count'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={CloudDoneIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconDownloadCountButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconDownloadCountButton;","import React from 'react'\r\nimport IconButton from './IconButton';\r\nimport WarningRoundedIcon from '@material-ui/icons/WarningRounded'\r\nimport clsx from 'clsx';\r\n\r\n\r\nfunction WarningRoundedButton(\r\n    {\r\n        tooltip,\r\n        className,\r\n        ...props\r\n    }) {\r\n    return <IconButton\r\n        tooltip={tooltip}\r\n        Icon={WarningRoundedIcon}\r\n        className={clsx(className)\r\n        }\r\n        {...props}\r\n    />\r\n}\r\n\r\nexport default WarningRoundedButton;","import React from 'react';\r\n\r\nconst DemandValidationContext = React.createContext(null);\r\nexport const DemandValidationProvider = DemandValidationContext.Provider;\r\nexport default DemandValidationContext;","import React, {useReducer, useState} from 'react'\r\nimport {makeStyles, TableCell, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport moment from \"libs/moment\";\r\nimport WorkableIconDownloadButton from 'components/button/WorkableIconDownloadButton';\r\nimport WorkableIconUnpublishButton from \"components/button/WorkableIconUnpublishButton\";\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport WorkableIconDownloadCountButton from \"components/button/WorkableIconDownloadCountButton\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport {getPublishDateCellValue} from \"./SiwzFileTableRow\";\r\nimport clsx from \"clsx\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    cell: {\r\n        padding: theme.spacing(1),\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn\r\n}));\r\n\r\nfunction SiwzVersionsTableRow(\r\n    {\r\n        demandId,\r\n        rootRowIdentity,\r\n        row,\r\n        onOpenDownloadHistory,\r\n        onEditDescriptionFile,\r\n        showShare,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        preview: false,\r\n        download: false,\r\n        publish: false,\r\n        share: false,\r\n        downloadCount: false\r\n    });\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        SiwzService.getDownloadFile(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source, rootRowIdentity), false)\r\n            .finally(() => dispatchIconWorks({type: 'download', works: false}));\r\n    }\r\n\r\n    const onPublish = () => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        SiwzService.publish(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source, rootRowIdentity))\r\n            .finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    };\r\n\r\n    const onUnpublish = () => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        SiwzService.unpublish(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source, rootRowIdentity))\r\n            .finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    };\r\n\r\n    const onShareFile = (row) => setShareFilePopup(sharePopupData(row.name, row));\r\n\r\n    const doShare = (row, system) => {\r\n        setShareFilePopup(null);\r\n        dispatchIconWorks({type: 'share', works: true});\r\n        SiwzService.shareSiwz(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source, rootRowIdentity), system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            dispatchIconWorks({type: 'share', works: false})\r\n        });\r\n    }\r\n\r\n    return (<TableRow>\r\n        <TableCell className={classes.cell}>{row.name}</TableCell>\r\n        <TableCell className={clsx(classes.cell, classes.buttonColumn)}>\r\n            <WorkableIconSearchButton\r\n                onClick={() => onEditDescriptionFile(row, rootRowIdentity)}\r\n                tooltip={row.description ? <p className={classes.descriptionTooltip}>{row.description}</p> : <i>{Tr('no_description')}</i>}\r\n                disabled={iconWorks.anyWorks}\r\n            />\r\n        </TableCell>\r\n        <TableCell className={classes.cell}>{row.typeTranslated}</TableCell>\r\n        <TableCell className={classes.cell}>{row.version}</TableCell>\r\n        <TableCell className={classes.cell}>{moment(row.createDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n        <TableCell className={classes.cell}>{getPublishDateCellValue(row)}</TableCell>\r\n        <TableCell className={clsx(classes.cell, classes.buttonColumn)}>\r\n            <WorkableIconDownloadButton\r\n                onClick={() => onDownload(row)}\r\n                disabled={iconWorks.anyWorks || !row.actions.download}\r\n                hideTooltip={!row.actions.download}\r\n                working={iconWorks.download}\r\n            />\r\n        </TableCell>\r\n        {showShare && <TableCell className={clsx(classes.cell, classes.buttonColumn)}>\r\n            <WorkableIconShareButton\r\n                onClick={() => onShareFile(row)}\r\n                disabled={iconWorks.anyWorks || !row.actions.download}\r\n                working={iconWorks.share}\r\n            />\r\n            {!!shareFilePopup && <ShareSelectPopup\r\n                data={shareFilePopup}\r\n                onCancel={() => setShareFilePopup(null)}\r\n                onChoose={doShare}\r\n            />}\r\n        </TableCell>}\r\n        <TableCell className={clsx(classes.cell, classes.buttonColumn)}>\r\n            {!!row.actions.unpublish ?\r\n                <WorkableIconUnpublishButton\r\n                    onClick={() => onUnpublish(row)}\r\n                    disabled={iconWorks.anyWorks || !row.actions.unpublish}\r\n                    working={iconWorks.publish}\r\n                /> :\r\n                <WorkableIconPublishButton\r\n                    onClick={() => onPublish(row)}\r\n                    disabled={iconWorks.anyWorks || !row.actions.publish}\r\n                    hideTooltip={!row.actions.publish}\r\n                    working={iconWorks.publish}\r\n                />\r\n            }\r\n        </TableCell>\r\n        <TableCell className={clsx(classes.cell, classes.buttonColumn)}>\r\n            <WorkableIconDownloadCountButton\r\n                tooltip={Tr(\"download_count_x\", {downloadCount: row.downloadCount})}\r\n                onClick={() => onOpenDownloadHistory(row, rootRowIdentity)}\r\n                disabled={!row.actions.downloadDetails}\r\n                hideTooltip={!row.actions.downloadDetails}\r\n            />\r\n        </TableCell>\r\n    </TableRow>)\r\n}\r\n\r\nSiwzVersionsTableRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    rootRowIdentity: PropTypes.number.isRequired,\r\n    row: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        source: PropTypes.string.isRequired\r\n    }).isRequired,\r\n    onOpenDownloadHistory: PropTypes.func.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired,\r\n    showShare: PropTypes.bool.isRequired\r\n};\r\n\r\nexport default SiwzVersionsTableRow;","import React from 'react'\r\nimport {makeStyles, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport clsx from \"clsx\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport SiwzVersionsTableRow from \"./SiwzVersionsTableRow\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    cell: {\r\n        padding: theme.spacing(1),\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    versionColumn: {\r\n        width: 70\r\n    },\r\n    typeColumn: {\r\n        width: 180\r\n    }\r\n}));\r\n\r\nfunction SiwzVersionsTable(\r\n    {\r\n        demandId,\r\n        rootRowIdentity,\r\n        versions,\r\n        onOpenDownloadHistory,\r\n        onEditDescriptionFile,\r\n        showShare,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow>\r\n                    <TableCell className={classes.cell}>{Tr(\"name\")}</TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.buttonColumn)}>{Tr(\"description\")}</TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.typeColumn)}>{Tr(\"type\")}</TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.versionColumn)}>{Tr(\"version\")}</TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.dateColumn)}>{Tr(\"add_data\")}</TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.dateColumn)}>{Tr(\"publish_data\")}</TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.buttonColumn)}></TableCell>\r\n                    {showShare && <TableCell className={clsx(classes.cell, classes.buttonColumn)}></TableCell>}\r\n                    <TableCell className={clsx(classes.cell, classes.buttonColumn)}></TableCell>\r\n                    <TableCell className={clsx(classes.cell, classes.buttonColumn)}></TableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {\r\n                    versions.map((doc) => (\r\n                        <SiwzVersionsTableRow\r\n                            key={doc.source + \"_\" + doc.identity}\r\n                            demandId={demandId}\r\n                            rootRowIdentity={rootRowIdentity}\r\n                            row={doc}\r\n                            onEditDescriptionFile={onEditDescriptionFile}\r\n                            onOpenDownloadHistory={onOpenDownloadHistory}\r\n                            showShare={showShare}\r\n                        />\r\n                    ))\r\n                }\r\n            </TableBody>\r\n\r\n        </Table>\r\n    )\r\n}\r\n\r\nSiwzVersionsTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    rootRowIdentity: PropTypes.number.isRequired,\r\n    versions: PropTypes.arrayOf(PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        source: PropTypes.string.isRequired\r\n    })).isRequired,\r\n    onOpenDownloadHistory: PropTypes.func.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired,\r\n    showShare: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default SiwzVersionsTable;","import React, {useContext, useMemo, useReducer, useState} from 'react'\r\nimport {makeStyles, TableCell, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport moment from \"libs/moment\";\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconDownloadButton from 'components/button/WorkableIconDownloadButton';\r\nimport WorkableIconDownloadCountButton from \"components/button/WorkableIconDownloadCountButton\";\r\nimport WarningRoundedButton from \"components/button/WarningRoundedButton\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport DemandValidationContext from \"context/DemandValidationContext\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconUnpublishButton from \"components/button/WorkableIconUnpublishButton\";\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport SiwzVersionsTable from \"./SiwzVersionsTable\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport reduxStore from 'redux/store'\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\nimport validateSection from \"services/helpers/validateSection\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport HelpComponent from \"../../../HelpComponent\";\r\nimport WorkableIconEditButton from \"../../../button/WorkableIconEditButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    warnIcon: {\r\n        padding: 0,\r\n        color: `${theme.palette.secondary.main} !important`\r\n    },\r\n    descriptionTooltip: {\r\n        whiteSpace: 'pre-line'\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    versionsCell: {\r\n        background: theme.palette.background.default,\r\n        paddingLeft: 0,\r\n        paddingRight: 0\r\n    }\r\n}));\r\n\r\nexport const getPublishDateCellValue = (row) => {\r\n    switch (row.status) {\r\n        case 'uploaded':\r\n            return Tr('new');\r\n        case 'unpublished':\r\n            return Tr('unpublished');\r\n        default:\r\n            return row.publishDate ? moment(row.publishDate).format(DateFormats.DATETIME_FORMAT) : null\r\n    }\r\n};\r\n\r\nfunction SiwzFileTableRow(\r\n    {\r\n        demandId,\r\n        index,\r\n        row,\r\n        isPublished,\r\n        disabled,\r\n        onOpenDownloadHistory,\r\n        onEditDescriptionFile,\r\n        onEditNoticeReferenceNumber,\r\n        showShare,\r\n    }) {\r\n    const classes = useStyle();\r\n    const currentDemandValidation = useContext(DemandValidationContext);\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        publish: false,\r\n        delete: false,\r\n        expand: false,\r\n        share: false,\r\n        enterNoticeReferenceNumber: false\r\n    });\r\n\r\n    const hasVersions = useMemo(() => row.version && row.version > 1, [row]);\r\n\r\n    const onVersionsExpand = () => {\r\n        dispatchIconWorks({type: 'expand', works: true});\r\n        var func;\r\n        if (!row.versions)\r\n            func = SiwzService.getVersions\r\n        else\r\n            func = SiwzService.clearVersions\r\n\r\n        func(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source))\r\n            .finally(() => dispatchIconWorks({type: 'expand', works: false}));\r\n    }\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        SiwzService.getDownloadFile(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source), false)\r\n            .finally(() => dispatchIconWorks({type: 'download', works: false}));\r\n    }\r\n\r\n    const checkRealizationAmountValue = async () => {\r\n        //demand validation nie ma na II etapie\r\n        if (!currentDemandValidation && row.type === \"x.realizationAmountValue\") {\r\n            const {resources} = reduxStore.getState();\r\n            const currentRfxRound = resources[StatisticsService.CURRENT_RFX_RESOURCE_ID];\r\n            if (Boolean(currentRfxRound)) {\r\n                RfxOfferService.getOffersDecryptionStatus(currentRfxRound.id);\r\n            }\r\n        } else if (currentDemandValidation === DemandValidation.DOCUMENTS && row.type.startsWith('x.openOffers')) {\r\n            await validateSection(DemandValidation.CONTRACTOR_VERIFICATION, demandId, false)\r\n            await validateSection(DemandValidation.OFFERS_EVALUATION, demandId, false)\r\n            await validateSection(DemandValidation.OFFER_CHOICE, demandId, false)\r\n        }\r\n    }\r\n\r\n    const onPublish = () => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        SiwzService.publish(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source), currentDemandValidation)\r\n            .then(checkRealizationAmountValue).finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    };\r\n\r\n    const onUnpublish = () => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        SiwzService.unpublish(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source), currentDemandValidation)\r\n            .then(checkRealizationAmountValue).finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    };\r\n\r\n    const onDelete = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        SiwzService.deleteItem(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source), currentDemandValidation)\r\n            .finally(() => {\r\n                dispatchIconWorks({type: 'delete', works: false})\r\n            });\r\n    }\r\n\r\n    const onShareFile = (row) => setShareFilePopup(sharePopupData(row.name, row));\r\n\r\n    const doShare = (row, system) => {\r\n        setShareFilePopup(null);\r\n        dispatchIconWorks({type: 'share', works: true});\r\n        SiwzService.shareSiwz(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source), system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            dispatchIconWorks({type: 'share', works: false})\r\n        });\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <TableRow>\r\n                <TableCell>{index}</TableCell>\r\n                <TableCell>\r\n                    {(isPublished && row.status !== 'published' && row.status !== 'accepted') &&\r\n                        <WarningRoundedButton className={classes.warnIcon} disabled tooltip={Tr('file_not_published')}/>\r\n                    } {row.name}\r\n                </TableCell>\r\n                <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconSearchButton\r\n                        onClick={() => onEditDescriptionFile(row)}\r\n                        tooltip={row.description ? <p className={classes.descriptionTooltip}>{row.description}</p> : <i>{Tr('no_description')}</i>}\r\n                    />\r\n                </TableCell>\r\n                <TableCell>{row.typeTranslated}</TableCell>\r\n                <TableCell>\r\n                    <HelpComponent text={`${row.fileSize}, SHA256: ${row.sha256}`}></HelpComponent>\r\n                </TableCell>\r\n                <TableCell>{moment(row.createDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n                {isPublished && <TableCell>{getPublishDateCellValue(row)}</TableCell>}\r\n                <TableCell className={classes.buttonColumn}>\r\n                    {row.actions.enterNoticeReferenceNumber &&\r\n                        <WorkableIconEditButton\r\n                            tooltip={Tr('enter_notice_reference_number')}\r\n                            onClick={() => onEditNoticeReferenceNumber(row)}\r\n                            disabled={iconWorks.anyWorks}\r\n                            hideTooltip={!row.actions.enterNoticeReferenceNumber}\r\n                            working={iconWorks.enterNoticeReferenceNumber}\r\n                        />\r\n                    }\r\n                </TableCell>\r\n                <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconDownloadButton\r\n                        onClick={() => onDownload(row.actions.download, row.name)}\r\n                        disabled={iconWorks.anyWorks || !row.actions.download}\r\n                        working={iconWorks.download}\r\n                    />\r\n                </TableCell>\r\n                {\r\n                    showShare &&\r\n                    <TableCell className={classes.buttonColumn}>\r\n                        <WorkableIconShareButton\r\n                            onClick={() => onShareFile(row)}\r\n                            hideTooltip={!row.actions.download}\r\n                            disabled={iconWorks.anyWorks || !row.actions.download}\r\n                            working={iconWorks.share}\r\n                        />\r\n\r\n                        {!!shareFilePopup && <ShareSelectPopup\r\n                            data={shareFilePopup}\r\n                            onCancel={() => setShareFilePopup(null)}\r\n                            onChoose={doShare}\r\n                        />}\r\n                    </TableCell>\r\n                }\r\n                {isPublished && <TableCell className={classes.buttonColumn}>\r\n\r\n                    {row.status === \"published\" || row.status === \"accepted\" ?\r\n                        <WorkableIconUnpublishButton\r\n                            onClick={onUnpublish}\r\n                            disabled={iconWorks.anyWorks || !row.actions.unpublish}\r\n                            hideTooltip={!row.actions.unpublish}\r\n                            working={iconWorks.publish}\r\n                        />\r\n                        :\r\n                        <WorkableIconPublishButton\r\n                            onClick={onPublish}\r\n                            hideTooltip={!row.actions.publish}\r\n                            disabled={iconWorks.anyWorks || !row.actions.publish}\r\n                            working={iconWorks.publish}\r\n                        />\r\n                    }\r\n                </TableCell>\r\n                }\r\n                {isPublished && <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconDownloadCountButton\r\n                        tooltip={Tr(\"download_count_x\", {downloadCount: row.downloadCount})}\r\n                        onClick={() => onOpenDownloadHistory(row)}\r\n                        hideTooltip={!row.actions.downloadDetails}\r\n                        disabled={iconWorks.anyWorks || !row.actions.downloadDetails}\r\n                    />\r\n                </TableCell>\r\n                }\r\n                <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconDeleteButton\r\n                        tooltip={row.actions.delete ? Tr('delete') : Tr('delete_repo_disabled')}\r\n                        onClick={onDelete}\r\n                        disabled={iconWorks.anyWorks || !row.actions.delete}\r\n                        working={iconWorks.delete}\r\n                    />\r\n                </TableCell>\r\n\r\n                {isPublished && <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconExpandButton\r\n                        tooltip={hasVersions ? (!row.versions ? Tr('expand_prev_versions') : Tr('collapse_prev_versions')) : Tr('no_prev_versions')}\r\n                        expanded={!!row.versions}\r\n                        onClick={onVersionsExpand}\r\n                        disabled={iconWorks.anyWorks || !hasVersions}\r\n                        working={iconWorks.expand}\r\n                    />\r\n                </TableCell>\r\n                }\r\n            </TableRow>\r\n\r\n            {!!row.versions &&\r\n                <TableRow>\r\n                    <TableCell className={classes.versionsCell}></TableCell>\r\n                    <TableCell className={classes.versionsCell} colSpan={isPublished ? 10 : 6}>\r\n                        <SiwzVersionsTable\r\n                            demandId={demandId}\r\n                            rootRowIdentity={row.identity}\r\n                            versions={row.versions}\r\n                            onOpenDownloadHistory={onOpenDownloadHistory}\r\n                            onEditDescriptionFile={onEditDescriptionFile}\r\n                            showShare={showShare}\r\n                        />\r\n                    </TableCell>\r\n                    <TableCell className={classes.versionsCell}></TableCell>\r\n                </TableRow>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nSiwzFileTableRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    row: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        source: PropTypes.string.isRequired\r\n    }).isRequired,\r\n    index: PropTypes.number.isRequired,\r\n    isPublished: PropTypes.bool.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    onOpenDownloadHistory: PropTypes.func.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired,\r\n    onEditNoticeReferenceNumber: PropTypes.func.isRequired,\r\n    showShare: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default SiwzFileTableRow;","import React, {useState} from 'react'\r\nimport {connect} from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport PropTypes from 'prop-types'\r\nimport DoubleButton from \"../../../popup/components/DoubleButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    disabledEmpty: {\r\n        fontStyle: 'italic'\r\n    },\r\n    disabled: {\r\n        '& textarea': {\r\n            color: theme.palette.text.primary\r\n        }\r\n    },\r\n    textField: {\r\n        wordBreak: \"break-word\",\r\n        whiteSpace: 'pre-line',\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nexport const createEditNoticeReferenceNumberFile = (demandId, identity, noticeReferenceNumber) => ({demandId, identity, noticeReferenceNumber})\r\n\r\nfunction AddNoticeReferenceNumberPopup(\r\n    {\r\n        editNoticeReferenceNumberFile,\r\n        onUpdated,\r\n        onClose,\r\n        service,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const [working, setWorking] = useState(false);\r\n\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = ({noticeReferenceNumber}) => {\r\n        setWorking(true);\r\n        service.updateNoticeReferenceNumber(editNoticeReferenceNumberFile.demandId,\r\n                                            editNoticeReferenceNumberFile.identity,\r\n                                            noticeReferenceNumber)\r\n            .then(onUpdated)\r\n            .finally(()=> setWorking(false))\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"enter_notice_reference_number\")}\r\n            maxWidth={'sm'}\r\n            open={true}\r\n            onClose={onClose}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    noticeReferenceNumber: editNoticeReferenceNumberFile.noticeReferenceNumber,\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    noticeReferenceNumber: VS.string(),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <TextInput\r\n                            id='noticeReferenceNumber'\r\n                            formikProps={formikProps}\r\n                            label={Tr('notice_reference_number')}\r\n                            disabled={working}\r\n                        />\r\n\r\n                        <div className={classes.actions}>\r\n                            <DoubleButton\r\n                                justify='flex-end'\r\n                                labelFirst={Tr('cancel')}\r\n                                labelSecond={Tr('confirm2')}\r\n                                onClickFirst={onClose}\r\n                                onClickSecond={handleSubmit}\r\n                                disabledFirst={working}\r\n                                disabledSecond={working}\r\n                            />\r\n                        </div>\r\n\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAddNoticeReferenceNumberPopup.propTypes = {\r\n    editNoticeReferenceNumberFile: PropTypes.shape({\r\n        demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n        identity: PropTypes.oneOfType([PropTypes.number, PropTypes.object]).isRequired,\r\n        noticeReferenceNumber: PropTypes.string\r\n    }).isRequired,\r\n    onUpdated: PropTypes.func.isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n    service: PropTypes.shape({\r\n        updateDescription: PropTypes.func.isRequired\r\n    })\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddNoticeReferenceNumberPopup);","import React, {useContext, useMemo, useState} from 'react'\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport DownloadHistoryPopup, {createDownloadHistoryFile} from \"components/popup/DownloadHistoryPopup\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport EditDescriptionPopup, {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport SiwzFileTableRow from \"./SiwzFileTableRow\";\r\nimport DemandValidationContext from \"context/DemandValidationContext\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from 'prop-types';\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport {shareSystemsActive} from \"libs/shareSystems\";\r\nimport {connect} from \"react-redux\";\r\nimport AddNoticeReferenceNumberPopup, {createEditNoticeReferenceNumberFile} from \"./AddNoticeReferenceNumberPopup\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: theme.components.table.lpColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    typeColumn: {\r\n        width: 180\r\n    }\r\n}));\r\n\r\nfunction SiwzFileTable(\r\n    {\r\n        demandId,\r\n        isPublished,\r\n        disabled,\r\n        siwzList,\r\n        demandPrivileges = {},\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [downloadHistory, setDownloadHistory] = useState(null);\r\n    const [openConfirmDeleteAll, setOpenConfirmDeleteAll] = useState(false);\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(null);\r\n    const [editNoticeReferenceNumberFile, setEditNoticeReferenceNumberFile] = useState(null);\r\n    const currentDemandValidation = useContext(DemandValidationContext);\r\n\r\n    const showShare = useMemo(() => demandPrivileges.INTEGRATIONS_UPLOAD && shareSystemsActive(demandHeader).length > 0, [demandHeader, demandPrivileges])\r\n\r\n    const onDeleteAll = () => {\r\n        setOpenConfirmDeleteAll(false);\r\n        SiwzService.deleteAll(demandId, currentDemandValidation);\r\n    };\r\n\r\n    const onDownloadHistoryDialogClose = () => {\r\n        setDownloadHistory(null);\r\n    }\r\n\r\n    const openDownloadHistory = (row, parentRowIdentity) => {\r\n        setDownloadHistory(createDownloadHistoryFile(row.name, demandId, SiwzService.buildSiwzIdentity(row.identity, row.source, parentRowIdentity)));\r\n    };\r\n\r\n    const openEditDescription = (row, parentRowIdentity) => {\r\n        setEditDescriptionFile(createEditDescriptionFile(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source, parentRowIdentity),\r\n            row.name, row.description, !row.actions.editDescription));\r\n    };\r\n\r\n    const openEditNoticeReferenceNumber = (row) => {\r\n        setEditNoticeReferenceNumberFile(createEditNoticeReferenceNumberFile(demandId, SiwzService.buildSiwzIdentity(row.identity, row.source), row.noticeReferenceNumber));\r\n    }\r\n\r\n    return (<>\r\n        {!!siwzList && <div>\r\n            {!siwzList.length ?\r\n                <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                :\r\n                <>\r\n\r\n                    <Table>\r\n                        <TableHead>\r\n                            <TableRow>\r\n                                <TableCell className={classes.lpColumn}>{Tr(\"column_lp\")}</TableCell>\r\n                                <TableCell>{Tr(\"name\")}</TableCell>\r\n                                <TableCell className={classes.buttonColumn}>{Tr(\"description\")}</TableCell>\r\n                                <TableCell className={classes.typeColumn}>{Tr(\"type\")}</TableCell>\r\n                                <TableCell className={classes.buttonColumn}>{Tr(\"size\")}</TableCell>\r\n                                <TableCell className={classes.dateColumn}>{Tr(\"add_data\")}</TableCell>\r\n                                {isPublished && <TableCell className={classes.dateColumn}>{Tr(\"publish_data\")}</TableCell>}\r\n                                <TableCell className={classes.buttonColumn}></TableCell>\r\n                                {showShare && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                {isPublished && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                {isPublished && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                <TableCell className={classes.buttonColumn}>\r\n                                    {!isPublished && <WorkableIconDeleteButton\r\n                                        onClick={() => setOpenConfirmDeleteAll(true)}\r\n                                        tooltip={Tr('delete_all')}\r\n                                        disabled={disabled}\r\n                                    />}\r\n                                </TableCell>\r\n                                {isPublished && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                            </TableRow>\r\n                        </TableHead>\r\n                        <TableBody>\r\n                            {\r\n                                siwzList.map((doc, index) => (\r\n                                    <SiwzFileTableRow\r\n                                        key={doc.source + \"_\" + doc.identity}\r\n                                        row={doc}\r\n                                        demandId={demandId}\r\n                                        index={index + 1}\r\n                                        isPublished={isPublished}\r\n                                        disabled={disabled}\r\n                                        showShare={showShare}\r\n                                        onEditDescriptionFile={openEditDescription}\r\n                                        onEditNoticeReferenceNumber={openEditNoticeReferenceNumber}\r\n                                        onOpenDownloadHistory={openDownloadHistory}\r\n                                    />))\r\n                            }\r\n                        </TableBody>\r\n                    </Table>\r\n\r\n                    {downloadHistory &&\r\n                    <DownloadHistoryPopup downloadHistoryFile={downloadHistory} onClose={onDownloadHistoryDialogClose} service={SiwzService}/>\r\n                    }\r\n\r\n                    {Boolean(editDescriptionFile) &&\r\n                    <EditDescriptionPopup\r\n                        editDescriptionFile={editDescriptionFile}\r\n                        onUpdated={() => setEditDescriptionFile(null)}\r\n                        onClose={() => setEditDescriptionFile(null)}\r\n                        service={SiwzService}\r\n                    />\r\n                    }\r\n\r\n                    {Boolean(editNoticeReferenceNumberFile) &&\r\n                    <AddNoticeReferenceNumberPopup\r\n                        editNoticeReferenceNumberFile={editNoticeReferenceNumberFile}\r\n                        onUpdated={() => setEditNoticeReferenceNumberFile(false)}\r\n                        onClose={() => setEditNoticeReferenceNumberFile(false)}\r\n                        service={SiwzService}\r\n                    />\r\n                    }\r\n\r\n                    <Confirm\r\n                        open={Boolean(openConfirmDeleteAll)}\r\n                        onConfirm={onDeleteAll}\r\n                        onCancel={() => setOpenConfirmDeleteAll(false)}\r\n                        confirmText=\"confirm_delete_all\"\r\n                    />\r\n                </>\r\n            }\r\n        </div>\r\n        }\r\n    </>)\r\n}\r\n\r\nSiwzFileTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    isPublished: PropTypes.bool.isRequired,\r\n    disabled: PropTypes.bool.isRequired\r\n};\r\nexport default connect((state) => ({\r\n    siwzList: state.resources[SiwzService.SIWZ_LIST_RESOURCE_ID],\r\n    demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY],\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(SiwzFileTable);","import React, {useContext, useState} from 'react'\r\nimport UploadFile from 'components/UploadFile';\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport SelectSiwzDocumentType from \"./SelectSiwzDocumentType\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport SiwzFileTable from \"./SiwzFileTable\";\r\nimport DemandValidationContext from \"context/DemandValidationContext\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction SelectSiwzDocument(\r\n    {\r\n        demandId,\r\n        disabled,\r\n        isPublished,\r\n    }) {\r\n\r\n    const currentDemandValidation = useContext(DemandValidationContext);\r\n    const [portFilesWorking, setPostFilesWorking] = useState(false);\r\n    const [selectedFiles, setSelectedFiles] = useState(null);\r\n    const [configuredFiles, setConfiguredFiles] = useState(null);\r\n\r\n\r\n    const handleSendFiles = (uploadedFiles, config) => {\r\n        setConfiguredFiles(null);\r\n        if(uploadedFiles.length) {\r\n            const tab = uploadedFiles.map((x, i) => ({\r\n                ...x,\r\n                type: config[`item${x.originalIndex}`],\r\n                parent: config[`parent${x.originalIndex}`],\r\n                autopublish: config[`autopublish${x.originalIndex}`],\r\n            }));\r\n            setPostFilesWorking(true)\r\n            SiwzService.send(demandId, tab, currentDemandValidation).finally(()=> setPostFilesWorking(false));\r\n        }\r\n    };\r\n\r\n    const handleSubmitSelectDocumentTypes = (values) => {\r\n        setConfiguredFiles({files: selectedFiles, config: values})\r\n        setSelectedFiles(null);\r\n    };\r\n\r\n    return (\r\n        <>\r\n            <TitledComponent title={Tr('added_documents')}>\r\n\r\n                {!disabled &&\r\n                    <UploadFile\r\n                        onUploadPopupClosed={handleSendFiles}\r\n                        onOpenConfigureFiles={(files) => setSelectedFiles(files)}\r\n                        configuredFiles={configuredFiles}\r\n                        working={portFilesWorking}\r\n                    />\r\n                }\r\n\r\n                <SiwzFileTable\r\n                    demandValidationSectionId={currentDemandValidation}\r\n                    demandId={demandId}\r\n                    isPublished={isPublished}\r\n                    disabled={disabled}\r\n                />\r\n            </TitledComponent>\r\n\r\n            {!!selectedFiles && <SelectSiwzDocumentType\r\n                items={selectedFiles}\r\n                onCancel={() => setSelectedFiles(null)}\r\n                onSubmit={handleSubmitSelectDocumentTypes}\r\n                pickAutopublish={isPublished}\r\n                pickParent={isPublished}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nSelectSiwzDocument.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    isPublished: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default SelectSiwzDocument;","import React, {useMemo, useState} from 'react'\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport {isDemandModification, isDemandOfferCollection, wasEverPublished} from \"libs/getDemandStatus\";\r\nimport downloadFile from \"libs/downloadFile\";\r\nimport ChooseSwzGeneratorOptions from \"components/complex/papersGenerator/customPopups/swzGenerator/ChooseSwzGeneratorOptions\";\r\nimport isBzpAttachmentNoticeType from \"libs/isBzpAttachmentNoticeType\";\r\nimport {connect} from \"react-redux\";\r\nimport {withRouter} from \"react-router\";\r\nimport AddBzpNoticePopup from \"./AddBzpNoticePopup\";\r\nimport SelectSiwzDocument from \"./SelectSiwzDocument\";\r\nimport PropTypes from \"prop-types\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    topButtons: {\r\n        marginBottom: theme.spacing(1)\r\n    }\r\n}));\r\n\r\nfunction SiwzDocuments(\r\n    {\r\n        demandId,\r\n        editable,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [addBzpNoticePopupOpened, setAddBzpNoticePopupOpened] = useState(false);\r\n    const [swzParamsOpen, setSwzParamsOpen] = useState(false);\r\n\r\n    const isBzpAttachmentNotice = useMemo(() => isBzpAttachmentNoticeType(demandHeader), [demandHeader]);\r\n    const isPublished = useMemo(() => demandHeader ? wasEverPublished() : undefined, [demandHeader]);\r\n    const isOfferCollectionOrModification = useMemo(() => demandHeader ? isDemandOfferCollection() || isDemandModification() : undefined, [demandHeader]);\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (isBzpAttachmentNotice && editable && (!isPublished || isOfferCollectionOrModification)) {\r\n            buttons.push(createButton(Tr(isPublished ? \"add_bzp_notice_update\" : \"add_bzp_notice\"), () => setAddBzpNoticePopupOpened(true)))\r\n        }\r\n\r\n        if (demandHeader && editable) {\r\n            if(!isPublished || isOfferCollectionOrModification) {\r\n                if (demandHeader.applicationClientSettings.papersGenerator.active) {\r\n                    buttons.push(createButton(Tr('swz_button'), () => setSwzParamsOpen(true)))\r\n                } else {\r\n                    buttons.push(createButton(Tr('swz_button'), () => downloadFile({url: Endpoints.PAPERS_GENERATOR_PRINT(demandId, 'swz_generator')})))\r\n                }\r\n            }\r\n        }\r\n\r\n        if (buttons.length)\r\n            return <MultiButton className={classes.topButtons} buttons={buttons} justify=\"flex-start\"/>\r\n    }\r\n\r\n    return (\r\n        <GridBlock\r\n            column\r\n        >\r\n            {getButtons()}\r\n\r\n            <SelectSiwzDocument\r\n                demandId={demandId}\r\n                disabled={!editable}\r\n                isPublished={isPublished}\r\n            />\r\n\r\n            {addBzpNoticePopupOpened && <AddBzpNoticePopup demandId={demandId} onClose={() => setAddBzpNoticePopupOpened(false)}/>}\r\n            {swzParamsOpen && <ChooseSwzGeneratorOptions id={demandId} onClose={() => setSwzParamsOpen(false)}/>}\r\n\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nSiwzDocuments.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool\r\n};\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(withRouter(SiwzDocuments));","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport { withStyles } from '@material-ui/core';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport DoubleButton from '../../../popup/components/DoubleButton';\r\nimport TextInput from 'components/TextInput';\r\nimport * as Yup from 'yup';\r\nimport validationShema from 'constants/ValidationShema';\r\nimport useId from 'hooks/useId';\r\nimport { connect } from 'react-redux'\r\nimport RepoService from 'services/RepoService';\r\nimport InputLimits from \"constants/InputLimits\";\r\n\r\nconst style = theme => ({\r\n\tpadding: {\r\n\t\tmarginTop: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction CreateFolderPopup({\r\n\topen,\r\n\tonClose,\r\n\tclasses,\r\n\tformSubmit,\r\n\tdemandId\r\n}) {\r\n\r\n\tconst formId = useId();\r\n\r\n\tconst handleSubmit = () => formSubmit[formId]()\r\n\tconst onAdd = (values) => {\r\n\t\tRepoService.addFolder(demandId,values)\r\n\t\tonClose()\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\ttitle={Tr('create_folder')}\r\n\t\t\topen={open}\r\n\t\t\tmaxWidth={'md'}\r\n\t\t>\r\n\t\t\t<Form\r\n\t\t\t\tinitialValues={{\r\n\t\t\t\t\tname: \"\",\r\n\t\t\t\t\tdescription: \"\"\r\n\t\t\t\t}}\r\n\t\t\t\tvalidationSchema={Yup.object().shape({\r\n\t\t\t\t\tname: validationShema.stringMax(InputLimits.procedure.documents.NAME),\r\n\t\t\t\t})}\r\n\t\t\t\tonSubmit={onAdd}\r\n\t\t\t\tid={formId}\r\n\t\t\t>\r\n\t\t\t\t{(formikProps) => (\r\n\t\t\t\t\t<GridBlock column>\r\n\t\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\t\tid='name'\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tlabel={Tr('folder_name')}\r\n\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\tlimit={InputLimits.procedure.documents.NAME}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<TextInput\r\n\t\t\t\t\t\t\tid='description'\r\n\t\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\t\tlabel={Tr('folder_description')}\r\n\t\t\t\t\t\t\tmultiline\r\n\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t<div className={classes.actions}>\r\n\t\t\t\t\t\t\t<DoubleButton\r\n\t\t\t\t\t\t\t\tjustify='flex-end'\r\n\t\t\t\t\t\t\t\tlabelFirst={Tr('cancel')}\r\n\t\t\t\t\t\t\t\tlabelSecond={Tr('add')}\r\n\t\t\t\t\t\t\t\tonClickFirst={onClose}\r\n\t\t\t\t\t\t\t\tonClickSecond={handleSubmit}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</GridBlock>\r\n\t\t\t\t)}\r\n\t\t\t</Form>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tformSubmit: state.form\r\n}), {})(withStyles(style)(CreateFolderPopup));","import React from 'react'\r\nimport {List, ListItem, ListItemIcon, ListItemText} from '@material-ui/core';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport FolderIcon from '@material-ui/icons/Folder';\r\nimport RepoFolderTypes from \"constants/RepoFolderTypes\";\r\nimport PropTypes from \"prop-types\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\n\r\n\r\nfunction SelectFolderPopup(\r\n    {\r\n        onCancel,\r\n        onSubmit,\r\n        folderList,\r\n    }) {\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            title={Tr('select_directory')}\r\n            titleCentered\r\n            maxWidth=\"sm\"\r\n            dialogActions={<SingleButton onClick={onCancel} label={Tr('cancel')}/>}\r\n        >\r\n\r\n            <List dense>\r\n                {\r\n                    folderList.filter(x => x.type !== RepoFolderTypes.Z_TRASH).map(x =>\r\n                        <ListItem key={x.identity} button onClick={() => onSubmit(x.identity)}>\r\n                            <ListItemIcon>\r\n                                <FolderIcon/>\r\n                            </ListItemIcon>\r\n                            <ListItemText\r\n                                primary={x.name}\r\n                            />\r\n                        </ListItem>\r\n                    )\r\n                }\r\n                {\r\n                    folderList.length === 1 && folderList[0].type === RepoFolderTypes.Z_TRASH &&\r\n                    <ListItem onClick={onCancel}>\r\n                        <ListItemText\r\n                            primary={Tr(\"lack_of_folder\")}\r\n                        />\r\n                    </ListItem>\r\n                }\r\n\r\n            </List>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nSelectFolderPopup.propTypes = {\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n    folderList: PropTypes.arrayOf(PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        type: PropTypes.string.isRequired,\r\n        name: PropTypes.string.isRequired\r\n    })).isRequired\r\n}\r\n\r\nexport default SelectFolderPopup;\r\n","import React, {useEffect, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport Select from \"components/Select\";\r\nimport DescriptionIcon from '@material-ui/icons/Description';\r\nimport FolderIcon from '@material-ui/icons/Folder';\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport moment from \"libs/moment\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport RepoService from \"services/RepoService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nfunction ChangeRepoVisibilityPopup(\r\n    {\r\n        onClose = () => {\r\n        },\r\n        demandId,\r\n        repoVisibility,\r\n        formSubmit,\r\n        repoVisibilityTypes\r\n    }) {\r\n\r\n\r\n    const {fileId, folderId, name, visibilityStatus, visibilityEndDate} = repoVisibility;\r\n    const isFile = !!fileId;\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const [visibilityTypes, setVisibilityTypes] = useState([]);\r\n\r\n    useEffect(() => {\r\n        const types = [];\r\n        Object.keys(repoVisibilityTypes).forEach((x) => types.push({label: repoVisibilityTypes[x], value: x}));\r\n        setVisibilityTypes(types);\r\n    }, [repoVisibilityTypes]);\r\n\r\n\r\n    const onSubmit = (values) => {\r\n        let promise;\r\n        if (isFile) {\r\n            promise = RepoService.changeFileVisibility(demandId, folderId, fileId, values);\r\n        } else {\r\n            promise = RepoService.changeFolderFilesVisibility(demandId, folderId, values);\r\n        }\r\n        promise.then(onClose);\r\n\r\n    }\r\n\r\n    const validationSchema = VS.lazy((value) => {\r\n\r\n        let objShape = {\r\n            visibility: VS.string(),\r\n        }\r\n\r\n        if (value.visibility !== 'STATUS_INTERNAL') {\r\n            objShape['visibilityEndDate'] = VS.dateTimeNoReq()\r\n        }\r\n\r\n        return Yup.object().shape(objShape)\r\n    })\r\n\r\n    return (\r\n        <Dialog\r\n            title={isFile ? Tr('change_file_visibility') : Tr('change_visibility_for_all_files')}\r\n            open={true}\r\n            maxWidth={'xs'}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr('confirm')}\r\n                onClickFirst={onClose}\r\n                onClickSecond={handleSubmit}\r\n            />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    visibility: visibilityStatus,\r\n                    visibilityEndDate: visibilityEndDate ? moment(visibilityEndDate) : null,\r\n                }}\r\n                validationSchema={validationSchema}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <TypographyWithIcon Icon={isFile ? DescriptionIcon : FolderIcon} className={classes.margin}>\r\n                            {name}\r\n                        </TypographyWithIcon>\r\n\r\n                        <Select\r\n                            id='visibility'\r\n                            formikProps={formikProps}\r\n                            items={visibilityTypes}\r\n                            label={Tr('repo_visibility_type')}\r\n                        />\r\n\r\n                        <DateTimePicker\r\n                            formikProps={formikProps}\r\n                            id='visibilityEndDate'\r\n                            label={Tr('repo_visibility_end_date')}\r\n                            disabled={formikProps.values.visibility === 'STATUS_INTERNAL'}\r\n                        />\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n    repoVisibilityTypes: state.resources.repoVisibilityTypes\r\n}), {})(ChangeRepoVisibilityPopup);","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport GetAppIcon from '@material-ui/icons/Eject';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconEjectButton(\r\n    {\r\n        tooltip = Tr('eject'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={GetAppIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconEjectButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconEjectButton;","import React, {useReducer, useState} from 'react'\r\nimport {makeStyles, TableCell, TableRow} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport moment from \"libs/moment\";\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport WorkableIconDownloadButton from 'components/button/WorkableIconDownloadButton';\r\nimport WorkableIconDownloadCountButton from \"components/button/WorkableIconDownloadCountButton\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconUnpublishButton from \"components/button/WorkableIconUnpublishButton\";\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport RepoService from \"services/RepoService\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\nimport WorkableIconEjectButton from \"components/button/WorkableIconEjectButton\";\r\nimport HelpComponent from \"../../../HelpComponent\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    descriptionTooltip: {\r\n        whiteSpace: 'pre-line'\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n}));\r\n\r\nfunction RepoFileTableRow(\r\n    {\r\n        demandId,\r\n        index,\r\n        row,\r\n        isPublished,\r\n        onOpenDownloadHistory,\r\n        onEditDescriptionFile,\r\n        onSetRepoVisibility,\r\n        showShare,\r\n        onMoveToSiwz\r\n    }) {\r\n    const classes = useStyle();\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        delete: false,\r\n        share: false,\r\n    });\r\n\r\n    const onDownload = () => {\r\n        dispatchIconWorks({type: 'download', works: true});\r\n        RepoService.getDownloadFile(demandId, row.identity, false)\r\n            .finally(() => dispatchIconWorks({type: 'download', works: false}));\r\n    }\r\n\r\n    const onDelete = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        RepoService.deleteItem(demandId, row.identity)\r\n            .finally(() => {\r\n                dispatchIconWorks({type: 'delete', works: false})\r\n            });\r\n    }\r\n\r\n    const onShareFile = (row) => setShareFilePopup(sharePopupData(row.name, row));\r\n\r\n    const doShare = (row, system) => {\r\n        setShareFilePopup(null);\r\n        dispatchIconWorks({type: 'share', works: true});\r\n        RepoService.shareRepo(demandId, row.identity, system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            dispatchIconWorks({type: 'share', works: false})\r\n        });\r\n    }\r\n\r\n    return (\r\n        <TableRow>\r\n            <TableCell>{index}</TableCell>\r\n            <TableCell>\r\n                {row.name}\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconSearchButton\r\n                    onClick={() => onEditDescriptionFile(row)}\r\n                    tooltip={row.description ? <p className={classes.descriptionTooltip}>{row.description}</p> : <i>{Tr('no_description')}</i>}\r\n                    disabled={iconWorks.anyWorks}\r\n                />\r\n            </TableCell>\r\n            <TableCell>{Tr(`repo.visibility.${row.visibilityStatus}`)}</TableCell>\r\n            <TableCell><HelpComponent text={`${row.fileSize}, SHA256: ${row.sha256}`}></HelpComponent></TableCell>\r\n            <TableCell>{moment(row.createDate).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n            {isPublished && <TableCell>{row.publishDate ? moment(row.publishDate).format(DateFormats.DATETIME_FORMAT) : null}</TableCell>}\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconDownloadButton\r\n                    onClick={() => onDownload(row.actions.download, row.name)}\r\n                    hideTooltip={!row.actions.download}\r\n                    disabled={iconWorks.anyWorks || !row.actions.download}\r\n                    working={iconWorks.download}\r\n                />\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconEjectButton\r\n                    tooltip={Tr('move_to_siwz')}\r\n                    onClick={() => onMoveToSiwz([{identity: row.identity, name: row.name}])}\r\n                    hideTooltip={!row.actions.moveToSiwz}\r\n                    disabled={iconWorks.anyWorks || !row.actions.moveToSiwz}\r\n                />\r\n            </TableCell>\r\n            {showShare &&\r\n                <TableCell className={classes.buttonColumn}>\r\n                    <WorkableIconShareButton\r\n                        onClick={() => onShareFile(row)}\r\n                        hideTooltip={!row.actions.download}\r\n                        disabled={iconWorks.anyWorks || !row.actions.download}\r\n                        working={iconWorks.share}\r\n                    />\r\n                    {!!shareFilePopup && <ShareSelectPopup\r\n                        data={shareFilePopup}\r\n                        onCancel={() => setShareFilePopup(null)}\r\n                        onChoose={doShare}\r\n                    />}\r\n                </TableCell>\r\n            }\r\n\r\n            <TableCell className={classes.buttonColumn}>\r\n                {row.visibilityStatus === 'STATUS_INTERNAL' ?\r\n                    <WorkableIconPublishButton\r\n                        onClick={() => onSetRepoVisibility(row)}\r\n                        hideTooltip={!row.actions.changeVisibility}\r\n                        disabled={iconWorks.anyWorks || !row.actions.changeVisibility}\r\n                    />\r\n                    :\r\n                    <WorkableIconUnpublishButton\r\n                        onClick={() => onSetRepoVisibility(row)}\r\n                        hideTooltip={!row.actions.changeVisibility}\r\n                        disabled={iconWorks.anyWorks || !row.actions.changeVisibility}\r\n                    />\r\n\r\n                }\r\n            </TableCell>\r\n\r\n            {isPublished && <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconDownloadCountButton\r\n                    tooltip={Tr(\"download_count_x\", {downloadCount: row.downloadCount})}\r\n                    onClick={() => onOpenDownloadHistory(row)}\r\n                    hideTooltip={!row.actions.downloadDetails}\r\n                    disabled={iconWorks.anyWorks || !row.actions.downloadDetails}\r\n                />\r\n            </TableCell>\r\n            }\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconDeleteButton\r\n                    tooltip={row.actions.delete ? Tr('delete') : Tr('delete_repo_disabled')}\r\n                    onClick={onDelete}\r\n                    disabled={iconWorks.anyWorks || !row.actions.delete}\r\n                    working={iconWorks.delete}\r\n                />\r\n            </TableCell>\r\n        </TableRow>\r\n    )\r\n}\r\n\r\nRepoFileTableRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    row: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired\r\n    }).isRequired,\r\n    index: PropTypes.number.isRequired,\r\n    isPublished: PropTypes.bool.isRequired,\r\n    onOpenDownloadHistory: PropTypes.func.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired,\r\n    onSetRepoVisibility: PropTypes.func.isRequired,\r\n    showShare: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default RepoFileTableRow;","import React, {useReducer, useState} from 'react'\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport DownloadHistoryPopup, {createDownloadHistoryFile} from \"components/popup/DownloadHistoryPopup\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport EditDescriptionPopup, {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from 'prop-types';\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport ChangeRepoVisibilityPopup from \"./ChangeRepoVisibilityPopup\";\r\nimport RepoService from \"services/RepoService\";\r\nimport RepoFileTableRow from \"./RepoFileTableRow\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconEjectButton from \"../../../button/WorkableIconEjectButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    lpColumn: theme.components.table.lpColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    typeColumn: {\r\n        width: 180\r\n    },\r\n    visibilityColumn: {\r\n        width: 120\r\n    },\r\n    sizeColumn: {\r\n        width: 80\r\n    }\r\n}));\r\n\r\nfunction RepoFileTable(\r\n    {\r\n        demandId,\r\n        isPublished,\r\n        folder,\r\n        disabled,\r\n        showShare,\r\n        onMoveToSiwz\r\n    }) {\r\n    const classes = useStyle();\r\n    const [downloadHistory, setDownloadHistory] = useState(null);\r\n    const [openConfirmDeleteAll, setOpenConfirmDeleteAll] = useState(false);\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(null);\r\n    const [repoVisibility, setRepoVisibility] = useState(null);\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        delete: false,\r\n    });\r\n\r\n    disabled = disabled || iconWorks.anyWorks;\r\n\r\n    const onDeleteAll = () => {\r\n        dispatchIconWorks({type: 'delete', works: true})\r\n        setOpenConfirmDeleteAll(false);\r\n        RepoService.deleteAll(demandId, folder.identity).finally(() => dispatchIconWorks({type: 'delete', works: false}))\r\n    };\r\n\r\n\r\n    const openDownloadHistory = (row) => {\r\n        setDownloadHistory(createDownloadHistoryFile(row.name, demandId, row.identity));\r\n    };\r\n\r\n    const openEditDescription = (row) => {\r\n        setEditDescriptionFile(createEditDescriptionFile(demandId, RepoService.buildIdentity(row.identity, folder.identity),\r\n            row.name, row.description, !row.actions.editDescription));\r\n    };\r\n\r\n    const onChangeVisibilityAll = () => {\r\n        const visibilityStatus = folder.files.length > 0 ? folder.files[0].visibilityStatus : null;\r\n        const visibilityEndDate = folder.files.length > 0 ? folder.files[0].visibilityEndDate : null;\r\n        setRepoVisibility({folderId: folder.identity, folderType: folder.type, name: folder.name, visibilityStatus, visibilityEndDate});\r\n    };\r\n\r\n    const onSetRepoVisibility = (row) => {\r\n        setRepoVisibility({\r\n            fileId: row.identity,\r\n            folderId: row.folderId,\r\n            folderType: folder.type,\r\n            name: row.name,\r\n            visibilityStatus: row.visibilityStatus,\r\n            visibilityEndDate: row.visibilityEndDate\r\n        })\r\n    }\r\n\r\n    const onSelectFileToMoveToSiwz = (files) => {\r\n        onMoveToSiwz(folder, files);\r\n    }\r\n\r\n    return (<>\r\n        {!!folder.files && <div>\r\n            {!folder.files.length ?\r\n                <BoldTypography align='center' variant=\"h6\">{Tr('no_files_in_directory')}</BoldTypography>\r\n                :\r\n                <>\r\n\r\n                    <Table>\r\n                        <TableHead>\r\n                            <TableRow>\r\n                                <TableCell className={classes.lpColumn}>{Tr(\"column_lp\")}</TableCell>\r\n                                <TableCell>{Tr(\"name\")}</TableCell>\r\n                                <TableCell className={classes.buttonColumn}>{Tr(\"description\")}</TableCell>\r\n                                <TableCell className={classes.visibilityColumn}>{Tr(\"repo_visibility_type\")}</TableCell>\r\n                                <TableCell className={classes.buttonColumn}>{Tr(\"size\")}</TableCell>\r\n                                <TableCell className={classes.dateColumn}>{Tr(\"add_data\")}</TableCell>\r\n                                {isPublished && <TableCell className={classes.dateColumn}>{Tr(\"publish_data\")}</TableCell>}\r\n                                <TableCell className={classes.buttonColumn}></TableCell>\r\n                                <TableCell className={classes.buttonColumn}>\r\n                                    <WorkableIconEjectButton\r\n                                        tooltip={Tr('move_all_to_siwz')}\r\n                                        onClick={() => onSelectFileToMoveToSiwz(folder.files.map((doc, index) => ({identity: doc.identity, name: doc.name})))}\r\n                                        hideTooltip={!folder.actions.moveToSiwz}\r\n                                        disabled={disabled || !folder.actions.moveToSiwz}\r\n                                    />\r\n                                </TableCell>\r\n                                {showShare && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                <TableCell className={classes.buttonColumn}>\r\n                                    <WorkableIconPublishButton\r\n                                        tooltip={Tr('change_visibility_for_all_files')}\r\n                                        onClick={onChangeVisibilityAll}\r\n                                        disabled={disabled || !folder.actions.updateFolderFilesVisibility}\r\n                                        hideTooltip={!folder.actions.updateFolderFilesVisibility}\r\n                                    />\r\n                                </TableCell>\r\n                                {isPublished && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                                <TableCell className={classes.buttonColumn}>\r\n                                    {!!folder.actions.deleteFolderFiles &&\r\n                                        <WorkableIconDeleteButton\r\n                                            onClick={() => setOpenConfirmDeleteAll(true)}\r\n                                            tooltip={Tr('delete_all_unpublished')}\r\n                                            working={iconWorks.delete}\r\n                                            disabled={disabled}\r\n                                        />}\r\n                                </TableCell>\r\n                            </TableRow>\r\n                        </TableHead>\r\n                        <TableBody>\r\n                            {\r\n                                folder.files.map((doc, index) => (\r\n                                    <RepoFileTableRow\r\n                                        key={doc.identity}\r\n                                        row={doc}\r\n                                        demandId={demandId}\r\n                                        index={index + 1}\r\n                                        isPublished={isPublished}\r\n                                        onEditDescriptionFile={openEditDescription}\r\n                                        onOpenDownloadHistory={openDownloadHistory}\r\n                                        onSetRepoVisibility={onSetRepoVisibility}\r\n                                        showShare={showShare}\r\n                                        onMoveToSiwz={onSelectFileToMoveToSiwz}\r\n                                    />))\r\n                            }\r\n                        </TableBody>\r\n                    </Table>\r\n\r\n                    {downloadHistory &&\r\n                        <DownloadHistoryPopup downloadHistoryFile={downloadHistory} onClose={() => setDownloadHistory(null)} service={RepoService}/>\r\n                    }\r\n\r\n                    {repoVisibility &&\r\n                        <ChangeRepoVisibilityPopup repoVisibility={repoVisibility} onClose={() => setRepoVisibility(null)} demandId={demandId}/>\r\n                    }\r\n\r\n                    {Boolean(editDescriptionFile) &&\r\n                        <EditDescriptionPopup\r\n                            editDescriptionFile={editDescriptionFile}\r\n                            onUpdated={() => setEditDescriptionFile(null)}\r\n                            onClose={() => setEditDescriptionFile(null)}\r\n                            service={RepoService}\r\n                        />\r\n                    }\r\n\r\n                    <Confirm\r\n                        open={openConfirmDeleteAll}\r\n                        onConfirm={onDeleteAll}\r\n                        onCancel={() => setOpenConfirmDeleteAll(false)}\r\n                        confirmText=\"confirm_delete_all\"\r\n                    />\r\n                </>\r\n            }\r\n        </div>\r\n        }\r\n    </>)\r\n}\r\n\r\nRepoFileTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    isPublished: PropTypes.bool.isRequired,\r\n    folder: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        type: PropTypes.string.isRequired,\r\n        name: PropTypes.string.isRequired,\r\n        description: PropTypes.string,\r\n        actions: PropTypes.object.isRequired,\r\n        files: PropTypes.array.isRequired\r\n    }).isRequired,\r\n    disabled: PropTypes.bool,\r\n    showShare: PropTypes.bool.isRequired\r\n};\r\n\r\nexport default RepoFileTable;","import React, {useMemo, useReducer, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport FolderIcon from \"@material-ui/icons/Folder\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Form from \"components/Form\";\r\nimport * as Yup from \"yup\";\r\nimport useId from 'hooks/useId';\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport InputLimits from \"constants/InputLimits\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport RepoService from \"services/RepoService\";\r\nimport RepoFileTable from \"./RepoFileTable\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconConfirmButton from \"components/button/WorkableIconConfirmButton\";\r\nimport WorkableIconSearchButton from \"../../../button/WorkableIconSearchButton\";\r\nimport EditDescriptionPopup, {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport {connect} from \"react-redux\";\r\nimport WorkableIconShareButton from \"../../../button/WorkableIconShareButton\";\r\nimport PrivilegeService from \"../../../../services/PrivilegeService\";\r\nimport {shareSystemsActive} from \"../../../../libs/shareSystems\";\r\nimport ShareSelectPopup, {sharePopupData} from \"../../../popup/ShareSelectPopup\";\r\nimport useSnackbar from \"../../../../hooks/useSnackbar\";\r\nimport RepoFolderTypes from \"../../../../constants/RepoFolderTypes\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    headTable: {\r\n        background: theme.palette.background.default,\r\n        marginTop: theme.spacing(5)\r\n    },\r\n    cell: {\r\n        padding: `${theme.spacing(1)}px ${theme.spacing(1)}px 0`,\r\n        border: 'none'\r\n    },\r\n    icon: {\r\n        marginRight: theme.spacing()\r\n    },\r\n    nameCell: {\r\n        fontWeight: 700\r\n    },\r\n    descriptionCell: {\r\n        fontStyle: 'italic',\r\n        whiteSpace: 'pre-line'\r\n    },\r\n    buttonColumn: {\r\n        ...theme.components.table.buttonColumn,\r\n        verticalAlign: 'top'\r\n    },\r\n    iconColumn: {\r\n        width: 25,\r\n        '& .MuiSvgIcon-root': {\r\n            fontSize: '2rem'\r\n        }\r\n    },\r\n\r\n}));\r\n\r\nconst RepoFolder = (\r\n    {\r\n        demandId,\r\n        folder,\r\n        isPublished,\r\n        disabled,\r\n        formSubmit,\r\n        demandHeader,\r\n        demandPrivileges,\r\n        onMoveToSiwz\r\n    }) => {\r\n\r\n    const classes = useStyles();\r\n\r\n    const [nameEdited, setNameEdited] = useState(false);\r\n    const [openConfirmDeleteFolder, setOpenConfirmDeleteFolder] = useState(false);\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(null);\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const showShare = useMemo(() => demandPrivileges.INTEGRATIONS_UPLOAD && shareSystemsActive(demandHeader).length > 0, [demandHeader, demandPrivileges])\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        name: false,\r\n        delete: false,\r\n        share: false,\r\n    });\r\n    const curDisabled = disabled || iconWorks.anyWorks;\r\n    const nameFormId = useId();\r\n\r\n    const handleSubmit = () => {\r\n        formSubmit[nameFormId]();\r\n    }\r\n\r\n    const onSubmit = (values) => {\r\n        dispatchIconWorks({type: 'name', works: true});\r\n        RepoService.updateFolderName(demandId, folder.identity, values.name).then(() => {\r\n            dispatchIconWorks({type: 'name', works: false});\r\n            setNameEdited(false);\r\n        });\r\n    };\r\n\r\n\r\n    const handleDeleteFolder = () => {\r\n        dispatchIconWorks({type: 'delete', works: true});\r\n        setOpenConfirmDeleteFolder(false);\r\n        RepoService.deleteFolder(demandId, folder.identity).catch(() => dispatchIconWorks({type: 'delete', works: false}));\r\n    };\r\n\r\n    const openEditDescription = () => {\r\n        setEditDescriptionFile(createEditDescriptionFile(demandId, folder.identity,\r\n            folder.name, folder.description, curDisabled, false, true));\r\n    };\r\n\r\n    const onShareFolder = () => {\r\n        setShareFilePopup(sharePopupData(folder.name, folder));\r\n    }\r\n\r\n    const doShareFolder = (row, system) => {\r\n        setShareFilePopup(null);\r\n        dispatchIconWorks({type: 'share', works: true});\r\n        RepoService.shareRepoFolder(demandId, row.identity, system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            dispatchIconWorks({type: 'share', works: false})\r\n        });\r\n    }\r\n\r\n    const getItems = () => {\r\n\r\n        const actions = folder.actions || {};\r\n\r\n\r\n        const rows = [];\r\n        rows.push([\r\n            <FolderIcon color=\"primary\" className={classes.icon}/>,\r\n            {\r\n                value: nameEdited ?\r\n                    <Form\r\n                        initialValues={{\r\n                            name: folder.name,\r\n                        }}\r\n                        validationSchema={Yup.object().shape({\r\n                            name: VS.stringMax(InputLimits.procedure.documents.NAME),\r\n                        })}\r\n                        onSubmit={onSubmit}\r\n                        id={nameFormId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <TextInput\r\n                                id='name'\r\n                                formikProps={formikProps}\r\n                                label={Tr('name')}\r\n                                limit={InputLimits.procedure.documents.NAME}\r\n                            />\r\n                        )}\r\n                    </Form>\r\n                    : folder.name,\r\n                className: classes.nameCell\r\n            },\r\n            showShare && folder.type !== RepoFolderTypes.Z_TRASH ? <WorkableIconShareButton\r\n                tooltip={`${Tr(\"send_folder\")} `}\r\n                onClick={onShareFolder}\r\n                disabled={curDisabled}\r\n                working={iconWorks.share}\r\n            /> : null,\r\n            <WorkableIconSearchButton\r\n                onClick={openEditDescription}\r\n                tooltip={folder.description ? <p className={classes.descriptionTooltip}>{folder.description}</p> : <i>{Tr('no_description')}</i>}\r\n            />,\r\n            nameEdited ?\r\n                <WorkableIconConfirmButton\r\n                    color='primary'\r\n                    onClick={() => handleSubmit(\"name\")}\r\n                    disabled={curDisabled}\r\n                    working={iconWorks.name}\r\n                /> :\r\n                <WorkableIconEditButton\r\n                    tooltip={Tr('edit_name')}\r\n                    onClick={() => setNameEdited(true)}\r\n                    disabled={!actions.updateFolderName || curDisabled}\r\n                    hideTooltip={!actions.updateFolderName}\r\n                />,\r\n            <WorkableIconDeleteButton\r\n                tooltip={actions.deleteFolder ? Tr('delete_folder') : Tr('delete_repo_folder_disabled')}\r\n                onClick={() => setOpenConfirmDeleteFolder(true)}\r\n                disabled={!actions.deleteFolder || curDisabled}\r\n                working={iconWorks.delete}\r\n            />\r\n        ]);\r\n        return rows;\r\n    };\r\n    return (\r\n        <>\r\n            <SimpleTable\r\n                items={getItems()}\r\n                columnClasses={[\r\n                    classes.iconColumn,\r\n                    undefined,\r\n                    classes.buttonColumn,\r\n                    classes.buttonColumn,\r\n                    classes.buttonColumn,\r\n                    classes.buttonColumn,\r\n                ]}\r\n                cellClassName={classes.cell}\r\n                className={classes.headTable}\r\n            />\r\n\r\n            <RepoFileTable\r\n                demandId={demandId}\r\n                isPublished={isPublished}\r\n                folder={folder}\r\n                disabled={curDisabled}\r\n                showShare={showShare}\r\n                onMoveToSiwz={onMoveToSiwz}\r\n            />\r\n\r\n            {Boolean(editDescriptionFile) &&\r\n                <EditDescriptionPopup\r\n                    editDescriptionFile={editDescriptionFile}\r\n                    onUpdated={() => setEditDescriptionFile(null)}\r\n                    onClose={() => setEditDescriptionFile(null)}\r\n                    service={{updateDescription: RepoService.updateFolderDescription}}\r\n                />\r\n            }\r\n            {!!shareFilePopup && <ShareSelectPopup\r\n                data={shareFilePopup}\r\n                onCancel={() => setShareFilePopup(null)}\r\n                onChoose={doShareFolder}\r\n            />}\r\n\r\n            <Confirm\r\n                open={openConfirmDeleteFolder}\r\n                onConfirm={() => handleDeleteFolder()}\r\n                onCancel={() => setOpenConfirmDeleteFolder(false)}\r\n                confirmText=\"confirm_delete_folder\"\r\n            />\r\n        </>\r\n\r\n    );\r\n};\r\nRepoFolder.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    isPublished: PropTypes.bool.isRequired,\r\n    disabled: PropTypes.bool,\r\n    folder: PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        type: PropTypes.string.isRequired,\r\n        name: PropTypes.string.isRequired,\r\n        description: PropTypes.string,\r\n        actions: PropTypes.object.isRequired,\r\n        files: PropTypes.array.isRequired\r\n    }).isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n    demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY],\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(RepoFolder);","import React, {useContext, useState} from 'react'\r\nimport UploadFile from 'components/UploadFile';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport {Typography} from '@material-ui/core';\r\nimport CreateNewFolderIcon from '@material-ui/icons/CreateNewFolder';\r\nimport CreateFolderPopup from 'components/complex/documentsTables/repo/CreateFolderPopup';\r\nimport Tr from 'translations/Translations';\r\nimport SelectFolderPopup from 'components/complex/documentsTables/repo/SelectFolderPopup';\r\nimport RepoFolder from \"./RepoFolder\";\r\nimport RepoService from \"services/RepoService\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport SelectSiwzDocumentType from \"../swz/SelectSiwzDocumentType\";\r\nimport SiwzService from \"../../../../services/SiwzService\";\r\nimport DemandValidationContext from \"../../../../context/DemandValidationContext\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    title: {\r\n        fontWeight: \"bold\"\r\n    },\r\n    margin: {\r\n        '&>*:first-child, &>*:nth-child(2)': {\r\n            marginLeft: theme.spacing(2),\r\n            marginBottom: theme.spacing()\r\n        },\r\n        '&>*:nth-child(3)': {\r\n            margin: `0 ${theme.spacing(4)}px`\r\n        }\r\n    },\r\n    buttonRow: {\r\n        marginBottom: theme.spacing(1),\r\n        marginTop: theme.spacing(1)\r\n    }\r\n}));\r\n\r\nfunction SelectRepoDocument(\r\n    {\r\n        demandId,\r\n        disabled,\r\n        isPublished,\r\n        folderList\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const currentDemandValidation = useContext(DemandValidationContext);\r\n    const [portFilesWorking, setPostFilesWorking] = useState(false);\r\n    const [selectedFiles, setSelectedFiles] = useState(null);\r\n    const [configuredFiles, setConfiguredFiles] = useState(null);\r\n    const [moveToSiwzFolderAndFile, setMoveToSiwzFolderAndFile] = useState(null);\r\n\r\n    const [openFolderPopup, setOpenFolderPopup] = useState(false);\r\n\r\n    const handleSendFiles = (uploadedFiles, config) => {\r\n        setConfiguredFiles(null);\r\n        if(uploadedFiles.length) {\r\n            setPostFilesWorking(true);\r\n            RepoService.addFiles(demandId, config, uploadedFiles).finally(() => setPostFilesWorking(false));\r\n        }\r\n    };\r\n\r\n    const handleSubmitSelectFolder = (values) => {\r\n        setConfiguredFiles({files: selectedFiles, config: values})\r\n        setSelectedFiles(null);\r\n    };\r\n\r\n    const getButtons = () => {\r\n        if (!disabled) {\r\n            const buttons = [];\r\n            buttons.push(createButton(Tr(\"create_folder\"), () => setOpenFolderPopup(true), undefined, undefined,\r\n                undefined, undefined, CreateNewFolderIcon));\r\n\r\n            if (buttons.length)\r\n                return <MultiButton className={classes.buttonRow} buttons={buttons} justify=\"flex-start\"/>\r\n        }\r\n    }\r\n\r\n    const onMoveToSiwz = (folder, files) => {\r\n        setMoveToSiwzFolderAndFile({folder: folder, files: files});\r\n    }\r\n\r\n    const doMoveToSiwz = (values, items) => {\r\n        const folder = moveToSiwzFolderAndFile.folder;\r\n        setMoveToSiwzFolderAndFile(null);\r\n        if (items.length) {\r\n            const tab = items.map((x, i) => ({\r\n                ...x,\r\n                type: values[`item${i}`],\r\n                parent: values[`parent${i}`],\r\n                autopublish: values[`autopublish${i}`],\r\n            }));\r\n            setPostFilesWorking(true)\r\n            SiwzService.moveFromRepo(demandId, tab, currentDemandValidation).finally(() => {\r\n                RepoService.refreshFolder(demandId, folder.identity).finally(() => setPostFilesWorking(false));\r\n            });\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <TitledComponent title={Tr('internal_doc')}>\r\n\r\n                {!disabled && <>\r\n\r\n                    {getButtons()}\r\n\r\n                    {!!folderList && folderList.length < 2 ?\r\n                        <Typography color=\"error\">{Tr('add_folder_before_file')}</Typography>\r\n                        : <UploadFile\r\n                            onOpenConfigureFiles={(files) => setSelectedFiles(files)}\r\n                            configuredFiles={configuredFiles}\r\n                            onUploadPopupClosed={handleSendFiles}\r\n                            working={portFilesWorking}\r\n                        />\r\n                    }\r\n                </>\r\n                }\r\n\r\n                {\r\n                    folderList.map(x => (\r\n                        <RepoFolder\r\n                            key={x.identity}\r\n                            demandId={demandId}\r\n                            folder={x}\r\n                            isPublished={isPublished}\r\n                            disabled={disabled}\r\n                            onMoveToSiwz={onMoveToSiwz}\r\n                        />\r\n                    ))\r\n                }\r\n\r\n            </TitledComponent>\r\n\r\n            <CreateFolderPopup\r\n                demandId={demandId}\r\n                open={openFolderPopup}\r\n                onClose={() => setOpenFolderPopup(false)}\r\n            />\r\n\r\n            {!!selectedFiles && <SelectFolderPopup\r\n                onCancel={() => setSelectedFiles(null)}\r\n                onSubmit={handleSubmitSelectFolder}\r\n                folderList={folderList}\r\n            />}\r\n\r\n            {!!moveToSiwzFolderAndFile && <SelectSiwzDocumentType\r\n                items={moveToSiwzFolderAndFile.files}\r\n                onCancel={() => setMoveToSiwzFolderAndFile(null)}\r\n                onSubmit={doMoveToSiwz}\r\n                pickAutopublish={isPublished}\r\n                pickParent={isPublished}\r\n            />}\r\n\r\n        </>\r\n    )\r\n}\r\n\r\nexport default SelectRepoDocument;","import React, {useMemo, useState} from 'react'\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\nimport Button from 'components/Button';\r\nimport {wasEverPublished} from \"libs/getDemandStatus\";\r\nimport RepoService from \"services/RepoService\";\r\nimport {connect} from \"react-redux\";\r\nimport SelectRepoDocument from \"./SelectRepoDocument\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    firstTable: {\r\n        marginTop: theme.spacing(5)\r\n    }\r\n}));\r\n\r\nfunction RepoDocuments(\r\n    {\r\n        demandId,\r\n        editable,\r\n        folderList,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const [showInternalDocuments, setShowInternalDocuments] = useState(()=> folderList.length > 1 || (folderList.length === 1 && folderList[0].files.length > 0));\r\n    const isPublished = useMemo(() => demandHeader ? wasEverPublished() : undefined, [demandHeader]);\r\n\r\n    return (\r\n        <GridBlock\r\n            column\r\n            className={classes.firstTable}\r\n        >\r\n            {showInternalDocuments ?\r\n                <SelectRepoDocument\r\n                    demandId={demandId}\r\n                    disabled={!editable}\r\n                    isPublished={isPublished}\r\n                    folderList={folderList}\r\n                />\r\n                :\r\n                <Button\r\n                    onClick={() => setShowInternalDocuments(true)}\r\n                    variant=\"outlined\"\r\n                    disabled={!editable}\r\n                >\r\n                    {Tr(\"add_inner_document\")}\r\n                </Button>\r\n            }\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    folderList: state.resources[RepoService.FOLDER_LIST_RESOURCE_ID],\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(RepoDocuments);","import React, {useEffect, useState} from 'react'\r\nimport {withRouter} from \"react-router\";\r\nimport SiwzDocuments from \"./swz/SiwzDocuments\";\r\nimport RepoDocuments from \"./repo/RepoDocuments\";\r\nimport RepoService from \"services/RepoService\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport Loading from \"components/Loading\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction DocumentsTables(\r\n    {\r\n        demandId,\r\n        siwzEditable,\r\n        repoEditable\r\n    }) {\r\n\r\n    const [documentsLoading, setDocumentsLoading] = useState(true);\r\n\r\n    useEffect(() => {\r\n        const siwzListPromise = SiwzService.getList(demandId);\r\n        const siwzTypesPromise = SiwzService.getTypes(demandId);\r\n        const repoFolderListPromise = RepoService.getList(demandId);\r\n        const repoVsibilityTypesPromise = RepoService.getVisibilityTypes(demandId);\r\n        Promise.all([siwzListPromise, siwzTypesPromise, repoFolderListPromise, repoVsibilityTypesPromise])\r\n            .then(() => setDocumentsLoading(false));\r\n\r\n        return () => {\r\n            RepoService.clearResources(RepoService.FOLDER_LIST_RESOURCE_ID);\r\n            RepoService.clearResources(RepoService.VISIBILITY_TYPES_RESOURCE_ID);\r\n            SiwzService.clearResources(SiwzService.SIWZ_LIST_RESOURCE_ID);\r\n            SiwzService.clearResources(SiwzService.SIWZ_TYPE_LIST_RESOURCE_ID);\r\n        }\r\n    }, [demandId]);\r\n\r\n    if (documentsLoading) return <Loading/>\r\n    return (<>\r\n        <SiwzDocuments editable={siwzEditable} demandId={demandId}/>\r\n        <RepoDocuments editable={repoEditable} demandId={demandId}/>\r\n    </>)\r\n}\r\n\r\nDocumentsTables.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    siwzEditable: PropTypes.bool.isRequired,\r\n    repoEditable: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default withRouter(DocumentsTables);","import React from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport DocumentsTables from \"components/complex/documentsTables/DocumentsTables\";\r\nimport {DemandValidationProvider} from \"context/DemandValidationContext\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    }\r\n}));\r\n\r\nfunction DocumentsPanel(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const demandId = match.params.id;\r\n\r\n    const currentDemandValidation = DemandValidation.DOCUMENTS;\r\n    const section = demandValidation.find(x => x.section === currentDemandValidation);\r\n    const siwzEditable = section ? !!section.siwzEditable : false;\r\n    const repoEditable = section ? !!section.repoEditable : false;\r\n\r\n    return (<div className={classes.root}>\r\n            <DemandValidationProvider value={currentDemandValidation}>\r\n                <DemandValidationMessages editable={siwzEditable || repoEditable} section={section}/>\r\n                <DocumentsTables\r\n                    demandId={demandId}\r\n                    siwzEditable={siwzEditable}\r\n                    repoEditable={repoEditable}\r\n                />\r\n            </DemandValidationProvider>\r\n        </div>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(DocumentsPanel));\r\n\r\n","import React from 'react'\r\nimport DocumentsPanel from \"./DocumentsPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n    return (expanded && <DocumentsPanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import Tr from 'translations/Translations';\r\n\r\nexport const ContractorVerificationProcedureType = {\r\n    CLASSIC: \"CLASSIC\",\r\n    REVERSE: \"REVERSE\"\r\n}\r\nconst _TR_PREFIX = 'contractor_verification_';\r\nexport const ContractorVerificationProcedureTypeLabel = (type) => (Tr(_TR_PREFIX + type.toLowerCase()));\r\n","import React, {useState} from \"react\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport ToggleButtonGroup from \"@material-ui/lab/ToggleButtonGroup\";\r\nimport ToggleButton from \"@material-ui/lab/ToggleButton\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport clsx from \"clsx\";\r\nimport PropTypes from \"prop-types\";\r\nimport {ContractorVerificationProcedureType, ContractorVerificationProcedureTypeLabel} from \"constants/ContractorVerificationProcedureType\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    button: {\r\n        width: 560,\r\n    },\r\n    help: {\r\n        position: 'absolute',\r\n        right: 70,\r\n        color: theme.palette.text.button\r\n    },\r\n    helpNotSelected: {\r\n        color: theme.palette.primary.main\r\n    }\r\n}));\r\n\r\nfunction VerificationProcedureType(\r\n    {\r\n        className,\r\n        contractorVerificationProcedure,\r\n        handleProcedureChange,\r\n        editable\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [confirmOpened, setConfirmOpened] = useState(false);\r\n\r\n    const handleProcedureChangeConfirm = () => {\r\n        setConfirmOpened(false);\r\n        handleProcedureChange(contractorVerificationProcedure.verificationProcedure === ContractorVerificationProcedureType.CLASSIC ?\r\n            ContractorVerificationProcedureType.REVERSE : ContractorVerificationProcedureType.CLASSIC);\r\n    };\r\n\r\n    const handleToggleClick = (event, newProcedure) => {\r\n        if (editable && newProcedure !== null) {\r\n            setConfirmOpened(true)\r\n        }\r\n    };\r\n    const proc = contractorVerificationProcedure.verificationProcedure;\r\n\r\n    return (<GridBlock column className={className}>\r\n            <GridBlock justify=\"center\">\r\n                <ToggleButtonGroup size=\"medium\" value={proc} exclusive onChange={handleToggleClick}>\r\n                    <ToggleButton classes={{root: classes.button}} value={ContractorVerificationProcedureType.CLASSIC} disabled={!editable}>\r\n                        {ContractorVerificationProcedureTypeLabel(ContractorVerificationProcedureType.CLASSIC)}\r\n                        <HelpTooltip className={clsx(classes.help, {[classes.helpNotSelected]: !(proc === ContractorVerificationProcedureType.CLASSIC)})}\r\n                                     text={Tr('contractor_verification_classic_desc')}/>\r\n                    </ToggleButton>\r\n                    <ToggleButton classes={{root: classes.button}} value={ContractorVerificationProcedureType.REVERSE} disabled={!editable}>\r\n                        {ContractorVerificationProcedureTypeLabel(ContractorVerificationProcedureType.REVERSE)}\r\n                        <HelpTooltip className={clsx(classes.help, {[classes.helpNotSelected]: !(proc === ContractorVerificationProcedureType.REVERSE)})}\r\n                                     text={Tr('contractor_verification_reverse_desc')}/>\r\n                    </ToggleButton>\r\n                </ToggleButtonGroup>\r\n            </GridBlock>\r\n\r\n            <Confirm\r\n                open={Boolean(confirmOpened)}\r\n                onConfirm={handleProcedureChangeConfirm}\r\n                onCancel={() => setConfirmOpened(false)}\r\n                confirmText=\"contractor_verification_procedure_change_confirm\"\r\n            />\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nVerificationProcedureType.propTypes = {\r\n    contractorVerificationProcedure: PropTypes.shape({\r\n        verificationProcedure: PropTypes.string\r\n    }),\r\n    handleProcedureChange: PropTypes.func,\r\n    editable: PropTypes.bool\r\n}\r\n\r\nexport default VerificationProcedureType;\r\n\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const ContractorVerificationOfferStatus = {\r\n    ALLOWED: \"ALLOWED\",\r\n    ALLOWED_PARTIALLY: \"ALLOWED_PARTIALLY\",\r\n    EXCLUDED: \"EXCLUDED\",\r\n    REVERSE_PROCEDURE: \"REVERSE_PROCEDURE\",\r\n    OFFER_REJECTED: \"OFFER_REJECTED\",\r\n    NOT_SCORED: \"NOT_SCORED\",\r\n    NOT_VERIFIED: \"NOT_VERIFIED\"\r\n}\r\nconst _TR_PREFIX = 'contractor_verification_offer_status_';\r\n\r\nexport const ContractorVerificationOfferStatusLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport applySearchParams from \"libs/applySearchParams\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\n\r\nconst CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID = 'contractorVerificationList';\r\nconst CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID = 'contractorVerificationProcedure';\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n}\r\n\r\nconst getContractors = async (roundId, pagination, search) => {\r\n    const params = {\r\n        ...pagination\r\n    };\r\n    applySearchParams(search, params);\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.CONTRACTOR_VERIFICATION_LIST(roundId), {params});\r\n        let res2;\r\n        if (pagination.page > 1) {\r\n            const state = reduxStore.getState();\r\n            if (state?.resources?.[CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID]?.items) {\r\n                res2 = {\r\n                    ...res,\r\n                    items: [...state.resources[CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID].items, ...res.items],\r\n                };\r\n            }\r\n        } else {\r\n            res2 = res;\r\n        }\r\n        reduxStore.dispatch(setResource(CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID, res2));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst updateContractorStatus = async (demandId, contractor, status) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.CONTRACTOR_VERIFICATION_STATUS(demandId), {contractor, status});\r\n        if (resp.success) {\r\n            const state = reduxStore.getState();\r\n            if (state?.resources?.[CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID]?.items) {\r\n                const curRes = state.resources[CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID];\r\n                const res = {\r\n                    ...curRes,\r\n                    items: curRes.items.map(x => x.contractor.identity === contractor.identity ? {...x, status} : x)\r\n                }\r\n                reduxStore.dispatch(setResource(CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID, res))\r\n            }\r\n            await validateSection(DemandValidation.CONTRACTOR_VERIFICATION, demandId, false);\r\n            await validateSection(DemandValidation.OFFERS_EVALUATION, demandId, false);\r\n            await validateSection(DemandValidation.OFFER_CHOICE, demandId, false);\r\n        }\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getProcedure = async (id) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.CONTRACTOR_VERIFICATION_PROCEDURE(id));\r\n        reduxStore.dispatch(setResource(CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst updateProcedure = async (demandId, verificationProcedure) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.CONTRACTOR_VERIFICATION_PROCEDURE(demandId), {verificationProcedure});\r\n        reduxStore.dispatch(setResource(CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID, resp));\r\n        await validateSection(DemandValidation.CONTRACTOR_VERIFICATION, demandId, false);\r\n        await validateSection(DemandValidation.OFFERS_EVALUATION, demandId, false);\r\n        await validateSection(DemandValidation.OFFER_CHOICE, demandId, false);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.CONTRACTOR_VERIFICATION_VALIDATE(id));\r\n}\r\n\r\nexport default {\r\n    getContractors,\r\n    updateContractorStatus,\r\n    getProcedure,\r\n    updateProcedure,\r\n    validate,\r\n    clearResources,\r\n    CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID,\r\n    CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID\r\n}","import React, {useMemo, useState} from \"react\";\r\nimport {makeStyles, TableCell, TableRow} from \"@material-ui/core\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {ContractorVerificationOfferStatus, ContractorVerificationOfferStatusLabel} from \"constants/ContractorVerificationOfferStatus\";\r\nimport PropTypes from \"prop-types\";\r\nimport ContractorVerificationService from \"services/ContractorVerificationService\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    statusCell: {\r\n        paddingTop: theme.spacing(),\r\n        paddingBottom: theme.spacing(),\r\n    }\r\n}));\r\n\r\nfunction ContractorVerificationRow(\r\n    {\r\n        index,\r\n        contractorVerificationProcedure,\r\n        contractorElem,\r\n        working,\r\n        editable,\r\n        demandId\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [rowWorking, setRowWorking] = useState(false);\r\n    const [confirmOpened, setConfirmOpened] = useState(false);\r\n    const [statusToConfirm, setStatusToConfirm] = useState(null)\r\n    const statusesList = useMemo(()=> Object.keys(ContractorVerificationOfferStatus).filter(x => !!contractorVerificationProcedure.changeable || x !== ContractorVerificationOfferStatus.REVERSE_PROCEDURE).map(key => ({label: ContractorVerificationOfferStatusLabel(key), value: key})), [contractorVerificationProcedure]);\r\n\r\n    const updateContractorStatus = (newStatus, confirmed) => {\r\n\r\n        if (!confirmed && newStatus === ContractorVerificationOfferStatus.OFFER_REJECTED) {\r\n            setConfirmOpened(true);\r\n            setStatusToConfirm(ContractorVerificationOfferStatus.OFFER_REJECTED);\r\n        } else if (!confirmed && newStatus === ContractorVerificationOfferStatus.NOT_SCORED) {\r\n            setConfirmOpened(true);\r\n            setStatusToConfirm(ContractorVerificationOfferStatus.NOT_SCORED);\r\n        } else {\r\n            setRowWorking(true);\r\n            ContractorVerificationService.updateContractorStatus(demandId, contractorElem.contractor, newStatus).finally(() => setRowWorking(false))\r\n        }\r\n    }\r\n\r\n    return (<TableRow>\r\n        <TableCell>{index + 1}.</TableCell>\r\n        <TableCell>{contractorElem.contractor.consorciumOffer ? Tr('consorcium_with_name', {name: contractorElem.contractor.name}) : contractorElem.contractor.name}</TableCell>\r\n        <TableCell className={classes.statusCell}>\r\n            <SimpleSelect\r\n                disabled={!editable || working || rowWorking}\r\n                items={statusesList}\r\n                value={contractorElem.status}\r\n                onChange={(e) => {\r\n                    updateContractorStatus(e.target.value)\r\n                }}\r\n                working={rowWorking}\r\n            />\r\n            {<Confirm confirmText={statusToConfirm === ContractorVerificationOfferStatus.OFFER_REJECTED\r\n                ? 'rfx.scoring.supplier.status.will.change.position.status.confirm'\r\n                : 'rfx.scoring.supplier.status.will.change.position.status.not_scored.confirm'}\r\n                      onCancel={() => setConfirmOpened(false)}\r\n                      onConfirm={() => {\r\n                          setConfirmOpened(false);\r\n                          updateContractorStatus(statusToConfirm, true)\r\n                      }}\r\n                      open={confirmOpened}\r\n                      translateConfirmTexts\r\n            />}\r\n        </TableCell>\r\n    </TableRow>)\r\n}\r\n\r\nContractorVerificationRow.propTypes = {\r\n    index: PropTypes.number,\r\n    contractor: PropTypes.shape({\r\n        contractor: PropTypes.shape({\r\n            identity: PropTypes.number,\r\n            name: PropTypes.string\r\n        }),\r\n        status: PropTypes.string\r\n    }),\r\n    working: PropTypes.bool,\r\n    editable: PropTypes.bool,\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n};\r\n\r\nexport default ContractorVerificationRow;\r\n\r\n","import React from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Tr from 'translations/Translations';\r\nimport ContractorVerificationRow from \"./ContractorVerificationRow\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        tableLayout: 'fixed',\r\n\r\n        '& td, th': {\r\n            overflow: 'hidden',\r\n        }\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    statusColumn: {\r\n        width: 300,\r\n        paddingRight: theme.spacing(2)\r\n    },\r\n}));\r\n\r\nfunction ContractorVerificationTable(\r\n    {\r\n        contractorList,\r\n        contractorVerificationProcedure,\r\n        working,\r\n        editable,\r\n        demandId\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    return (<TableContainer>\r\n        <Table className={clsx(classes.table)}>\r\n            <TableHead>\r\n                <TableRow>\r\n                    <TableCell className={classes.lpColumn}>{Tr(\"column_lp\")}</TableCell>\r\n                    <TableCell>{Tr(\"contractor\")}</TableCell>\r\n                    <TableCell className={classes.statusColumn}>{Tr(\"contractor_status\")}</TableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {contractorList.items.map((contractorElem, index) =>\r\n                    <ContractorVerificationRow\r\n                        key={contractorElem.contractor.identity}\r\n                        contractorElem={contractorElem}\r\n                        contractorVerificationProcedure={contractorVerificationProcedure}\r\n                        index={index}\r\n                        working={working}\r\n                        editable={editable && contractorElem.editable}\r\n                        demandId={demandId}\r\n                    />\r\n                )}\r\n            </TableBody>\r\n        </Table>\r\n    </TableContainer>)\r\n}\r\n\r\nexport default ContractorVerificationTable;\r\n\r\n","import React, {useEffect, useState} from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport VerificationProcedureType from \"./components/VerificationProcedureType\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport Loading from \"components/Loading\";\r\nimport MoreButton from \"components/button/MoreButton\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport ContractorVerificationTable from \"./components/ContractorVerificationTable\";\r\nimport ContractorVerificationService from \"services/ContractorVerificationService\";\r\nimport Tr from \"translations/Translations\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport Link from \"@material-ui/core/Link\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    marginBottomItalic: {\r\n        marginBottom: theme.spacing(2),\r\n        fontStyle: 'italic'\r\n    }\r\n}));\r\n\r\nfunction ContractorVerification(\r\n    {\r\n        match,\r\n        contractorVerificationList,\r\n        contractorVerificationProcedure,\r\n        demandValidation\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const FORM_ID = DemandValidation.CONTRACTOR_VERIFICATION;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === FORM_ID);\r\n    const editable = section ? section.editable : false;\r\n\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig, setSortConfig} = useSearch();\r\n    const [working, setWorking] = useState(true);\r\n\r\n    useEffect(() => {\r\n        ContractorVerificationService.getProcedure(demandId);\r\n        return () => {\r\n            ContractorVerificationService.clearResources(ContractorVerificationService.CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID);\r\n            ContractorVerificationService.clearResources(ContractorVerificationService.CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID);\r\n        }\r\n    }, [demandId])\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        const {pagination, search} = searchData;\r\n        ContractorVerificationService.getContractors(demandId, pagination, search).then(() => (setWorking(false)));\r\n        // eslint-disable-next-line\r\n    }, [searchData, demandId])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (contractorVerificationList?.totalCount !== undefined) {\r\n            setTotalCount(contractorVerificationList.totalCount)\r\n        }\r\n    }, [contractorVerificationList?.totalCount]);\r\n\r\n   const handleProcedureChange = (newProcedure) => {\r\n        ContractorVerificationService.clearResources(ContractorVerificationService.CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID);\r\n        ContractorVerificationService.updateProcedure(demandId, newProcedure).then(() => {\r\n            setSortConfig(null);\r\n        })\r\n    }\r\n\r\n    if (!contractorVerificationList || !contractorVerificationProcedure) return <Loading/>;\r\n\r\n    return (<div className={classes.root}>\r\n        <DemandValidationMessages editable={editable} section={section}/>\r\n        <Typography color=\"primary\" className={classes.marginBottomItalic}>\r\n            {Tr('contractor.sanction.check.info')}\r\n            <Link href={Tr('contractor.sanction.check.url')} label={'label'} target=\"_blank\">\r\n                LINK\r\n            </Link>\r\n        </Typography>\r\n        { !!contractorVerificationProcedure.changeable && <VerificationProcedureType\r\n                className={classes.marginBottom}\r\n                contractorVerificationProcedure={contractorVerificationProcedure}\r\n                handleProcedureChange={handleProcedureChange}\r\n                editable={editable && !contractorVerificationProcedure.readonly}\r\n            />\r\n        }\r\n\r\n        <BasicSearch\r\n            label={Tr('search_supplier')}\r\n            searchInProgress={working}\r\n            doSearch={setSearchConfig}\r\n        />\r\n\r\n        <ContractorVerificationTable\r\n            contractorList={contractorVerificationList}\r\n            contractorVerificationProcedure={contractorVerificationProcedure}\r\n            working={working}\r\n            editable={editable}\r\n            demandId={demandId}\r\n        />\r\n\r\n        <MoreButton\r\n            config={searchData.pagination}\r\n            setConfig={setPaginationConfig}\r\n            totalCount={totalCount}\r\n            loadedCount={contractorVerificationList.items.length}\r\n            captionTrKey='showing_x_of_y_rows'\r\n            disabled={working}\r\n        />\r\n    </div>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    contractorVerificationList: state.resources[ContractorVerificationService.CONTRACTOR_VERIFICATION_LIST_RESOURCE_ID],\r\n    contractorVerificationProcedure: state.resources[ContractorVerificationService.CONTRACTOR_VERIFICATION_PROCEDURE_RESOURCE_ID],\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(ContractorVerification));\r\n\r\n","import React from 'react'\r\nimport ContractorVerification from \"./ContractorVerification\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <ContractorVerification />)\r\n}\r\n\r\n\r\nexport default Index;","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport applySearchParams from \"libs/applySearchParams\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\n\r\nconst OFFER_EVALUATION_LIST_RESOURCE_ID = 'offerEvaluationList';\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n}\r\n\r\nconst getOffers = async (demandId, pagination, search, mode, roundType) => {\r\n    const params = {\r\n        ...pagination\r\n    };\r\n    applySearchParams(search, params);\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.OFFER_EVALUATION_LIST(demandId, mode, roundType), {params});\r\n        //const resp = {...lsit(pagination, search, mode)};\r\n        reduxStore.dispatch(setResource(OFFER_EVALUATION_LIST_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst handleUpdate = async (response, mode, offerItem, rowItem, status) => {\r\n    if (response.success) {\r\n        const result = response.result;\r\n        const changeType = result.changeType;\r\n        const {resources} = reduxStore.getState();\r\n\r\n        switch (changeType) {\r\n            case AVAILABLE_CHANGE_TYPES.STATUS:\r\n                const list = resources[OFFER_EVALUATION_LIST_RESOURCE_ID];\r\n                const newList = {\r\n                    ...list,\r\n                    items: list.items.map(offer => {\r\n                        if (offer.identity === offerItem.identity) {\r\n                            offer.offerEvaluations = offer.offerEvaluations.map(row => {\r\n                                if (row.identity === rowItem.identity) {\r\n                                    row.status = status;\r\n                                }\r\n                                return row;\r\n                            })\r\n                        }\r\n                        return offer;\r\n                    })\r\n                }\r\n                reduxStore.dispatch(setResource(OFFER_EVALUATION_LIST_RESOURCE_ID, newList));\r\n                break;\r\n            case AVAILABLE_CHANGE_TYPES.ROW:\r\n                const list2 = resources[OFFER_EVALUATION_LIST_RESOURCE_ID];\r\n                const newList2 = {\r\n                    ...list2,\r\n                    items: list2.items.map(offer => {\r\n\r\n                        if (offer.identity === offerItem.identity) {\r\n                            offer.offerEvaluations = offer.offerEvaluations.map(row => {\r\n                                if (row.identity === rowItem.identity) {\r\n                                    return result.offerEvaluation;\r\n                                }\r\n                                return row;\r\n                            })\r\n                        }\r\n                        return offer;\r\n                    })\r\n                }\r\n                reduxStore.dispatch(setResource(OFFER_EVALUATION_LIST_RESOURCE_ID, newList2));\r\n                break;\r\n            case AVAILABLE_CHANGE_TYPES.ALL:\r\n                break;\r\n            default:\r\n                throw new Error(\"Unsupported change type: \" + changeType);\r\n        }\r\n\r\n        return changeType;\r\n    }\r\n}\r\n\r\nconst updateStatus = async (demandId, mode, roundType, offerItem, row, status) => {\r\n    const data = {\r\n        identity: offerItem.identity,\r\n        mode,\r\n        offerEvaluation: {\r\n            identity: row.identity,\r\n            status\r\n        }\r\n    }\r\n    const resp = await RestRequestPOST(Endpoints.OFFER_EVALUATION_LIST_UPDATE_STATUS(demandId, mode, roundType), data);\r\n    await validateSection(DemandValidation.OFFERS_EVALUATION, demandId, false);\r\n    return handleUpdate(resp, mode, offerItem, row, status);\r\n};\r\n\r\nconst updateScore = async (demandId, mode, roundType, offerItem, row, criterion, score) => {\r\n    const data = {\r\n        identity: offerItem.identity,\r\n        mode,\r\n        offerEvaluation: {\r\n            identity: row.identity,\r\n            criteriaEvaluation: {\r\n                identity: criterion.identity,\r\n                score\r\n            }\r\n        }\r\n    }\r\n\r\n    const resp = await RestRequestPOST(Endpoints.OFFER_EVALUATION_LIST_UPDATE_SCORE(demandId, mode, roundType), data);\r\n    await validateSection(DemandValidation.OFFERS_EVALUATION, demandId, false);\r\n    return handleUpdate(resp, mode, offerItem, row);\r\n};\r\n\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.OFFER_EVALUATION_VALIDATE(id));\r\n}\r\n\r\nconst AVAILABLE_CHANGE_TYPES = {\r\n    STATUS: \"STATUS\",\r\n    ROW: \"ROW\",\r\n    ALL: \"ALL\"\r\n}\r\n\r\nexport default {\r\n    getOffers,\r\n    updateStatus,\r\n    updateScore,\r\n    validate,\r\n    clearResources,\r\n    OFFER_EVALUATION_LIST_RESOURCE_ID,\r\n    AVAILABLE_CHANGE_TYPES\r\n}","const OfferEvaluationViewMode = {\r\n    POSITION: \"POSITION\",\r\n    SUPPLIER: \"SUPPLIER\"\r\n}\r\n\r\nexport default OfferEvaluationViewMode;","import Tr from 'translations/Translations';\r\n\r\nexport const OfferEvaluationPositionStatus = {\r\n    ALLOWED: \"ALLOWED\",\r\n    EXCLUDED: \"EXCLUDED\",\r\n    EXTREMELY_LOW: \"EXTREMELY_LOW\",\r\n    NOT_SCORED: \"NOT_SCORED\",\r\n    OUT_OF_DATE: \"OUT_OF_DATE\",\r\n    EXCLUDED_FROM_CONTRACT: \"EXCLUDED_FROM_CONTRACT\"\r\n}\r\nconst _TR_PREFIX = 'offer_evaluation_position_status_';\r\n\r\nexport const OfferEvaluationPositionStatusLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import React, {useEffect, useState} from \"react\";\r\nimport {makeStyles, TextField, Tooltip, Typography} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PropTypes from \"prop-types\";\r\nimport DoneIcon from '@material-ui/icons/Done'\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    edit: {\r\n        width: 'auto'\r\n    },\r\n    error: {\r\n        fontSize: '0.8em'\r\n    }\r\n}));\r\n\r\nconst scoreRegex = /^((([0-9]{1,2}?)([,][0-9]{0,2})?)|100|)$/;\r\nconst emptyRegex = /^$/\r\nconst emptyEditMode = {enabled: false, value: \"\", error: false, working: false}\r\nfunction OffersEvaluationScoreColumn(\r\n    {\r\n        editable,\r\n        offerEvaluationRow,\r\n        offerEvaluationCriterion,\r\n        updateScore\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [editMode, setEditMode] = useState(emptyEditMode);\r\n\r\n    useEffect(() => {\r\n        if (editMode)\r\n            setEditMode(emptyEditMode);\r\n        // eslint-disable-next-line\r\n    }, [offerEvaluationRow])\r\n\r\n    const onScoreClick = () => {\r\n        const value = editMode.value;\r\n        if (emptyRegex.test(value)) {\r\n            setEditMode(emptyEditMode);\r\n        } else if (scoreRegex.test(value)) {\r\n            const number = parseFloat(value.replace(/[,]/, \".\"));\r\n            if(number <= offerEvaluationCriterion.weight) {\r\n                setEditMode(x => ({...x, working: true}))\r\n                updateScore(number, offerEvaluationCriterion).finally(()=> setEditMode(emptyEditMode));\r\n            }\r\n        }\r\n    }\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (!editMode.error && e.key === 'Enter') {\r\n            onScoreClick();\r\n        }\r\n    }\r\n\r\n    const handleChange = (e) => {\r\n        const value = e.target.value.replace(/[.]/, \",\");\r\n        if (emptyRegex.test(value) || scoreRegex.test(value)) {\r\n            const number = parseFloat(value.replace(/[,]/, \".\"));\r\n            const error = number > offerEvaluationCriterion.weight;\r\n            setEditMode(x => ({...x, value, error}))\r\n        }\r\n    }\r\n\r\n    return (<GridBlock column>\r\n        <GridBlock justify='space-between' alignItems=\"center\" wrap='nowrap'>\r\n            {editMode.enabled ?\r\n                <Tooltip title={Tr('criterium_points')}>\r\n                <TextField\r\n                    className={classes.edit}\r\n                    onChange={e => handleChange(e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    disabled={!editable}\r\n                    value={editMode.value}\r\n                    error={editMode.error}\r\n                /></Tooltip> :\r\n                <Typography variant=\"body2\">{formatAmountNumber(offerEvaluationCriterion.score, '-')}</Typography>\r\n            }\r\n            {offerEvaluationCriterion.editable && <>\r\n                {editMode.enabled ?\r\n                    <WorkableIconButton\r\n                        Icon={DoneIcon}\r\n                        onClick={onScoreClick}\r\n                        color='primary'\r\n                        disabled={editMode.error || !editable}\r\n                        working={editMode.working}\r\n                    /> :\r\n                    <WorkableIconEditButton\r\n                        onClick={() => {\r\n                            setEditMode({enabled: true, value: formatAmountNumber(offerEvaluationCriterion.score, '-'), error: (offerEvaluationCriterion.score > offerEvaluationCriterion.weight), working: false});\r\n                        }}\r\n                        color='primary'\r\n                        disabled={!editable}\r\n                    />}\r\n            </>\r\n            }\r\n\r\n        </GridBlock>\r\n        {editMode.error && <Typography className={classes.error} color='error' variant='body2'>{Tr(\"score_exceed_weight\", {value: formatAmountNumber(offerEvaluationCriterion.weight, '-')})}</Typography>}\r\n    </GridBlock>)\r\n}\r\n\r\nOffersEvaluationScoreColumn.propTypes = {\r\n    editable: PropTypes.bool.isRequired,\r\n    offerEvaluationRow: PropTypes.object.isRequired,\r\n    offerEvaluationCriterion: PropTypes.object.isRequired,\r\n    updateScore: PropTypes.func.isRequired\r\n}\r\n\r\nexport default OffersEvaluationScoreColumn;\r\n\r\n","import React, {useState} from \"react\";\r\nimport {makeStyles, TableCell, TableRow, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from \"clsx\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {OfferEvaluationPositionStatus, OfferEvaluationPositionStatusLabel} from \"../constants/OfferEvaluationPositionStatus\";\r\nimport PropTypes from \"prop-types\";\r\nimport ViewMode from \"../constants/OfferEvaluationViewMode\";\r\nimport OffersEvaluationScoreColumn from \"./OffersEvaluationScoreColumn\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    italic: {\r\n        fontStyle: 'italic',\r\n        userSelect: 'none'\r\n    },\r\n    evenRow: {\r\n        backgroundColor: theme.palette.background.default\r\n    },\r\n    lastRow: {\r\n        borderBottom: `solid 2px ${theme.palette.primary.main}`\r\n    },\r\n    scoreColumn: {\r\n        padding: '4px 4px 4px 8px !important'\r\n    },\r\n    statusSelect: {\r\n        width: 170,\r\n        \"& .MuiSelect-selectMenu\": {\r\n            whiteSpace: \"normal\"\r\n        }\r\n    }\r\n}));\r\n\r\nconst statusesList = Object.keys(OfferEvaluationPositionStatus).map(key => ({label: OfferEvaluationPositionStatusLabel(key), value: key}));\r\n\r\n\r\nfunction OffersEvaluationRow(\r\n    {\r\n        editable,\r\n        offerEvaluationRow,\r\n        mode,\r\n        rowNumber,\r\n        updateScore,\r\n        updateStatus\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const even = rowNumber % 2 === 1;\r\n    const [statusWorking, setStatusWorking] = useState(false);\r\n    const [scoreWorking, setScoreWorking] = useState(false);\r\n    const [confirmOpened, setConfirmOpened] = useState(false);\r\n\r\n    const onUpdateScore = async (score, criterion) => {\r\n        setScoreWorking(true);\r\n        try {\r\n            await updateScore(score, criterion, offerEvaluationRow);\r\n        } finally {\r\n            setScoreWorking(false);\r\n        }\r\n    }\r\n\r\n    const onUpdateStatus = (newStatus, confirmed) => {\r\n\r\n        if (!confirmed && newStatus === OfferEvaluationPositionStatus.ALLOWED && offerEvaluationRow.status === OfferEvaluationPositionStatus.EXTREMELY_LOW) {\r\n            setConfirmOpened(true);\r\n        } else {\r\n            setStatusWorking(true);\r\n            updateStatus(newStatus, offerEvaluationRow).finally(() => setStatusWorking(false));\r\n        }\r\n\r\n    }\r\n\r\n    return (offerEvaluationRow.criteriaEvaluation.map((element, index, array) => {\r\n        const first = index === 0;\r\n        const last = index === array.length - 1;\r\n\r\n        const rowSpan = offerEvaluationRow.criteriaEvaluation.length;\r\n        return (<TableRow key={element.identity} className={clsx({[classes.evenRow]: even, [classes.lastRow]: last})}>\r\n            {first && <TableCell className={classes.partColumn} rowSpan={rowSpan}>\r\n                <Typography className={classes.italic} variant=\"body2\">\r\n                    {Tr(`offer_evaluation_mode_title_${mode === ViewMode.SUPPLIER ? ViewMode.POSITION.toLowerCase() : ViewMode.SUPPLIER.toLowerCase()}`, {value: offerEvaluationRow.order})}\r\n                </Typography>\r\n                {mode === ViewMode.POSITION ?\r\n                    <Typography variant=\"body2\">\r\n                        {offerEvaluationRow.consorciumOffer ? Tr('consorcium_with_name', {name: offerEvaluationRow.name}) : offerEvaluationRow.name}\r\n                    </Typography>\r\n                    : <>\r\n                        <Typography variant=\"body2\">\r\n                            {offerEvaluationRow.name}\r\n                        </Typography>\r\n                        {offerEvaluationRow.consorciumOffer && <Typography className={classes.italic} variant=\"body2\">\r\n                            ({Tr('consorcium_offer')})\r\n                        </Typography>}\r\n                    </>\r\n\r\n                }\r\n            </TableCell>}\r\n            <TableCell>{element.name}</TableCell>\r\n            <TableCell>{formatAmountNumber(element.weight, '-')}</TableCell>\r\n            <TableCell>{element.value}</TableCell>\r\n            <TableCell className={classes.scoreColumn}>\r\n                <OffersEvaluationScoreColumn\r\n                    offerEvaluationRow={offerEvaluationRow}\r\n                    offerEvaluationCriterion={element}\r\n                    editable={!statusWorking && editable}\r\n                    updateScore={onUpdateScore}\r\n                />\r\n            </TableCell>\r\n\r\n            {first && <TableCell className={classes.scoreTotalColumn} rowSpan={rowSpan}>{formatAmountNumber(offerEvaluationRow.score)}</TableCell>}\r\n            {first && <TableCell className={classes.statusColumn} rowSpan={rowSpan}>\r\n                <SimpleSelect\r\n                    className={classes.statusSelect}\r\n                    disabled={!editable || scoreWorking}\r\n                    items={statusesList}\r\n                    value={offerEvaluationRow.status}\r\n                    onChange={event => onUpdateStatus(event.target.value)}\r\n                    working={statusWorking}\r\n                />\r\n                {<Confirm confirmText='rfx.scoring.offer.extremely.to.allowed.confirm'\r\n                          onCancel={() => setConfirmOpened(false)}\r\n                          onConfirm={() => {\r\n                              setConfirmOpened(false);\r\n                              onUpdateStatus(OfferEvaluationPositionStatus.ALLOWED, true)\r\n                          }}\r\n                          open={confirmOpened}\r\n                />}\r\n            </TableCell>}\r\n        </TableRow>)\r\n    }))\r\n}\r\n\r\nOffersEvaluationRow.propTypes = {\r\n    editable: PropTypes.bool.isRequired,\r\n    offerEvaluationRow: PropTypes.object.isRequired,\r\n    mode: PropTypes.oneOf([ViewMode.POSITION, ViewMode.SUPPLIER]).isRequired,\r\n    rowNumber: PropTypes.number.isRequired,\r\n    updateScore: PropTypes.func.isRequired,\r\n    updateStatus: PropTypes.func.isRequired\r\n}\r\n\r\nexport default OffersEvaluationRow;\r\n\r\n","import React from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport ViewMode from \"../constants/OfferEvaluationViewMode\";\r\nimport OffersEvaluationRow from \"./OffersEvaluationRow\";\r\nimport PropTypes from \"prop-types\";\r\nimport BoldTypography from \"../../../../../../../../components/BoldTypography\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        border: `solid 3px ${theme.palette.background.paper}`,\r\n        \"& .MuiTableCell-root\": {\r\n            border: `solid 1px ${theme.palette.border.dark}`,\r\n            padding: theme.spacing()\r\n        }\r\n    },\r\n    headRow: {\r\n        \"&>.MuiTableCell-head\": {\r\n            textAlign: \"center\",\r\n            borderBottom: `solid 2px ${theme.palette.primary.main}`\r\n        }\r\n    },\r\n    critColumn: {},\r\n    weightColumn: {\r\n        width: 40\r\n    },\r\n    valueColumn: {\r\n        width: '15%'\r\n    },\r\n    scoreColumn: {\r\n        width: 100\r\n    },\r\n    scoreTotalColumn: {\r\n        width: 50\r\n    },\r\n    statusColumn: {\r\n        width: 170\r\n    },\r\n\r\n}));\r\n\r\nfunction OffersEvaluationTable(\r\n    {\r\n        editable,\r\n        offerEvaluationItem,\r\n        updateScore,\r\n        updateStatus\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const mode = offerEvaluationItem?.mode;\r\n\r\n    const onUpdateScore = async (score, criterion, row) => {\r\n        await updateScore(score, criterion, row, offerEvaluationItem, mode);\r\n    }\r\n\r\n    const onUpdateStatus = async (status, row) => {\r\n        await updateStatus(status, row, offerEvaluationItem, mode);\r\n    }\r\n\r\n    return (<Table className={classes.table}>\r\n        <TableHead>\r\n            <TableRow className={classes.headRow}>\r\n                <TableCell className={classes.partColumn}>{Tr(mode === ViewMode.SUPPLIER ? \"part\" : \"offer\")}</TableCell>\r\n                <TableCell className={classes.critColumn}>{Tr(\"criteria\")}</TableCell>\r\n                <TableCell className={classes.weightColumn}>{Tr(\"weight\")}</TableCell>\r\n                <TableCell className={classes.valueColumn}>{Tr(\"value\")}</TableCell>\r\n                <TableCell className={classes.scoreColumn}>{Tr(\"score\")}</TableCell>\r\n                <TableCell className={classes.scoreTotalColumn}>{Tr(\"score_total\")}</TableCell>\r\n                <TableCell className={classes.statusColumn}>{Tr(\"status\")}</TableCell>\r\n            </TableRow>\r\n        </TableHead>\r\n        <TableBody>\r\n            {\r\n                offerEvaluationItem.offerEvaluations.length ?\r\n                    offerEvaluationItem.offerEvaluations.map((x, index) =>\r\n                        <OffersEvaluationRow\r\n                            key={x.identity}\r\n                            offerEvaluationRow={x}\r\n                            editable={!!editable && !!x.editable}\r\n                            mode={mode}\r\n                            rowNumber={index + 1}\r\n                            updateScore={onUpdateScore}\r\n                            updateStatus={onUpdateStatus}\r\n                        />)\r\n                    :\r\n                    <TableRow>\r\n                        <TableCell colSpan={7}>\r\n                            <BoldTypography align='center'>{Tr('no_options')}</BoldTypography>\r\n                        </TableCell>\r\n                    </TableRow>\r\n            }\r\n        </TableBody>\r\n    </Table>)\r\n}\r\n\r\nOffersEvaluationTable.propTypes = {\r\n    editable: PropTypes.bool.isRequired,\r\n    offerEvaluationItem: PropTypes.object.isRequired,\r\n    updateScore: PropTypes.func.isRequired,\r\n    updateStatus: PropTypes.func.isRequired\r\n}\r\n\r\nexport default OffersEvaluationTable;\r\n\r\n","import React, {useEffect, useState} from 'react'\r\nimport Pagination from '@material-ui/lab/Pagination';\r\nimport PropTypes from 'prop-types';\r\nimport {getPaginationConfig} from \"hooks/useSearch\";\r\nimport GridBlock from \"./GridBlock\";\r\nimport {makeStyles, TextField} from \"@material-ui/core\";\r\nimport Typography from \"./Typography\";\r\nimport IconButton from \"./button/IconButton\";\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowRight'\r\nimport Tr from 'translations/Translations'\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        marginTop: theme.spacing()\r\n    },\r\n    pageInputInput: {\r\n        \"&>input\": {\r\n            textAlign: 'center'\r\n        }\r\n    },\r\n    pageInput: {\r\n        width: theme.components.input.criteria.width,\r\n        marginLeft: theme.spacing()\r\n    },\r\n    emptyWidth: {\r\n        width: 200\r\n    },\r\n    goToPage: {\r\n        userSelect: 'none'\r\n    }\r\n}));\r\n\r\nfunction DottedPagination(\r\n    {\r\n        config = getPaginationConfig(1, 10),\r\n        setConfig = () => {\r\n        },\r\n        totalCount = 0,\r\n        disabled,\r\n        showManualInputField = true\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [pageValue, setPageValue] = useState(\"\");\r\n    const handleChangePage = (event, newPage) => {\r\n        setConfig({...config, page: newPage});\r\n    }\r\n\r\n    useEffect(() => {\r\n        setPageValue((\"\"))\r\n    }, [config])\r\n\r\n    const changePage = (e) => {\r\n        let value = e.target.value;\r\n        if (/^\\d+$/.test(value)) {\r\n            const intVal = parseInt(value);\r\n            if (intVal >= 1 && intVal <= totalCount) {\r\n                setPageValue(value);\r\n            }\r\n        } else if (value === \"\") {\r\n            setPageValue(value);\r\n        }\r\n    }\r\n\r\n    const handleKeyUp = (e) => {\r\n        if (e.key === 'Enter') {\r\n            handleConfirmPageValue();\r\n        }\r\n    }\r\n\r\n    const handleConfirmPageValue = () => {\r\n        if (pageValue !== \"\") {\r\n            setConfig({...config, page: parseInt(pageValue)});\r\n        }\r\n    }\r\n\r\n    return (\r\n        <GridBlock className={classes.root} justify='space-between'>\r\n            {showManualInputField && <div className={classes.emptyWidth}></div>}\r\n            <Pagination\r\n                count={Math.ceil(totalCount/ config.pageSize)}\r\n                page={config.page}\r\n                onChange={handleChangePage}\r\n                showFirstButton\r\n                showLastButton\r\n                size=\"large\"\r\n                color=\"primary\"\r\n                siblingCount={showManualInputField ? 1 : 2}\r\n                boundaryCount={showManualInputField ? 2 : 3}\r\n                disabled={disabled}\r\n            />\r\n            {showManualInputField && <GridBlock alignItems='center'>\r\n                <Typography className={classes.goToPage}>{Tr('go_to_page')}:</Typography>\r\n                <TextField\r\n                    className={classes.pageInput}\r\n                    id='list-search'\r\n                    onChange={changePage}\r\n                    onKeyUp={handleKeyUp}\r\n                    value={pageValue}\r\n                    disabled={disabled || totalCount <= 1}\r\n                    InputProps={{\r\n                        className: classes.pageInputInput\r\n                    }}\r\n                />\r\n                <IconButton\r\n                    Icon={ArrowIcon}\r\n                    disabled={pageValue === \"\"}\r\n                    onClick={handleConfirmPageValue}\r\n                />\r\n            </GridBlock>}\r\n        </GridBlock>\r\n\r\n    )\r\n}\r\n\r\nDottedPagination.propTypes = {\r\n    config: PropTypes.shape({\r\n        page: PropTypes.number,\r\n        pageSize: PropTypes.number\r\n    }),\r\n    setConfig: PropTypes.func,\r\n    totalCount: PropTypes.number,\r\n    disabled: PropTypes.bool,\r\n    showCustomInput: PropTypes.bool\r\n}\r\n\r\nexport default DottedPagination;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport ArrowIconRight from '@material-ui/icons/KeyboardArrowRight'\r\nimport Tr from 'translations/Translations'\r\nimport Button from \"./Button\";\r\nimport ArrowIconLeft from '@material-ui/icons/KeyboardArrowLeft'\r\n\r\nexport const Types = {\r\n    PREV: \"prev\",\r\n    NEXT: \"next\"\r\n}\r\n\r\nfunction PaginationButton(\r\n    {\r\n        type = Types.NEXT,\r\n        config,\r\n        setConfig = () => {\r\n        },\r\n        totalCount = 0,\r\n        disabled\r\n    }) {\r\n\r\n\r\n    const changePage = () => {\r\n        if (type === Types.NEXT) {\r\n            const newPage = config.page + 1;\r\n            if(totalCount >= newPage)\r\n                setConfig({...config, page: newPage});\r\n        }\r\n        if (type ===Types.PREV) {\r\n            const newPage = config.page - 1;\r\n            if(newPage >= 1 && totalCount >= newPage )\r\n                setConfig({...config, page: newPage});\r\n        }\r\n    }\r\n\r\n    const variantDisabled = disabled || (type === Types.NEXT && config.page >= totalCount) || (type === Types.PREV && config.page <= 1)\r\n\r\n\r\n    return (\r\n        <Button\r\n            color='primary'\r\n            variant='text'\r\n            onClick={changePage}\r\n            disabled={variantDisabled}\r\n        >\r\n            {type === \"prev\" && <ArrowIconLeft/>}\r\n            {type === \"prev\" ? Tr(\"previous\") : Tr(\"next\")}\r\n            {type === \"next\" && <ArrowIconRight/>}\r\n        </Button>\r\n\r\n    )\r\n}\r\n\r\nPaginationButton.propTypes = {\r\n    config: PropTypes.shape({\r\n        page: PropTypes.number,\r\n        pageSize: PropTypes.number\r\n    }),\r\n    setConfig: PropTypes.func,\r\n    totalCount: PropTypes.number,\r\n    disabled: PropTypes.bool,\r\n    type: PropTypes.oneOf([Types.PREV, Types.NEXT])\r\n}\r\n\r\nexport default PaginationButton;\r\n","import Tr from \"translations/Translations\";\r\n\r\nexport const OfferEvaluationRoundType = {\r\n    BASE: \"base\",\r\n    ADDITIONAL_OFFERS: \"additional_offers\",\r\n    AUCTION: \"auction\"\r\n}\r\nconst _TR_PREFIX = 'offer_evaluation_round_type_';\r\n\r\nexport const OfferEvaluationRoundTypeLabel = (type) => (Tr(_TR_PREFIX + type));\r\n","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {OfferEvaluationRoundType, OfferEvaluationRoundTypeLabel} from \"../constants/OfferEvaluationRoundType\";\r\nimport ViewMode from \"../constants/OfferEvaluationViewMode\";\r\nimport {useDidUpdateEffect} from \"../../../../../../../../hooks/useDidUpdateEffect\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    roundType: {\r\n        width: 285,\r\n    },\r\n    search: {\r\n        width: 250,\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {roundType: OfferEvaluationRoundType.BASE, search: ''}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nconst decisionsList =\r\n    [OfferEvaluationRoundType.BASE, OfferEvaluationRoundType.ADDITIONAL_OFFERS, OfferEvaluationRoundType.AUCTION].map(key => ({\r\n        label: OfferEvaluationRoundTypeLabel(key),\r\n        value: key\r\n    }))\r\n\r\nfunction OfferEvaluationSearch(\r\n    {\r\n        searchInProgress,\r\n        doSearch,\r\n        viewMode\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState({...EMPTY_SEARCH_OBJECT});\r\n    const [submitState, setSubmitState] = useState({counter: 0, paginationClear:true});\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => value[k])\r\n                .reduce((a, k) => ({...a, [k]: value[k]}), {});\r\n            doSearch(valueFiltered, submitState.paginationClear);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    useDidUpdateEffect(()=> {\r\n        doClearSearch();\r\n    }, [viewMode]);\r\n\r\n\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleSubmit = (paginationClear=true) => {\r\n        setSubmitState(x => ({counter: x.counter + 1,  paginationClear}))\r\n    };\r\n\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (e.key === 'Enter') {\r\n            e.preventDefault();\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    const doClearSearch = () => {\r\n        setValue({...value, search: \"\"});\r\n        handleSubmit();\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <BoldTypography>{Tr('search_box')}</BoldTypography>\r\n            <GridBlock\r\n                alignItems='flex-end'\r\n                className={classes.root}\r\n            >\r\n                <SimpleSelect\r\n                    className={classes.roundType}\r\n                    label={Tr('offer_evaluation_round_type')}\r\n                    items={decisionsList}\r\n                    value={value.roundType}\r\n                    onChange={(e) => {\r\n                        handleChange(\"roundType\", e);\r\n                        handleSubmit(false);\r\n                    }}\r\n                />\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr(viewMode === ViewMode.POSITION ? \"search_part\" : \"search_supplier\")}\r\n                    onChange={e => handleChange('search', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.search}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={doClearSearch}/>\r\n                </div>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nOfferEvaluationSearch.propTypes = {\r\n    doSearch: PropTypes.func.isRequired,\r\n    searchInProgress: PropTypes.bool,\r\n    viewMode: PropTypes.oneOf([ViewMode.POSITION, ViewMode.SUPPLIER]).isRequired\r\n}\r\n\r\n\r\nexport default OfferEvaluationSearch;","import React, {useEffect, useState} from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport useSearch, {getPaginationConfig} from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport Loading from \"components/Loading\";\r\nimport OfferEvaluationService from \"services/OfferEvaluationService\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport ViewMode from \"./constants/OfferEvaluationViewMode\";\r\nimport OffersEvaluationTable from \"./components/OffersEvaluationTable\";\r\nimport DottedPagination from \"components/DottedPagination\";\r\nimport Tr from \"translations/Translations\";\r\nimport PaginationButton, {Types as PaginationButtonTypes} from \"components/PaginationButton\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport OfferEvaluationSearch from \"./components/OfferEvaluationSearch\";\r\nimport {OfferEvaluationRoundType} from \"./constants/OfferEvaluationRoundType\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic',\r\n        userSelect: 'none'\r\n    },\r\n    center: {\r\n        textAlign: 'center',\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    name: {\r\n        marginTop: theme.spacing(2),\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\n\r\nfunction OffersEvaluation(\r\n    {\r\n        match,\r\n        offerEvaluationList,\r\n        demandValidation\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const curDemandValidation = DemandValidation.OFFERS_EVALUATION;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} =\r\n        useSearch({pagination: getPaginationConfig(1, 1), search: {roundType: OfferEvaluationRoundType.BASE}});\r\n    const [offerLoading, setOfferLoading] = useState(true);\r\n    const [mode, setMode] = useState(ViewMode.POSITION);\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            OfferEvaluationService.clearResources(OfferEvaluationService.OFFER_EVALUATION_LIST_RESOURCE_ID);\r\n        }\r\n    }, [demandId])\r\n\r\n    useEffect(() => {\r\n        setOfferLoading(true);\r\n        const pagination = searchData.pagination;\r\n        const search = {...searchData.search};\r\n        const roundType = search.roundType;\r\n        delete search.roundType;\r\n        OfferEvaluationService.getOffers(demandId, pagination, search, mode, roundType).then(() => (setOfferLoading(false)));\r\n        // eslint-disable-next-line\r\n    }, [searchData, demandId])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (offerEvaluationList?.totalCount !== undefined) {\r\n            setTotalCount(offerEvaluationList.totalCount)\r\n        }\r\n    }, [offerEvaluationList?.totalCount]);\r\n\r\n    const updateStatus = async (status, row, offerItem, mode) => {\r\n        try {\r\n            const changeType = await OfferEvaluationService.updateStatus(demandId, mode, searchData.search.roundType, offerItem, row, status);\r\n            if (changeType === OfferEvaluationService.AVAILABLE_CHANGE_TYPES.ALL) {\r\n                setPaginationConfig({...searchData.pagination});\r\n            }\r\n        } catch (e) {\r\n            console.error(e);\r\n        }\r\n    }\r\n    const updateScore = async (score, criterion, row, offerItem, mode) => {\r\n        try {\r\n            const changeType = await OfferEvaluationService.updateScore(demandId, mode, searchData.search.roundType, offerItem, row, criterion, score)\r\n            if (changeType === OfferEvaluationService.AVAILABLE_CHANGE_TYPES.ALL) {\r\n                setPaginationConfig({...searchData.pagination});\r\n            }\r\n        } catch (e) {\r\n            console.error(e);\r\n        }\r\n    }\r\n\r\n    const doSearch = (searchOb, paginationClear) => {\r\n        setSearchConfig(searchOb, !paginationClear);\r\n    };\r\n\r\n    if (!offerEvaluationList) return <Loading/>;\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <DemandValidationMessages editable={editable} section={section}/>\r\n            <GridBlock justify='space-between'>\r\n                <OfferEvaluationSearch\r\n                    doSearch={doSearch}\r\n                    viewMode={mode}\r\n                    searchInProgress={offerLoading}\r\n                />\r\n                <Button\r\n                    disabled={offerLoading}\r\n                    onClick={() => {\r\n                        setMode(x => x === ViewMode.SUPPLIER ? ViewMode.POSITION : ViewMode.SUPPLIER);\r\n                    }}\r\n                >\r\n                    {mode === ViewMode.POSITION ? Tr(\"switch_view_per_supplier\") : Tr(\"switch_view_per_part\")}\r\n                </Button>\r\n            </GridBlock>\r\n            {!offerEvaluationList.items[0] ?\r\n                <BoldTypography align='center' className={classes.name} variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                :\r\n                <>\r\n                    <GridBlock justify='space-between' className={classes.name}>\r\n                        <PaginationButton type={PaginationButtonTypes.PREV} config={searchData.pagination} setConfig={setPaginationConfig}\r\n                                          totalCount={totalCount}\r\n                                          disabled={offerLoading}/>\r\n                        <Typography className={classes.center} variant=\"h6\">\r\n                        <span\r\n                            className={classes.italic}>{Tr(`offer_evaluation_mode_title_${mode.toLowerCase()}`, {value: offerEvaluationList.items[0].order})} - </span>\r\n                            <span>{offerEvaluationList.items[0].name}</span>\r\n                        </Typography>\r\n                        <PaginationButton type={PaginationButtonTypes.NEXT} config={searchData.pagination} setConfig={setPaginationConfig}\r\n                                          totalCount={totalCount}\r\n                                          disabled={offerLoading}/>\r\n                    </GridBlock>\r\n\r\n                    <OffersEvaluationTable\r\n                        offerEvaluationItem={offerEvaluationList.items[0]}\r\n                        demandId={demandId}\r\n                        editable={editable && !offerLoading}\r\n                        updateScore={updateScore}\r\n                        updateStatus={updateStatus}\r\n                    />\r\n                    <DottedPagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={offerLoading}/>\r\n                </>}\r\n        </div>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    offerEvaluationList: state.resources[OfferEvaluationService.OFFER_EVALUATION_LIST_RESOURCE_ID],\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(OffersEvaluation));\r\n\r\n","import React from 'react'\r\nimport OffersEvaluation from \"./OffersEvaluation\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <OffersEvaluation />)\r\n}\r\n\r\n\r\nexport default Index;","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource, setSaveStatusError} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport applySearchParams from \"libs/applySearchParams\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport DemandSectionsService from \"./DemandSectionsService\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst OFFER_CHOICE_LIST_RESOURCE_ID = 'offerChoiceList';\r\nconst OFFER_CHOICE_JUSTIFICATIONS = 'choiceJustificationBasis';\r\n\r\nconst getChoiceList = async (demandId, pagination, search) => {\r\n    const params = {\r\n        ...pagination\r\n    };\r\n    applySearchParams(search, params);\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.OFFER_CHOICE(demandId), {params});\r\n        reduxStore.dispatch(setResource(OFFER_CHOICE_LIST_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\nconst getPositionAuctions = async (demandId, positionId) => {\r\n    return await RestRequestGET(Endpoints.OFFER_CHOICE_PREPARE_AUCTION_INFO(demandId, positionId));\r\n};\r\n\r\nconst updatePosition = async (demandId, positionId, sectionsToRefresh) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.OFFER_CHOICE_GET_POSITION(demandId, positionId));\r\n        if (isResponseValid(resp)) {\r\n            _doUpdatePosition(resp);\r\n            await callSectionsValidation(demandId, sectionsToRefresh)\r\n        }\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nlet updateInProgress = false;\r\nconst callSectionsValidation = async (demandId, sectionsToRefresh) => {\r\n    if (!updateInProgress && Array.isArray(sectionsToRefresh)) {\r\n        updateInProgress = true;\r\n        try {\r\n            for (const demandValidation of sectionsToRefresh)\r\n                await validateSection(demandValidation, demandId, false);\r\n\r\n        } finally {\r\n            updateInProgress = false;\r\n        }\r\n    }\r\n}\r\n\r\nconst addAuctionToAdditionalRoundInfo = (positionId, auction) => {\r\n    _doUpdateAuction(positionId, auction, \"ADD\")\r\n}\r\nconst removeAuctionFromAdditionalRoundInfo = (positionId, auction) => {\r\n    _doUpdateAuction(positionId, auction, \"DELETE\")\r\n}\r\nconst updateAuctionInAdditionalRoundInfo = (positionId, auction) => {\r\n    _doUpdateAuction(positionId, auction, \"UPDATE\")\r\n}\r\n\r\n\r\nconst _doUpdatePosition = (newPos) => {\r\n    const {resources} = reduxStore.getState();\r\n\r\n    const curList = resources[OFFER_CHOICE_LIST_RESOURCE_ID];\r\n    if (curList) {\r\n        const newList = {\r\n            ...curList,\r\n            items: curList.items.map(pos => pos.identity !== newPos.identity ? pos : newPos)\r\n        }\r\n        reduxStore.dispatch(setResource(OFFER_CHOICE_LIST_RESOURCE_ID, newList));\r\n    }\r\n}\r\n\r\nconst _doUpdateAuction = (positionId, auction, mode) => {\r\n    const {resources} = reduxStore.getState();\r\n\r\n    const curList = resources[OFFER_CHOICE_LIST_RESOURCE_ID];\r\n    if (curList) {\r\n        const newList = {\r\n            ...curList,\r\n            items: curList.items.map(pos =>\r\n                pos.identity !== positionId ? pos : {\r\n                    ...pos,\r\n                    currentAdditionalRoundInfo: {\r\n                        ...pos.currentAdditionalRoundInfo,\r\n                        auctions: mode === \"ADD\" ? [...pos.currentAdditionalRoundInfo.auctions, auction] :\r\n                            (mode === \"UPDATE\" ?\r\n                                    pos.currentAdditionalRoundInfo.auctions.map(auc => auc.auctionId !== auction.auctionId ? auc : auction) :\r\n                                    pos.currentAdditionalRoundInfo.auctions.filter(auc => auc.auctionId !== auction.auctionId)\r\n                            )\r\n                    }\r\n                }\r\n            )\r\n        }\r\n        reduxStore.dispatch(setResource(OFFER_CHOICE_LIST_RESOURCE_ID, newList));\r\n    }\r\n}\r\n\r\n\r\nconst getChoiceJustificationBasis = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.OFFER_CHOICE_JUSTIFICATIONS(demandId));\r\n        reduxStore.dispatch(setResource(OFFER_CHOICE_JUSTIFICATIONS, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst getPositionsWithNoOffer = async (demandId) => {\r\n    try {\r\n        return await RestRequestGET(Endpoints.OFFER_CHOICE_POSITIONS_WITH_NO_OFFER(demandId));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst prepareAdditionalRound = async (demandId, roundType) => {\r\n    try {\r\n        return await RestRequestGET(Endpoints.OFFER_CHOICE_PREPARE_ADDITIONAL_ROUND(demandId, roundType));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst cancelPositionsWithNoOffer = async (demandId, values) => {\r\n\r\n    const data = {\r\n        ...values,\r\n        offerChoiceDate: values.offerChoiceDate.format()\r\n    }\r\n\r\n    const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_CANCEL_WHERE_NO_OFFERS(demandId), data);\r\n    if (resp.success !== true) {\r\n        throw new Error(resp)\r\n    }\r\n    await validateSection(DemandValidation.OFFER_CHOICE, demandId, false);\r\n    await validateSection(DemandValidation.OFFERS_CHOICE_RESULT, demandId, false);\r\n    return resp;\r\n};\r\n\r\nconst createAdditionalRound = async (demandId, values, roundType) => {\r\n    const data = {\r\n        \"endDate\": values.endDate ? values.endDate.format() : null,\r\n        \"openOfferDate\": values.openOfferDate ? values.openOfferDate.format() : null,\r\n        \"positions\": Object.keys(values.parts).filter(x => values.parts[x].checked === true).map(x => {\r\n            const filteredContractors = Object.keys(values.parts[x].contractors).filter(c => values.parts[x].contractors[c] === true);\r\n            return {\r\n                positionId: x.substring(1),\r\n                departmentIds: !!filteredContractors ? filteredContractors.map(c => c.substring(1)) : []\r\n            }\r\n        }),\r\n        \"roundType\": roundType\r\n    }\r\n    const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_CREATE_ADDITIONAL_ROUND(demandId), data);\r\n    await validateSection(DemandValidation.OFFER_CHOICE, demandId, false);\r\n    return resp;\r\n};\r\n\r\nconst modifyChoice = async (demandId, positionId) => {\r\n    const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_REVOKE(demandId, positionId));\r\n    if (!(resp.success && resp.result)) {\r\n        throw new Error();\r\n    }\r\n    await validateSection(DemandValidation.OFFER_CHOICE, demandId, false);\r\n    await validateSection(DemandValidation.OFFERS_CHOICE_RESULT, demandId, false);\r\n    _doUpdatePosition(resp.result)\r\n}\r\n\r\nconst saveOfferChoice = async (demandId, positionId, canceled, chosenSupplierIds, offerChoiceDate, offerChoiceJustification) => {\r\n    const data = {\r\n        identity: positionId,\r\n        offerChoiceDate: offerChoiceDate.format(),\r\n        offerChoiceJustification,\r\n        canceled\r\n    };\r\n\r\n    if (!canceled) {\r\n        data.chosenSupplierIds = [...chosenSupplierIds]\r\n    }\r\n\r\n    const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE(demandId), data);\r\n\r\n    if (!(resp.success && resp.result)) {\r\n        throw new Error();\r\n    }\r\n    await validateSection(DemandValidation.OFFER_CHOICE, demandId, false);\r\n    await validateSection(DemandValidation.OFFERS_CHOICE_RESULT, demandId, false);\r\n    _doUpdatePosition(resp.result)\r\n}\r\n\r\n\r\nconst checkForPrimaryTenderChoiceOptions = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.OFFER_CHOICE_PRIMARY_CHECK(demandId));\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\nconst postPrimaryTenderDoNegotiations = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_PRIMARY_DO_NEGOTIATIONS(demandId));\r\n        if (isResponseValid(resp, (e) => {throw new Error(e)}))\r\n            await DemandSectionsService.getEvaluationSections(demandId, true)\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n};\r\nconst postPrimaryTenderDoOfferChoice = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_PRIMARY_DO_OFFER_CHOICE(demandId));\r\n        if (isResponseValid(resp, (e) => {throw new Error(e)}))\r\n        await DemandSectionsService.getEvaluationSections(demandId, true)\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n};\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.OFFER_CHOICE_VALIDATE(id));\r\n}\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n};\r\n\r\nexport default {\r\n    getChoiceList,\r\n    getPositionsWithNoOffer,\r\n    getChoiceJustificationBasis,\r\n    createAdditionalRound,\r\n    prepareAdditionalRound,\r\n    cancelPositionsWithNoOffer,\r\n    saveOfferChoice,\r\n    updateAuctionInAdditionalRoundInfo,\r\n    addAuctionToAdditionalRoundInfo,\r\n    removeAuctionFromAdditionalRoundInfo,\r\n    updatePosition,\r\n    modifyChoice,\r\n    getPositionAuctions,\r\n    checkForPrimaryTenderChoiceOptions,\r\n    postPrimaryTenderDoOfferChoice,\r\n    postPrimaryTenderDoNegotiations,\r\n    validate,\r\n    callSectionsValidation,\r\n    clearResources,\r\n    OFFER_CHOICE_JUSTIFICATIONS,\r\n    OFFER_CHOICE_LIST_RESOURCE_ID\r\n}","import React from 'react'\r\nimport {TablePagination} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport {getPaginationConfig} from \"hooks/useSearch\";\r\n\r\nfunction Pagination(\r\n    {\r\n        config = getPaginationConfig(1, 10),\r\n        setConfig = () => {\r\n        },\r\n        rowsPerPageOptions = [1, 2, 5, 10, 25, 50],\r\n        totalCount = 0,\r\n        disabled\r\n    }) {\r\n\r\n    const handleChangePage = (event, newPage) => {\r\n        setConfig({...config, page: newPage + 1});\r\n    }\r\n\r\n    const handleChangeRowsPerPage = (event) => {\r\n        setConfig({...config, page: 1, pageSize: parseInt(event.target.value, 10)});\r\n    }\r\n\r\n    return (\r\n        <TablePagination\r\n            component=\"div\"\r\n            rowsPerPageOptions={rowsPerPageOptions}\r\n            count={totalCount}\r\n            rowsPerPage={config.pageSize}\r\n            page={config.page - 1}\r\n            onPageChange={handleChangePage}\r\n            onRowsPerPageChange={handleChangeRowsPerPage}\r\n            labelRowsPerPage={Tr('rows_per_page')}\r\n            labelDisplayedRows={({from, to, count}) => `${from}-${to === -1 ? count : to} ${Tr('of')} ${count}`}\r\n            SelectProps={{\r\n                disabled: disabled\r\n            }}\r\n            backIconButtonProps={\r\n                disabled\r\n                    ? {\r\n                        disabled: disabled\r\n                    }\r\n                    : undefined\r\n            }\r\n            nextIconButtonProps={\r\n                disabled\r\n                    ? {\r\n                        disabled: disabled\r\n                    }\r\n                    : undefined\r\n            }\r\n        />\r\n    )\r\n}\r\n\r\nPagination.propTypes = {\r\n    config: PropTypes.shape({\r\n        page: PropTypes.number,\r\n        pageSize: PropTypes.number\r\n    }),\r\n    setConfig: PropTypes.func,\r\n    rowsPerPageOptions: PropTypes.arrayOf(PropTypes.number),\r\n    totalCount: PropTypes.number,\r\n    disabled: PropTypes.bool\r\n}\r\n\r\nexport default Pagination;","import React from \"react\";\r\nimport {makeStyles, TableCell, Tooltip} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from 'translations/Translations'\r\nimport {CheckBox as CheckBoxIcon, CheckBoxOutlineBlank as CheckBoxOutlineBlankIcon, IndeterminateCheckBox as IndeterminateCheckBoxIcon} from '@material-ui/icons';\r\nimport IconButton from \"components/button/IconButton\";\r\nimport clsx from \"clsx\";\r\nimport Filter1Icon from '@material-ui/icons/Filter1';\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    italic: {\r\n        fontStyle: 'italic',\r\n        userSelect: 'none'\r\n    },\r\n    evenRow: {\r\n        backgroundColor: theme.palette.background.default\r\n    },\r\n    lastRow: {\r\n        borderBottom: `solid 2px ${theme.palette.primary.main}`\r\n    },\r\n    statusSelect: {\r\n        width: 170,\r\n        \"& .MuiSelect-selectMenu\": {\r\n            whiteSpace: \"normal\"\r\n        }\r\n    },\r\n    iconColumn: {\r\n        padding: '0 !important'\r\n    },\r\n    columnChecked: {\r\n        backgroundColor: theme.palette.secondary.light\r\n    },\r\n    unavailable: {\r\n        color: theme.palette.text.secondary\r\n    },\r\n    maxPoints: {\r\n        fontWeight: theme.typography.fontWeightBold,\r\n        textDecoration: 'underline'\r\n    },\r\n    iconMax: {\r\n        fontSize: 'medium'\r\n    }\r\n}));\r\n\r\n\r\nfunction OfferChoiceContractorRowPart(\r\n    {\r\n        editable,\r\n        chosen,\r\n        chooseSupplierCountReached,\r\n        offerChoiceContractor,\r\n        offerChoiceRow,\r\n        chooseSupplier,\r\n        maxPartScore\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n\r\n    const getTooltip = () => {\r\n        if (editable && !chosen) {\r\n            if (offerChoiceContractor.available) {\r\n                if (chooseSupplierCountReached)\r\n                    return Tr('choose_supplier_max_tooltip', {max: offerChoiceRow.maxOfferChoiceCount})\r\n            } else {\r\n                return offerChoiceContractor.unavailableReason ? offerChoiceContractor.unavailableReason : Tr('choose_supplier_unavilable');\r\n            }\r\n        }\r\n        return null;\r\n    }\r\n    const maxScore = maxPartScore === offerChoiceContractor.offerScore;\r\n    const className =clsx({\r\n        [classes.columnChecked]: chosen,\r\n        [classes.unavailable]: !offerChoiceContractor.available,\r\n        [classes.maxPoints]: offerChoiceContractor.available && maxScore});\r\n    return (<>\r\n            <TableCell className={className}>{maxScore &&<Tooltip title={Tr('offer_with_max_points')}><Filter1Icon className={classes.iconMax} /></Tooltip>}\r\n                {offerChoiceContractor.consorciumOffer ? Tr('consorcium_with_name', {name: offerChoiceContractor.name}) : offerChoiceContractor.name}</TableCell>\r\n            <TableCell className={className}>{offerChoiceContractor.offerValue}</TableCell>\r\n            <TableCell className={className}>{formatAmountNumber(offerChoiceContractor.offerScore)}</TableCell>\r\n            <TableCell className={clsx(classes.iconColumn)}>\r\n                <IconButton\r\n                    className={clsx({[classes.unavailable]: !offerChoiceContractor.available})}\r\n                    disabled={!offerChoiceContractor.available || !editable || (!chosen && chooseSupplierCountReached)}\r\n                    tooltip={getTooltip()}\r\n                    onClick={() => chooseSupplier(offerChoiceContractor)}\r\n                    Icon={offerChoiceContractor.available ? (chosen ? CheckBoxIcon : CheckBoxOutlineBlankIcon) : IndeterminateCheckBoxIcon}\r\n                    color={ offerChoiceContractor.available ? 'primary' : undefined}\r\n                />\r\n            </TableCell>\r\n        </>\r\n    )\r\n}\r\n\r\nOfferChoiceContractorRowPart.propTypes = {\r\n    editable: PropTypes.bool.isRequired,\r\n    chosen: PropTypes.bool.isRequired,\r\n    chooseSupplierCountReached: PropTypes.bool.isRequired,\r\n    offerChoiceContractor: PropTypes.object.isRequired,\r\n    offerChoiceRow: PropTypes.object.isRequired,\r\n    chooseSupplier: PropTypes.func.isRequired,\r\n    maxPartScore: PropTypes.number.isRequired\r\n}\r\n\r\nexport default OfferChoiceContractorRowPart;\r\n\r\n","import PropTypes from \"prop-types\";\r\nimport React from \"react\";\r\nimport Tr from 'translations/Translations';\r\nimport {AuctionType} from \"constants/AuctionType\";\r\nimport Typography from \"components/Typography\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Link from \"@material-ui/core/Link\";\r\nimport {AuctionStatusLabel} from \"constants/AuctionStatus\";\r\n\r\nfunction AuctionTypeList(\r\n    {\r\n        auctionType,\r\n        auctions\r\n    }) {\r\n\r\n    return (<>\r\n            <BoldTypography>{Tr(auctionType === AuctionType.PROD ? 'auctions_prod' : 'auctions_test')}</BoldTypography>\r\n            <Typography>{Tr('auction_numbers')}:\r\n                {auctions.length === 0 ?\r\n                    <BoldTypography component='span'>{Tr('auctions_empty')}</BoldTypography>\r\n                    :\r\n                    auctions.map((x, i) => (<Typography key={x.auctionId} component='span'>\r\n                            <Link href={x.url}>\r\n                                {x.auctionId + \" (\" + AuctionStatusLabel(x.status) + \")\"}\r\n                            </Link>\r\n                            {(i < auctions.length - 1 && auctions.length > 1) && '; '}\r\n                        </Typography>\r\n                    ))\r\n                }\r\n            </Typography>\r\n        </>\r\n    )\r\n}\r\n\r\nAuctionTypeList.propTypes = {\r\n    auctions: PropTypes.array.isRequired,\r\n    auctionType: PropTypes.string.isRequired,\r\n}\r\n\r\nexport default AuctionTypeList;\r\n","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport {AuctionType} from \"constants/AuctionType\";\r\nimport AuctionTypeList from \"./AuctionTypeList\";\r\n\r\nconst AuctionHistoryPopup = (\r\n    {\r\n        demandId,\r\n        positionId,\r\n        onClose\r\n    }) => {\r\n\r\n\r\n    const [auctions, setAuctions] = useState(null);\r\n\r\n    useEffect(() => {\r\n        OfferChoiceService.getPositionAuctions(demandId, positionId).then((resp) => {\r\n            const {prod, test} = resp.auctions.reduce((prev, cur) => {\r\n                if (cur.type === AuctionType.PROD)\r\n                    prev.prod.push(cur);\r\n                else\r\n                    prev.test.push(cur);\r\n                return prev;\r\n            }, {prod: [], test: []});\r\n\r\n            setAuctions({prod, test})\r\n        }).catch(() => setAuctions({}))\r\n    }, [demandId, positionId])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('close'), onClose, undefined, !auctions));\r\n        return buttons;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('auctions_information_button')}\r\n            maxWidth='sm'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                {!auctions ? <Loading/>\r\n                    :\r\n                    <div>\r\n                        {!!auctions.prod && <AuctionTypeList auctions={auctions.prod} auctionType={AuctionType.PROD}/>}\r\n                        <br/>\r\n                        {!!auctions.test && <AuctionTypeList auctions={auctions.test} auctionType={AuctionType.TEST}/>}\r\n                    </div>\r\n                }\r\n            </GridBlock>\r\n        </Dialog>)\r\n}\r\n\r\nAuctionHistoryPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    positionId: PropTypes.number.isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default AuctionHistoryPopup","import {useMemo, useState} from \"react\";\r\nimport {makeStyles, TextField} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from \"clsx\";\r\nimport PropTypes from \"prop-types\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {KeyboardDatePicker} from \"@material-ui/pickers\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment from \"libs/moment\";\r\nimport Button from \"components/Button\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {createSelectItem} from \"components/Select\";\r\nimport {connect} from \"react-redux\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport AuctionHistoryPopup from \"./auction/AuctionHistoryPopup\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    choiceSize: {\r\n        \"& .MuiInput-root\": {\r\n            fontSize: theme.typography.body2.fontSize,\r\n            color: theme.palette.text.primary\r\n        }\r\n    },\r\n    choiceStatus: {\r\n        marginBottom: theme.spacing()\r\n    },\r\n    choiceControls: {\r\n        marginTop: theme.spacing(2),\r\n        textAlign: 'center'\r\n    },\r\n    choiceControlsEnd: {\r\n        textAlign: 'end'\r\n    },\r\n    offerChoiceJustification: {\r\n        width: 300,\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    menuItemClassName: {\r\n        whiteSpace: 'normal'\r\n    },\r\n    auctionHistory: {\r\n        float: 'right',\r\n    }\r\n}));\r\n\r\nfunction OfferChoiceSummaryCell(\r\n    {\r\n        demandId,\r\n        editable,\r\n        rowWorking,\r\n        working,\r\n        offerChoiceRow,\r\n        chosenStatusDone,\r\n        setChosenStatusDone,\r\n        chosenSuppliers,\r\n        updateStatus,\r\n        modifyChoice,\r\n        offerChoiceJustifications\r\n    }) {\r\n    const classes = useStyles();\r\n    const [auctionHistoryPopup, setAuctionHistoryPopup] = useState(false);\r\n    const [offerChoiceDateError, setOfferChoiceDateError] = useState(false);\r\n    const [modifyConfirmOpen, setModifyConfirmOpen] = useState(false);\r\n    const [offerChoiceJustification, setOfferChoiceJustification] = useState(offerChoiceRow.offerChoiceJustification || '');\r\n    const [offerChoiceDate, setOfferChoiceDate] = useState(offerChoiceRow.offerChoiceDate ? moment(offerChoiceRow.offerChoiceDate) : null);\r\n\r\n    const handleChangeDate = (date) => {\r\n        const dateValue = date ? date : null;\r\n        setOfferChoiceDateError(!dateValue);\r\n        setOfferChoiceDate(dateValue)\r\n    }\r\n\r\n    const onUpdateStatus = () => {\r\n\r\n        if (!offerChoiceDate || !moment.isMoment(offerChoiceDate) || !offerChoiceDate.isValid()) {\r\n            setOfferChoiceDateError(true);\r\n            return;\r\n        }\r\n\r\n        const canceled = chosenSuppliers.length === 0;\r\n        updateStatus(offerChoiceRow.identity, canceled, canceled ? null : chosenSuppliers, offerChoiceDate, offerChoiceJustification).then(() => {\r\n            setChosenStatusDone(true);\r\n        }).catch((e) => console.error(e));\r\n\r\n    };\r\n\r\n    const disabledInputs = working || chosenStatusDone || !editable;\r\n\r\n    const auctionHistoryVisible = useMemo(() => offerChoiceRow.currentAdditionalRoundInfo\r\n        && offerChoiceRow.currentAdditionalRoundInfo.type === RoundType.AUCTION, [offerChoiceRow.currentAdditionalRoundInfo]);\r\n\r\n    return (\r\n        <GridBlock column>\r\n            {auctionHistoryVisible &&\r\n            <Button className={classes.auctionHistory} onClick={() => setAuctionHistoryPopup(true)} variant=\"outlined\">{Tr('auctions_information_button')}</Button>\r\n            }\r\n\r\n            {chosenStatusDone &&\r\n            <BoldTypography\r\n                className={classes.choiceStatus}>{offerChoiceRow.canceled ? Tr('offer_choice_cancelled') : Tr('offer_choice_chosen')}\r\n            </BoldTypography>}\r\n\r\n            <KeyboardDatePicker\r\n                disabled={disabledInputs}\r\n                className={classes.choiceSize}\r\n                label={Tr('choice_date')}\r\n                format={DateFormats.DATE_FORMAT}\r\n                variant='dialog'\r\n                cancelLabel={Tr('cancel')}\r\n                value={offerChoiceDate}\r\n                invalidDateMessage={Tr(\"invalid_date_format\")}\r\n                onChange={handleChangeDate}\r\n                error={offerChoiceDateError}\r\n                helperText={offerChoiceDateError ? Tr('required_field') : undefined}\r\n            />\r\n            {!chosenStatusDone && chosenSuppliers.length === 0 &&\r\n            <SimpleSelect\r\n                className={classes.offerChoiceJustification}\r\n                menuItemClassName={classes.menuItemClassName}\r\n                items={[createSelectItem(\"empty\", Tr('select_justifiction')), ...Object.keys(offerChoiceJustifications).map(x => createSelectItem(x, offerChoiceJustifications[x]))]}\r\n                onChange={(event) => setOfferChoiceJustification(event.target.value === \"empty\" ? \"\" : offerChoiceJustifications[event.target.value])}\r\n                value={\"empty\"}\r\n            />}\r\n\r\n            <TextField\r\n                disabled={disabledInputs}\r\n                className={classes.choiceSize}\r\n                label={Tr('choice_justification')}\r\n                multiline\r\n                fullWidth\r\n                maxRows={5}\r\n                value={offerChoiceJustification}\r\n                onChange={(e => setOfferChoiceJustification(e.target.value))}\r\n            />\r\n\r\n            {\r\n                editable &&\r\n                <div className={clsx(classes.choiceControls, {[classes.choiceControlsEnd]: chosenStatusDone})}>\r\n                    {chosenStatusDone ?\r\n                        <WorkableButton working={rowWorking} disabled={rowWorking || working || !editable} onClick={() => setModifyConfirmOpen(true)}>\r\n                            {Tr('choose_modify')}\r\n                        </WorkableButton> :\r\n                        <WorkableButton working={rowWorking} disabled={rowWorking || working || !editable}\r\n                                        onClick={onUpdateStatus}>{chosenSuppliers.length > 0 ? Tr('confirm') : Tr('invalidate')}</WorkableButton>\r\n                    }\r\n                </div>\r\n            }\r\n\r\n            {auctionHistoryPopup && <AuctionHistoryPopup\r\n                onClose={()=> setAuctionHistoryPopup(false)}\r\n                positionId={offerChoiceRow.identity}\r\n                demandId={demandId}\r\n                />}\r\n\r\n            <Confirm\r\n                confirmText={Tr('choose_modify_confirm', {order: offerChoiceRow.order})}\r\n                onCancel={() => setModifyConfirmOpen(false)}\r\n                onConfirm={() => {\r\n                    setModifyConfirmOpen(false);\r\n                    modifyChoice(offerChoiceRow.identity);\r\n                }}\r\n                open={modifyConfirmOpen}\r\n                translateConfirmTexts={false}\r\n            />\r\n        </GridBlock>)\r\n}\r\n\r\nOfferChoiceSummaryCell.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    rowWorking: PropTypes.bool.isRequired,\r\n    offerChoiceRow: PropTypes.object.isRequired,\r\n    chosenStatusDone: PropTypes.bool.isRequired,\r\n    setChosenStatusDone: PropTypes.func.isRequired,\r\n    chosenSuppliers: PropTypes.array.isRequired,\r\n    updateStatus: PropTypes.func.isRequired,\r\n    modifyChoice: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    offerChoiceJustifications: state.resources[OfferChoiceService.OFFER_CHOICE_JUSTIFICATIONS]\r\n}), {})(OfferChoiceSummaryCell);\r\n;\r\n\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const AdditionalRoundStatus = {\r\n    OFFER_COLLECTION: 'OFFER_COLLECTION',\r\n    OFFER_DECRYPTION: 'OFFER_DECRYPTION',\r\n    OFFER_EVALUATION: 'OFFER_EVALUATION',\r\n    CANCELLED: 'CANCELLED',\r\n    FINISHED: 'FINISHED'\r\n}\r\n\r\nexport const LABELS = {\r\n    [AdditionalRoundStatus.OFFER_COLLECTION]: Tr('procedure_status_2'),\r\n    [AdditionalRoundStatus.OFFER_DECRYPTION]: Tr('procedure_status_4_0'),\r\n    [AdditionalRoundStatus.OFFER_EVALUATION]: Tr('procedure_status_4'),\r\n    [AdditionalRoundStatus.FINISHED]: Tr('procedure_status_7'),\r\n    [AdditionalRoundStatus.CANCELLED]: Tr('procedure_status_6'),\r\n}\r\n\r\nexport const AdditionalRoundStatusLabel = (status) => (LABELS[status]);\r\n\r\nexport const AdditionalRoundStatusesPending = [AdditionalRoundStatus.OFFER_COLLECTION, AdditionalRoundStatus.OFFER_DECRYPTION]\r\n","import Tr from \"translations/Translations\";\r\nconst MINUTE_SECONDS = 60;\r\nconst HOUR_SECONDS = 60 * MINUTE_SECONDS;\r\nconst DAY_SECONDS = 24 * HOUR_SECONDS;\r\nconst zeroTable = [0, 0, 0, 0];\r\n\r\n\r\nexport const getDays = (sec) => {\r\n    return Math.floor(sec / DAY_SECONDS);\r\n}\r\n\r\nexport const getDaysHoursMinutesSeconds = (sec, zeroValue = zeroTable) => {\r\n    if (sec <= 0) {\r\n        return zeroValue;\r\n    }\r\n\r\n    let secLeft = sec;\r\n    const days = Math.floor(sec / DAY_SECONDS);\r\n\r\n    secLeft = secLeft - (days * DAY_SECONDS);\r\n    const hours = Math.floor(secLeft / HOUR_SECONDS);\r\n\r\n    secLeft = secLeft - (hours * HOUR_SECONDS);\r\n    const minutes = Math.floor(secLeft / MINUTE_SECONDS);\r\n\r\n    secLeft = secLeft - (minutes * MINUTE_SECONDS)\r\n    const seconds = secLeft;\r\n    return [days, hours, minutes, seconds];\r\n}\r\n\r\nexport const  formatDaysHoursMinutesSeconds = (table) => {\r\n\r\n    if(!table || table.length !== 4) {\r\n        return \"\";\r\n    }\r\n    let ret = '';\r\n    if(table[0] > 0) {\r\n        ret += table[0] + ' ' + Tr('day')\r\n    }\r\n    if(table[1] > 0) {\r\n        ret += \" \" + table[1] + ' ' + Tr('hours')\r\n    }\r\n    if(table[2] > 0) {\r\n        ret += \" \" + table[2] + ' ' + Tr('min')\r\n    }\r\n    if(table[3] > 0) {\r\n        ret += \" \" + table[3] + ' ' + Tr('seconds')\r\n    }\r\n    return ret;\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\n\r\n\r\nconst changeDates = async (demandId, {roundId, endDate, openOfferDate}) => {\r\n    const data = {\r\n        roundId,\r\n        endDate: endDate.format(),\r\n        openOfferDate: openOfferDate.format()\r\n\r\n    }\r\n    return await RestRequestPOST(Endpoints.ADDITIONAL_ROUND_CHANGE_DATES(demandId), data);\r\n};\r\n\r\nconst getOffersDecryptionStatus = async (roundId) => {\r\n    return await RestRequestGET(Endpoints.RFX_OFFERS_DECRYPTION_STATUS_LIGHT(roundId));\r\n}\r\n\r\nconst getOffersDecryptionProgress = async (roundId) => {\r\n    return await RestRequestGET(Endpoints.RFX_OFFERS_DECRYPTION_PROGRESS(roundId));\r\n}\r\n\r\nconst startOffersDecryptionProcess = async (roundId) => {\r\n    return await RestRequestPOST(Endpoints.RFX_OFFERS_DECRYPTION_START(roundId));\r\n}\r\n\r\nexport default {\r\n    startOffersDecryptionProcess,\r\n    getOffersDecryptionStatus,\r\n    getOffersDecryptionProgress,\r\n    changeDates\r\n}","import React, {useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport * as Yup from \"yup\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport moment from \"libs/moment\";\r\nimport AdditionalRoundService from \"services/AdditionalRoundService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    dateTimePicker: {\r\n        width: 350\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nconst OfferChoiceEditAdditionalRoundsDatesPopup = (\r\n    {\r\n        demandId,\r\n        roundName,\r\n        additionalRoundId,\r\n        additionalRoundStatus,\r\n        additionalRoundEndDate,\r\n        additionalRoundOpenOfferDate,\r\n        onCancel,\r\n        onSuccess,\r\n        formSubmit\r\n    }) => {\r\n    const classes = useStyle();\r\n    const [working, setWorking] = useState(false);\r\n    const [error, setError] = useState(false);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = (values) => {\r\n        setError(false);\r\n        setWorking(true);\r\n        AdditionalRoundService.changeDates(demandId, values).then(() => onSuccess(values)).catch(() => {\r\n            setError(true);\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('change_dates'), handleSubmit, undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n    const handleEndDate = (formikProps, value) => {\r\n        formikProps.setFieldValue('openOfferDate', value);\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('edit_dates_popup_title')}\r\n            maxWidth='sm'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                {working && <Loading/>}\r\n                {error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{Tr('unknown_error_message')}</TypographyWithIcon>}\r\n\r\n                <Form\r\n                    initialValues={{\r\n                        roundId: additionalRoundId,\r\n                        endDate: moment(additionalRoundEndDate),\r\n                        openOfferDate: moment(additionalRoundOpenOfferDate)\r\n                    }}\r\n                    validationSchema={Yup.object().shape({\r\n                        endDate: VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past')),\r\n                        openOfferDate: VS.dateTimeValid()\r\n                            .when('endDate', (endDate, schema) => {\r\n                                return schema.test('EndDateLessOpenDate', Tr(\"EndDateLessOpenDate\"), (offerOpenDate) => {\r\n                                    if (endDate && offerOpenDate) {\r\n                                        return !offerOpenDate.isBefore(endDate);\r\n                                    }\r\n                                    return false;\r\n                                })\r\n                            })\r\n                    })}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock\r\n                            column\r\n                        >\r\n                            <Typography className={classes.marginBottom} variant=\"h6\">\r\n                                {roundName}\r\n                            </Typography>\r\n                            <DateTimePicker\r\n                                className={classes.dateTimePicker}\r\n                                id='endDate'\r\n                                label={Tr('additional_round_end_date')}\r\n                                formikProps={formikProps}\r\n                                disabled={working}\r\n                                onChange={(value) => handleEndDate(formikProps, value)}\r\n                                minDate={new Date()}\r\n                            />\r\n\r\n                            <DateTimePicker\r\n                                className={classes.dateTimePicker}\r\n                                id='openOfferDate'\r\n                                label={Tr('additional_round_open_offer_date')}\r\n                                formikProps={formikProps}\r\n                                disabled={working}\r\n                                minDate={new Date()}\r\n                            />\r\n\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n            </GridBlock>\r\n        </Dialog>)\r\n}\r\n\r\nOfferChoiceEditAdditionalRoundsDatesPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    roundName: PropTypes.string.isRequired,\r\n    additionalRoundId: PropTypes.number.isRequired,\r\n    additionalRoundStatus: PropTypes.string.isRequired,\r\n    additionalRoundEndDate: PropTypes.string.isRequired,\r\n    additionalRoundOpenOfferDate: PropTypes.string.isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(OfferChoiceEditAdditionalRoundsDatesPopup)","export default {\r\n    UNAVAILABLE: \"UNAVAILABLE\",\r\n    CAN_START: \"CAN_START\",\r\n    IN_PROGRESS: \"IN_PROGRESS\",\r\n    PROCESSED: \"PROCESSED\",\r\n    ERROR: \"ERROR\"\r\n}","import {makeStyles, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport React, {useCallback, useEffect, useRef, useState} from \"react\";\r\nimport moment from \"libs/moment\";\r\nimport {formatDaysHoursMinutesSeconds, getDaysHoursMinutesSeconds} from \"libs/durations\";\r\nimport {AdditionalRoundStatus} from \"constants/AdditionalRoundStatus\";\r\nimport OfferChoiceEditAdditionalRoundsDatesPopup from \"./OfferChoiceEditAdditionalRoundsDatesPopup\";\r\nimport AdditionalRoundService from \"services/AdditionalRoundService\";\r\nimport ProgressStatus from \"constants/ProgressStatus\";\r\nimport ProgressBar from \"components/ProgressBar\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    buttons: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    button: {\r\n        marginLeft: theme.spacing()\r\n    }\r\n}));\r\n\r\nconst countTimeFunction = (endTime, serverBrowserTimeDiffSeconds, setLeftTable, timerInterval, endTimeCallback) => {\r\n    const end = moment(endTime);\r\n    const nowBrowserTime = moment();\r\n    const secondsDiff = end.diff(nowBrowserTime, \"s\") - serverBrowserTimeDiffSeconds.current;\r\n    if (secondsDiff <= 0) {\r\n        if (timerInterval.current)\r\n            clearInterval(timerInterval.current);\r\n        endTimeCallback();\r\n    }\r\n    setLeftTable(getDaysHoursMinutesSeconds(secondsDiff, null));\r\n}\r\n\r\n//to widzimy tylko w statusie OFFER_COLLECTION i OFFER_DECRYPTION\r\nfunction OfferChoiceSummaryCellAdditionalRound(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        rowWorking,\r\n        setRowWorking,\r\n        refreshRow,\r\n        serverBrowserTimeDiff,\r\n        roundName,\r\n        additionalRoundId,\r\n        additionalRoundStatus,\r\n        additionalRoundEndDate,\r\n        additionalRoundOpenOfferDate,\r\n\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const [leftTableToOfferEnd, setLeftTableToOfferEnd] = useState(null);\r\n    const [leftTableToOpenOffer, setLeftTableToOpenOffer] = useState(null);\r\n    const [editDatesOpened, setEditDatesOpened] = useState(false);\r\n    const [decryptionStatus, setDecryptionStatus] = useState(null);\r\n    const [decryptionProgress, setDecryptionProgress] = useState([-1, 0]);\r\n    const decryptionInterval = useRef(0);\r\n    const timerInterval = useRef(0);\r\n    const decryptionFinished = useRef(false);\r\n\r\n    const endTimeCallback = useCallback(() => {\r\n        setTimeout(refreshRow, 3000);\r\n    }, [refreshRow]);\r\n\r\n    useEffect(() => {\r\n        setDecryptionStatus(null);\r\n\r\n\r\n        if (additionalRoundStatus === AdditionalRoundStatus.OFFER_COLLECTION) {\r\n            const nowBrowserTime = moment();\r\n            const end = moment(additionalRoundEndDate);\r\n            const secondsLeftToOfferEnd = moment(end).diff(nowBrowserTime, 's') - serverBrowserTimeDiff.current;\r\n            setLeftTableToOfferEnd(getDaysHoursMinutesSeconds(secondsLeftToOfferEnd, null));\r\n            //trwa zbieranie\r\n            if (secondsLeftToOfferEnd > 0) {\r\n                timerInterval.current = setInterval(countTimeFunction, 250,\r\n                    additionalRoundEndDate,\r\n                    serverBrowserTimeDiff,\r\n                    setLeftTableToOfferEnd,\r\n                    timerInterval,\r\n                    endTimeCallback);\r\n                //zakończono zbieranie\r\n            } else {\r\n                const openOffer = moment(additionalRoundOpenOfferDate);\r\n                const secondsLeftToOpenOffer = moment(openOffer).diff(nowBrowserTime, 's') - serverBrowserTimeDiff.current;\r\n                //minął termin otwarcia ofert\r\n                if (secondsLeftToOpenOffer > 0) {\r\n                    timerInterval.current = setInterval(countTimeFunction, 250,\r\n                        additionalRoundOpenOfferDate,\r\n                        serverBrowserTimeDiff,\r\n                        setLeftTableToOpenOffer,\r\n                        timerInterval,\r\n                        endTimeCallback);\r\n                } else {\r\n                    AdditionalRoundService.getOffersDecryptionStatus(additionalRoundId)\r\n                        .then(resp => setDecryptionStatus(resp));\r\n                }\r\n            }\r\n        } else if (additionalRoundStatus === AdditionalRoundStatus.OFFER_DECRYPTION) {\r\n            AdditionalRoundService.getOffersDecryptionStatus(additionalRoundId).then((resp) => {\r\n                setDecryptionStatus(resp);\r\n            })\r\n        }\r\n\r\n        return () => {\r\n            if (timerInterval.current) {\r\n                clearInterval(timerInterval.current);\r\n                timerInterval.current = 0;\r\n            }\r\n            if (decryptionInterval.current) {\r\n                clearInterval(decryptionInterval.current);\r\n                decryptionInterval.current = 0;\r\n\r\n            }\r\n        }\r\n    }, [additionalRoundEndDate, additionalRoundId, additionalRoundOpenOfferDate, additionalRoundStatus, endTimeCallback, serverBrowserTimeDiff]);\r\n\r\n    useEffect(() => {\r\n        if (decryptionStatus && decryptionStatus.status === ProgressStatus.IN_PROGRESS && !decryptionInterval.current) {\r\n            decryptionInterval.current = setInterval(async () => {\r\n                const resp = await AdditionalRoundService.getOffersDecryptionProgress(additionalRoundId);\r\n                setDecryptionProgress(resp.result);\r\n                if (resp.result[0] === 100) {\r\n                    clearInterval(decryptionInterval.current);\r\n                    decryptionInterval.current = setInterval(async () => {\r\n                        const resp = await AdditionalRoundService.getOffersDecryptionStatus(additionalRoundId);\r\n                        setDecryptionStatus(resp);\r\n                        if (resp.status === ProgressStatus.PROCESSED) {\r\n                            clearInterval(decryptionInterval.current);\r\n                            decryptionInterval.current = 0;\r\n                        }\r\n                    }, 2000)\r\n                }\r\n            }, 3000);\r\n        } else if (decryptionStatus && decryptionStatus.status === ProgressStatus.PROCESSED && !decryptionFinished.current) {\r\n            refreshRow([DemandValidation.DOCUMENTS, DemandValidation.CONTRACTOR_VERIFICATION, DemandValidation.OFFERS_EVALUATION, DemandValidation.OFFER_CHOICE]);\r\n            decryptionFinished.current = true;\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [decryptionStatus]);\r\n\r\n\r\n    const onDecryptionStart = () => {\r\n        setRowWorking(true);\r\n        AdditionalRoundService.startOffersDecryptionProcess(additionalRoundId)\r\n            .finally(refreshRow);\r\n    };\r\n\r\n    return (<GridBlock\r\n        column\r\n        justify='space-between'\r\n        alignItems='center'\r\n    >\r\n        {\r\n            additionalRoundStatus === AdditionalRoundStatus.OFFER_COLLECTION &&\r\n            <>\r\n                {leftTableToOfferEnd !== null ?\r\n                    <>\r\n                        <Typography>{Tr('additional_offer_collection_pending')}</Typography>\r\n                        <Typography>{Tr('additional_offer_collection_left')}: <BoldTypography\r\n                            component=\"span\">{formatDaysHoursMinutesSeconds(leftTableToOfferEnd)}</BoldTypography></Typography>\r\n                    </> : <>\r\n                        <Typography>{Tr('additional_offer_collection_finished')}</Typography>\r\n                        {leftTableToOpenOffer !== null &&\r\n                        <Typography>{Tr('additional_offer_open_time_left')}: <BoldTypography\r\n                            component=\"span\">{formatDaysHoursMinutesSeconds(leftTableToOpenOffer)}</BoldTypography></Typography>\r\n                        }\r\n                    </>\r\n                }\r\n            </>\r\n        }\r\n        {\r\n            additionalRoundStatus === AdditionalRoundStatus.OFFER_DECRYPTION &&\r\n            <>\r\n                <Typography>{Tr('additional_offer_decryption')}</Typography>\r\n                {decryptionProgress[0] <= 0 && decryptionProgress[1] > 0 && <Typography>{decryptionProgress[1] + ' ' + Tr('in_queue')}</Typography>}\r\n                {(decryptionProgress[0] > 0 || decryptionProgress[1] === 0) && <ProgressBar max={100} value={decryptionProgress[0]}/>}\r\n            </>\r\n        }\r\n\r\n        <GridBlock className={classes.buttons}>\r\n            {additionalRoundStatus === AdditionalRoundStatus.OFFER_COLLECTION &&\r\n            <>\r\n                <Button disabled={rowWorking || working || !editable}\r\n                        variant={leftTableToOfferEnd !== null ? 'contained' : 'outlined'}\r\n                        onClick={() => setEditDatesOpened(true)}>{Tr('edit_dates')}\r\n                </Button>\r\n                {leftTableToOfferEnd === null &&\r\n                <Button\r\n                    className={classes.button}\r\n                    disabled={(decryptionStatus === null || decryptionStatus.status !== ProgressStatus.CAN_START) || rowWorking || working || !editable}\r\n                    onClick={onDecryptionStart}>{Tr('open_offers')}\r\n                </Button>\r\n                }\r\n            </>\r\n            }\r\n        </GridBlock>\r\n\r\n        {editDatesOpened &&\r\n        <OfferChoiceEditAdditionalRoundsDatesPopup\r\n            demandId={demandId}\r\n            roundName={roundName}\r\n            additionalRoundId={additionalRoundId}\r\n            additionalRoundStatus={additionalRoundStatus}\r\n            additionalRoundEndDate={additionalRoundEndDate}\r\n            additionalRoundOpenOfferDate={additionalRoundOpenOfferDate}\r\n            onCancel={() => setEditDatesOpened(false)}\r\n            onSuccess={() => {\r\n                refreshRow().then(() => setEditDatesOpened(false));\r\n            }}\r\n        />}\r\n    </GridBlock>)\r\n}\r\n\r\nOfferChoiceSummaryCellAdditionalRound.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    rowWorking: PropTypes.bool.isRequired,\r\n    roundName: PropTypes.string.isRequired,\r\n    additionalRoundId: PropTypes.number.isRequired,\r\n    additionalRoundStatus: PropTypes.string.isRequired,\r\n    additionalRoundEndDate: PropTypes.string.isRequired,\r\n    additionalRoundOpenOfferDate: PropTypes.string.isRequired,\r\n    refreshRow: PropTypes.func.isRequired,\r\n    setRowWorking: PropTypes.func.isRequired,\r\n    serverBrowserTimeDiff: PropTypes.object.isRequired,\r\n}\r\n\r\nexport default OfferChoiceSummaryCellAdditionalRound;\r\n\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\n\r\nconst formatValues = (values) => {\r\n    return ({\r\n        ...values,\r\n        startDate: values.startDate.format(),\r\n        endDate: values.endDate ? values.endDate.format() : null\r\n    })\r\n}\r\n\r\nconst create = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_CREATE(demandId, roundId), formatValues(values));\r\n};\r\n\r\nconst editDates = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_EDIT_DATES(demandId, roundId), formatValues(values));\r\n};\r\n\r\nconst publish = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_PUBLISH(demandId, roundId), values);\r\n};\r\n\r\nconst unpublish = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_UNPUBLISH(demandId, roundId), values);\r\n};\r\n\r\nconst pause = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_PAUSE(demandId, roundId), values);\r\n};\r\nconst resume = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_RESUME(demandId, roundId), values);\r\n};\r\n\r\nconst cancel = async (demandId, roundId, values) => {\r\n    return await RestRequestPOST(Endpoints.AUCTION_CANCEL(demandId, roundId), values);\r\n};\r\n\r\nconst remove = async (demandId, roundId, values) => {\r\n    return await RestRequestDELETE(Endpoints.AUCTION_DELETE(demandId, roundId), {data: values});\r\n};\r\n\r\nconst prepare = async (demandId, roundId, netOverGross) => {\r\n    return await RestRequestGET(Endpoints.AUCTION_PREPARE(demandId, roundId) + (netOverGross != null ? '?useNetOverGross=' + netOverGross : ''));\r\n};\r\nconst accept = async (demandId, roundId, auctionId) => {\r\n    return await RestRequestGET(Endpoints.AUCTION_ACCEPT(demandId, roundId, auctionId));\r\n};\r\n\r\nconst details = async (demandId, roundId, auctionId) => {\r\n    return await RestRequestGET(Endpoints.AUCTION_DETAILS(demandId, roundId, auctionId));\r\n};\r\n\r\nconst downloadAuctionInvitation = async (demandId, roundId, finallyCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.AUCTION_DOWNLOAD_INVITATION(demandId, roundId))\r\n            .finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nexport default {\r\n    prepare,\r\n    create,\r\n    cancel,\r\n    remove,\r\n    editDates,\r\n    publish,\r\n    unpublish,\r\n    pause,\r\n    resume,\r\n    accept,\r\n    details,\r\n    downloadAuctionInvitation\r\n}","import Tr from 'translations/Translations';\r\nimport {createSelectItem} from \"components/Select\";\r\nimport {AuctionRule} from \"constants/AuctionRule\";\r\n\r\nexport const AuctionItemBidType = {\r\n\r\n\r\n    RFX_CRITERIUM_VALUE: \"RFX_CRITERIUM_VALUE\",//domyślaa prezentuje wszystkie kryteria zwrócone, bez itemsów\r\n    /**\r\n     *  (tylko dla japońskich, gdy jest jedna pozycja (items=1))\r\n     */\r\n    RFX_CRITERIUM_PRICE: \"RFX_CRITERIUM_PRICE\", //(tutaj itemsy), bez kryterium typ price, reszta kryt. tak\r\n    /**\r\n     *  (tylko dla aukcji angielskich i dynamicznych)\r\n     */\r\n    RFX_ITEM_VALUE: \"RFX_ITEM_VALUE\" //(tutaj itemsy), bez kryterium typ price, reszta kryt. tak\r\n}\r\nconst _TR_PREFIX = 'auction_item_bid_type_';\r\n\r\nexport const AuctionItemBidTypeLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n\r\nexport const AuctionItemBidTypeItems = (auctionRule, allowQuantityEditInOffer, fixedOfferVat) => {\r\n    const arr = [createSelectItem(AuctionItemBidType.RFX_CRITERIUM_VALUE, AuctionItemBidTypeLabel(AuctionItemBidType.RFX_CRITERIUM_VALUE))]\r\n       if ((auctionRule === AuctionRule.ENGLISH || auctionRule === AuctionRule.DYNAMIC) && !allowQuantityEditInOffer && !fixedOfferVat) {\r\n        arr.push(createSelectItem(AuctionItemBidType.RFX_ITEM_VALUE, AuctionItemBidTypeLabel(AuctionItemBidType.RFX_ITEM_VALUE)))\r\n    }\r\n    return arr;\r\n}","import React, {useMemo} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport {FormHelperText, makeStyles} from \"@material-ui/core\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport {AuctionItemBidType} from \"../../constants/AuctionItemBidType\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Typography from \"components/Typography\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport Checkbox from \"components/Checkbox\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    checkboxColumn: {\r\n        width: 70\r\n    },\r\n    inputColumn: {\r\n        width: 100\r\n    },\r\n    boundaryColumn: {\r\n        width: 320\r\n    }\r\n}));\r\n\r\n\r\nconst OfferChoiceCreateAuctionTable = (\r\n    {\r\n        demandId,\r\n        items,\r\n        working,\r\n        formikProps\r\n\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n    const isCriterion = items === 'criterias'\r\n\r\n    const headers = useMemo(() => (isCriterion ? [\r\n        Tr('criterion_name'),\r\n        Tr('auction_biddable'),\r\n        Tr('auction_step'),\r\n        Tr('auction_value_min'),\r\n        Tr('auction_value_max'),\r\n        Tr('auction_boundary_values'),\r\n    ] : [\r\n        Tr('position_name'),\r\n        Tr('auction_step'),\r\n        Tr('auction_value_min'),\r\n        Tr('auction_value_max'),\r\n        Tr('auction_boundary_values'),\r\n    ]), [isCriterion]);\r\n\r\n    const tableItems = () => {\r\n        let table = undefined;\r\n        if (isCriterion) {\r\n            table = formikProps.values.positions[0].criterias.map((x, index) => {\r\n                if (formikProps.values.positions[0].bidType !== AuctionItemBidType.RFX_CRITERIUM_VALUE && x.type === 'price')\r\n                    return null;\r\n                const nameError = getObjectValue(`positions.0.criterias.${index}.name`, formikProps.errors, null)\r\n                return ([\r\n                    <>\r\n                        {x.name}\r\n                        {!!nameError && <FormHelperText className={classes.text} error>{nameError}</FormHelperText>}\r\n                    </>,\r\n                    <Checkbox\r\n                        id={`positions.0.criterias.${index}.biddable`}\r\n                        formikProps={formikProps}\r\n                        disabled={x.biddableDisabled}\r\n                    />\r\n                    ,\r\n                    <>\r\n                        {x.type !== 'text' && x.type !== 'list' && x.type !== 'yesNo' && x.biddable &&\r\n                        <TextInput\r\n                            id={`positions.0.criterias.${index}.step`}\r\n                            formikProps={formikProps}\r\n                            type={INPUT_TYPE.NUMBER_19}\r\n                            step=\"0.01\"\r\n                        />\r\n                        }\r\n                    </>,\r\n                    <>\r\n                        {x.type !== 'text' && x.type !== 'list' && x.type !== 'yesNo' && x.biddable &&\r\n                        <TextInput\r\n                            id={`positions.0.criterias.${index}.min`}\r\n                            formikProps={formikProps}\r\n                            type={INPUT_TYPE.NUMBER_19}\r\n                            step=\"0.01\"\r\n                        />\r\n                        }\r\n                    </>,\r\n                    <>\r\n                        {x.type !== 'text' && x.type !== 'list' && x.type !== 'yesNo' && x.biddable &&\r\n                        <TextInput\r\n                            id={`positions.0.criterias.${index}.max`}\r\n                            formikProps={formikProps}\r\n                            type={INPUT_TYPE.NUMBER_19}\r\n                            step=\"0.01\"\r\n                        />\r\n                        }\r\n                    </>,\r\n                    <>\r\n                        {!!x.minOfferValue && <Typography>{Tr('auction_criterion_min_value')}: {x.minOfferValue.toFixed(2).replace(/[.]/, \",\")}{x.type === 'price' ? ' PLN' : (!!x.measureUnit ? ` (${x.measureUnit})` : '')}</Typography>}\r\n                        {!!x.maxOfferValue && <Typography>{Tr('auction_criterion_max_value')}: {x.maxOfferValue.toFixed(2).replace(/[.]/, \",\")}{x.type === 'price' ? ' PLN' : (!!x.measureUnit ? ` (${x.measureUnit})` : '')}</Typography>}\r\n                        {(x.type === 'text' || x.type === 'list' || x.type === 'yesNo') && <Typography>{Tr(`auction_criterion_type_${x.type}`)}</Typography>}\r\n                    </>\r\n                ])\r\n\r\n            });\r\n        } else {\r\n            table = formikProps.values.positions[0].items.map((x, index) => {\r\n                const nameError = getObjectValue(`positions.0.items.${index}.name`, formikProps.errors, null)\r\n                return ([\r\n                    <>\r\n                        {x.name}\r\n                        {!!nameError && <FormHelperText className={classes.text} error>{nameError}</FormHelperText>}\r\n                    </>,\r\n                    <TextInput\r\n                        id={`positions.0.items.${index}.step`}\r\n                        formikProps={formikProps}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        step=\"0.01\"\r\n                    />,\r\n                    <TextInput\r\n                        id={`positions.0.items.${index}.min`}\r\n                        formikProps={formikProps}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        step=\"0.01\"\r\n                    />,\r\n                    <TextInput\r\n                        id={`positions.0.items.${index}.max`}\r\n                        formikProps={formikProps}\r\n                        type={INPUT_TYPE.NUMBER_19}\r\n                        step=\"0.01\"\r\n                    />,\r\n                    <>\r\n                        <Typography>{Tr('auction_criterion_min_price')}: {x.minOfferPrice.toFixed(2).replace(/[.]/, \",\")} PLN</Typography>\r\n                        <Typography>{Tr('auction_criterion_max_price')}: {x.maxOfferPrice.toFixed(2).replace(/[.]/, \",\")} PLN</Typography>\r\n                    </>\r\n                ])\r\n            });\r\n        }\r\n        return table;\r\n    }\r\n\r\n    const shouldShow = isCriterion || formikProps.values.positions[0].bidType === AuctionItemBidType.RFX_ITEM_VALUE\r\n        || formikProps.values.positions[0].bidType === AuctionItemBidType.RFX_CRITERIUM_PRICE;\r\n\r\n    return (shouldShow && <>\r\n        <BoldTypography>{Tr(isCriterion ? 'auction_criterias_table_title' : 'auction_items_table_title')}</BoldTypography>\r\n        <SimpleTable\r\n            headers={headers}\r\n            items={tableItems()}\r\n            columnClasses={isCriterion ? [\r\n                undefined,\r\n                classes.checkboxColumn,\r\n                classes.inputColumn,\r\n                classes.inputColumn,\r\n                classes.inputColumn,\r\n                classes.boundaryColumn\r\n            ] : [\r\n                undefined,\r\n                classes.inputColumn,\r\n                classes.inputColumn,\r\n                classes.inputColumn,\r\n                classes.boundaryColumn\r\n            ]}\r\n            cellClassName={classes.cell}\r\n        />\r\n    </>)\r\n}\r\n\r\nOfferChoiceCreateAuctionTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    items: PropTypes.oneOf(['criterias', 'items']),\r\n    working: PropTypes.bool.isRequired,\r\n    formikProps: PropTypes.object.isRequired,\r\n}\r\n\r\nexport default OfferChoiceCreateAuctionTable;","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport AuctionService from \"services/AuctionService\";\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport {AuctionTypeItems} from \"constants/AuctionType\";\r\nimport {AuctionRule, AuctionTypeRuleItems} from \"constants/AuctionRule\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport {PriceType, PriceTypeItems, PriceTypeItemsForAuction} from \"constants/PriceTypes\";\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport Typography from \"components/Typography\";\r\nimport moment from \"libs/moment\";\r\nimport {AuctionItemBidType, AuctionItemBidTypeItems} from \"../../constants/AuctionItemBidType\";\r\nimport OfferChoiceCreateAuctionTable from \"./OfferChoiceCreateAuctionTable\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport getObjectValue from 'libs/getObjectValue';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    title: {\r\n        marginTop: 0\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    },\r\n    bold: {\r\n        fontWeight: theme.typography.fontWeightBold\r\n    },\r\n    formElement: {\r\n        width: 400\r\n    },\r\n    dd: {\r\n        whiteSpace: \"pre-line\",\r\n        fontSize: 9\r\n    }\r\n\r\n}));\r\n\r\n\r\nconst OfferChoiceCreateAuctionPopup = (\r\n    {\r\n        demandId,\r\n        onCancel,\r\n        onSuccess,\r\n        roundId,\r\n        auctionType,\r\n        formSubmit,\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [preparedAuction, setPreparedAuction] = useState(null);\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(null);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = (values) => {\r\n        setError(null);\r\n        setWorking(true);\r\n        AuctionService.create(demandId, roundId, values).then((resp) => {\r\n            if (isResponseValid(resp, setError)) {\r\n                onSuccess(resp);\r\n            } else {\r\n                setWorking(false);\r\n            }\r\n        }).catch(() => {\r\n            setError(Tr('unknown_error_message'));\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    useEffect(() => {\r\n        AuctionService.prepare(demandId, roundId)\r\n            .then(resp => {\r\n                resp.type = auctionType;\r\n                resp.startDate = moment(resp.startDate);\r\n                resp.endDate = moment(resp.endDate);\r\n                resp.positions[0].bidType = AuctionItemBidType.RFX_CRITERIUM_VALUE;\r\n                setPreparedAuction(resp);\r\n            }).finally(() => setWorking(false));\r\n    }, [demandId, roundId, auctionType]);\r\n\r\n    const handleUseNetOverGrossChange = (formikProps, value) => {\r\n        AuctionService.prepare(demandId, roundId, value.target.value)\r\n            .then(resp => {\r\n                resp.type = getObjectValue('type', formikProps.values, \"\");\r\n                resp.rule = getObjectValue('rule', formikProps.values, \"\");\r\n                resp.startDate = getObjectValue('startDate', formikProps.values, \"\");\r\n                resp.decisionTime = getObjectValue('decisionTime', formikProps.values, \"\");\r\n                resp.endDate = getObjectValue('endDate', formikProps.values, \"\");\r\n                const position = getObjectValue('positions', formikProps.values, \"\");\r\n                resp.positions[0].bidType = getObjectValue('bidType', position[0], \"\");\r\n                resp.digitalSign = getObjectValue('digitalSign', formikProps.values, \"\");\r\n                resp.overtimeCount = getObjectValue('overtimeCount', formikProps.values, \"\");\r\n                resp.overtime = getObjectValue('overtime', formikProps.values, \"\");\r\n                setPreparedAuction(resp);\r\n            }).finally(() => setWorking(false));\r\n    }\r\n\r\n    const handleEndDate = (formikProps, value) => {\r\n        formikProps.setFieldValue('endDate', value);\r\n        formikProps.setFieldTouched('endDate', true);\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('auction_create_button'), handleSubmit, undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    const validationSchema = VS.lazy((value) => {\r\n\r\n        const rule = value.rule;\r\n        const overtimeCount = value.overtimeCount;\r\n        const bidType = value.positions[0].bidType;\r\n\r\n        const shape = {\r\n            rule: VS.string(),\r\n            startDate: VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past')),\r\n            type: VS.string(),\r\n\r\n        }\r\n\r\n        if (AuctionRule.JAPANESE !== rule) {\r\n            shape.endDate = VS.dateTimeValid()\r\n                .when('startDate', (startDate, schema) => {\r\n                    return schema.test('EndDateLessStartDate', Tr(\"EndDateLessStartDate\"), (endDate) => {\r\n                        if (startDate && endDate) {\r\n                            return endDate.isAfter(startDate);\r\n                        }\r\n                        return false;\r\n                    })\r\n                });\r\n            shape.overtimeCount = VS.integerMinMax(0, 999);\r\n            shape.overtime = overtimeCount === '0' ? VS.integerMinMax(0, 60) : VS.integerMax(60);\r\n        } else {\r\n            shape.decisionTime = VS.integerMax(99999)\r\n        }\r\n\r\n        shape.positions = VS.arrayOf(VS.object({\r\n            criterias: VS.arrayOf(VS.lazy(criterion => {\r\n                if (bidType !== AuctionItemBidType.RFX_CRITERIUM_VALUE && criterion.type === 'price') {\r\n                    return VS.any();\r\n                } else {\r\n                    const textYesNoOrList = criterion.type === 'text' || criterion.type === 'list' || criterion.type === 'yesNo';\r\n                    const critShape = {\r\n                        step: textYesNoOrList || !criterion.biddable ? VS.any() : VS.numberPositiveNoZero(),\r\n                        min: textYesNoOrList || !criterion.biddable ? VS.any() : VS.numberMin0(),\r\n                        max: textYesNoOrList || !criterion.biddable ? VS.any() : VS.numberMin(criterion.min, 'max_value_min_value')\r\n                    };\r\n                    if (AuctionRule.JAPANESE === rule) {\r\n                        critShape.name = VS.string().test('maxSubMinDivStep', Tr('difference_between_max_and_min_value_is_not_multiple_of_step'),\r\n                            () => {\r\n                                return  criterion.max == null || criterion.min == null || criterion.step == null ||\r\n                                    ((criterion.max - criterion.min) / criterion.step) === Math.floor((criterion.max - criterion.min) / criterion.step);\r\n                            })\r\n                    }\r\n                    return VS.object(critShape)\r\n                }\r\n            })),\r\n            items: VS.arrayOf(VS.lazy(item => {\r\n                if (bidType === AuctionItemBidType.RFX_CRITERIUM_VALUE) {\r\n                    return VS.any();\r\n\r\n                } else {\r\n                    const itemShape = {\r\n                        step: VS.numberPositiveNoZero(),\r\n                        min: VS.numberMin0(),\r\n                        max: VS.numberMin(item.min, 'max_value_min_value')\r\n                    }\r\n                    if (AuctionRule.JAPANESE === rule) {\r\n                        itemShape.name = VS.string().test('maxSubMinDivStep', Tr('difference_between_max_and_min_value_is_not_multiple_of_step'),\r\n                            () => {\r\n                                return item.max == null || item.min == null || item.step == null ||\r\n                                    ((item.max - item.min) / item.step) === Math.floor((item.max - item.min) / item.step);\r\n                            })\r\n                    }\r\n                    return VS.object(itemShape)\r\n                }\r\n            }))\r\n        }));\r\n        return VS.object(shape);\r\n    })\r\n\r\n    const title = useMemo(() => (<>\r\n            <span className={classes.bold}>{Tr('auction_create_popup_title')} </span>\r\n            {preparedAuction && <>\r\n                <span className={classes.italic}>{Tr('part_x', {x: preparedAuction.positions[0].order})}</span>:\r\n                <span> {preparedAuction.positions[0].name}</span>\r\n            </>}\r\n        </>),\r\n        // eslint-disable-next-line\r\n        [preparedAuction]);\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={title}\r\n            maxWidth='lg'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n\r\n                {working && <Loading/>}\r\n                {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n                {!!preparedAuction && <>\r\n\r\n                    <Form\r\n                        initialValues={{\r\n                            ...preparedAuction\r\n                        }}\r\n                        validationSchema={validationSchema}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <GridBlock\r\n                                column\r\n                            >\r\n                                <GridBlock\r\n                                    justify='space-between'\r\n                                >\r\n                                    <GridBlock\r\n                                        column\r\n                                    >\r\n                                        <Select\r\n                                            className={classes.formElement}\r\n                                            disabled\r\n                                            label={Tr('auction_type')}\r\n                                            id='type'\r\n                                            required\r\n                                            formikProps={formikProps}\r\n                                            items={[createSelectItem('', '---'), ...AuctionTypeItems]}\r\n                                        />\r\n                                        <Select\r\n                                            className={classes.formElement}\r\n                                            disabled={working}\r\n                                            label={Tr('auction_rule')}\r\n                                            id='rule'\r\n                                            required\r\n                                            formikProps={formikProps}\r\n                                            items={[createSelectItem('', '---'), ...AuctionTypeRuleItems(preparedAuction.rules)]}\r\n                                            onChange={() => formikProps.setFieldValue('positions.0.bidType', AuctionItemBidType.RFX_CRITERIUM_VALUE)}\r\n                                        />\r\n                                        <DateTimePicker\r\n                                            className={classes.formElement}\r\n                                            id='startDate'\r\n                                            label={Tr('auction_start_date')}\r\n                                            formikProps={formikProps}\r\n                                            disabled={working}\r\n                                            onChange={(value) => handleEndDate(formikProps, value)}\r\n                                            minDate={new Date()}\r\n                                        />\r\n\r\n                                        {AuctionRule.JAPANESE === formikProps.values.rule ?\r\n                                            <TextInput\r\n                                                className={classes.formElement}\r\n                                                disabled={working}\r\n                                                label={Tr('auction_decision_time')}\r\n                                                id='decisionTime'\r\n                                                required\r\n                                                formikProps={formikProps}\r\n                                                type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n                                            />\r\n                                            :\r\n                                            <DateTimePicker\r\n                                                className={classes.formElement}\r\n                                                id='endDate'\r\n                                                label={Tr('auction_end_date')}\r\n                                                formikProps={formikProps}\r\n                                                disabled={working}\r\n                                                minDate={new Date()}\r\n                                            />\r\n                                        }\r\n\r\n                                        <Select\r\n                                            className={classes.formElement}\r\n                                            disabled={working}\r\n                                            label={Tr('auction_item_bid_type')}\r\n                                            id='positions.0.bidType'\r\n                                            required\r\n                                            formikProps={formikProps}\r\n                                            items={AuctionItemBidTypeItems(formikProps.values.rule, preparedAuction.allowQuantityEditInOffer, preparedAuction.fixedOfferVat)}\r\n                                        />\r\n                                    </GridBlock>\r\n                                    <GridBlock\r\n                                        column\r\n                                    >\r\n                                        {getObjectValue('priceType', formikProps.values, \"\") === PriceType.NET_GROSS ?\r\n                                            <Select\r\n                                                className={classes.formElement}\r\n                                                label={Tr('auction_price_type')}\r\n                                                id='useNetOverGross'\r\n                                                required\r\n                                                formikProps={formikProps}\r\n                                                items={PriceTypeItemsForAuction}\r\n                                                onChange={(value) => handleUseNetOverGrossChange(formikProps, value)}\r\n                                            />\r\n                                            :\r\n                                            <Select\r\n                                                className={classes.formElement}\r\n                                                disabled\r\n                                                label={Tr('auction_price_type')}\r\n                                                id='priceType'\r\n                                                required\r\n                                                formikProps={formikProps}\r\n                                                items={PriceTypeItems}\r\n                                            />\r\n                                        }\r\n                                        {AuctionRule.JAPANESE !== formikProps.values.rule &&\r\n                                        <>\r\n                                            <Select\r\n                                                className={classes.formElement}\r\n                                                disabled={working}\r\n                                                label={Tr('auction_digital_sign')}\r\n                                                id='digitalSign'\r\n                                                required\r\n                                                formikProps={formikProps}\r\n                                                items={BooleanItems}\r\n                                            />\r\n                                            <TextInput\r\n                                                className={classes.formElement}\r\n                                                disabled={working}\r\n                                                label={Tr('auction_overtime_count')}\r\n                                                id='overtimeCount'\r\n                                                required\r\n                                                formikProps={formikProps}\r\n                                                type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n                                            />\r\n                                            <TextInput\r\n                                                className={classes.formElement}\r\n                                                disabled={working}\r\n                                                label={Tr('auction_overtime')}\r\n                                                id='overtime'\r\n                                                required\r\n                                                formikProps={formikProps}\r\n                                                type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n                                            />\r\n                                        </>\r\n                                        }\r\n                                        <div className={classes.formElement}>\r\n                                            <Typography component='span'>{Tr('auction_price_item_count')}</Typography>:\r\n                                            <Typography component='span'> {formikProps.values.positions[0].priceItemCount}</Typography>\r\n                                            <br/>\r\n                                            <Typography component='span'>{Tr('auction_offer_count')}</Typography>:\r\n                                            <Typography component='span'> {formikProps.values.positions[0].offerCount}</Typography>\r\n                                            <br/>\r\n                                            <Typography component='span'>{Tr('realization_value')}</Typography>:\r\n                                            <Typography\r\n                                                component='span'> {formikProps.values.positions[0].estimatedValue ? formikProps.values.positions[0].estimatedValue.toFixed(2).replace(/[.]/, \",\") : '--'} PLN</Typography>\r\n                                        </div>\r\n                                    </GridBlock>\r\n                                </GridBlock>\r\n\r\n                                <OfferChoiceCreateAuctionTable\r\n                                    demandId={demandId}\r\n                                    items='criterias'\r\n                                    working={working}\r\n                                    formikProps={formikProps}\r\n                                />\r\n\r\n                                <OfferChoiceCreateAuctionTable\r\n                                    demandId={demandId}\r\n                                    items='items'\r\n                                    working={working}\r\n                                    formikProps={formikProps}\r\n                                />\r\n\r\n                            </GridBlock>\r\n                        )}\r\n                    </Form>\r\n                </>}\r\n            </GridBlock>\r\n        </Dialog>)\r\n}\r\n\r\nOfferChoiceCreateAuctionPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    roundId: PropTypes.number.isRequired,\r\n    auctionType: PropTypes.string.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(OfferChoiceCreateAuctionPopup)","import PropTypes from \"prop-types\";\r\nimport React, {useEffect, useMemo, useRef} from \"react\";\r\nimport Tr from 'translations/Translations';\r\nimport {AuctionType} from \"constants/AuctionType\";\r\nimport {AuctionStatus} from \"constants/AuctionStatus\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport {AuctionRule} from \"constants/AuctionRule\";\r\nimport moment from \"libs/moment\";\r\nimport AuctionTypeList from \"./AuctionTypeList\";\r\n\r\n//to widzimy tylko w statusie OFFER_COLLECTION i OFFER_DECRYPTION\r\nfunction AuctionTypePart(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        auctionType,\r\n        auctions,\r\n        buttonWorks,\r\n        setCreatePopupOpened,\r\n        deleteAuction,\r\n        editAuction,\r\n        publishAuction,\r\n        unpublishAuction,\r\n        cancelAuction,\r\n        pauseAuction,\r\n        acceptAuction,\r\n        resumeAuction,\r\n        auctionDetails,\r\n        serverBrowserTimeDiff,\r\n        prodAuctionStatus\r\n    }) {\r\n\r\n    const timeout = useRef(0);\r\n\r\n    useEffect(() => {\r\n        const auction = auctions.length > 0 ? auctions[auctions.length - 1] : null;\r\n        if (auction != null) {\r\n            if (auction.status === AuctionStatus.PENDING) {\r\n                const secondsLeftToStart = moment(auction.startDate).diff(moment(), 's') - serverBrowserTimeDiff.current;\r\n                timeout.current = setTimeout(auctionDetails, (secondsLeftToStart + 2) * 1000, auction)\r\n            } else if (auction.status === AuctionStatus.OPEN || auction.status === AuctionStatus.PAUSED) {\r\n                if (auction.rule === AuctionRule.JAPANESE) {\r\n                    const secondsFromStart = moment().diff(moment(auction.startDate), 's') - serverBrowserTimeDiff.current;\r\n                    const secondsToWindowEnd = Math.ceil(secondsFromStart / auction.decisionTime) + 2;\r\n                    timeout.current = setTimeout(auctionDetails, secondsToWindowEnd * 1000, auction)\r\n                } else {\r\n                    const secondsLeftToEnd = moment(auction.endDate).diff(moment(), 's') - serverBrowserTimeDiff.current;\r\n                    timeout.current = setTimeout(auctionDetails, (secondsLeftToEnd + 2) * 1000, auction)\r\n                }\r\n            }\r\n        }\r\n        return () => {\r\n            if (timeout.current)\r\n                clearTimeout(timeout.current)\r\n        }\r\n    }, [auctions, auctionDetails, serverBrowserTimeDiff])\r\n\r\n\r\n    const getButtons = () => {\r\n        const btns = [];\r\n        const disabled = !editable || working || buttonWorks.anyWorks;\r\n        if (auctions.length > 0) {\r\n            const auction = auctions[auctions.length - 1];\r\n            switch (auction.status) {\r\n                case AuctionStatus.INCOMPLETE:\r\n                    if (auctionType === AuctionType.PROD) {\r\n                        btns.push(createButton(Tr('cancel'), () => cancelAuction(auction), 'outlined', disabled, undefined, buttonWorks.cancel))\r\n                    } else {\r\n                        btns.push(createButton(Tr('delete'), () => deleteAuction(auction), 'outlined', disabled, undefined, buttonWorks.remove))\r\n                    }\r\n                    btns.push(createButton(Tr('edit'), () => editAuction(auction), 'outlined', disabled))\r\n                    btns.push(createButton(Tr('publish'), () => publishAuction(auction), 'contained', disabled, undefined, buttonWorks.publish))\r\n                    break;\r\n                case AuctionStatus.PENDING:\r\n                    btns.push(createButton(Tr('unpublish'), () => unpublishAuction(auction), 'outlined', disabled, undefined, buttonWorks.unpublish))\r\n                    break;\r\n                case AuctionStatus.OPEN:\r\n                    if (auction.rule !== AuctionRule.JAPANESE) {\r\n                        btns.push(createButton(Tr('pause'), () => pauseAuction(auction), 'outlined', disabled, undefined, buttonWorks.pause))\r\n                    }\r\n                    break;\r\n                case AuctionStatus.PAUSED:\r\n                    btns.push(createButton(Tr('cancel'), () => cancelAuction(auction), 'outlined', disabled, undefined, buttonWorks.cancel))\r\n                    btns.push(createButton(Tr('edit'), () => editAuction(auction), 'outlined', disabled))\r\n                    btns.push(createButton(Tr('resume'), () => resumeAuction(auction), 'contained', disabled, undefined, buttonWorks.resume))\r\n                    break;\r\n                case AuctionStatus.FINISHED:\r\n                    if (auctionType === AuctionType.PROD) {\r\n                        btns.push(createButton(Tr('cancel'), () => cancelAuction(auction), 'outlined', disabled, undefined, buttonWorks.cancel))\r\n                        btns.push(createButton(Tr('auction_accept'), () => acceptAuction(auction), 'contained', disabled, undefined, buttonWorks.accept))\r\n                    } else {\r\n                        if (!prodAuctionStatus || prodAuctionStatus === AuctionStatus.CANCELLED) {\r\n                            btns.push(createButton(Tr('auction_create_button'), () => setCreatePopupOpened(auctionType), 'contained', disabled))\r\n                        }\r\n                    }\r\n                    break;\r\n                case AuctionStatus.CANCELLED:\r\n                    if (auctionType === AuctionType.PROD || (!prodAuctionStatus || prodAuctionStatus === AuctionStatus.CANCELLED)) {\r\n                        btns.push(createButton(Tr('auction_create_button'), () => setCreatePopupOpened(auctionType), 'contained', disabled));\r\n                    }\r\n                    break;\r\n                default:\r\n            }\r\n        } else {\r\n            if (auctionType === AuctionType.PROD || (!prodAuctionStatus || prodAuctionStatus === AuctionStatus.CANCELLED)) {\r\n                btns.push(createButton(Tr('auction_create_button'), () => setCreatePopupOpened(auctionType), 'contained', disabled))\r\n            }\r\n        }\r\n        return btns;\r\n    }\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const buttons = useMemo(getButtons, [editable, working, auctionType, auctions, buttonWorks]);\r\n\r\n    return (\r\n        <div>\r\n            <AuctionTypeList auctions={auctions} auctionType={auctionType}/>\r\n            <MultiButton justify='flex-start' buttons={buttons}/>\r\n        </div>)\r\n}\r\n\r\nAuctionTypePart.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    auctionType: PropTypes.string.isRequired,\r\n    auctions: PropTypes.array.isRequired,\r\n    buttonWorks: PropTypes.object.isRequired,\r\n    setCreatePopupOpened: PropTypes.func.isRequired,\r\n    deleteAuction: PropTypes.func.isRequired,\r\n    editAuction: PropTypes.func.isRequired,\r\n    publishAuction: PropTypes.func.isRequired,\r\n    unpublishAuction: PropTypes.func.isRequired,\r\n    cancelAuction: PropTypes.func.isRequired,\r\n    pauseAuction: PropTypes.func.isRequired,\r\n    resumeAuction: PropTypes.func.isRequired,\r\n    auctionDetails: PropTypes.func.isRequired,\r\n    acceptAuction: function (props, propName, componentName) {\r\n        if ((props['auctionType'] === AuctionType.PROD && (props[propName] === undefined || typeof (props[propName]) !== 'function'))) {\r\n            return new Error('Please provide a acceptAuction function!');\r\n        }\r\n    },\r\n    serverBrowserTimeDiff: PropTypes.object.isRequired,\r\n    prodAuctionStatus: function (props, propName, componentName) {\r\n        if ((props['auctionType'] === AuctionType.TEST && (props[propName] !== undefined && typeof (props[propName]) !== 'string'))) {\r\n            return new Error('Please provide a valid prodAuctionStatus string');\r\n        }\r\n    },\r\n\r\n}\r\n\r\nexport default AuctionTypePart;\r\n","import React, {useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport AuctionService from \"services/AuctionService\";\r\nimport {AuctionRule} from \"constants/AuctionRule\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport moment from \"libs/moment\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport {AuctionStatus} from \"constants/AuctionStatus\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    title: {\r\n        marginTop: 0\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    },\r\n    bold: {\r\n        fontWeight: theme.typography.fontWeightBold\r\n    },\r\n    formElement: {\r\n        width: 400\r\n    },\r\n}));\r\n\r\n\r\nconst EditDatesAuctionPopup = (\r\n    {\r\n        demandId,\r\n        offerChoiceRow,\r\n        onCancel,\r\n        onSuccess,\r\n        roundId,\r\n        auction,\r\n        formSubmit,\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [error, setError] = useState(null);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = (values) => {\r\n        setError(null);\r\n        setWorking(true);\r\n        AuctionService.editDates(demandId, roundId, values).then((resp) => {\r\n            if(isResponseValid(resp, setError)) {\r\n                OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n                onSuccess();\r\n            } else {\r\n                setWorking(false);\r\n            }\r\n        }).catch(() => {\r\n            setError(Tr('unknown_error_message'));\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    const handleEndDate = (formikProps, value) => {\r\n        formikProps.setFieldValue('endDate', value);\r\n        formikProps.setFieldTouched('endDate', true);\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('auction_update_dates_button'), handleSubmit, undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    const validationSchema = VS.lazy((value) => {\r\n        const shape = {\r\n        }\r\n        if(value.status !== AuctionStatus.PAUSED) {\r\n            shape.startDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n        }\r\n\r\n        if (AuctionRule.JAPANESE !== value.rule) {\r\n            shape.endDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'))\r\n                .when('startDate', (startDate, schema) => {\r\n                    return schema.test('EndDateLessStartDate', Tr(\"EndDateLessStartDate\"), (endDate) => {\r\n                        if (startDate && endDate) {\r\n                            return endDate.isAfter(startDate);\r\n                        }\r\n                        return false;\r\n                    })\r\n                })\r\n        } else {\r\n            shape.decisionTime = VS.integerMax(99999)\r\n        }\r\n        return VS.object(shape);\r\n    })\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('auction_create_popup_title')}\r\n            maxWidth='sm'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n\r\n                {working && <Loading/>}\r\n                {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n\r\n                <Form\r\n                    initialValues={{\r\n                        ...auction,\r\n                        startDate: moment(auction.startDate),\r\n                        endDate: auction.endDate ? moment(auction.endDate) : null\r\n                    }}\r\n                    validationSchema={validationSchema}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock\r\n                            column\r\n                        >\r\n                            <DateTimePicker\r\n                                className={classes.formElement}\r\n                                id='startDate'\r\n                                label={Tr('auction_start_date')}\r\n                                formikProps={formikProps}\r\n                                disabled={working || auction.status === AuctionStatus.PAUSED}\r\n                                onChange={(value) => handleEndDate(formikProps, value)}\r\n                                minDate={new Date()}\r\n                            />\r\n\r\n                            {AuctionRule.JAPANESE === formikProps.values.rule ?\r\n                                <TextInput\r\n                                    className={classes.formElement}\r\n                                    disabled={working}\r\n                                    label={Tr('auction_decision_time')}\r\n                                    id='decisionTime'\r\n                                    required\r\n                                    formikProps={formikProps}\r\n                                    type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n                                />\r\n                                :\r\n                                <DateTimePicker\r\n                                    className={classes.formElement}\r\n                                    id='endDate'\r\n                                    label={Tr('auction_end_date')}\r\n                                    formikProps={formikProps}\r\n                                    disabled={working}\r\n                                    minDate={new Date()}\r\n                                />\r\n                            }\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n            </GridBlock>\r\n        </Dialog>)\r\n}\r\n\r\nEditDatesAuctionPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    offerChoiceRow: PropTypes.object.isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    roundId: PropTypes.number.isRequired,\r\n    auction: PropTypes.object.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(EditDatesAuctionPopup)","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport Typography from \"components/Typography\";\r\nimport BoldTypography from \"../../../../../../../../../components/BoldTypography\";\r\n\r\nexport const createConfirmAuctionCfg = (auction, sendEmail, onConfirm, message, confirmButtonLabel) => ({\r\n    auction, sendEmail, onConfirm, message, confirmButtonLabel\r\n})\r\n\r\nfunction ConfirmAuction(\r\n    {\r\n        cfg,\r\n        onCancel\r\n    }) {\r\n\r\n    const [sendEmail, setSendEmail] = useState(cfg.sendEmail);\r\n\r\n    const onConfirm = () => {\r\n        const data= {\r\n            auctionId: cfg.auction.auctionId,\r\n        }\r\n        if(sendEmail !== undefined)\r\n            data.sendEmail = sendEmail;\r\n\r\n        cfg.onConfirm(data)\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('attention')}\r\n            open\r\n            titleCentered\r\n            maxWidth='xs'\r\n            onClose={onCancel}\r\n\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr(cfg.confirmButtonLabel)}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={onConfirm}\r\n            />}\r\n        >\r\n            <BoldTypography>{Tr(cfg.message)}</BoldTypography>\r\n            {\r\n                sendEmail !== undefined && <>\r\n                <br/>\r\n                <Typography>{Tr('auction_send_email_label')}</Typography>\r\n                <SimpleSelect\r\n                    onChange={(event) => setSendEmail(event.target.value)}\r\n                    items={BooleanItems}\r\n                    value={sendEmail}\r\n                />\r\n                </>\r\n            }\r\n\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nConfirmAuction.propTypes = {\r\n    onCancel: PropTypes.func.isRequired,\r\n    cfg: PropTypes.shape({\r\n        auction: PropTypes.object.isRequired,\r\n        sendEmail: PropTypes.bool,\r\n        onConfirm: PropTypes.func.isRequired,\r\n        message: PropTypes.string.isRequired,\r\n        confirmButtonLabel: PropTypes.string.isRequired,\r\n    })\r\n}\r\n\r\nexport default ConfirmAuction;","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport Title from 'components/Title';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Button from 'components/Button';\r\nimport clsx from 'clsx';\r\nimport Dialog from 'components/Dialog';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t},\r\n\ticon: {\r\n\t\tfontSize: theme.components.icon.fontSize,\r\n\t},\r\n\tpadding: {\r\n\t\tpaddingTop: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction SaveDialogBase({\r\n\tclasses,\r\n\tonClose,\r\n\tchildren,\r\n\ttitle,\r\n\tIcon,\r\n\ticonClassName,\r\n}) {\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\topen={true}\r\n\t\t\tclassName={classes.root}\r\n\t\t\ttransitionDuration={{ enter: 0 }}\r\n\t\t\tfullWidth={false}\r\n\t\t\tonClose={onClose}\r\n\t\t>\r\n\t\t\t<GridBlock justify='center' alignItems=\"center\" className={classes.padding} direction=\"column\">\r\n\t\t\t\t<Icon color='primary' className={clsx(classes.icon, iconClassName)} />\r\n\t\t\t\t<Title>{title}</Title>\r\n\t\t\t</GridBlock>\r\n\r\n\t\t\t{children}\r\n\r\n\t\t\t<GridBlock justify='center' className={classes.padding}>\r\n\t\t\t\t<Button onClick={onClose}> {Tr('close')} </Button>\r\n\t\t\t</GridBlock>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nSaveDialogBase.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tonClose: PropTypes.func,\r\n}\r\n\r\nSaveDialogBase.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(SaveDialogBase);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport Typography from \"components/Typography\";\r\nimport HighlightOffIcon from \"@material-ui/icons/HighlightOff\";\r\nimport SaveDialogBase from \"components/popup/save/SaveDialogBase\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    icon: {\r\n        color: theme.palette.common.error,\r\n    }\r\n}))\r\n\r\nfunction AuctionSaveError(\r\n    {\r\n        message,\r\n        onClose\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <SaveDialogBase\r\n            onClose={onClose}\r\n            title={Tr('failure')}\r\n            Icon={HighlightOffIcon}\r\n            iconClassName={classes.icon}\r\n        >\r\n            <Typography variant='body1'>\r\n                {message}\r\n            </Typography>\r\n        </SaveDialogBase>\r\n    )\r\n}\r\n\r\nAuctionSaveError.propTypes = {\r\n    message: PropTypes.string.isRequired,\r\n    onClose: PropTypes.func.isRequired\r\n}\r\n\r\nexport default AuctionSaveError;","import PropTypes from \"prop-types\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport React, {useCallback, useMemo, useReducer, useState} from \"react\";\r\nimport OfferChoiceCreateAuctionPopup from \"./OfferChoiceCreateAuctionPopup\";\r\nimport {AuctionType} from \"constants/AuctionType\";\r\nimport AuctionTypePart from \"./AuctionTypePart\";\r\nimport EditDatesAuctionPopup from \"./EditDatesAuctionPopup\";\r\nimport AuctionService from \"services/AuctionService\";\r\nimport ConfirmAuction, {createConfirmAuctionCfg} from \"./ConfirmAuction\";\r\nimport AuctionSaveError from \"./AuctionSaveError\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport redirectUsingPOST from \"libs/redirectUsingPOST\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    inviteButton: {\r\n        float: 'right',\r\n        marginTop: theme.spacing()\r\n    }\r\n}));\r\n\r\n//to widzimy tylko w statusie OFFER_COLLECTION i OFFER_DECRYPTION\r\nfunction OfferChoiceSummaryCellAuction(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        rowWorking,\r\n        offerChoiceRow,\r\n        refreshRow,\r\n        serverBrowserTimeDiff\r\n    }) {\r\n    const classes = useStyles();\r\n    const currentAdditionalRoundInfo = useMemo(() => offerChoiceRow.currentAdditionalRoundInfo, [offerChoiceRow]);\r\n    const [createPopupAuctionType, setCreatePopupAuctionType] = useState(null);\r\n    const [editPopupAuction, setEditPopupAuction] = useState(null);\r\n    const [auctionError, setAuctionError] = useState(null);\r\n    const [confirmCfg, setConfirmCfg] = useState(null);\r\n    const [downloadInvitationWorking, setDownloadInvitationWorking] = useState(null);\r\n\r\n    const [prodButtonWorks, dispatchProdButtonWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        publish: false,\r\n        unpublish: false,\r\n        remove: false,\r\n        cancel: false,\r\n        pause: false,\r\n        accept: false,\r\n        resume: false\r\n    });\r\n    const [testButtonWorks, dispatchTestButtonWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        publish: false,\r\n        unpublish: false,\r\n        remove: false,\r\n        cancel: false,\r\n        pause: false,\r\n        accept: false,\r\n        resume: false\r\n    });\r\n\r\n    const dispatchButtonWorks = (auction, type, works) => {\r\n        if (auction.type === AuctionType.PROD) {\r\n            dispatchProdButtonWorks({type, works})\r\n        } else {\r\n            dispatchTestButtonWorks({type, works})\r\n        }\r\n    }\r\n\r\n    const {prod, test} = useMemo(() => currentAdditionalRoundInfo.auctions.reduce((prev, cur) => {\r\n        if (cur.type === AuctionType.PROD)\r\n            prev.prod.push(cur);\r\n        else\r\n            prev.test.push(cur);\r\n        return prev;\r\n    }, {prod: [], test: []}), [currentAdditionalRoundInfo]);\r\n\r\n\r\n    const deleteAuction = useCallback((auction, confirmed, values) => {\r\n        if (confirmed) {\r\n            dispatchButtonWorks(auction, 'remove', true)\r\n            setConfirmCfg(null);\r\n            AuctionService.remove(demandId, currentAdditionalRoundInfo.roundId, values).then((resp) => {\r\n                if (isResponseValid(resp, setAuctionError)) {\r\n                    OfferChoiceService.removeAuctionFromAdditionalRoundInfo(offerChoiceRow.identity, auction);\r\n                }\r\n            }).finally(() => dispatchButtonWorks(auction, 'remove', false));\r\n        } else {\r\n            const callback = (auction, confirmed) => (values) => deleteAuction(auction, confirmed, values)\r\n            setConfirmCfg(createConfirmAuctionCfg(auction, undefined, callback(auction, true), \"auction_delete_confirm\", \"delete\"));\r\n        }\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const editAuction = useCallback((auction) => {\r\n        setEditPopupAuction(auction);\r\n    }, []);\r\n\r\n    const publishAuction = useCallback((auction, confirmed, values) => {\r\n        if (confirmed) {\r\n            dispatchButtonWorks(auction, 'publish', true)\r\n            setConfirmCfg(null);\r\n            AuctionService.publish(demandId, currentAdditionalRoundInfo.roundId, values).then((resp) => {\r\n                if (isResponseValid(resp, setAuctionError)) {\r\n                    OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n                }\r\n            }).finally(() => dispatchButtonWorks(auction, 'publish', false));\r\n        } else {\r\n            const callback = (auction, confirmed) => (values) => publishAuction(auction, confirmed, values)\r\n            setConfirmCfg(createConfirmAuctionCfg(auction, true, callback(auction, true), \"auction_publish_confirm\", \"publish\"));\r\n        }\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const resumeAuction = useCallback((auction, confirmed, values) => {\r\n        if (confirmed) {\r\n            dispatchButtonWorks(auction, 'resume', true)\r\n            setConfirmCfg(null);\r\n            AuctionService.resume(demandId, currentAdditionalRoundInfo.roundId, values).then((resp) => {\r\n                if (isResponseValid(resp, setAuctionError)) {\r\n                    OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n                }\r\n            }).finally(() => dispatchButtonWorks(auction, 'resume', false));\r\n        } else {\r\n            const callback = (auction, confirmed) => (values) => resumeAuction(auction, confirmed, values)\r\n            setConfirmCfg(createConfirmAuctionCfg(auction, true, callback(auction, true), \"auction_resume_confirm\", \"resume\"));\r\n        }\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const unpublishAuction = useCallback((auction, confirmed, values) => {\r\n        if (confirmed) {\r\n            dispatchButtonWorks(auction, 'unpublish', true)\r\n            setConfirmCfg(null);\r\n            AuctionService.unpublish(demandId, currentAdditionalRoundInfo.roundId, values).then((resp) => {\r\n                if (isResponseValid(resp, setAuctionError)) {\r\n                    OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n                }\r\n            }).finally(() => dispatchButtonWorks(auction, 'unpublish', false));\r\n        } else {\r\n            const callback = (auction, confirmed) => (values) => unpublishAuction(auction, confirmed, values)\r\n            setConfirmCfg(createConfirmAuctionCfg(auction, true, callback(auction, true), \"auction_unpublish_confirm\", \"unpublish\"));\r\n        }\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const cancelAuction = useCallback((auction, confirmed, values) => {\r\n        if (confirmed) {\r\n            dispatchButtonWorks(auction, 'cancel', true)\r\n            setConfirmCfg(null);\r\n            AuctionService.cancel(demandId, currentAdditionalRoundInfo.roundId, values).then((resp) => {\r\n                if (isResponseValid(resp, setAuctionError)) {\r\n                    OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n                }\r\n            }).finally(() => dispatchButtonWorks(auction, 'cancel', false));\r\n        } else {\r\n            const callback = (auction, confirmed) => (values) => cancelAuction(auction, confirmed, values)\r\n            setConfirmCfg(createConfirmAuctionCfg(auction, undefined, callback(auction, true), \"auction_cancel_confirm\", \"auction_cancel\"));\r\n        }\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const pauseAuction = useCallback((auction, confirmed, values) => {\r\n        if (confirmed) {\r\n            dispatchButtonWorks(auction, 'pause', true)\r\n            setConfirmCfg(null);\r\n            AuctionService.pause(demandId, currentAdditionalRoundInfo.roundId, values).then((resp) => {\r\n                if (isResponseValid(resp, setAuctionError)) {\r\n                    OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n                }\r\n            }).finally(() => dispatchButtonWorks(auction, 'pause', false));\r\n        } else {\r\n            const callback = (auction, confirmed) => (values) => pauseAuction(auction, confirmed, values)\r\n            setConfirmCfg(createConfirmAuctionCfg(auction, true, callback(auction, true), \"auction_pause_confirm\", \"pause\"));\r\n        }\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const acceptAuction = useCallback((auction) => {\r\n\r\n        dispatchButtonWorks(auction, 'accept', true);\r\n        AuctionService.accept(demandId, currentAdditionalRoundInfo.roundId, auction.auctionId).then((resp) => {\r\n            if (isResponseValid(resp, setAuctionError)) {\r\n                redirectUsingPOST(resp.result);\r\n            }\r\n        }).finally(() => dispatchButtonWorks(auction, 'accept', false));\r\n\r\n\r\n    }, [demandId, currentAdditionalRoundInfo]);\r\n\r\n    const auctionDetails = useCallback((auction) => {\r\n        AuctionService.details(demandId, currentAdditionalRoundInfo.roundId, auction.auctionId).then((resp) => {\r\n            if (isResponseValid(resp, setAuctionError)) {\r\n                OfferChoiceService.updateAuctionInAdditionalRoundInfo(offerChoiceRow.identity, resp.result);\r\n            }\r\n        })\r\n    }, [demandId, currentAdditionalRoundInfo, offerChoiceRow]);\r\n\r\n    const downloadAuctionInvitation = () => {\r\n        setDownloadInvitationWorking(true);\r\n        AuctionService.downloadAuctionInvitation(demandId, currentAdditionalRoundInfo.roundId, () => setDownloadInvitationWorking(false));\r\n    }\r\n\r\n\r\n    return (<GridBlock\r\n        column\r\n        justify='space-between'\r\n        alignItems='center'\r\n    >\r\n        <AuctionTypePart\r\n            demandId={demandId}\r\n            editable={editable}\r\n            working={working || rowWorking}\r\n            auctionType={AuctionType.PROD}\r\n            auctions={prod}\r\n            buttonWorks={prodButtonWorks}\r\n            setCreatePopupOpened={setCreatePopupAuctionType}\r\n            acceptAuction={acceptAuction}\r\n            cancelAuction={cancelAuction}\r\n            deleteAuction={deleteAuction}\r\n            editAuction={editAuction}\r\n            pauseAuction={pauseAuction}\r\n            publishAuction={publishAuction}\r\n            unpublishAuction={unpublishAuction}\r\n            resumeAuction={resumeAuction}\r\n            auctionDetails={auctionDetails}\r\n            serverBrowserTimeDiff={serverBrowserTimeDiff}\r\n        />\r\n        <br/>\r\n        <AuctionTypePart\r\n            demandId={demandId}\r\n            editable={editable}\r\n            working={working || rowWorking}\r\n            auctionType={AuctionType.TEST}\r\n            auctions={test}\r\n            buttonWorks={testButtonWorks}\r\n            setCreatePopupOpened={setCreatePopupAuctionType}\r\n            cancelAuction={cancelAuction}\r\n            deleteAuction={deleteAuction}\r\n            editAuction={editAuction}\r\n            pauseAuction={pauseAuction}\r\n            publishAuction={publishAuction}\r\n            unpublishAuction={unpublishAuction}\r\n            resumeAuction={resumeAuction}\r\n            auctionDetails={auctionDetails}\r\n            serverBrowserTimeDiff={serverBrowserTimeDiff}\r\n            prodAuctionStatus={prod.length > 0 ? prod[prod.length - 1].status : undefined}\r\n        />\r\n\r\n        {editable && prod.filter(a => a.status === 'INCOMPLETE').length > 0 && <WorkableButton\r\n            className={classes.inviteButton}\r\n            working={downloadInvitationWorking}\r\n            variant='text'\r\n            disabled={working || rowWorking}\r\n            onClick={downloadAuctionInvitation}\r\n        >{Tr('auction_invitation_button')}</WorkableButton>\r\n        }\r\n\r\n        {\r\n            !!createPopupAuctionType && <OfferChoiceCreateAuctionPopup\r\n                demandId={demandId}\r\n                onSuccess={(auction) => {\r\n                    OfferChoiceService.addAuctionToAdditionalRoundInfo(offerChoiceRow.identity, auction);\r\n                    setCreatePopupAuctionType(null);\r\n                }}\r\n                onCancel={() => setCreatePopupAuctionType(null)}\r\n                auctionType={createPopupAuctionType}\r\n                roundId={currentAdditionalRoundInfo.roundId}\r\n            />\r\n        }\r\n        {\r\n            !!editPopupAuction && <EditDatesAuctionPopup\r\n                demandId={demandId}\r\n                roundId={currentAdditionalRoundInfo.roundId}\r\n                offerChoiceRow={offerChoiceRow}\r\n                onSuccess={() => setEditPopupAuction(null)}\r\n                onCancel={() => setEditPopupAuction(null)}\r\n                auction={editPopupAuction}\r\n            />\r\n        }\r\n        {\r\n            !!confirmCfg && <ConfirmAuction onCancel={() => setConfirmCfg(null)} cfg={confirmCfg}/>\r\n        }\r\n        {\r\n            !!auctionError && <AuctionSaveError onClose={() => setAuctionError(null)} message={auctionError}/>\r\n        }\r\n\r\n    </GridBlock>)\r\n}\r\n\r\nOfferChoiceSummaryCellAuction.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    rowWorking: PropTypes.bool.isRequired,\r\n    offerChoiceRow: PropTypes.object.isRequired,\r\n    refreshRow: PropTypes.func.isRequired,\r\n    serverBrowserTimeDiff: PropTypes.object.isRequired,\r\n}\r\n\r\nexport default OfferChoiceSummaryCellAuction;\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const OfferChoiceState = {\r\n    NEW: \"NEW\",\r\n    PENDING: \"PENDING\",\r\n    ACCEPTED: \"ACCEPTED\",\r\n    REJECTED: \"REJECTED\"\r\n}\r\nconst _TR_PREFIX = 'offer_choice_state_';\r\n\r\nexport const OfferChoiceStateLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\nconst _DECISION_STATES = [OfferChoiceState.ACCEPTED, OfferChoiceState.PENDING];\r\nexport const isOfferChoiceStateWithDecision = (status) => (_DECISION_STATES.indexOf(status) > -1);\r\n","import {useMemo, useRef, useState} from \"react\";\r\nimport {makeStyles, TableCell, TableRow, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from \"clsx\";\r\nimport OfferChoiceContractorRowPart from \"./OfferChoiceContractorRowPart\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport OfferChoiceSummaryCell from \"./OfferChoiceSummaryCell\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport {AdditionalRoundStatusesPending} from \"constants/AdditionalRoundStatus\";\r\nimport OfferChoiceSummaryCellAdditionalRound from \"./additionalRound/OfferChoiceSummaryCellAdditionalRound\";\r\nimport PropTypes from 'prop-types';\r\nimport OfferChoiceSummaryCellAuction from \"./auction/OfferChoiceSummaryCellAuction\";\r\nimport moment from \"libs/moment\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport {isOfferChoiceStateWithDecision} from \"../constants/OfferChoiceState\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    italic: {\r\n        fontStyle: 'italic',\r\n        userSelect: 'none'\r\n    },\r\n    evenRow: {\r\n        backgroundColor: theme.palette.background.default\r\n    },\r\n    lastRow: {\r\n        borderBottom: `solid 3px ${theme.palette.primary.main}`\r\n    },\r\n    choiceSize: {\r\n        \"& .MuiInput-root\": {\r\n            fontSize: theme.typography.body2.fontSize,\r\n            color: theme.palette.text.primary\r\n        }\r\n    },\r\n    choiceStatus: {\r\n        marginBottom: theme.spacing()\r\n    },\r\n    choiceControls: {\r\n        marginTop: theme.spacing(2),\r\n        textAlign: 'center'\r\n    },\r\n    choiceControlsEnd: {\r\n        textAlign: 'end'\r\n    },\r\n    noOffer: {\r\n        textAlign: 'center',\r\n        fontSize: '1.5rem'\r\n    }\r\n}));\r\n\r\nfunction OfferChoiceRow(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceRow,\r\n        rowNumber,\r\n        updateStatus,\r\n        modifyChoice,\r\n\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const even = rowNumber % 2 === 1;\r\n    const serverBrowserTimeDiff = useRef(moment(offerChoiceRow.serverTime).diff(moment(), \"s\"));\r\n\r\n    const [chosenSuppliers, setChosenSuppliers] = useState(offerChoiceRow.offerChoices.filter(x => x.chosen).map(x => x.identity));\r\n    const [chosenStatusDone, setChosenStatusDone] = useState(isOfferChoiceStateWithDecision(offerChoiceRow.state));\r\n    const [curWorking, setCurWorking] = useState(false);\r\n    const maxPartScore = useMemo(() => offerChoiceRow.offerChoices.reduce((prev, cur) => prev < cur.offerScore ? cur.offerScore : prev, 0), [offerChoiceRow]);\r\n\r\n    const refreshRow = async (sectionsToRefresh) => {\r\n        setCurWorking(true);\r\n        await OfferChoiceService.updatePosition(demandId, offerChoiceRow.identity, sectionsToRefresh).finally(() => setCurWorking(false));\r\n    };\r\n\r\n    const chooseSupplier = (supplier) => {\r\n        const index = chosenSuppliers.indexOf(supplier.identity);\r\n        if (index > -1) {\r\n            setChosenSuppliers(chosenSuppliers.filter(x => x !== supplier.identity));\r\n        } else {\r\n            if (chosenSuppliers.length < offerChoiceRow.maxOfferChoiceCount) {\r\n                setChosenSuppliers([...chosenSuppliers, supplier.identity]);\r\n            }\r\n        }\r\n    }\r\n\r\n    const doUpdateStatus = async (positionId, canceled, chosenSupplierIds, offerChoiceDate, offerChoiceJustification) => {\r\n        setCurWorking(true);\r\n        try {\r\n            await updateStatus(positionId, canceled, chosenSupplierIds, offerChoiceDate, offerChoiceJustification);\r\n\r\n        } finally {\r\n            setCurWorking(false);\r\n        }\r\n    }\r\n\r\n    const doModifyChoice = async (positionId) => {\r\n        setCurWorking(true);\r\n        try {\r\n            await modifyChoice(positionId);\r\n        } finally {\r\n            setCurWorking(false);\r\n        }\r\n    }\r\n\r\n    const isAdditionalOffers = useMemo(() => !!offerChoiceRow.currentAdditionalRoundInfo &&\r\n        offerChoiceRow.currentAdditionalRoundInfo.type === RoundType.ADDITIONAL_OFFERS &&\r\n        AdditionalRoundStatusesPending.indexOf(offerChoiceRow.currentAdditionalRoundInfo.status) > -1\r\n        , [offerChoiceRow]);\r\n\r\n    const isAuction = useMemo(() => !!offerChoiceRow.currentAdditionalRoundInfo &&\r\n        offerChoiceRow.currentAdditionalRoundInfo.type === RoundType.AUCTION &&\r\n        AdditionalRoundStatusesPending.indexOf(offerChoiceRow.currentAdditionalRoundInfo.status) > -1\r\n        , [offerChoiceRow]);\r\n\r\n    const disabledInputs = working || chosenStatusDone || !editable || curWorking || isAdditionalOffers || isAuction;\r\n\r\n    const getRow = (element, index, array) => {\r\n        const noOffer = element.identity === -1;\r\n        const first = index === 0;\r\n        const last = index >= array.length - 1;\r\n\r\n        const rowSpan = noOffer ? 1 : array.length;\r\n        return (<TableRow key={element.identity} className={clsx({[classes.evenRow]: even, [classes.lastRow]: last})}>\r\n            {first && <TableCell className={classes.partColumn} rowSpan={rowSpan}>\r\n                <Typography className={classes.italic} variant=\"body2\">\r\n                    {Tr(`offer_evaluation_mode_title_position`, {value: offerChoiceRow.order})}\r\n                </Typography>\r\n                <Typography variant=\"body2\">\r\n                    {offerChoiceRow.name}\r\n                </Typography>\r\n            </TableCell>}\r\n\r\n            {noOffer ?\r\n                <TableCell className={classes.noOffer} colSpan={4}>\r\n                    <BoldTypography>{Tr('offer_status_noOffer')}</BoldTypography>\r\n                </TableCell>\r\n                :\r\n                <OfferChoiceContractorRowPart\r\n                    editable={!disabledInputs}\r\n                    chosen={chosenSuppliers.indexOf(element.identity) > -1}\r\n                    chooseSupplierCountReached={chosenSuppliers.length >= offerChoiceRow.maxOfferChoiceCount}\r\n                    offerChoiceContractor={element}\r\n                    offerChoiceRow={offerChoiceRow}\r\n                    chooseSupplier={chooseSupplier}\r\n                    maxPartScore={maxPartScore}\r\n                />}\r\n\r\n            {first &&\r\n            <TableCell className={classes.scoreTotalColumn} rowSpan={rowSpan}>\r\n\r\n\r\n                {isAdditionalOffers && <OfferChoiceSummaryCellAdditionalRound\r\n                    demandId={demandId}\r\n                    working={working}\r\n                    rowWorking={curWorking}\r\n                    setRowWorking={setCurWorking}\r\n                    editable={editable}\r\n                    refreshRow={refreshRow}\r\n                    serverBrowserTimeDiff={serverBrowserTimeDiff}\r\n                    roundName={offerChoiceRow.name}\r\n                    additionalRoundId={offerChoiceRow.currentAdditionalRoundInfo.roundId}\r\n                    additionalRoundStatus={offerChoiceRow.currentAdditionalRoundInfo.status}\r\n                    additionalRoundEndDate={offerChoiceRow.currentAdditionalRoundInfo.endDate}\r\n                    additionalRoundOpenOfferDate={offerChoiceRow.currentAdditionalRoundInfo.openOfferDate}\r\n                />}\r\n\r\n                {isAuction && <OfferChoiceSummaryCellAuction\r\n                    demandId={demandId}\r\n                    working={working}\r\n                    rowWorking={curWorking}\r\n                    setRowWorking={setCurWorking}\r\n                    offerChoiceRow={offerChoiceRow}\r\n                    editable={editable}\r\n                    refreshRow={refreshRow}\r\n                    serverBrowserTimeDiff={serverBrowserTimeDiff}\r\n                />}\r\n\r\n                {!isAdditionalOffers && !isAuction && <OfferChoiceSummaryCell\r\n                    demandId={demandId}\r\n                    rowWorking={curWorking}\r\n                    setRowWorking={setCurWorking}\r\n                    working={working}\r\n                    offerChoiceRow={offerChoiceRow}\r\n                    editable={editable}\r\n                    chosenStatusDone={chosenStatusDone}\r\n                    setChosenStatusDone={setChosenStatusDone}\r\n                    chosenSuppliers={chosenSuppliers}\r\n                    updateStatus={doUpdateStatus}\r\n                    modifyChoice={doModifyChoice}\r\n                />}\r\n            </TableCell>\r\n            }\r\n        </TableRow>)\r\n    }\r\n\r\n\r\n    return (offerChoiceRow.offerChoices.length > 0 ?\r\n            offerChoiceRow.offerChoices.map((element, index, array) => getRow(element, index, array))\r\n            :\r\n            getRow({identity: -1}, 0, [])\r\n    )\r\n}\r\n\r\nOfferChoiceRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    offerChoiceRow: PropTypes.object.isRequired,\r\n    rowNumber: PropTypes.number.isRequired,\r\n    updateStatus: PropTypes.func.isRequired,\r\n    modifyChoice: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default OfferChoiceRow;\r\n\r\n","import React from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport OfferChoiceRow from \"./OfferChoiceRow\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        border: `solid 3px ${theme.palette.background.paper}`,\r\n        \"& .MuiTableCell-root\": {\r\n            border: `solid 1px ${theme.palette.border.dark}`,\r\n            padding: theme.spacing()\r\n        }\r\n    },\r\n    headRow: {\r\n        \"&>.MuiTableCell-head\": {\r\n            textAlign: \"center\",\r\n            borderBottom: `solid 3px ${theme.palette.primary.main}`\r\n        }\r\n    },\r\n    partColumn: {\r\n        width: 200\r\n    },\r\n    contractorColumn: {\r\n        width: 250\r\n    },\r\n    valueColumn: {\r\n        width: 105\r\n    },\r\n    scoreColumn: {\r\n        width: 100\r\n    },\r\n    checkColumn: {\r\n        width: 20\r\n    }\r\n\r\n}));\r\n\r\nfunction OfferChoiceTable(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceList,\r\n        updateStatus,\r\n        modifyChoice,\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    return (<Table className={classes.table}>\r\n        <TableHead>\r\n            <TableRow className={classes.headRow}>\r\n                <TableCell className={classes.partColumn}>{Tr(\"part\")}</TableCell>\r\n                <TableCell className={classes.contractorColumn}>{Tr(\"contractor\")}</TableCell>\r\n                <TableCell className={classes.valueColumn}>{Tr(\"offer_value\")}</TableCell>\r\n                <TableCell className={classes.scoreColumn}>{Tr(\"score\")}</TableCell>\r\n                <TableCell className={classes.checkColumn}></TableCell>\r\n                <TableCell className={classes.statusColumn}></TableCell>\r\n            </TableRow>\r\n        </TableHead>\r\n        <TableBody>\r\n            {\r\n                offerChoiceList.items.map((element, index) => {\r\n                    const key = \"\" + element.identity + element.canceled + element.editable;\r\n                    return <OfferChoiceRow\r\n                        key={key}\r\n                        demandId={demandId}\r\n                        updateStatus={updateStatus}\r\n                        modifyChoice={modifyChoice}\r\n                        offerChoiceRow={element}\r\n                        rowNumber={index}\r\n                        working={working}\r\n                        editable={editable}\r\n                    />\r\n                })\r\n            }\r\n        </TableBody>\r\n    </Table>)\r\n}\r\n\r\nOfferChoiceTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    offerChoiceList: PropTypes.object.isRequired,\r\n    updateStatus: PropTypes.func.isRequired,\r\n    modifyChoice: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default OfferChoiceTable;\r\n\r\n","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport SingleButton from \"../components/SingleButton\";\r\n\r\nfunction Alert(\r\n    {\r\n        title = 'attention',\r\n        open,\r\n        confirmText,\r\n        confirmText2,\r\n        maxWidth= 'xs',\r\n        onClose,\r\n        buttonText = Tr('close'),\r\n        translateTexts = false\r\n    }) {\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(title)}\r\n            open={open}\r\n            titleCentered\r\n            maxWidth={maxWidth}\r\n            onClose={onClose}\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={buttonText}\r\n                onClick={onClose}\r\n            />}\r\n        >\r\n            {!!confirmText && <Typography variant='body1'>\r\n                {translateTexts ? Tr(confirmText) : confirmText}\r\n            </Typography>}\r\n            {!!confirmText2 && <Typography variant='body1'>\r\n                {translateTexts ? Tr(confirmText2) : confirmText2}\r\n            </Typography>}\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAlert.propTypes = {\r\n    classes: PropTypes.any,\r\n    open: PropTypes.bool.isRequired,\r\n    confirmText: PropTypes.string.isRequired,\r\n    confirmText2: PropTypes.string,\r\n    onClose: PropTypes.func.isRequired,\r\n    buttonText: PropTypes.string,\r\n    translateTexts: PropTypes.bool\r\n}\r\n\r\nexport default Alert;","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport * as Yup from \"yup\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport DatePicker from 'components/DatePicker';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    cells: {\r\n        padding: theme.spacing()\r\n    },\r\n    partColumn: {\r\n        width: 75\r\n    }\r\n}));\r\n\r\n\r\nconst OfferChoiceCancelWhereNoOffersPopup = (\r\n    {\r\n        demandId,\r\n        onCancel,\r\n        onSuccess,\r\n        formSubmit\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [positionsWithNoOffer, setPositionsWithNoOffer] = useState(null);\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(false);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = (values) => {\r\n        setError(false);\r\n        setWorking(true);\r\n        OfferChoiceService.cancelPositionsWithNoOffer(demandId, values).then(onSuccess).catch(() => {\r\n            setError(true);\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    useEffect(() => {\r\n        OfferChoiceService.getPositionsWithNoOffer(demandId).then(resp => setPositionsWithNoOffer(resp)).finally(() => setWorking(false));\r\n    }, [demandId])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('invalidate_parts'), handleSubmit, undefined, working || !positionsWithNoOffer?.positions.length));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('invalidate_parts_no_offers')}\r\n            maxWidth='md'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                {working && <Loading/>}\r\n                {error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{Tr('unknown_error_message')}</TypographyWithIcon>}\r\n                {!!positionsWithNoOffer && <>\r\n\r\n                    <Form\r\n                        initialValues={{\r\n                            offerChoiceDate: null,\r\n                            offerChoiceJustification: Tr('offer_choice_invalidate_no_offers_message')\r\n                        }}\r\n                        validationSchema={Yup.object().shape({\r\n                            offerChoiceDate: VS.dateTimeValid(),\r\n                            offerChoiceJustification: VS.stringNoRq(),\r\n                        })}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <>\r\n                                <DatePicker\r\n                                    id='offerChoiceDate'\r\n                                    label={Tr('choice_date')}\r\n                                    formikProps={formikProps}\r\n                                    disabled={working || !positionsWithNoOffer?.positions.length}\r\n                                />\r\n                                <TextInput\r\n                                    id='offerChoiceJustification'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('choice_justification')}\r\n                                    disabled={working || !positionsWithNoOffer?.positions.length}\r\n                                    multiline\r\n                                />\r\n                            </>\r\n                        )}\r\n                    </Form>\r\n\r\n                    {\r\n                        !(positionsWithNoOffer?.positions.length) ?\r\n                            <BoldTypography variant='body1'>\r\n                                {Tr('invalidate_parts_no_offers_list_empty')}\r\n                            </BoldTypography>\r\n                            :\r\n                            <>\r\n                                <BoldTypography variant='body1'>\r\n                                    {Tr('invalidate_parts_no_offers_list')} ({positionsWithNoOffer.positions.length}):\r\n                                </BoldTypography>\r\n                                {\r\n                                    <SimpleTable\r\n                                        headers={[\r\n                                            Tr('part'),\r\n                                            Tr('name')\r\n                                        ]}\r\n                                        items={positionsWithNoOffer.positions.map((x, i) => {\r\n                                            return [\r\n                                                Tr(`offer_evaluation_mode_title_position`, {value: x.order}),\r\n                                                x.name,\r\n                                            ]\r\n                                        })}\r\n                                        cellClassName={classes.cells}\r\n                                        columnClasses={[\r\n                                            classes.partColumn\r\n                                        ]}\r\n                                    />\r\n                                }\r\n                            </>\r\n                    }\r\n                </>}\r\n            </GridBlock>\r\n\r\n\r\n        </Dialog>)\r\n}\r\n\r\nOfferChoiceCancelWhereNoOffersPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(OfferChoiceCancelWhereNoOffersPopup)","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {OfferChoiceDecision, OfferChoiceDecisionLabel} from \"../constants/OfferChoiceDecision\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    decision: {\r\n        width: 182,\r\n    },\r\n    positionName: {\r\n        width: 250,\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {decision: \"\", positionName: ''}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nconst decisionsList = [{label: Tr('procedure_status_0'), value: \"\"}, ...Object.keys(OfferChoiceDecision).map(key => ({\r\n    label: OfferChoiceDecisionLabel(key),\r\n    value: key\r\n}))];\r\n\r\nfunction OfferChoiceSearch(\r\n    {\r\n        searchInProgress,\r\n        doSearch\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState({...EMPTY_SEARCH_OBJECT});\r\n    const [submitState, setSubmitState] = useState(0);\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => value[k])\r\n                .reduce((a, k) => ({...a, [k]: value[k]}), {});\r\n            doSearch(valueFiltered);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        setSubmitState(x => x + 1)\r\n    };\r\n\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (e.key === 'Enter') {\r\n            e.preventDefault();\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <BoldTypography>{Tr('search_box')}</BoldTypography>\r\n            <GridBlock\r\n                alignItems='flex-end'\r\n                className={classes.root}\r\n            >\r\n                <SimpleSelect\r\n                    className={classes.decision}\r\n                    label={Tr('decision')}\r\n                    items={decisionsList}\r\n                    value={value.decision}\r\n                    onChange={(e) => {\r\n                        handleChange(\"decision\", e);\r\n                        handleSubmit();\r\n                    }}\r\n                />\r\n\r\n                <TextField\r\n                    className={classes.positionName}\r\n                    label={Tr('search_part')}\r\n                    onChange={e => handleChange('positionName', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.positionName}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={() => {\r\n                        setValue(EMPTY_SEARCH_OBJECT);\r\n                        handleSubmit()\r\n                    }}/>\r\n                </div>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nOfferChoiceSearch.propTypes = {\r\n    doSearch: PropTypes.func.isRequired,\r\n    searchInProgress: PropTypes.bool\r\n}\r\n\r\n\r\nexport default OfferChoiceSearch;","import Tr from 'translations/Translations';\r\n\r\nexport const OfferChoiceDecision = {\r\n    NONE: \"NONE\",\r\n    OFFER_CHOSEN: \"OFFER_CHOSEN\",\r\n    CANCELED: \"CANCELED\"\r\n}\r\nconst _TR_PREFIX = 'offer_choice_decision_';\r\n\r\nexport const OfferChoiceDecisionLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import React from 'react'\r\nimport {Checkbox as MuiCheckbox, FormHelperText, Table, TableCell, TableHead, TableBody, TableRow, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport Checkbox from 'components/Checkbox';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport clsx from \"clsx\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    textBold: {\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    },\r\n    smallColumn: theme.components.table.lpColumn,\r\n    orderColumn: theme.components.table.ipColumn,\r\n    checkboxColumn: {\r\n        width: theme.spacing()\r\n    },\r\n    cells: {\r\n        paddingTop: theme.spacing(1),\r\n        paddingBottom: theme.spacing(1),\r\n    },\r\n    checkbox: {\r\n        padding: 0,\r\n    },\r\n    cursor: {\r\n        cursor: \"pointer\"\r\n    },\r\n    table: {\r\n        tableLayout: 'fixed',\r\n\r\n        '& td, th': {\r\n            overflow: 'hidden',\r\n        }\r\n    },\r\n    contractorsTable: {\r\n        '& tr:last-child td': {\r\n            borderBottom: 'none'\r\n        }\r\n    },\r\n    rowHidden: {\r\n        visibility: 'collapse'\r\n    },\r\n    divHidden: {\r\n        maxHeight: '0px !important'\r\n    },\r\n    divOpen: {\r\n        maxHeight: '2000px'\r\n    },\r\n    elemTransition: {\r\n        transition: 'all 0.8s'\r\n    }\r\n})\r\n\r\nfunction CreateAdditionalRoundTable(\r\n    {\r\n        classes,\r\n        className,\r\n        formikProps,\r\n        id,\r\n        elementList = [],\r\n        showContractors,\r\n        label,\r\n        editable = true,\r\n        required = true,\r\n        disabled\r\n    }) {\r\n    const elements = getObjectValue(id, formikProps.values, []);\r\n    const errorValue = getObjectValue(id, formikProps.errors, '');\r\n    const touched = getObjectValue(id, formikProps.touched, false);\r\n    const isAllChecked = elementList.length > 0 && !elementList.find(x => elements[x.identity].checked !== true)\r\n\r\n    const handleHeadCheckboxChange = (e, value) => {\r\n        elementList.forEach(x => formikProps.setFieldValue(id + '.' + x.identity + '.checked', value));\r\n    }\r\n\r\n    const handleContractorsHeadCheckboxChange = (e, value, elemId) => {\r\n        const position = elementList.find(x => x.identity === elemId);\r\n        position.contractors.forEach(c => formikProps.setFieldValue(id + '.' + position.identity + '.contractors.' + c.identity, value));\r\n    }\r\n\r\n    const isError = editable && !!errorValue && Boolean(touched);\r\n    const helperText = errorValue || ' ';\r\n    return (\r\n        <GridBlock\r\n            className={clsx(classes.root, className)}\r\n            column\r\n        >\r\n            <Typography\r\n                variant='body1'\r\n                className={classes.textBold}\r\n            >\r\n                {label ? label : Tr('assign_to_part')}{required ? '*' : ''}\r\n            </Typography>\r\n            <Table className={classes.table}>\r\n                <TableHead>\r\n                    <TableRow>\r\n                        <TableCell className={clsx(classes.checkboxColumn, classes.cells)}><MuiCheckbox\r\n                            color='primary'\r\n                            className={classes.checkbox}\r\n                            onChange={handleHeadCheckboxChange}\r\n                            checked={isAllChecked}\r\n                            disabled={disabled}\r\n                        /></TableCell>\r\n                        <TableCell className={clsx(classes.orderColumn, classes.cells)}>{Tr('part_number')}</TableCell>\r\n                        <TableCell className={classes.cells}>{Tr('name')}</TableCell>\r\n                    </TableRow>\r\n                </TableHead>\r\n                <TableBody>\r\n                    {elementList.map((x, i) => {\r\n                            const positionChecked = elements[x.identity].checked;\r\n                            const allContractorsChecked = !!elements[x.identity].contractors && !Object.keys(elements[x.identity].contractors).find(c => elements[x.identity].contractors[c] !== true);\r\n                            return (\r\n                                <React.Fragment key={`p.${x.identity}`}>\r\n                                    <TableRow>\r\n                                        <TableCell className={clsx(classes.checkboxColumn, classes.cells)}><Checkbox\r\n                                            id={`${id}.${x.identity}.checked`}\r\n                                            formikProps={formikProps}\r\n                                            checkboxClassName={classes.checkbox}\r\n                                            htmlId={`${id}.${x.identity}.checked`}\r\n                                            disabled={disabled}\r\n                                        /></TableCell>\r\n                                        <TableCell className={clsx(classes.orderColumn, classes.cells)}><label className={classes.cursor}\r\n                                                                                                               htmlFor={`${id}.${x.identity}.checked`}>{x.order}</label></TableCell>\r\n                                        <TableCell className={classes.cells}><label className={classes.cursor}\r\n                                                                                    htmlFor={`${id}.${x.identity}.checked`}>{x.name}</label></TableCell>\r\n                                    </TableRow>\r\n\r\n                                    {showContractors &&\r\n                                    <TableRow className={clsx(classes.elemTransition, {[classes.rowHidden]: !positionChecked})}>\r\n                                        <TableCell className={clsx(classes.checkboxColumn, classes.cells, classes.elemTransition)}></TableCell>\r\n                                        <TableCell className={clsx(classes.cells, classes.elemTransition)} colSpan={2}>\r\n                                            <div className={clsx(classes.elemTransition, {[classes.divHidden]: !positionChecked}, classes.divOpen)}>\r\n                                            <Table className={clsx(classes.table, classes.contractorsTable)}>\r\n                                                <TableHead>\r\n                                                    <TableRow>\r\n                                                        <TableCell className={clsx(classes.checkboxColumn, classes.cells)}><MuiCheckbox\r\n                                                            color='primary'\r\n                                                            className={classes.checkbox}\r\n                                                            onChange={(e, value) => handleContractorsHeadCheckboxChange(e, value, x.identity)}\r\n                                                            checked={allContractorsChecked}\r\n                                                            disabled={disabled}\r\n                                                        /></TableCell>\r\n                                                        <TableCell className={clsx(classes.orderColumn, classes.cells)}>{Tr('column_lp')}</TableCell>\r\n                                                        <TableCell className={classes.cells}>{Tr('contractor')}</TableCell>\r\n                                                    </TableRow>\r\n                                                </TableHead>\r\n                                                <TableBody>\r\n                                                    {x.contractors.map((c, i) => {\r\n                                                        return (\r\n                                                            <TableRow key={`cd.${x.identity}.${c.identity}`}>\r\n                                                                <TableCell className={clsx(classes.checkboxColumn, classes.cells)}><Checkbox\r\n                                                                    id={`${id}.${x.identity}.contractors.${c.identity}`}\r\n                                                                    formikProps={formikProps}\r\n                                                                    checkboxClassName={classes.checkbox}\r\n                                                                    htmlId={`${id}.${x.identity}.contractors.${c.identity}`}\r\n                                                                    disabled={disabled}\r\n                                                                /></TableCell>\r\n                                                                <TableCell className={clsx(classes.orderColumn, classes.cells)}><label\r\n                                                                    className={classes.cursor}\r\n                                                                    htmlFor={`${id}.${x.identity}.contractors.${c.identity}`}>{i + 1}</label></TableCell>\r\n                                                                <TableCell className={classes.cells}><label className={classes.cursor}\r\n                                                                                                            htmlFor={`${id}.${x.identity}.contractors.${c.identity}`}>{c.name}</label></TableCell>\r\n                                                            </TableRow>\r\n                                                        )\r\n                                                    })}\r\n                                                </TableBody>\r\n                                            </Table>\r\n                                            </div>\r\n                                        </TableCell>\r\n                                    </TableRow>\r\n                                    }\r\n                                </React.Fragment>\r\n                            )\r\n                        }\r\n                    )}\r\n                </TableBody>\r\n            </Table>\r\n            {isError && <FormHelperText error>{helperText}</FormHelperText>}\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nCreateAdditionalRoundTable.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(CreateAdditionalRoundTable);\r\n","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport * as Yup from \"yup\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport CreateAdditionalRoundTable from \"./CreateAdditionalRoundTable\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    cells: {\r\n        padding: theme.spacing()\r\n    },\r\n    partColumn: {\r\n        width: 75\r\n    },\r\n    dateTimePicker: {\r\n        width: 350\r\n    }\r\n}));\r\n\r\n\r\nconst OfferChoiceCreateAdditionalRoundPopup = (\r\n    {\r\n        demandId,\r\n        onCancel,\r\n        onSuccess,\r\n        roundType,\r\n        formSubmit\r\n    }) => {\r\n\r\n    const isAuction = roundType === RoundType.AUCTION;\r\n    const classes = useStyle();\r\n\r\n    const [rounds, setRounds] = useState(null);\r\n    const [showContractors, setShowContractors] = useState(false);\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(false);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = (values) => {\r\n        setError(false);\r\n        setWorking(true);\r\n        OfferChoiceService.createAdditionalRound(demandId, values, roundType).then(onSuccess).catch(() => {\r\n            setError(true);\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    useEffect(() => {\r\n        OfferChoiceService.prepareAdditionalRound(demandId, roundType).then(resp => {\r\n            setRounds({...resp, positions: resp.positions.map(x => ({...x, identity: \"_\" + x.identity, contractors: !!x.contractors ? x.contractors.map(c => ({...c, identity: \"_\" + c.identity})) : []}))})\r\n            setShowContractors(resp.showContractors);\r\n        }).finally(() => setWorking(false));\r\n    }, [demandId, roundType])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr(isAuction ? 'additional_round_create_auction_begin_button' : 'additional_round_create_additional_offers_begin_button'), handleSubmit, undefined, working || !rounds?.positions.length));\r\n        return buttons;\r\n    }\r\n    const handleEndDate = (formikProps, value) => {\r\n        formikProps.setFieldValue('openOfferDate', value);\r\n    }\r\n\r\n    const validationSchema = () => {\r\n        const shape = {\r\n            parts: VS.any().test('partSelected', Tr('choose_at_least_one_position'), (e) => {\r\n                const selIndex = Object.keys(e).findIndex(x => e[x].checked === true);\r\n                return selIndex > -1;\r\n            }).test('contractorSelected', Tr('choose_at_least_one_contractor'), (e) => {\r\n                return showContractors ? Object.keys(e).filter(x => e[x].checked === true).every(x => Object.keys(e[x].contractors).findIndex(c => e[x].contractors[c] === true) > -1) : true;\r\n            })\r\n        }\r\n        if (!isAuction) {\r\n            shape.endDate = VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past'));\r\n            shape.openOfferDate = VS.dateTimeValid()\r\n                .when('endDate', (endDate, schema) => {\r\n                    return schema.test('EndDateLessOpenDate', Tr(\"EndDateLessOpenDate\"), (offerOpenDate) => {\r\n                        if (endDate && offerOpenDate) {\r\n                            return !offerOpenDate.isBefore(endDate);\r\n                        }\r\n                        return false;\r\n                    })\r\n                })\r\n        }\r\n        return Yup.object().shape(shape)\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr(isAuction ? 'additional_round_create_auction_popup_title' : 'additional_round_create_additional_offers_popup_title')}\r\n            maxWidth='md'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n\r\n                {working && <Loading/>}\r\n                {error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{Tr('unknown_error_message')}</TypographyWithIcon>}\r\n                {!working && !!rounds && <>\r\n\r\n                    <Form\r\n                        initialValues={{\r\n                            endDate: null,\r\n                            openOfferDate: null,\r\n                            parts: rounds.positions.reduce((prev, cur) => {\r\n                                prev[cur.identity] = {\r\n                                    checked: false,\r\n                                    contractors: cur.contractors.reduce((arr, elem) => {\r\n                                        arr[elem.identity] = false;\r\n                                        return arr;\r\n                                    }, {})\r\n                                };\r\n                                return prev;\r\n                            }, {})\r\n                        }}\r\n                        validationSchema={validationSchema()}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <GridBlock\r\n                                column\r\n                            >\r\n                                {!isAuction &&\r\n                                <DateTimePicker\r\n                                    className={classes.dateTimePicker}\r\n                                    id='endDate'\r\n                                    label={Tr('additional_round_end_date')}\r\n                                    formikProps={formikProps}\r\n                                    disabled={working || !rounds?.positions.length}\r\n                                    onChange={(value) => handleEndDate(formikProps, value)}\r\n                                    minDate={new Date()}\r\n                                />\r\n                                }\r\n\r\n                                {!isAuction &&\r\n                                <DateTimePicker\r\n                                    className={classes.dateTimePicker}\r\n                                    id='openOfferDate'\r\n                                    label={Tr('additional_round_open_offer_date')}\r\n                                    formikProps={formikProps}\r\n                                    disabled={working || !rounds?.positions.length}\r\n                                    minDate={new Date()}\r\n                                />\r\n                                }\r\n                                {\r\n                                    !(rounds?.positions.length) ?\r\n                                        <BoldTypography variant='body1'>\r\n                                            {\r\n                                                isAuction ? (rounds.error ? rounds.error : Tr('additional_round_auction_list_empty')) : Tr('additional_round_list_empty')\r\n                                            }\r\n                                        </BoldTypography>\r\n                                        :\r\n                                        <CreateAdditionalRoundTable\r\n                                            label={Tr(isAuction ? 'additional_round_auction_list_title' : 'additional_round_list_title')}\r\n                                            id={'parts'}\r\n                                            formikProps={formikProps}\r\n                                            elementList={rounds.positions}\r\n                                            showContractors={showContractors}\r\n                                        />\r\n                                }\r\n                            </GridBlock>\r\n                        )}\r\n                    </Form>\r\n\r\n\r\n                </>}\r\n            </GridBlock>\r\n\r\n\r\n        </Dialog>)\r\n}\r\n\r\nOfferChoiceCreateAdditionalRoundPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    roundType: PropTypes.oneOf([RoundType.AUCTION, RoundType.ADDITIONAL_OFFERS]).isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(OfferChoiceCreateAdditionalRoundPopup)","import React from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport {Grid, Typography, withStyles} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport Form from \"components/Form\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    limit: {\r\n        position: 'absolute',\r\n        bottom: 0,\r\n        right: 0,\r\n        color: theme.palette.text.secondary,\r\n    },\r\n    relative: {\r\n        position: 'relative'\r\n    }\r\n})\r\n\r\nfunction RealizationAmountForm(\r\n    {\r\n        formId,\r\n        realizationValues,\r\n        required,\r\n        editable,\r\n        onSubmit,\r\n        classes\r\n    }) {\r\n\r\n\r\n    const getInitValues = () => {\r\n        const init = {\r\n            dealings: realizationValues.dealings.map(({realizationGrossValue, identity}) => ({\r\n                realizationGrossValue,\r\n                identity\r\n            }))\r\n        };\r\n        return init;\r\n    }\r\n\r\n    const getValidationSchema = () => {\r\n        const shape = {\r\n            realizationGrossValue: required ? VS.amount(0, true) : VS.amountOptional(0, true)\r\n        }\r\n\r\n        return VS.object({\r\n            dealings: VS.lazy(x => {\r\n                return VS.arrayOfShape(shape)\r\n            })\r\n        })\r\n    }\r\n\r\n    const formatPublishDate = (publishDate) => {\r\n        return moment(publishDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT);\r\n    }\r\n\r\n    return (<Form\r\n        id={formId}\r\n        initialValues={getInitValues()}\r\n        validationSchema={getValidationSchema()}\r\n        onSubmit={onSubmit}\r\n    >\r\n        {(formikProps) => (\r\n            <>\r\n                <Grid container spacing={3}>\r\n                    {realizationValues.dealings.map((x, i) =>\r\n                        (<Grid item key={x.identity} xs={4}>\r\n                            <div className={classes.relative}>\r\n                                <TextInput\r\n                                    id={`dealings.${i}.realizationGrossValue`}\r\n                                    label={realizationValues.dealings.length > 1 ? Tr('part_x', {x: i + 1}) : ''}\r\n                                    formikProps={formikProps}\r\n                                    type={INPUT_TYPE.NUMBER_19}\r\n                                    disabled={!editable}\r\n                                    required={required}\r\n                                />\r\n                                {x.realizationPublishDate && <Typography key={x.identity} variant='caption' className={classes.limit}>{Tr('realization_publish_date')}{realizationValues.dealings.length > 1 ? Tr('on_part_x', {x: i + 1}) : ''}: {formatPublishDate(x.realizationPublishDate)}</Typography>}\r\n                            </div>\r\n                        </Grid>))\r\n                    }\r\n                </Grid>\r\n            </>)}\r\n    </Form>)\r\n}\r\n\r\nRealizationAmountForm.propTypes = {\r\n    formId: PropTypes.string.isRequired,\r\n    realizationValues: PropTypes.shape({\r\n        dealings: PropTypes.array.isRequired,\r\n        realizationValuePublished: PropTypes.bool\r\n    }).isRequired,\r\n    required: PropTypes.bool.isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default withStyles(style)(RealizationAmountForm);","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport useId from \"hooks/useId\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport RealizationAmountForm from \"components/complex/realizationAmount/RealizationAmountForm\";\r\n\r\n\r\nconst FinalRealizationValuePopup = (\r\n    {\r\n        demandId,\r\n        onCancel,\r\n        onSuccess,\r\n        editable,\r\n        formSubmit,\r\n    }) => {\r\n\r\n\r\n    const [realizationValues, setRealizationValues] = useState(null);\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(null);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = ({dealings}) => {\r\n        setError(false);\r\n        setWorking(true);\r\n\r\n        const toCompare = realizationValues.dealings;\r\n\r\n        const touched = dealings.filter((el, i) => {\r\n            return el.realizationGrossValue !== toCompare[i].realizationGrossValue\r\n        });\r\n\r\n        DealingsService.saveFinalRealizationValues(demandId, {dealings: touched}).then(onSuccess).catch(() => {\r\n            setError(Tr('unknown_error_message'));\r\n            setWorking(false);\r\n        });\r\n    }\r\n\r\n    useEffect(() => {\r\n        DealingsService.getFinalRealizationValues(demandId).then(resp => {\r\n            if (isResponseValid(resp, setError))\r\n                setRealizationValues(resp)\r\n        }).finally(() => setWorking(false))\r\n    }, [demandId])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('realization_value_update'), handleSubmit, undefined, working || !editable));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('final_realization_value')}\r\n            maxWidth='md'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                {working && <Loading/>}\r\n                {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n                {!!realizationValues && <RealizationAmountForm\r\n                    onSubmit={onSubmit}\r\n                    required\r\n                    formId={formId}\r\n                    realizationValues={realizationValues}\r\n                    editable={editable}\r\n                />}\r\n            </GridBlock>\r\n\r\n\r\n        </Dialog>)\r\n}\r\n\r\nFinalRealizationValuePopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(FinalRealizationValuePopup)","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport Pagination from \"components/Pagination\";\r\nimport OfferChoiceTable from \"./components/OfferChoiceTable\";\r\nimport Alert from \"components/popup/alert/Alert\";\r\nimport OfferChoiceCancelWhereNoOffersPopup from \"./components/OfferChoiceCancelWhereNoOffersPopup\";\r\nimport OfferChoiceSearch from \"./components/OfferChoiceSearch\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport OfferChoiceCreateAdditionalRoundPopup from \"./components/additionalRound/OfferChoiceCreateAdditionalRoundPopup\";\r\nimport {RoundType} from \"constants/RoundType\";\r\nimport FinalRealizationValuePopup from \"./components/FinalRealizationValuePopup\";\r\nimport SplitButton, {createButton as createSplitButton} from \"components/popup/components/SplitButton\";\r\nimport MultiButton from \"components/popup/components/MultiButton\";\r\n\r\n\r\nfunction OfferChoice(\r\n    {\r\n        match,\r\n        offerChoiceList,\r\n        offerChoiceJustification,\r\n        demandValidation\r\n    }) {\r\n\r\n    const curDemandValidation = DemandValidation.OFFER_CHOICE;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} = useSearch();\r\n    const [working, setWorking] = useState(true);\r\n    const [errorDialogOpen, setErrorDialogOpen] = useState(false);\r\n    const [realizationDialogOpen, setRealizationDialogOpen] = useState(false);\r\n    const [cancelWhereNoOffersPopupOpen, setCancelWhereNoOffersPopupOpen] = useState(false);\r\n    const [createPopupType, setCreatePopupType] = useState(null);\r\n\r\n    const updateStatus = async (positionId, canceled, chosenSupplierIds, offerChoiceDate, offerChoiceJustification) => {\r\n        setWorking(true);\r\n        try {\r\n            await OfferChoiceService.saveOfferChoice(demandId, positionId, canceled, chosenSupplierIds, offerChoiceDate, offerChoiceJustification);\r\n        } catch (e) {\r\n            setErrorDialogOpen(true);\r\n            throw e;\r\n        } finally {\r\n            setWorking(false);\r\n        }\r\n    }\r\n\r\n    const modifyChoice = async (positionId) => {\r\n        setWorking(true);\r\n        try {\r\n            await OfferChoiceService.modifyChoice(demandId, positionId);\r\n        } catch (e) {\r\n            setErrorDialogOpen(true);\r\n            throw e;\r\n        } finally {\r\n            setWorking(false);\r\n        }\r\n    }\r\n\r\n    const refreshData = () => setSearchConfig({...searchData.search});\r\n\r\n    useEffect(() => {\r\n        OfferChoiceService.getChoiceJustificationBasis(demandId);\r\n        return () => {\r\n            OfferChoiceService.clearResources(OfferChoiceService.OFFER_CHOICE_LIST_RESOURCE_ID);\r\n            OfferChoiceService.clearResources(OfferChoiceService.OFFER_CHOICE_JUSTIFICATIONS);\r\n        }\r\n    }, [demandId])\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        const {pagination, search} = searchData;\r\n        OfferChoiceService.getChoiceList(demandId, pagination, search).then(() => (setWorking(false)));\r\n        // eslint-disable-next-line\r\n    }, [searchData, demandId])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (offerChoiceList?.totalCount !== undefined) {\r\n            setTotalCount(offerChoiceList.totalCount)\r\n        }\r\n    }, [offerChoiceList?.totalCount]);\r\n\r\n\r\n    const createRoundButton = useMemo(() => {\r\n        const buttons = [];\r\n        buttons.push(createSplitButton(Tr('additional_round_create_additional_offers_button'), () => setCreatePopupType(RoundType.ADDITIONAL_OFFERS), !editable || working));\r\n        buttons.push(createSplitButton(Tr('additional_round_create_auction_button'), () => setCreatePopupType(RoundType.AUCTION), !editable || working));\r\n        return (<SplitButton\r\n            label={Tr('create_round')}\r\n            buttons={buttons}\r\n        />)\r\n    }, [editable, working])\r\n\r\n    const additionalActionsButton = useMemo(() => {\r\n        const buttons = [];\r\n        buttons.push(createSplitButton(Tr('invalidate_parts_no_offers'), () => setCancelWhereNoOffersPopupOpen(true), !editable || working));\r\n        buttons.push(createSplitButton(Tr('realization_value_update'), () => setRealizationDialogOpen(true), working));\r\n        return (<SplitButton\r\n            label={Tr('additional_actions')}\r\n            buttons={buttons}\r\n            variant=\"outlined\"\r\n        />)\r\n    }, [editable, working])\r\n\r\n    if (!offerChoiceList || !offerChoiceJustification) return <Loading/>;\r\n\r\n    return (<GridBlock column>\r\n        <DemandValidationMessages editable={editable} section={section}/>\r\n        <GridBlock justify='space-between'>\r\n            <OfferChoiceSearch\r\n                searchInProgress={working}\r\n                doSearch={setSearchConfig}\r\n            />\r\n            <MultiButton buttons={[]} before={createRoundButton} after={additionalActionsButton} />\r\n        </GridBlock>\r\n        {!offerChoiceList?.items.length ?\r\n            <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            :\r\n            <>\r\n                <OfferChoiceTable\r\n                    demandId={demandId}\r\n                    updateStatus={updateStatus}\r\n                    modifyChoice={modifyChoice}\r\n                    offerChoiceList={offerChoiceList}\r\n                    working={working}\r\n                    editable={editable}\r\n                />\r\n                <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n                <Alert confirmText={Tr('unknown_error_message')} open={errorDialogOpen} onClose={() => setErrorDialogOpen(false)}/>\r\n            </>}\r\n        {\r\n            cancelWhereNoOffersPopupOpen &&\r\n            <OfferChoiceCancelWhereNoOffersPopup\r\n                demandId={demandId}\r\n                onCancel={() => setCancelWhereNoOffersPopupOpen(false)}\r\n                onSuccess={() => {\r\n                    refreshData();\r\n                    setCancelWhereNoOffersPopupOpen(false);\r\n                }}\r\n            />\r\n        }\r\n        {\r\n            !!createPopupType &&\r\n            <OfferChoiceCreateAdditionalRoundPopup\r\n                demandId={demandId}\r\n                onCancel={() => setCreatePopupType(null)}\r\n                onSuccess={() => {\r\n                    refreshData();\r\n                    setCreatePopupType(null);\r\n                }}\r\n                roundType={createPopupType}\r\n            />\r\n        }\r\n        {\r\n            !!realizationDialogOpen &&\r\n            <FinalRealizationValuePopup\r\n                demandId={demandId}\r\n                onCancel={() => setRealizationDialogOpen(false)}\r\n                onSuccess={() => {\r\n                    refreshData();\r\n                    setRealizationDialogOpen(false);\r\n                }}\r\n                editable={editable}\r\n            />\r\n        }\r\n    </GridBlock>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    offerChoiceList: state.resources[OfferChoiceService.OFFER_CHOICE_LIST_RESOURCE_ID],\r\n    offerChoiceJustification: state.resources[OfferChoiceService.OFFER_CHOICE_JUSTIFICATIONS],\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(OfferChoice));\r\n\r\n","import React from 'react'\r\nimport OfferChoice from \"./OfferChoice\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <OfferChoice />)\r\n}\r\n\r\n\r\nexport default Index;","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport {clearResource, setResource, setSaveStatusError} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport applySearchParams from \"libs/applySearchParams\";\r\nimport Tr from \"../translations/Translations\";\r\nimport downloadFileWithPreloadUrl from \"../libs/downloadFileWithPreloadUrl\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\nimport moment from \"libs/moment\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\n\r\nconst OFFER_CHOICE_RESULT_LIST_RESOURCE_ID = 'offerChoiceResultList';\r\n\r\nconst getChoiceResultList = async (demandId, pagination, search) => {\r\n    const params = {\r\n        ...pagination\r\n    };\r\n    applySearchParams(search, params);\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.OFFER_CHOICE_RESULT(demandId), {params});\r\n        reduxStore.dispatch(setResource(OFFER_CHOICE_RESULT_LIST_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst setChoiceResult = (roundResult) => {\r\n    const {resources} = reduxStore.getState();\r\n    const curList = resources?.[OFFER_CHOICE_RESULT_LIST_RESOURCE_ID];\r\n    if (curList) {\r\n        const newList = {\r\n            ...curList,\r\n            items: curList.items.map(x => x.identity === roundResult.identity ? roundResult : x)\r\n        }\r\n        reduxStore.dispatch(setResource(OFFER_CHOICE_RESULT_LIST_RESOURCE_ID, newList));\r\n    }\r\n};\r\n\r\nconst getChoiceResultFilesList = async (demandId, roundResultId) => {\r\n    try {\r\n        return await RestRequestGET(Endpoints.OFFER_CHOICE_RESULT_FILE(demandId, roundResultId));\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n};\r\n\r\nconst getChoiceResultPrint = async (demandId, roundResultId) => {\r\n    try {\r\n        await RestRequestBLOB(Endpoints.OFFER_CHOICE_RESULT_PRINT(demandId, roundResultId));\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n};\r\n\r\nconst shareChoiceResultPrint = async (demandId, roundResultId, system) => {\r\n\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_RESULT_SHARE(demandId, roundResultId), {system});\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n    return false;\r\n};\r\n\r\nconst updatePublishUntilDate = async (demandId, roundResultId, values) => {\r\n    try {\r\n        const data = {\r\n            date: values.publishUntilDate ? moment(values.publishUntilDate) : null\r\n        };\r\n        const resp = await RestRequestPUT(Endpoints.OFFER_CHOICE_RESULT_PUBLISH_UNTIL_DATE(demandId, roundResultId), data);\r\n        if (resp.success) {\r\n            const result = resp.result;\r\n            const {resources} = reduxStore.getState();\r\n            const list = resources[OFFER_CHOICE_RESULT_LIST_RESOURCE_ID];\r\n            if (list) {\r\n\r\n                const newList = {\r\n                    ...list,\r\n                    items: list.items.map(x => x.identity === result.identity ? {...result, positionOrders: x.positionOrders} : x)\r\n                }\r\n                reduxStore.dispatch(setResource(OFFER_CHOICE_RESULT_LIST_RESOURCE_ID, newList));\r\n            }\r\n        } else {\r\n            throw new Error(resp)\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n};\r\n\r\nconst addChoiceResultFilesList = async (demandId, roundResultId, repositoryFiles) => {\r\n    const data = {\r\n        repositoryIds: repositoryFiles.map(x => x.identity)\r\n    }\r\n\r\n    try {\r\n        return await RestRequestPOST(Endpoints.OFFER_CHOICE_RESULT_FILE(demandId, roundResultId), data);\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n};\r\n\r\nconst getDownloadFile = async (demandId, roundResultId, resultFileId) => {\r\n    await downloadFileWithPreloadUrl(\r\n        Endpoints.OFFER_CHOICE_RESULT_FILE_DOWNLOAD_URL(demandId, roundResultId, resultFileId, false),\r\n        false);\r\n}\r\n\r\nconst deleteFile = async (demandId, roundResultId, resultFileId) => {\r\n    try {\r\n        const resp = await RestRequestDELETE(Endpoints.OFFER_CHOICE_RESULT_FILE_DELETE(demandId, roundResultId, resultFileId));\r\n        if (resp?.success && resp?.result) {\r\n            return resp.result;\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nconst publishFile = async (demandId, roundResultId, resultFileId) => {\r\n    try {\r\n        const resp = await RestRequestPUT(Endpoints.OFFER_CHOICE_RESULT_FILE_PUBLISH(demandId, roundResultId, resultFileId));\r\n        validateSection(DemandValidation.OFFERS_CHOICE_RESULT, demandId, false);\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nconst unpublishFile = async (demandId, roundResultId, resultFileId) => {\r\n    try {\r\n        const resp = await RestRequestPUT(Endpoints.OFFER_CHOICE_RESULT_FILE_UNPUBLISH(demandId, roundResultId, resultFileId));\r\n        validateSection(DemandValidation.OFFERS_CHOICE_RESULT, demandId, false);\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\nconst shareFile = async (demandId, roundResultId, resultFileId, system) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.OFFER_CHOICE_RESULT_FILE_SHARE(demandId, roundResultId, resultFileId), {system});\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e)))) {\r\n            return true;\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n    return false;\r\n\r\n}\r\n\r\nconst getDownloadHistory = async (demandId, resultNoticeId, resultFileId, pagination) => {\r\n\r\n    const params = {\r\n        ...pagination\r\n    }\r\n\r\n    const siwzDownloadHistory = await RestRequestGET(Endpoints.OFFER_CHOICE_RESULT_FILE_DOWNLOAD_HISTORY(demandId, resultNoticeId, resultFileId, params), {params});\r\n    return siwzDownloadHistory;\r\n}\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.OFFER_CHOICE_RESULT_VALIDATE(id));\r\n}\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n};\r\n\r\nexport default {\r\n    getChoiceResultList,\r\n    setChoiceResult,\r\n    getChoiceResultFilesList,\r\n    updatePublishUntilDate,\r\n    addChoiceResultFilesList,\r\n    getDownloadFile,\r\n    getChoiceResultPrint,\r\n    shareChoiceResultPrint,\r\n    deleteFile,\r\n    publishFile,\r\n    unpublishFile,\r\n    getDownloadHistory,\r\n    validate,\r\n    clearResources,\r\n    shareFile,\r\n    OFFER_CHOICE_RESULT_LIST_RESOURCE_ID\r\n}","import Tr from 'translations/Translations';\r\n\r\nexport const OfferChoiceResultFileState = {\r\n    NEW: \"NEW\",\r\n    PUBLISHED: \"PUBLISHED\",\r\n    WITHDRAWN: \"WITHDRAWN\"\r\n}\r\nconst _TR_PREFIX = 'offer_choice_result_file_state_';\r\n\r\nexport const OfferChoiceResultFileStateLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import {makeStyles, TableCell, TableRow} from \"@material-ui/core\";\r\nimport {Delete as DeleteIcon} from \"@material-ui/icons\";\r\nimport moment from \"libs/moment\";\r\nimport PropTypes from \"prop-types\";\r\nimport React, {useReducer, useState} from \"react\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport OffersChoiceResultService from \"services/OffersChoiceResultService\";\r\nimport {OfferChoiceResultFileState, OfferChoiceResultFileStateLabel} from \"../constants/OfferChoiceResultFileState\";\r\nimport WorkableIconUnpublishButton from \"components/button/WorkableIconUnpublishButton\";\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport WorkableIconDownloadCountButton from \"components/button/WorkableIconDownloadCountButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconDownloadButton from \"components/button/WorkableIconDownloadButton\";\r\nimport DownloadHistoryPopup, {createDownloadHistoryFile} from \"components/popup/DownloadHistoryPopup\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    buttonCell: {\r\n        padding: 0\r\n    }\r\n}));\r\n\r\nfunction OfferChoiceResultFilesTableRow(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceResultItem,\r\n        onDeleteFile,\r\n        onUpdateFile,\r\n        file,\r\n        showShare,\r\n        canDownloadFile\r\n    }) {\r\n    const classes = useStyles();\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        download: false,\r\n        publish: false,\r\n        delete: false,\r\n        share: false,\r\n    });\r\n    const [downloadHistory, setDownloadHistory] = useState(null);\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const onDownloadCount = () => {\r\n        setDownloadHistory(createDownloadHistoryFile(file.name, demandId, file.identity));\r\n    };\r\n\r\n    const onDownloadDialogClose = () => {\r\n        setDownloadHistory(null);\r\n    };\r\n\r\n    const downloadFile = (file) => {\r\n        dispatchIconWorks({type: 'download', works: true})\r\n        OffersChoiceResultService.getDownloadFile(demandId, offerChoiceResultItem.identity, file.identity)\r\n            .catch(() => {\r\n            }).finally(() => dispatchIconWorks({type: 'download', works: false}));\r\n    };\r\n\r\n    const deleteFile = (file) => {\r\n        dispatchIconWorks({type: 'delete', works: true})\r\n        OffersChoiceResultService.deleteFile(demandId, offerChoiceResultItem.identity, file.identity)\r\n            .then(() => {\r\n                onDeleteFile(file)\r\n            })\r\n            .catch(() => dispatchIconWorks({type: 'delete', works: false}));\r\n    };\r\n\r\n    const publishFile = (file) => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        const promise = OffersChoiceResultService.publishFile(demandId, offerChoiceResultItem.identity, file.identity);\r\n        doPublishChange(promise);\r\n    };\r\n\r\n    const unpublishFile = (file) => {\r\n        dispatchIconWorks({type: 'publish', works: true});\r\n        const promise = OffersChoiceResultService.unpublishFile(demandId, offerChoiceResultItem.identity, file.identity);\r\n        doPublishChange(promise);\r\n    };\r\n\r\n    const doPublishChange = (promise) => {\r\n        promise\r\n            .then((resp) => {\r\n                if (resp?.file) {\r\n                    onUpdateFile(resp.file);\r\n                }\r\n                if (resp?.info) {\r\n                    OffersChoiceResultService.setChoiceResult(resp.info)\r\n                }\r\n            })\r\n            .finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    };\r\n\r\n\r\n    const onShareFile = (row) => setShareFilePopup(sharePopupData(row.name, row));\r\n\r\n    const doShare = (row, system) => {\r\n        setShareFilePopup(null);\r\n        dispatchIconWorks({type: 'share', works: true});\r\n        OffersChoiceResultService.shareFile(demandId, offerChoiceResultItem.identity, row.identity, system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            dispatchIconWorks({type: 'share', works: false})\r\n        });\r\n    }\r\n\r\n    return (\r\n        <TableRow>\r\n            <TableCell>{file.name}</TableCell>\r\n            <TableCell>{OfferChoiceResultFileStateLabel(file.state)}</TableCell>\r\n            <TableCell>{file.datePublished ? moment(file.datePublished).format(DateFormats.DATETIME_FORMAT) : null}</TableCell>\r\n            <TableCell className={classes.buttonCell}>\r\n                <WorkableIconDownloadButton disabled={iconWorks.anyWorks || !canDownloadFile} working={iconWorks.download} onClick={() => downloadFile(file)}/>\r\n            </TableCell>\r\n            {\r\n                showShare &&\r\n                <TableCell className={classes.buttonCell}>\r\n                    <WorkableIconShareButton\r\n                        onClick={() => onShareFile(file)}\r\n                        disabled={iconWorks.anyWorks}\r\n                        working={iconWorks.share}\r\n                    />\r\n\r\n                    {!!shareFilePopup && <ShareSelectPopup\r\n                        data={shareFilePopup}\r\n                        onCancel={() => setShareFilePopup(null)}\r\n                        onChoose={doShare}\r\n                    />}\r\n                </TableCell>\r\n            }\r\n            <TableCell className={classes.buttonCell}>\r\n                {\r\n                    file.state === OfferChoiceResultFileState.PUBLISHED ?\r\n                        <WorkableIconUnpublishButton\r\n                            disabled={iconWorks.anyWorks || !editable}\r\n                            working={iconWorks.publish}\r\n                            onClick={() => unpublishFile(file)}\r\n                        /> :\r\n                        <WorkableIconPublishButton\r\n                            disabled={iconWorks.anyWorks || !editable}\r\n                            working={iconWorks.publish}\r\n                            onClick={() => publishFile(file)}\r\n                        />\r\n                }\r\n            </TableCell>\r\n            <TableCell className={classes.buttonCell}>\r\n                <WorkableIconDownloadCountButton onClick={onDownloadCount}/>\r\n                {downloadHistory &&\r\n                <DownloadHistoryPopup\r\n                    downloadHistoryFile={downloadHistory}\r\n                    service={{\r\n                        getDownloadHistory: async (demandId, fileId, pagination) => {\r\n                            return await OffersChoiceResultService.getDownloadHistory(demandId, offerChoiceResultItem.identity, fileId, pagination)\r\n                        }\r\n                    }}\r\n                    onClose={onDownloadDialogClose}\r\n                />\r\n                }\r\n            </TableCell>\r\n            <TableCell className={classes.buttonCell}>\r\n                <WorkableIconButton\r\n                    disabled={!!file.datePublished || iconWorks.anyWorks || !editable}\r\n                    Icon={DeleteIcon}\r\n                    working={iconWorks.delete}\r\n                    onClick={() => deleteFile(file)}\r\n                />\r\n            </TableCell>\r\n        </TableRow>\r\n    )\r\n}\r\n\r\nOfferChoiceResultFilesTableRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    offerChoiceResultItem: PropTypes.object.isRequired,\r\n    onDeleteFile: PropTypes.func.isRequired,\r\n    onUpdateFile: PropTypes.func.isRequired,\r\n    file: PropTypes.object.isRequired,\r\n    showShare: PropTypes.bool.isRequired\r\n}\r\n\r\nexport default OfferChoiceResultFilesTableRow;\r\n\r\n","import {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\nimport React from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport OfferChoiceResultFilesTableRow from \"./OfferChoiceResultFilesTableRow\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    statusColumn: theme.components.table.emailColumn,\r\n    dateTimeColumn: {\r\n        width: 248\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n}));\r\n\r\nfunction OfferChoiceResultFilesTable(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceResultItem,\r\n        files,\r\n        setFiles,\r\n        showShare,\r\n        canDownloadFile\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const onDeleteFile = (fileToDelete) => {\r\n        setFiles(state => state.filter(f => f.identity !== fileToDelete.identity));\r\n    }\r\n\r\n    const onUpdateFile = (fileToUpdate) => {\r\n        setFiles(state => state.map(f => f.identity === fileToUpdate.identity ? fileToUpdate : f));\r\n    }\r\n\r\n    if (!files) return null;\r\n    return (<Table className={classes.table}>\r\n        <TableHead>\r\n            <TableRow className={classes.headRow}>\r\n                <TableCell>{Tr(\"name\")}</TableCell>\r\n                <TableCell className={classes.statusColumn}>{Tr(\"status\")}</TableCell>\r\n                <TableCell className={classes.dateTimeColumn}>{Tr(\"publish_data\")}</TableCell>\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n                {showShare && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n            </TableRow>\r\n        </TableHead>\r\n        <TableBody>\r\n            {files.map(file => (\r\n                <OfferChoiceResultFilesTableRow\r\n                    key={file.identity}\r\n                    demandId={demandId}\r\n                    file={file}\r\n                    working={working}\r\n                    offerChoiceResultItem={offerChoiceResultItem}\r\n                    editable={editable}\r\n                    onDeleteFile={onDeleteFile}\r\n                    onUpdateFile={onUpdateFile}\r\n                    showShare={showShare}\r\n                    canDownloadFile={canDownloadFile}\r\n                />\r\n            ))}\r\n        </TableBody>\r\n    </Table>)\r\n\r\n\r\n}\r\n\r\nOfferChoiceResultFilesTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    offerChoiceResultItem: PropTypes.object.isRequired,\r\n    files: PropTypes.array.isRequired,\r\n    setFiles: PropTypes.func.isRequired\r\n}\r\n\r\nexport default OfferChoiceResultFilesTable;\r\n\r\n","import {TableCell, TableRow} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\nimport React, {useState} from \"react\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport OffersChoiceResultService from \"services/OffersChoiceResultService\";\r\nimport Tr from \"translations/Translations\";\r\nimport OfferChoiceResultFilesTable from \"./OfferChoiceResultFilesTable\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\nfunction OfferChoiceResultFiles(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceResultItem,\r\n        files,\r\n        setFiles,\r\n        showShare,\r\n        canDownloadFile\r\n    }) {\r\n\r\n    const [filesWorking, setFilesWorking] = useState(false);\r\n\r\n\r\n    const handleSendFiles = (files) => {\r\n        if (files.length) {\r\n            setFilesWorking(true);\r\n            OffersChoiceResultService.addChoiceResultFilesList(demandId, offerChoiceResultItem.identity, files)\r\n                .then((resp) => {\r\n                    if (resp)\r\n                        setFiles(state => [...state, ...resp.files]);\r\n                })\r\n                .finally(() => setFilesWorking(false));\r\n        }\r\n    }\r\n\r\n\r\n    if (!files) return null;\r\n    return (<TableRow>\r\n        <TableCell colSpan={7}>\r\n            {editable && files && <UploadFile\r\n                disabled={working}\r\n                onUploadPopupClosed={handleSendFiles}\r\n                working={filesWorking}\r\n            />\r\n            }\r\n            {\r\n                !files.length ?\r\n                    <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                    :\r\n                    <OfferChoiceResultFilesTable\r\n                        demandId={demandId}\r\n                        files={files}\r\n                        setFiles={setFiles}\r\n                        working={working}\r\n                        offerChoiceResultItem={offerChoiceResultItem}\r\n                        editable={editable}\r\n                        showShare={showShare}\r\n                        canDownloadFile={canDownloadFile}\r\n                    />\r\n            }\r\n        </TableCell>\r\n    </TableRow>)\r\n}\r\n\r\nOfferChoiceResultFiles.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    offerChoiceResultItem: PropTypes.object.isRequired,\r\n    files: PropTypes.arrayOf(PropTypes.shape({\r\n        identity: PropTypes.number.isRequired,\r\n        name: PropTypes.string.isRequired,\r\n        state: PropTypes.string.isRequired,\r\n        datePublished: PropTypes.string\r\n    })),\r\n    setFiles: PropTypes.func.isRequired\r\n}\r\n\r\nexport default OfferChoiceResultFiles;\r\n\r\n","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport PrintIcon from '@material-ui/icons/Print';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nfunction WorkableIconPrintButton(\r\n    {\r\n        tooltip = Tr('download_print'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={PrintIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconPrintButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconPrintButton;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport DescriptionIcon from '@material-ui/icons/Description';\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport moment from \"libs/moment\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport PropTypes from 'prop-types';\r\n\r\nfunction OfferChoiceResultFilePublishPopup(\r\n    {\r\n        onClose,\r\n        onSubmit,\r\n        offerChoiceResultItem,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const {publishUntilDate} = offerChoiceResultItem;\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('publish_until_data')}\r\n            open={true}\r\n            maxWidth={'xs'}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr('confirm')}\r\n                onClickFirst={onClose}\r\n                onClickSecond={handleSubmit}\r\n            />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    publishUntilDate: publishUntilDate ? moment(publishUntilDate) : null,\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    publishUntilDate: VS.dateTimeMinNoRq(new Date(), Tr(\"v_data_can_not_be_past\"))\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <TypographyWithIcon Icon={DescriptionIcon}>\r\n                            {Tr(offerChoiceResultItem.modification ? 'offers_choice_modification_result_applies_parts' : 'offers_choice_result_applies_parts')}: {offerChoiceResultItem.positionOrders.join(\", \")}\r\n                        </TypographyWithIcon>\r\n\r\n                        <DateTimePicker\r\n                            formikProps={formikProps}\r\n                            id='publishUntilDate'\r\n                            label={Tr('repo_visibility_end_date')}\r\n                        />\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nOfferChoiceResultFilePublishPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n    offerChoiceResultItem: PropTypes.shape({\r\n        modification: PropTypes.bool.isRequired,\r\n        publishUntilDate: PropTypes.string,\r\n        positionOrders: PropTypes.arrayOf(PropTypes.number).isRequired\r\n    })\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n}), {})(OfferChoiceResultFilePublishPopup);","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport EventIcon from '@material-ui/icons/Event'\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconCalendarButton(\r\n    {\r\n        tooltip = Tr('choose_date'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={EventIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconCalendarButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconCalendarButton;","import PropTypes from \"prop-types\";\r\nimport React, {useReducer, useState} from \"react\";\r\nimport OffersChoiceResultService from \"services/OffersChoiceResultService\";\r\nimport {makeStyles, TableCell, TableRow} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport {KeyboardArrowDown as ArrowDownIcon, KeyboardArrowUp as ArrowUpIcon} from \"@material-ui/icons\";\r\nimport OfferChoiceResultFiles from \"./OfferChoiceResultFiles\";\r\nimport clsx from \"clsx\";\r\nimport {OfferChoiceResultStateLabel} from \"../constants/OfferChoiceResultState\";\r\nimport WorkableIconPrintButton from \"components/button/WorkableIconPrintButton\";\r\nimport OfferChoiceResultFilePublishPopup from \"./OfferChoiceResultFilePublishPopup\";\r\nimport WorkableIconCalendarButton from \"components/button/WorkableIconCalendarButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    openFilesCell: {\r\n        borderBottom: \"none\"\r\n    },\r\n    buttonCell: {\r\n        padding: 0\r\n    }\r\n}));\r\n\r\nfunction OfferChoiceResultRow(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceResultItem,\r\n        showShare,\r\n        canDownloadPaper,\r\n        canDownloadFile\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [publishPopupOpened, setPublishPopupOpened] = useState(false);\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        load: false,\r\n        print: false,\r\n        publish: false,\r\n        share: false\r\n    });\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const [files, setFiles] = useState(null);\r\n\r\n    const onPrintClick = () => {\r\n        if (!iconWorks.anyWorks) {\r\n            dispatchIconWorks({type: 'print', works: true})\r\n            OffersChoiceResultService.getChoiceResultPrint(demandId, offerChoiceResultItem.identity).finally(() => dispatchIconWorks({\r\n                type: 'print',\r\n                works: false\r\n            }));\r\n        }\r\n    }\r\n\r\n    const onUpdatePublishUntilDate = (values) => {\r\n        dispatchIconWorks({type: 'publish', works: true})\r\n        setPublishPopupOpened(false);\r\n        OffersChoiceResultService.updatePublishUntilDate(demandId, offerChoiceResultItem.identity, values)\r\n            .finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    }\r\n\r\n    const onLoadButtonClick = () => {\r\n        if (!iconWorks.anyWorks) {\r\n            if (files === null) {\r\n                dispatchIconWorks({type: 'load', works: true})\r\n                OffersChoiceResultService.getChoiceResultFilesList(demandId, offerChoiceResultItem.identity).then((resp) => {\r\n                    if (resp !== undefined)\r\n                        setFiles(resp.files);\r\n                }).finally(() => dispatchIconWorks({type: 'load', works: false}));\r\n            } else {\r\n                setFiles(null);\r\n            }\r\n        }\r\n    }\r\n    const name = `${Tr(offerChoiceResultItem.modification ? 'offers_choice_modification_result_applies_parts' : 'offers_choice_result_applies_parts')}: ${offerChoiceResultItem.positionOrders.join(\", \")}`;\r\n\r\n    const onShareFile = () => setShareFilePopup(sharePopupData(name));\r\n\r\n    const doShare = (row, system) => {\r\n        setShareFilePopup(null);\r\n        dispatchIconWorks({type: 'share', works: true});\r\n        OffersChoiceResultService.shareChoiceResultPrint(demandId, offerChoiceResultItem.identity, system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            dispatchIconWorks({type: 'share', works: false})\r\n        });\r\n    }\r\n\r\n    const filesLoaded = files !== null;\r\n    return (<>\r\n        <TableRow>\r\n            <TableCell className={clsx({[classes.openFilesCell]: filesLoaded})}>\r\n                {name}\r\n            </TableCell>\r\n            <TableCell className={clsx({[classes.openFilesCell]: filesLoaded})}>\r\n                {OfferChoiceResultStateLabel(offerChoiceResultItem.state)}\r\n            </TableCell>\r\n            <TableCell className={clsx({[classes.openFilesCell]: filesLoaded})}>\r\n                {offerChoiceResultItem.publishDate ? moment(offerChoiceResultItem.publishDate).format(DateFormats.DATETIME_FORMAT) : null}\r\n            </TableCell>\r\n            <TableCell className={clsx({[classes.openFilesCell]: filesLoaded})}>\r\n                {offerChoiceResultItem.publishUntilDate ? moment(offerChoiceResultItem.publishUntilDate).format(DateFormats.DATETIME_FORMAT) : null}\r\n            </TableCell>\r\n            <TableCell className={clsx(classes.buttonCell, {[classes.openFilesCell]: filesLoaded})}>\r\n                <WorkableIconCalendarButton\r\n                    //tooltip={Tr('generate_offer_choice_result_file', {parts: offerChoiceResultItem.positionOrders.join(\", \")})}\r\n                    working={iconWorks.publish}\r\n                    disabled={!editable || iconWorks.anyWorks}\r\n                    hideTooltip={iconWorks.publish}\r\n                    onClick={() => setPublishPopupOpened(true)}\r\n                />\r\n            </TableCell>\r\n            <TableCell className={clsx(classes.buttonCell, {[classes.openFilesCell]: filesLoaded})}>\r\n                <WorkableIconPrintButton\r\n                    tooltip={Tr('generate_offer_choice_result_file', {parts: offerChoiceResultItem.positionOrders.join(\", \")})}\r\n                    working={iconWorks.print}\r\n                    disabled={!canDownloadPaper || iconWorks.anyWorks}\r\n                    hideTooltip={iconWorks.print}\r\n                    onClick={onPrintClick}\r\n                />\r\n            </TableCell>\r\n            {\r\n                showShare && <TableCell className={clsx(classes.buttonCell, {[classes.openFilesCell]: filesLoaded})}>\r\n                    <WorkableIconShareButton\r\n                        working={iconWorks.share}\r\n                        disabled={iconWorks.anyWorks}\r\n                        hideTooltip={iconWorks.share}\r\n                        onClick={onShareFile}\r\n                    />\r\n                    {!!shareFilePopup && <ShareSelectPopup\r\n                        data={shareFilePopup}\r\n                        onCancel={() => setShareFilePopup(null)}\r\n                        onChoose={doShare}\r\n                    />}\r\n\r\n                </TableCell>\r\n            }\r\n            <TableCell className={clsx(classes.buttonCell, {[classes.openFilesCell]: filesLoaded})}>\r\n                <WorkableIconButton\r\n                    working={iconWorks.load}\r\n                    disabled={iconWorks.anyWorks}\r\n                    hideTooltip={iconWorks.load}\r\n                    Icon={filesLoaded ? ArrowUpIcon : ArrowDownIcon}\r\n                    onClick={onLoadButtonClick}\r\n                    tooltip={filesLoaded ? Tr('collapse') : Tr('show_files')}\r\n                />\r\n            </TableCell>\r\n        </TableRow>\r\n        <OfferChoiceResultFiles\r\n            demandId={demandId}\r\n            working={working || iconWorks.anyWorks}\r\n            editable={editable}\r\n            offerChoiceResultItem={offerChoiceResultItem}\r\n            files={files}\r\n            setFiles={setFiles}\r\n            showShare={showShare}\r\n            canDownloadFile={canDownloadFile}\r\n        />\r\n        {\r\n            publishPopupOpened &&\r\n            <OfferChoiceResultFilePublishPopup\r\n                offerChoiceResultItem={offerChoiceResultItem}\r\n                onClose={() => setPublishPopupOpened(false)}\r\n                onSubmit={onUpdatePublishUntilDate}\r\n            />\r\n        }\r\n    </>)\r\n}\r\n\r\nOfferChoiceResultRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool,\r\n    offerChoiceResultItem: PropTypes.shape({\r\n        positionOrders: PropTypes.arrayOf(PropTypes.number).isRequired,\r\n        publishDate: PropTypes.string,\r\n        state: PropTypes.string,\r\n    }).isRequired\r\n}\r\n\r\nexport default OfferChoiceResultRow;\r\n\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const OfferChoiceResultState = {\r\n    NEW: \"NEW\",\r\n    PUBLISHED: \"PUBLISHED\",\r\n    WITHDRAWN: \"WITHDRAWN\"\r\n}\r\nconst _TR_PREFIX = 'offer_choice_result_state_';\r\n\r\nexport const OfferChoiceResultStateLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));\r\n","import {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport OfferChoiceResultRow from \"./OfferChoiceResultRow\";\r\nimport {connect} from \"react-redux\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport {useMemo} from \"react\";\r\nimport {shareSystemsActive} from \"libs/shareSystems\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n\r\n    },\r\n    headRow: {\r\n    },\r\n    dateTimeColumn: theme.components.table.dateTimeColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    statusColumn: theme.components.table.emailColumn,\r\n}));\r\n\r\nfunction OfferChoiceResultTable(\r\n    {\r\n        demandId,\r\n        editable,\r\n        working,\r\n        offerChoiceResultList,\r\n        demandPrivileges,\r\n        demandHeader,\r\n        canDownloadPaper,\r\n        canDownloadFile\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const showShare = useMemo(() => demandPrivileges.INTEGRATIONS_UPLOAD && shareSystemsActive(demandHeader).length > 0, [demandHeader, demandPrivileges])\r\n    return (<Table className={classes.table}>\r\n        <TableHead>\r\n            <TableRow className={classes.headRow}>\r\n                <TableCell className={classes.partColumn}>{Tr(\"part\")}</TableCell>\r\n                <TableCell className={classes.statusColumn}>{Tr(\"status\")}</TableCell>\r\n                <TableCell className={classes.dateTimeColumn}>{Tr(\"publish_data\")}</TableCell>\r\n                <TableCell className={classes.dateTimeColumn}>{Tr(\"publish_until_data\")}</TableCell>\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n                {showShare && <TableCell className={classes.buttonColumn}></TableCell>}\r\n                <TableCell className={classes.buttonColumn}></TableCell>\r\n            </TableRow>\r\n        </TableHead>\r\n        <TableBody>\r\n            {\r\n                offerChoiceResultList.items.map((element, index) => {\r\n                    const key = \"\" + element.identity + element.canceled + element.editable;\r\n                    return <OfferChoiceResultRow\r\n                        key={key} offerChoiceResultItem={element}\r\n                        editable={editable}\r\n                        working={working}\r\n                        demandId={demandId}\r\n                        showShare={showShare}\r\n                        canDownloadFile={canDownloadFile}\r\n                        canDownloadPaper={canDownloadPaper}\r\n                    />\r\n                })\r\n            }\r\n        </TableBody>\r\n    </Table>)\r\n}\r\n\r\nOfferChoiceResultTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool,\r\n    offerChoiceResultList: PropTypes.shape({\r\n        items: PropTypes.array.isRequired,\r\n    }).isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY]\r\n}))(OfferChoiceResultTable)\r\n\r\n","import React, {useEffect, useState} from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport OffersChoiceResultService from \"services/OffersChoiceResultService\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport Tr from \"translations/Translations\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Pagination from \"components/Pagination\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport OfferChoiceResultTable from \"./components/OfferChoiceResultTable\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    }\r\n}));\r\n\r\nfunction OffersChoiceResult(\r\n    {\r\n        match,\r\n        offerChoiceResultList,\r\n        demandValidation\r\n    }) {\r\n    const classes = useStyles();\r\n    const curDemandValidation = DemandValidation.OFFERS_CHOICE_RESULT;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n    const canDownloadPaper = section ? section.canDownloadPaper : false;\r\n    const canDownloadFile = section ? section.canDownloadFile : false;\r\n\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} = useSearch();\r\n    const [working, setWorking] = useState(true);\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            OffersChoiceResultService.clearResources(OffersChoiceResultService.OFFER_CHOICE_RESULT_LIST_RESOURCE_ID);\r\n        }\r\n    }, [])\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        const {pagination, search} = searchData;\r\n        OffersChoiceResultService.getChoiceResultList(demandId, pagination, search).then(() => (setWorking(false)));\r\n        // eslint-disable-next-line\r\n    }, [searchData, demandId])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (offerChoiceResultList?.totalCount !== undefined) {\r\n            setTotalCount(offerChoiceResultList.totalCount)\r\n        }\r\n    }, [offerChoiceResultList?.totalCount]);\r\n\r\n    if (!offerChoiceResultList) return <Loading/>;\r\n    return (\r\n        <div className={classes.root}>\r\n            <DemandValidationMessages editable={editable} section={section}/>\r\n            <BasicSearch\r\n                label={Tr('search_part')}\r\n                searchInProgress={working}\r\n                doSearch={setSearchConfig}\r\n            />\r\n\r\n            {!offerChoiceResultList?.items.length ?\r\n                <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                :\r\n                <>\r\n                    <OfferChoiceResultTable editable={editable} offerChoiceResultList={offerChoiceResultList} working={working} demandId={demandId} canDownloadPaper={canDownloadPaper} canDownloadFile={canDownloadFile}/>\r\n                    <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n                </>\r\n            }\r\n        </div>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    offerChoiceResultList: state.resources[OffersChoiceResultService.OFFER_CHOICE_RESULT_LIST_RESOURCE_ID],\r\n    demandValidation: state.resources.demandValidation\r\n}), {})(withRouter(OffersChoiceResult));","import React from 'react'\r\nimport OffersChoiceResult from \"./OffersChoiceResult\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n    return (expanded && <OffersChoiceResult/>)\r\n}\r\n\r\n\r\nexport default Index;","const AgreementListType = {\r\n    CREATED: \"CREATED\",\r\n    AVAILABLE: \"AVAILABLE\"\r\n}\r\nexport default AgreementListType;","import React from \"react\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport ToggleButtonGroup from \"@material-ui/lab/ToggleButtonGroup\";\r\nimport ToggleButton from \"@material-ui/lab/ToggleButton\";\r\nimport PropTypes from \"prop-types\";\r\nimport AgreementListType from \"../constants/AgreementListType\";\r\nimport Tr from \"translations/Translations\"\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n      marginBottom: theme.spacing(3)\r\n    },\r\n    button: {\r\n        width: 560,\r\n    }\r\n\r\n}));\r\n\r\nfunction AgreementsListType(\r\n    {\r\n        listType,\r\n        setListType\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const handleToggleClick = (event, newProcedure) => {\r\n        if (newProcedure)\r\n            setListType(newProcedure);\r\n    };\r\n\r\n    return (<GridBlock column className={classes.root}>\r\n            <GridBlock justify=\"center\">\r\n                <ToggleButtonGroup size=\"medium\" value={listType} exclusive onChange={handleToggleClick}>\r\n                    <ToggleButton classes={{root: classes.button}} value={AgreementListType.AVAILABLE}>\r\n                        {Tr(\"agreements_available\")}\r\n                    </ToggleButton>\r\n                    <ToggleButton classes={{root: classes.button}} value={AgreementListType.CREATED}>\r\n                        {Tr(\"agreements_created\")}\r\n                    </ToggleButton>\r\n                </ToggleButtonGroup>\r\n            </GridBlock>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nAgreementsListType.propTypes = {\r\n    listType: PropTypes.string.isRequired,\r\n    setListType: PropTypes.func.isRequired\r\n}\r\n\r\nexport default AgreementsListType;\r\n\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource, setSaveStatusError} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst AGREEMENTS_RESOURCE_ID = 'agreementsList';\r\nconst AGREEMENTS_AVAILABLE_RESOURCE_ID = 'agreementsAvailableList';\r\nconst AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID = 'agreementsAvailableOrganizationsList';\r\n\r\nconst getAgreementsList = async (demandId, pagination, searchData) => {\r\n    try {\r\n        let params = {\r\n            ...pagination\r\n        }\r\n        params = applySearchParams(searchData, params);\r\n        const resp = await RestRequestGET(Endpoints.AGREEMENTS_CREATED(demandId), {params});\r\n        reduxStore.dispatch(setResource(AGREEMENTS_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\nconst getAgreementsAvailableList = async (demandId, pagination, searchData) => {\r\n    try {\r\n        let params = {\r\n            ...pagination\r\n        }\r\n        params = applySearchParams(searchData, params);\r\n\r\n        const resp = await RestRequestGET(Endpoints.AGREEMENTS_AVAILABLE(demandId), {params});\r\n        reduxStore.dispatch(setResource(AGREEMENTS_AVAILABLE_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst getAgreementsAvailableOrganizationsList = async (demandId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.AGREEMENTS_AVAILABLE_ORGANIZATIONS(demandId));\r\n        reduxStore.dispatch(setResource(AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID, resp));\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst createNoAgreements = async (demandId, positionIds) => {\r\n    const resp = await RestRequestPOST(Endpoints.AGREEMENTS_CREATE_NO_AGREEMENT(demandId), {items: positionIds});\r\n    if(!resp.success) {\r\n        reduxStore.dispatch(setSaveStatusError(Tr('bad_request_error')));\r\n    }\r\n    return resp;\r\n};\r\n\r\nconst deleteAgreement = async (demandId, objId, objType) => {\r\n    const resp = await RestRequestDELETE(objType === 'agreement' ? Endpoints.AGREEMENTS_DELETE_AGR(demandId, objId) : Endpoints.AGREEMENTS_DELETE(demandId, objId));\r\n    if(!resp.success) {\r\n        reduxStore.dispatch(setSaveStatusError(Tr('bad_request_error')));\r\n    }\r\n    return resp;\r\n};\r\n\r\nconst createAgreements = async (demandId, positionIds, orgForAgreement, oneAgreement) => {\r\n    const resp = await RestRequestPOST(Endpoints.AGREEMENTS_CREATE_AGREEMENT(demandId), {positionIds, oneAgreement, orgForAgreement});\r\n    if(!resp.success) {\r\n        reduxStore.dispatch(setSaveStatusError(Tr('bad_request_error')));\r\n    }\r\n    return resp;\r\n};\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.AGREEMENTS_VALIDATE(id));\r\n}\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n};\r\n\r\nexport default {\r\n    getAgreementsList,\r\n    getAgreementsAvailableList,\r\n    getAgreementsAvailableOrganizationsList,\r\n    createAgreements,\r\n    createNoAgreements,\r\n    deleteAgreement,\r\n    validate,\r\n    clearResources,\r\n    AGREEMENTS_RESOURCE_ID,\r\n    AGREEMENTS_AVAILABLE_RESOURCE_ID,\r\n    AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID\r\n}","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport AgreementsService from \"services/AgreementsService\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\n\r\n\r\nfunction AgreementCreatePopup(\r\n    {\r\n        onClose,\r\n        onSubmit,\r\n        agreementsAvailableOrganizationsList,\r\n        userData\r\n    }) {\r\n\r\n    const [value, setValue] = useState(() => {\r\n        const elem = agreementsAvailableOrganizationsList.find(x => x.orgId === userData.orgId);\r\n        return elem ? elem : agreementsAvailableOrganizationsList[0];\r\n    });\r\n\r\n    const [confirmOpen, setConfirmOpen] = useState(false);\r\n\r\n    const handleSubmit = (oneAgreement) => {\r\n        onSubmit(value, oneAgreement);\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), () => {\r\n            onClose();\r\n        }, 'outlined', false));\r\n        buttons.push(createButton(Tr('createSingleAgreements'), () => {\r\n            handleSubmit(false);\r\n        }, undefined, false));\r\n        buttons.push(createButton(Tr('createOneAgreement'), () => {\r\n            setConfirmOpen(true);\r\n        }, undefined, false));\r\n        return buttons;\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <Dialog\r\n                title={Tr('agreement_create')}\r\n                open={true}\r\n                maxWidth={'md'}\r\n                dialogActions={<MultiButton buttons={getButtons()} />}\r\n            >\r\n\r\n                <GridBlock column>\r\n\r\n                    <TypographyWithIcon Icon={InfoOutlinedIcon}>\r\n                        {Tr(\"agreement_create_select_org\")}\r\n                    </TypographyWithIcon>\r\n                    <SimpleSelect\r\n                        label={Tr('organizational_unit')}\r\n                        items={agreementsAvailableOrganizationsList.map(x => ({label: x.name, value: x}))}\r\n                        value={value}\r\n                        onChange={(e) => {\r\n                            setValue(e.target.value);\r\n                        }}\r\n                    />\r\n\r\n                </GridBlock>\r\n\r\n            </Dialog>\r\n\r\n            <Confirm\r\n                confirmText={Tr('createOneAgreement_info')}\r\n                onCancel={() => setConfirmOpen(false)}\r\n                onConfirm={() => {\r\n                    setConfirmOpen(false);\r\n                    handleSubmit(true);\r\n                }}\r\n                open={confirmOpen}\r\n                translateConfirmTexts={false}\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nAgreementCreatePopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    onSubmit: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    agreementsAvailableOrganizationsList: state.resources[AgreementsService.AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID],\r\n    userData: state.resources.userData\r\n}), {})(AgreementCreatePopup);","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\"\r\nimport {connect} from \"react-redux\";\r\nimport AgreementsService from \"services/AgreementsService\";\r\nimport Loading from \"components/Loading\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport {CheckBox as CheckBoxIcon, CheckBoxOutlineBlank as CheckBoxOutlineBlankIcon} from \"@material-ui/icons\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport Pagination from \"components/Pagination\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport AgreementCreatePopup from \"./AgreementCreatePopup\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    partColumn: theme.components.table.dateColumn,\r\n    buttonColumn: theme.components.table.buttonColumn\r\n}));\r\n\r\nfunction AgreementsAvailablePanel(\r\n    {\r\n        demandId,\r\n        editable,\r\n        agreementsAvailableList,\r\n        agreementsAvailableOrganizationsList\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} = useSearch();\r\n    const [working, setWorking] = useState(false);\r\n    const [confirmNoAgrOpened, setConfirmNoAgrOpened] = useState(false);\r\n    const [createOpened, setCreateOpened] = useState(false);\r\n    const [selected, setSelected] = useState([]);\r\n\r\n    useEffect(() => {\r\n        AgreementsService.getAgreementsAvailableOrganizationsList(demandId);\r\n        return () => {\r\n            AgreementsService.clearResources(AgreementsService.AGREEMENTS_AVAILABLE_RESOURCE_ID);\r\n            AgreementsService.clearResources(AgreementsService.AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID);\r\n        }\r\n    }, [demandId]);\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        const {pagination, search} = searchData;\r\n        AgreementsService.getAgreementsAvailableList(demandId, pagination, search).then(() => (setWorking(false)));\r\n        setSelected([]);\r\n        // eslint-disable-next-line\r\n    }, [searchData, demandId]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (agreementsAvailableList?.totalCount !== undefined) {\r\n            setTotalCount(agreementsAvailableList.totalCount)\r\n        }\r\n    }, [agreementsAvailableList?.totalCount]);\r\n\r\n    const checkClick = (x) => {\r\n        const index = selected.indexOf(x.identity);\r\n        if (index > -1) {\r\n            setSelected(selected.filter(posId => posId !== x.identity))\r\n        } else {\r\n            setSelected(selected => [...selected, x.identity])\r\n        }\r\n    };\r\n\r\n    const createNoAgr = () => {\r\n        AgreementsService.clearResources(AgreementsService.AGREEMENTS_AVAILABLE_RESOURCE_ID);\r\n        AgreementsService.createNoAgreements(demandId, selected).finally(() => {\r\n            setPaginationConfig({...searchData.pagination, page: 1})\r\n        });\r\n        setSelected([]);\r\n        setConfirmNoAgrOpened(false);\r\n\r\n    };\r\n    const create = (org, oneAgreement) => {\r\n        AgreementsService.clearResources(AgreementsService.AGREEMENTS_AVAILABLE_RESOURCE_ID);\r\n        AgreementsService.createAgreements(demandId, selected, org, oneAgreement).finally(() => {\r\n            setPaginationConfig({...searchData.pagination, page: 1})\r\n        });\r\n        setSelected([]);\r\n        setCreateOpened(false);\r\n    };\r\n\r\n    const buttons = useMemo(() => {\r\n        const disabled = !selected.length || working || !agreementsAvailableOrganizationsList.length;\r\n        const buttons = [];\r\n        if (editable) {\r\n            buttons.push(createButton(Tr('agreement_create'), () => {\r\n                setCreateOpened(true)\r\n            }, undefined, disabled));\r\n            buttons.push(createButton(Tr('agreement_create_no_agr'), () => setConfirmNoAgrOpened(true), undefined, disabled));\r\n        }\r\n        return buttons;\r\n    }, [selected, working, editable, agreementsAvailableOrganizationsList]);\r\n\r\n    if (!agreementsAvailableList || !agreementsAvailableOrganizationsList) return <Loading/>;\r\n\r\n    return (<>\r\n            <GridBlock justify='space-between'>\r\n                <BasicSearch\r\n                    label={Tr('search_part')}\r\n                    searchInProgress={working}\r\n                    doSearch={setSearchConfig}\r\n                />\r\n                <MultiButton buttons={buttons}/>\r\n            </GridBlock>\r\n\r\n            <SimpleTable\r\n                headers={\r\n                    [\r\n                        '',\r\n                        Tr('part_number'),\r\n                        Tr('part_name'),\r\n                    ]\r\n                }\r\n                items={\r\n                    agreementsAvailableList.items.map((x, i) => {\r\n                        return [\r\n                            <IconButton\r\n                                disabled={!editable}\r\n                                onClick={() => checkClick(x)}\r\n                                Icon={selected.indexOf(x.identity) > -1 ? CheckBoxIcon : CheckBoxOutlineBlankIcon}\r\n                            />,\r\n                            Tr('part_x', {x: x.order}),\r\n                            x.name\r\n                        ]\r\n                    })\r\n                }\r\n                columnClasses={\r\n                    [\r\n                        classes.buttonColumn,\r\n                        classes.partColumn,\r\n                        undefined,\r\n                    ]\r\n                }\r\n            />\r\n            {\r\n                !agreementsAvailableList.items.length && <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            }\r\n\r\n            <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n            {\r\n                confirmNoAgrOpened && <Confirm\r\n                    confirmText=\"agreement_create_confirm\"\r\n                    open\r\n                    onCancel={() => setConfirmNoAgrOpened(false)}\r\n                    onConfirm={createNoAgr}\r\n                />\r\n            }\r\n            {\r\n                createOpened && <AgreementCreatePopup\r\n                    onClose={() => setCreateOpened(false)}\r\n                    onSubmit={(org, oneAgreement) => create(org, oneAgreement)}\r\n                />\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nAgreementsAvailablePanel.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    agreementsAvailableList: state.resources[AgreementsService.AGREEMENTS_AVAILABLE_RESOURCE_ID],\r\n    agreementsAvailableOrganizationsList: state.resources[AgreementsService.AGREEMENTS_AVAILABLE_ORGANIZATIONS_RESOURCE_ID]\r\n}), {})(AgreementsAvailablePanel);\r\n\r\n","import React, {useEffect, useState} from \"react\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\"\r\nimport {connect} from \"react-redux\";\r\nimport AgreementsService from \"services/AgreementsService\";\r\nimport Loading from \"components/Loading\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport Pagination from \"components/Pagination\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport {AgreementStateLabel} from \"../constants/AgreementState\";\r\nimport {AgreementTypeLabel} from \"../constants/AgreementType\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    typeColumn: {\r\n        width: 170\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn\r\n}));\r\n\r\nfunction AgreementsCreatedPanel(\r\n    {\r\n        demandId,\r\n        editable,\r\n        agreementsList\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} = useSearch();\r\n    const [working, setWorking] = useState(false);\r\n    const [confirmDelete, setConfirmDelete] = useState(null);\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            AgreementsService.clearResources(AgreementsService.AGREEMENTS_RESOURCE_ID);\r\n        }\r\n    }, [demandId]);\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        const {pagination, search} = searchData;\r\n        AgreementsService.getAgreementsList(demandId, pagination, search).then(() => (setWorking(false)));\r\n        // eslint-disable-next-line\r\n    }, [searchData, demandId]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (agreementsList?.totalCount !== undefined) {\r\n            setTotalCount(agreementsList.totalCount)\r\n        }\r\n    }, [agreementsList?.totalCount]);\r\n\r\n    const deleteAgreement = () => {\r\n        AgreementsService.deleteAgreement(demandId, confirmDelete.identity > 0 ? confirmDelete.identity : confirmDelete.extObjId, confirmDelete.identity > 0 ? 'agreement' : 'extObj').then((resp) => {\r\n            if (resp.success) {\r\n                if (agreementsList.items.length === 1) {\r\n                    setPaginationConfig({...searchData.pagination, page: 1})\r\n                } else {\r\n                    setPaginationConfig({...searchData.pagination})\r\n                }\r\n            }\r\n        }).finally(() => setConfirmDelete(null))\r\n    }\r\n\r\n    if (!agreementsList) return <Loading/>;\r\n\r\n    return (<>\r\n            <GridBlock justify='space-between'>\r\n                <BasicSearch\r\n                    label={Tr('search_part')}\r\n                    searchInProgress={working}\r\n                    doSearch={setSearchConfig}\r\n                />\r\n            </GridBlock>\r\n\r\n            <SimpleTable\r\n                headers={\r\n                    [\r\n                        Tr('agreement_subject'),\r\n                        Tr('demand_number'),\r\n                        Tr('type'),\r\n                        Tr('status'),\r\n                        '',\r\n                        ''\r\n                    ]\r\n                }\r\n                items={\r\n                    agreementsList.items.map((x, i) => {\r\n                        return [\r\n                            x.subject,\r\n                            x.number,\r\n                            AgreementTypeLabel(x.type),\r\n                            AgreementStateLabel(x.state),\r\n                            x.actions.preview ? <WorkableIconPreviewButton tooltip={Tr('details')} onClick={() => window.location.href = x.actions.preview.url}/> : null,\r\n                            <WorkableIconDeleteButton onClick={() => setConfirmDelete(x)} disabled={!x.actions.delete}/>\r\n                        ]\r\n                    })\r\n                }\r\n                columnClasses={\r\n                    [\r\n                        undefined,\r\n                        classes.typeColumn,\r\n                        classes.typeColumn,\r\n                        classes.typeColumn,\r\n                        classes.buttonColumn,\r\n                        classes.buttonColumn,\r\n                    ]\r\n                }\r\n            />\r\n            {\r\n                !agreementsList.items.length && <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            }\r\n\r\n            <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n\r\n            {\r\n                !!confirmDelete && <Confirm\r\n                    confirmText={confirmDelete.subject}\r\n                    confirmText2={Tr(\"agreement_delete_confirm\")}\r\n                    open\r\n                    onCancel={() => setConfirmDelete(null)}\r\n                    onConfirm={() => deleteAgreement()}\r\n                    translateConfirmTexts={false}\r\n                />\r\n            }\r\n\r\n        </>\r\n    )\r\n}\r\n\r\nAgreementsCreatedPanel.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    agreementsList: state.resources[AgreementsService.AGREEMENTS_RESOURCE_ID]\r\n}), {})(AgreementsCreatedPanel);\r\n\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const AgreementType = {\r\n    SINGLE: \"SINGLE\",\r\n    PUBLIC_FRAMEWORK: \"PUBLIC_FRAMEWORK\",\r\n    SINGLE_EXECUTIVE: \"SINGLE_EXECUTIVE\"\r\n}\r\nconst _TR_PREFIX = 'agreement_type_';\r\n\r\nexport const AgreementTypeLabel = (type) => (type ? Tr(_TR_PREFIX + type.toLowerCase()) : null);\r\n","import Tr from 'translations/Translations';\r\n\r\nexport const AgreementState = {\r\n    NEW: \"NEW\",\r\n    ACCEPTING: \"ACCEPTING\",\r\n    REGISTERED: \"REGISTERED\",\r\n    FINISHED: \"FINISHED\",\r\n    ANNULED: \"ANNULED\",\r\n    CANCELED: \"CANCELED\",\r\n    EXTERNALLY_REGISTERED: \"EXTERNALLY_REGISTERED\"\r\n}\r\nconst _TR_PREFIX = 'agreement_state_';\r\n\r\nexport const AgreementStateLabel = (state) => (Tr(_TR_PREFIX + state.toLowerCase()));\r\n","import React, {useState} from \"react\";\r\nimport {connect} from 'react-redux'\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport AgreementsListType from \"./components/AgreementsListType\";\r\nimport AgreementListType from \"./constants/AgreementListType\";\r\nimport AgreementsAvailablePanel from \"./components/AgreementsAvailablePanel\";\r\nimport AgreementsCreatedPanel from \"./components/AgreementsCreatedPanel\";\r\n\r\nfunction AgreementsPanel(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n\r\n    const curDemandValidation = DemandValidation.AGREEMENTS;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n    const [listType, setListType] = useState(AgreementListType.AVAILABLE);\r\n\r\n    return (<div>\r\n        <AgreementsListType\r\n            listType={listType}\r\n            setListType={setListType}\r\n        />\r\n        {listType === AgreementListType.AVAILABLE && <AgreementsAvailablePanel editable={editable} demandId={demandId}/>}\r\n        {listType === AgreementListType.CREATED && <AgreementsCreatedPanel editable={editable} demandId={demandId}/>}\r\n    </div>)\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation\r\n}), {})(withRouter(AgreementsPanel));","import React from 'react'\r\nimport AgreementsPanel from \"./AgreementsPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <AgreementsPanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import {RestRequestPOST} from \"libs/RestRequest\";\r\nimport Endpoints from \"constants/Endpoints\";\r\n\r\nconst doFinishEvaluation = async (id) => {\r\n    return await RestRequestPOST(Endpoints.EVALUATION_FINISH(id));\r\n}\r\n\r\nexport default {\r\n    doFinishEvaluation,\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestPOST} from 'libs/RestRequest';\r\nimport PrivilegeService from \"./PrivilegeService\";\r\n\r\nconst RFX_PRIVILEGE_STORE_KEY = \"rfx\"\r\n\r\nconst cancelRound = async (roundId, comment) => {\r\n\r\n    const body = {\r\n        comment\r\n    }\r\n    const resp = await RestRequestPOST(Endpoints.RFX_ROUND_CANCEL(roundId), body);\r\n    return resp;\r\n}\r\n\r\nconst getBuyerPrivileges = async (roundId) => {\r\n    await PrivilegeService.getPrivileges(Endpoints.RFX_ROUND_PRIVILEGES(roundId), PrivilegeService.RFX_PRIVILEGE_STORE_KEY);\r\n}\r\n\r\nexport default {\r\n    cancelRound,\r\n    getBuyerPrivileges,\r\n    RFX_PRIVILEGE_STORE_KEY\r\n}","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport {makeStyles} from '@material-ui/core';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport DoubleButton from '../components/DoubleButton';\r\nimport TextInput from 'components/TextInput';\r\nimport * as Yup from 'yup';\r\nimport validationShema from 'constants/ValidationShema';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport InputLimits from \"constants/InputLimits\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    padding: {\r\n        marginTop: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nfunction InvalidateDemandPopup(\r\n    {\r\n        open,\r\n        onClose,\r\n        onInvalidate,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n\r\n\r\n    const handleSubmit = () => formSubmit[formId]()\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('invalidate_demand')}\r\n            open={open}\r\n            maxWidth={'md'}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    comment: \"\"\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    comment: validationShema.stringMax(InputLimits.procedure.documents.NAME),\r\n                })}\r\n                onSubmit={onInvalidate}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        <TextInput\r\n                            id='comment'\r\n                            formikProps={formikProps}\r\n                            label={Tr('invalidate_demand_comment')}\r\n                            multiline\r\n                        />\r\n\r\n                        <div className={classes.actions}>\r\n                            <DoubleButton\r\n                                justify='flex-end'\r\n                                labelFirst={Tr('cancel')}\r\n                                labelSecond={Tr('invalidate')}\r\n                                onClickFirst={onClose}\r\n                                onClickSecond={handleSubmit}\r\n                            />\r\n                        </div>\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(InvalidateDemandPopup);","import React, {useMemo, useState} from \"react\";\r\nimport PropTypes from 'prop-types';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport EvaliationFinishService from \"services/EvaluationFinishService\";\r\nimport {connect} from \"react-redux\";\r\nimport Button from \"components/Button\";\r\nimport Tr from 'translations/Translations'\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport LoadingScreen from \"components/complex/loadingScreen/LoadingScreen\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Icon from '@material-ui/icons/CheckBox'\r\nimport IconOff from '@material-ui/icons/HighlightOff';\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport RfxRoundService from \"services/RfxRoundService\";\r\nimport InvalidateDemandPopup from \"components/popup/invalidate/InvalidateDemandPopup\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    button: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    text: {\r\n        marginTop: theme.spacing(4)\r\n    },\r\n    icon: theme.components.icon,\r\n}))\r\n\r\nconst rp = RouterPath.myProcedure;\r\n\r\nfunction EvaluationFinish(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n    const classes = useStyle();\r\n    const id = match.params.id;\r\n    const curDemandValidation = DemandValidation.EVALUATION_FINISH;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const prevErrors = useMemo(() => demandValidation.filter((x) => x.section !== curDemandValidation && x.status === 'ERROR'), [demandValidation, curDemandValidation]);\r\n    const [working, setWorking] = useState(false)\r\n    const [openInvalidate, setOpenInvalidate] = useState(false)\r\n\r\n    const goToFinish = () => {\r\n        setWorking(true);\r\n        EvaliationFinishService.doFinishEvaluation(id).finally(() => setWorking(false)).then((resp) => {\r\n            if (resp.success)\r\n                RouterPath.redirect(RouterPath.createPath(rp.steps.MP_4_ID, {id: id}))\r\n        });\r\n    }\r\n\r\n    const goToCancel = ({comment}) => {\r\n        setWorking(true);\r\n        setOpenInvalidate(false)\r\n        StatisticsService.getCurrentRound(id).then((resp) => {\r\n            RfxRoundService.cancelRound(resp.id, comment)\r\n                .then(() => {RouterPath.redirect(RouterPath.createPath(rp.steps.MP_4_ID, {id}))}).catch(() => setWorking(false))\r\n        })\r\n    }\r\n\r\n    const hasPrevErrors = prevErrors.length > 0;\r\n    const cancelVisible = section && section.cancelVisibleEnabled  !== null;\r\n    return (<GridBlock\r\n            direction='column'\r\n            alignItems='center'\r\n        >\r\n            {hasPrevErrors ?\r\n                <IconOff className={classes.icon} color='primary'/>\r\n                :\r\n                <Icon className={classes.icon} color='primary'/>\r\n            }\r\n            {hasPrevErrors ?\r\n                <Typography>{Tr('to_finish_evaluation_done_sections')}: \"{prevErrors.map((x) => Tr(DemandValidationKeys[x.section])).join(\"\\\", \\\"\")}\"</Typography>\r\n                :\r\n                <Typography>{Tr('go_to_demand_finishing_info')}</Typography>\r\n            }\r\n            <Button className={classes.button}\r\n                    disabled={hasPrevErrors || !section.editable || section.status !== 'ERROR'}\r\n                    onClick={goToFinish}>\r\n                {Tr('go_to_demand_finishing')}\r\n            </Button>\r\n\r\n            {cancelVisible && <Typography className={classes.text}>{Tr('go_to_demand_cancel_info')}</Typography>}\r\n            {cancelVisible && <Button className={classes.button}\r\n                                      disabled={!section.cancelVisibleEnabled}\r\n                                      onClick={()=> setOpenInvalidate(true)}>\r\n                {Tr('go_to_demand_cancel')}\r\n            </Button>}\r\n            <InvalidateDemandPopup onClose={() => setOpenInvalidate(false)} open={openInvalidate} onInvalidate={goToCancel} />\r\n            <LoadingScreen open={working}/>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nEvaluationFinish.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation\r\n}), {})(withRouter(EvaluationFinish));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport EvaluationFinish from \"./EvaluationFinish\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n\r\n    return (expanded && <EvaluationFinish />)\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport OfferChoiceService from \"./OfferChoiceService\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\n\r\nconst ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID = 'additionalPassiveRoundsList';\r\n\r\nconst getAdditionalPassiveRoundsList = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.ADDITIONAL_ROUNDS_PASSIVE(demandId));\r\n    if (resp.success)\r\n        reduxStore.dispatch(setResource(ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID, resp.result));\r\n    else\r\n        throw new Error(resp.errors);\r\n};\r\n\r\nconst updateAdditionalPassiveRound = async (demandId, roundId, sectionsToRefresh) => {\r\n    const resp = await RestRequestGET(Endpoints.ADDITIONAL_ROUNDS_PASSIVE_ROUND(demandId, roundId));\r\n    if (resp.success) {\r\n        const {resources} = reduxStore.getState();\r\n        const list = resources[ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID].map(x => x.roundId === resp.result.roundId ? resp.result : x);\r\n        reduxStore.dispatch(setResource(ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID, list));\r\n        await validateSection(DemandValidation.ADDITIONAL_ROUND_PASSIVE, demandId, false);\r\n        await OfferChoiceService.callSectionsValidation(demandId, sectionsToRefresh)\r\n    } else\r\n        throw new Error(resp.errors);\r\n};\r\n\r\nconst getAvailableContractors = async (demandId, setError) => {\r\n    const res = await RestRequestGET(Endpoints.ADDITIONAL_ROUNDS_PASSIVE_AVAILABLE_CONTRACTORS(demandId));\r\n    if (isResponseValid(res, setError))\r\n        return res.result;\r\n};\r\n\r\n\r\nconst createAdditionalPassiveRound = async (demandId, values) => {\r\n\r\n    const data = {\r\n        departmentIds: Object.keys(values.contractors).filter(x => values.contractors[x] === true).map(x => x.substring(1)),\r\n        endDate: values.endDate.format(),\r\n        openOfferDate: values.openOfferDate.format()\r\n    }\r\n\r\n    const resp = await RestRequestPOST(Endpoints.ADDITIONAL_ROUNDS_PASSIVE(demandId), data);\r\n    const {resources} = reduxStore.getState();\r\n    if (resp.success)\r\n        reduxStore.dispatch(setResource(ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID, [resp.result, ...resources[ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID]]));\r\n    else\r\n        throw new Error(resp.errors);\r\n}\r\n\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.ADDITIONAL_ROUNDS_PASSIVE_VALIDATE(id));\r\n}\r\n\r\nconst clearResources = (resource) => {\r\n    reduxStore.dispatch(clearResource(resource));\r\n};\r\n\r\nexport default {\r\n    getAdditionalPassiveRoundsList,\r\n    updateAdditionalPassiveRound,\r\n    getAvailableContractors,\r\n    createAdditionalPassiveRound,\r\n    validate,\r\n    clearResources,\r\n    ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID\r\n}","import React from \"react\";\r\nimport PropTypes from 'prop-types';\r\nimport OfferChoiceSummaryCellAdditionalRound from \"../../offerChoice/components/additionalRound/OfferChoiceSummaryCellAdditionalRound\";\r\nimport {AdditionalRoundStatusesPending} from \"constants/AdditionalRoundStatus\";\r\nimport Tr from 'translations/Translations'\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\n\r\nfunction AdditionalRoundPassiveStatusCell(\r\n    {\r\n        demandId,\r\n        additionalRound,\r\n        setRowWorking,\r\n        rowWorking,\r\n        refreshRow,\r\n        serverBrowserTimeDiff,\r\n        working,\r\n        editable\r\n    }) {\r\n\r\n\r\n    return (\r\n        AdditionalRoundStatusesPending.indexOf(additionalRound.status) > -1 ?\r\n            <OfferChoiceSummaryCellAdditionalRound\r\n                demandId={demandId}\r\n                roundName={additionalRound.name}\r\n                additionalRoundId={additionalRound.roundId}\r\n                setRowWorking={setRowWorking}\r\n                rowWorking={rowWorking}\r\n                refreshRow={refreshRow}\r\n                working={working}\r\n                serverBrowserTimeDiff={serverBrowserTimeDiff}\r\n                additionalRoundStatus={additionalRound.status}\r\n                editable={editable}\r\n                additionalRoundOpenOfferDate={additionalRound.openOfferDate}\r\n                additionalRoundEndDate={additionalRound.endDate}\r\n            />\r\n            :\r\n            <BoldTypography align='center'>{Tr('additional_offer_collection_finished')}</BoldTypography>\r\n    )\r\n}\r\n\r\nAdditionalRoundPassiveStatusCell.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    additionalRound: PropTypes.object.isRequired,\r\n    setRowWorking: PropTypes.func.isRequired,\r\n    refreshRow: PropTypes.func.isRequired,\r\n    rowWorking: PropTypes.bool.isRequired,\r\n    serverBrowserTimeDiff: PropTypes.object.isRequired,\r\n}\r\n\r\nexport default AdditionalRoundPassiveStatusCell;\r\n\r\n","import React, {useRef, useState} from \"react\";\r\nimport {makeStyles, TableCell, TableRow, Typography} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport PropTypes from 'prop-types';\r\nimport moment from \"libs/moment\";\r\nimport Tr from \"translations/Translations\";\r\nimport AdditionalRoundPassiveStatusCell from \"./AdditionalRoundPassiveStatusCell\";\r\nimport AdditionalRoundPassiveService from \"services/AdditionalRoundPassiveService\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    evenRow: {\r\n        backgroundColor: theme.palette.background.default\r\n    },\r\n    lastRow: {\r\n        borderBottom: `solid 3px ${theme.palette.primary.main}`\r\n    }\r\n}));\r\n\r\nfunction AdditionalRoundPassiveRow(\r\n    {\r\n        demandId,\r\n        additionalRound,\r\n        rowNumber,\r\n        working,\r\n        editable\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const even = rowNumber % 2 === 1;\r\n    const serverBrowserTimeDiff = useRef(moment(additionalRound.serverTime).diff(moment(), \"s\"));\r\n    const [curWorking, setCurWorking] = useState(false);\r\n\r\n    const refreshRow = async (sectionsToRefresh) => {\r\n        await AdditionalRoundPassiveService.updateAdditionalPassiveRound(demandId, additionalRound.roundId, sectionsToRefresh);\r\n    }\r\n\r\n    const getRow = (element, index, array) => {\r\n        const noOffer = element.identity === -1;\r\n        const first = index === 0;\r\n        const last = index >= array.length - 1;\r\n\r\n        const rowSpan = noOffer ? 1 : array.length;\r\n        return (<TableRow key={element.identity} className={clsx({[classes.evenRow]: even, [classes.lastRow]: last})}>\r\n            {first && <TableCell rowSpan={rowSpan}>\r\n                <Typography variant=\"body2\">\r\n                    {Tr('additional_offer_nr', {value: additionalRound.ordinalNumber})}\r\n                </Typography>\r\n            </TableCell>}\r\n            <TableCell>\r\n                <Typography>{element.name}</Typography>\r\n            </TableCell>\r\n            {first && <TableCell rowSpan={rowSpan}>\r\n                <AdditionalRoundPassiveStatusCell\r\n                    demandId={demandId}\r\n                    working={working}\r\n                    editable={editable}\r\n                    rowWorking={curWorking}\r\n                    setRowWorking={setCurWorking}\r\n                    refreshRow={refreshRow}\r\n                    additionalRound={additionalRound}\r\n                    serverBrowserTimeDiff={serverBrowserTimeDiff}\r\n                />\r\n\r\n            </TableCell>}\r\n        </TableRow>)\r\n    }\r\n\r\n\r\n    return (<>{\r\n        additionalRound.contractors.map((element, index, array) => getRow(element, index, array))\r\n    }\r\n    </>)\r\n}\r\n\r\nAdditionalRoundPassiveRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n    additionalRound: PropTypes.object.isRequired,\r\n    rowNumber: PropTypes.number.isRequired,\r\n}\r\n\r\nexport default AdditionalRoundPassiveRow;\r\n\r\n","import React from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport AdditionalRoundPassiveRow from \"./AdditionalRoundPassiveRow\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        border: `solid 3px ${theme.palette.background.paper}`,\r\n        \"& .MuiTableCell-root\": {\r\n            border: `solid 1px ${theme.palette.border.dark}`,\r\n            padding: theme.spacing()\r\n        }\r\n    },\r\n    headRow: {\r\n        \"&>.MuiTableCell-head\": {\r\n            textAlign: \"center\",\r\n            borderBottom: `solid 3px ${theme.palette.primary.main}`\r\n        }\r\n    },\r\n    nameColumn: {\r\n        width: 210\r\n    },\r\n    contractorColumn: {\r\n        width: 250\r\n    }\r\n\r\n}));\r\n\r\nfunction AdditionalRoundPassiveTable(\r\n    {\r\n        demandId,\r\n        additionalPassiveRounds,\r\n        working,\r\n        editable\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    return (<Table className={classes.table}>\r\n        <TableHead>\r\n            <TableRow className={classes.headRow}>\r\n                <TableCell className={classes.nameColumn}>{Tr(\"additional_offer_collection\")}</TableCell>\r\n                <TableCell className={classes.contractorColumn}>{Tr(\"contractor\")}</TableCell>\r\n                <TableCell>{Tr('status')}</TableCell>\r\n            </TableRow>\r\n        </TableHead>\r\n        <TableBody>\r\n            {\r\n                additionalPassiveRounds.map((element, index) => (<AdditionalRoundPassiveRow\r\n                    key={element.roundId}\r\n                    demandId={demandId}\r\n                    additionalRound={element}\r\n                    rowNumber={index}\r\n                    working={working}\r\n                    editable={editable}\r\n                />))\r\n            }\r\n        </TableBody>\r\n    </Table>)\r\n}\r\n\r\nAdditionalRoundPassiveTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    additionalPassiveRounds: PropTypes.array.isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    working: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default AdditionalRoundPassiveTable;\r\n\r\n","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport * as Yup from \"yup\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport AdditionalRoundPassiveService from \"services/AdditionalRoundPassiveService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    cells: {\r\n        padding: theme.spacing()\r\n    },\r\n    partColumn: {\r\n        width: 75\r\n    },\r\n    dateTimePicker: {\r\n        width: 350\r\n    }\r\n}));\r\n\r\n\r\nconst AdditionalRoundPassiveCreatePopup = (\r\n    {\r\n        demandId,\r\n        onCancel,\r\n        onSuccess,\r\n        formSubmit\r\n    }) => {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [contractors, setContractors] = useState(null);\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(false);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = (values) => {\r\n        setError(false);\r\n        setWorking(true);\r\n        AdditionalRoundPassiveService.createAdditionalPassiveRound(demandId, values).then(onSuccess).catch(() => {\r\n            setError(true);\r\n            setWorking(false);\r\n        })\r\n    }\r\n\r\n    useEffect(() => {\r\n        AdditionalRoundPassiveService.getAvailableContractors(demandId).then(resp => setContractors(resp\r\n            .map(x => ({...x, identity: \"_\" +  x.identity, }))))\r\n            .finally(() => setWorking(false));\r\n    }, [demandId])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('additional_round_create_additional_offers_begin_button'), handleSubmit, undefined, working || !contractors?.length));\r\n        return buttons;\r\n    }\r\n    const handleEndDate = (formikProps, value) => {\r\n        formikProps.setFieldValue('openOfferDate', value);\r\n    }\r\n\r\n    const validationSchema = () => {\r\n        const shape = {\r\n            contractors: VS.any().test('partSelected', Tr('choose_at_least_two_contractors'), (e) => {\r\n                const selected = Object.keys(e).filter(x => e[x] === true).length;\r\n                return selected > 1;\r\n            }),\r\n            endDate: VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past')),\r\n            openOfferDate: VS.dateTimeValid()\r\n                .when('endDate', (endDate, schema) => {\r\n                    return schema.test('EndDateLessOpenDate', Tr(\"EndDateLessOpenDate\"), (offerOpenDate) => {\r\n                        if (endDate && offerOpenDate) {\r\n                            return !offerOpenDate.isBefore(endDate);\r\n                        }\r\n                        return false;\r\n                    })\r\n                })\r\n        }\r\n        return Yup.object().shape(shape)\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('additional_round_create_additional_offers_popup_title')}\r\n            maxWidth='md'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n\r\n                {working && <Loading/>}\r\n                {error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{Tr('unknown_error_message')}</TypographyWithIcon>}\r\n                {!!contractors && <>\r\n\r\n                    <Form\r\n                        initialValues={{\r\n                            endDate: null,\r\n                            openOfferDate: null,\r\n                            contractors: contractors.reduce((prev, cur) => {\r\n                                prev[cur.identity] = false;\r\n                                return prev;\r\n                            }, {})\r\n                        }}\r\n                        validationSchema={validationSchema()}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <GridBlock\r\n                                column\r\n                            >\r\n                                <DateTimePicker\r\n                                    className={classes.dateTimePicker}\r\n                                    id='endDate'\r\n                                    label={Tr('additional_round_end_date')}\r\n                                    formikProps={formikProps}\r\n                                    disabled={working || !contractors?.length}\r\n                                    onChange={(value) => handleEndDate(formikProps, value)}\r\n                                    minDate={new Date()}\r\n                                />\r\n\r\n                                <DateTimePicker\r\n                                    className={classes.dateTimePicker}\r\n                                    id='openOfferDate'\r\n                                    label={Tr('additional_round_open_offer_date')}\r\n                                    formikProps={formikProps}\r\n                                    disabled={working || !contractors?.length}\r\n                                    minDate={new Date()}\r\n                                />\r\n                                {\r\n                                    !(contractors?.length) ?\r\n                                        <BoldTypography variant='body1'>\r\n                                            {\r\n                                                contractors.error ? contractors.error : Tr('additional_round_auction_list_empty')\r\n                                            }\r\n                                        </BoldTypography>\r\n                                        :\r\n                                        <PartsTable\r\n                                            label={Tr('additional_round_passive_list_title')}\r\n                                            id={'contractors'}\r\n                                            formikProps={formikProps}\r\n                                            elementList={contractors}\r\n                                        />\r\n                                }\r\n                            </GridBlock>\r\n                        )}\r\n                    </Form>\r\n\r\n\r\n                </>}\r\n            </GridBlock>\r\n\r\n\r\n        </Dialog>)\r\n}\r\n\r\nAdditionalRoundPassiveCreatePopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AdditionalRoundPassiveCreatePopup)","import React, {useEffect, useState} from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport AdditionalRoundPassiveService from \"services/AdditionalRoundPassiveService\";\r\nimport AdditionalRoundPassiveTable from \"./components/AdditionalRoundPassiveTable\";\r\nimport Button from \"../../../../../../../components/Button\";\r\nimport AdditionalRoundPassiveCreatePopup from \"./components/AdditionalRoundPassiveCreatePopup\";\r\nimport {AdditionalRoundStatusesPending} from \"../../../../../../../constants/AdditionalRoundStatus\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    button: {\r\n        float: 'right',\r\n        marginBottom: theme.spacing()\r\n    }\r\n}));\r\n\r\nfunction AdditionalRoundPassive(\r\n    {\r\n        match,\r\n        additionalPassiveRounds,\r\n        demandValidation\r\n    }) {\r\n    const classes = useStyles();\r\n    const curDemandValidation = DemandValidation.ADDITIONAL_ROUND_PASSIVE;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n\r\n    const [refresh, setRefresh] = useState(0);\r\n    const [createPopupOpened, setCreatePopupOpened] = useState(false);\r\n\r\n    useEffect(() => {\r\n        AdditionalRoundPassiveService.getAdditionalPassiveRoundsList(demandId);\r\n        return () => AdditionalRoundPassiveService.clearResources(AdditionalRoundPassiveService.ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID);\r\n    }, [demandId, refresh])\r\n\r\n    const refreshData = () => {\r\n        setRefresh(x => x+1)\r\n    }\r\n\r\n    if (!additionalPassiveRounds) return <Loading/>;\r\n\r\n    return (<GridBlock column>\r\n        <DemandValidationMessages editable={editable} section={section}/>\r\n\r\n        {\r\n            editable && <Button\r\n                className={classes.button}\r\n                onClick={() => setCreatePopupOpened(true)}\r\n                disabled={!(additionalPassiveRounds.length === 0 || AdditionalRoundStatusesPending.indexOf(additionalPassiveRounds[0].status) === -1)}\r\n            >{Tr('additional_round_create_additional_offers_button')}</Button>\r\n        }\r\n\r\n\r\n        {!additionalPassiveRounds?.length ?\r\n            <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n            :\r\n            <>\r\n                <AdditionalRoundPassiveTable\r\n                    demandId={demandId}\r\n                    additionalPassiveRounds={additionalPassiveRounds}\r\n                    working={false}\r\n                    editable={editable}\r\n                />\r\n            </>}\r\n        {\r\n            createPopupOpened &&\r\n            <AdditionalRoundPassiveCreatePopup\r\n                demandId={demandId}\r\n                onCancel={() => setCreatePopupOpened(false)}\r\n                onSuccess={() => {\r\n                    refreshData();\r\n                    setCreatePopupOpened(false);\r\n                }}\r\n            />\r\n        }\r\n    </GridBlock>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    additionalPassiveRounds: state.resources[AdditionalRoundPassiveService.ADDITIONAL_PASSIVE_ROUNDS_LIST_RESOURCE_ID],\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(AdditionalRoundPassive));\r\n\r\n","import React from 'react'\r\nimport AdditionalRoundPassive from \"./AdditionalRoundPassive\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <AdditionalRoundPassive />)\r\n}\r\n\r\n\r\nexport default Index;","import React, {useMemo, useState} from \"react\";\r\nimport PropTypes from 'prop-types';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport EvaliationFinishService from \"services/EvaluationFinishService\";\r\nimport {connect} from \"react-redux\";\r\nimport Button from \"components/Button\";\r\nimport Tr from 'translations/Translations'\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport LoadingScreen from \"components/complex/loadingScreen/LoadingScreen\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Icon from '@material-ui/icons/CheckBox'\r\nimport IconOff from '@material-ui/icons/HighlightOff';\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    button: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    text: {\r\n        marginTop: theme.spacing(4)\r\n    },\r\n    icon: theme.components.icon,\r\n}))\r\n\r\nconst rp = RouterPath.myProcedure;\r\n\r\nfunction StageFinish(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n    const classes = useStyle();\r\n    const id = match.params.id;\r\n    const curDemandValidation = DemandValidation.STAGE_FINISH;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const prevErrors = useMemo(() => demandValidation.filter((x) => x.section !== curDemandValidation && x.status === 'ERROR'), [demandValidation, curDemandValidation]);\r\n    const [working, setWorking] = useState(false)\r\n\r\n    const goToFinish = () => {\r\n        setWorking(true);\r\n        EvaliationFinishService.doFinishEvaluation(id).finally(() => setWorking(false)).then((resp) => {\r\n            if (resp.success) {\r\n                if (resp.result) {\r\n                    window.location.href = resp.result;\r\n                } else {\r\n                    RouterPath.redirect(RouterPath.createPath(rp.steps.MP_4_ID, {id: id}))\r\n                }\r\n            }\r\n        });\r\n    }\r\n\r\n    const hasPrevErrors = prevErrors.length > 0;\r\n    return (<GridBlock\r\n            direction='column'\r\n            alignItems='center'\r\n        >\r\n            {hasPrevErrors ?\r\n                <IconOff className={classes.icon} color='primary'/>\r\n                :\r\n                <Icon className={classes.icon} color='primary'/>\r\n            }\r\n            {hasPrevErrors ?\r\n                <Typography>{Tr('to_finish_stage_done_sections')}: \"{prevErrors.map((x) => Tr(DemandValidationKeys[x.section])).join(\"\\\", \\\"\")}\"</Typography>\r\n                :\r\n                <Typography>{Tr('go_to_stage_finishing_info')}</Typography>\r\n            }\r\n            <Button className={classes.button}\r\n                    disabled={hasPrevErrors || !section.editable || section.status !== 'ERROR'}\r\n                    onClick={goToFinish}>\r\n                {Tr('primary_tender_variant_make_negociation')}\r\n            </Button>\r\n            <LoadingScreen open={working}/>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nStageFinish.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation\r\n}), {})(withRouter(StageFinish));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport StageFinish from \"./StageFinish\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n\r\n    return (expanded && <StageFinish />)\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport PropTypes from 'prop-types';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport Button from \"components/Button\";\r\nimport Tr from 'translations/Translations'\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Icon from '@material-ui/icons/CheckBox'\r\nimport IconOff from '@material-ui/icons/HighlightOff';\r\nimport OfferChoiceService from \"../../../../../../../services/OfferChoiceService\";\r\nimport {simpleConfirm} from \"../../../../../../../libs/ConfirmNotification\";\r\nimport LoadingScreen from \"../../../../../../../components/complex/loadingScreen/LoadingScreen\";\r\nimport moment from \"../../../../../../../libs/moment\";\r\nimport DateFormats from \"../../../../../../../constants/DateFormats\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    button: {\r\n        width: 400\r\n    },\r\n    buttonRow: {\r\n        marginTop: theme.spacing(2),\r\n        minWidth: 900\r\n    },\r\n    text: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    info: {\r\n        marginBottom: theme.spacing(4)\r\n    },\r\n    icon: theme.components.icon,\r\n}))\r\n\r\nfunction PrimaryTenderChoice(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n    const classes = useStyle();\r\n    const id = match.params.id;\r\n    const curDemandValidation = DemandValidation.PRIMARY_TENDER_CHOICE;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const prevErrors = useMemo(() => demandValidation.filter((x) => x.section !== curDemandValidation && x.status === 'ERROR'), [demandValidation, curDemandValidation]);\r\n    const [working, setWorking] = useState(false)\r\n    const [negotiationButton, setNegotiationButton] = useState(false);\r\n    const [foundExtremelyLowOfferStatus, setFoundExtremelyLowOfferStatus] = useState(false);\r\n\r\n    useEffect(() => {\r\n        if (section.choicePending) {\r\n            OfferChoiceService.checkForPrimaryTenderChoiceOptions(id).then(resp => {\r\n                setNegotiationButton(resp.result.showNegotiationPathButton);\r\n                setFoundExtremelyLowOfferStatus(resp.result.extremelyLowOfferStatusFound);\r\n            });\r\n        }\r\n    }, [id, section]);\r\n\r\n    const makeNegotiations = () => {\r\n        setWorking(true);\r\n        OfferChoiceService.postPrimaryTenderDoNegotiations(id).catch(() => setWorking(false));\r\n    }\r\n\r\n    const skipNegotiations = () => {\r\n        setWorking(true);\r\n        OfferChoiceService.postPrimaryTenderDoOfferChoice(id).catch(() => setWorking(false));\r\n    }\r\n\r\n    const hasPrevErrors = prevErrors.length > 0;\r\n    return (section.choicePending ? <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n            >\r\n                {\r\n                    hasPrevErrors ?\r\n                        <IconOff className={classes.icon} color='primary'/>\r\n                        :\r\n                        <Icon className={classes.icon} color='primary'/>\r\n                }\r\n                {hasPrevErrors ?\r\n                    <Typography className={classes.info}>{Tr('to_primary_tender_choice_done_sections')}:\r\n                        \"{prevErrors.map((x) => Tr(DemandValidationKeys[x.section])).join(\"\\\", \\\"\")}\"</Typography>\r\n                    :\r\n                    <Typography className={classes.info}>{!!negotiationButton ? Tr('primary_tender_variant_make_choice') : Tr('primary_tender_variant_no_contractors')}</Typography>\r\n                }\r\n                <GridBlock justify=\"space-between\" className={classes.buttonRow}>\r\n                    <Button className={classes.button} disabled={working || hasPrevErrors || !section.editable || !negotiationButton}\r\n                            onClick={() => simpleConfirm(foundExtremelyLowOfferStatus ? \"primary_tender_variant_make_negociation_confirm_extremly_low\" : \"primary_tender_variant_make_negociation_confirm\", makeNegotiations)}>\r\n                        {Tr('primary_tender_variant_make_negociation')}\r\n                    </Button>\r\n                    <Button className={classes.button} disabled={working || hasPrevErrors || !section.editable}\r\n                            onClick={() => simpleConfirm(\"primary_tender_variant_skip_negociation_confirm\", skipNegotiations)}>\r\n                        {Tr('primary_tender_variant_skip_negociation')}\r\n                    </Button>\r\n                </GridBlock>\r\n                <LoadingScreen open={working}/>\r\n            </GridBlock>\r\n\r\n            :\r\n\r\n            <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n            >\r\n                <Icon className={classes.icon} color='primary'/>\r\n                <Typography>{Tr('primary_tender_variant_choice_made')}: {!!section.negotiationsCreated ? Tr('primary_tender_variant_make_negociation') : Tr('primary_tender_variant_skip_negociation')}</Typography>\r\n\r\n                {!!section.choiceDate && <Typography\r\n                    className={classes.text}>{Tr('primary_tender_variant_choice_made_date')}: {moment(section.choiceDate).format(DateFormats.DATETIME_FORMAT)}</Typography>}\r\n            </GridBlock>\r\n    )\r\n}\r\n\r\nPrimaryTenderChoice.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation\r\n}), {})(withRouter(PrimaryTenderChoice));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport PrimaryTenderChoice from \"./PrimaryTenderChoice\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n\r\n    return (expanded && <PrimaryTenderChoice />)\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import {RestRequestDELETE, RestRequestGET, RestRequestPOST} from \"../libs/RestRequest\";\r\nimport Endpoints from \"../constants/Endpoints\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport reduxStore from 'redux/store'\r\nimport {setSaveStatusError} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\nimport validateSection from \"./helpers/validateSection\";\r\n\r\nconst getDemandAdditionalInfoWrapper = async (id) => {\r\n    try {\r\n        return RestRequestGET(Endpoints.DEMAND_ADDITIONAL_INFO(id));\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst saveDemandAdditionalInfo = async (id, data, sectionId) => {\r\n    try {\r\n        const resp = RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_INFO(id), data);\r\n        if (isResponseValid(resp, (e) => reduxStore.dispatch(setSaveStatusError(e))))\r\n            await validateSection(sectionId, id, true);\r\n    } catch (error) {\r\n        console.error(error);\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n    }\r\n}\r\nconst validate = async (id, section) => {\r\n    return RestRequestGET(Endpoints.DEMAND_ADDITIONAL_INFO_VALIDATE(id), {params: {section: section}})\r\n}\r\n\r\nconst checkForDraft = async (id) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_INFO_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraft = async (id) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_ADDITIONAL_INFO_AUTOSAVE(id));\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n    await RestRequestPOST(Endpoints.DEMAND_ADDITIONAL_INFO_AUTOSAVE(id), formValues);\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n    await RestRequestDELETE(Endpoints.DEMAND_ADDITIONAL_INFO_AUTOSAVE(id));\r\n}\r\n\r\nexport default {\r\n    getDemandAdditionalInfoWrapper,\r\n    saveDemandAdditionalInfo,\r\n    validate,\r\n    checkForDraft,\r\n    loadDraft,\r\n    saveDraft,\r\n    deleteDraft\r\n}","import {createContext} from \"react\";\r\nexport default createContext();","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport YesNo from \"components/YesNo\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\n\r\nfunction NoticeYesNoInput\r\n({\r\n     id,\r\n     label,\r\n     formikProps,\r\n     required,\r\n     disabled\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(label ? label : id);\r\n\r\n\r\n    const input = <YesNo\r\n        id={id}\r\n        label={formTr(label ? label : id)}\r\n        formikProps={formikProps}\r\n        required={required}\r\n        skipCheckTouched\r\n        disabled={disabled}\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeYesNoInput;","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport TextInput from \"components/TextInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport INPUT_TYPE from \"../../../../../constants/INPUT_TYPE\";\r\n\r\nfunction NoticeIntegerInput\r\n({\r\n     id,\r\n     label,\r\n     formikProps,\r\n     disabled,\r\n     required\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(label ? label : id);\r\n\r\n\r\n    const input = <TextInput\r\n        id={id}\r\n        type={INPUT_TYPE.INTEGER_POSITIVE_AMOUNT}\r\n        label={formTr(label ? label : id)}\r\n        formikProps={formikProps}\r\n        required={required}\r\n        disabled={disabled}\r\n        skipCheckTouched\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeIntegerInput;","import React, {useEffect, useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport {TreeItem, TreeView} from \"@material-ui/lab\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\r\nimport TextField from \"@material-ui/core/TextField/TextField\";\r\nimport Chip from \"@material-ui/core/Chip\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport Tr from \"translations/Translations\";\r\nimport Dialog from \"./Dialog\";\r\nimport SingleButton from \"./popup/components/SingleButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        position: \"relative\",\r\n        marginBottom: 10\r\n    },\r\n    dialogPaper: {\r\n        padding: theme.spacing(2),\r\n        minWidth: theme.breakpoints.values.sm\r\n    },\r\n    search: {\r\n        width: '90%'\r\n    },\r\n    textField: {\r\n        '&>.MuiInputBase-root': {\r\n            flexWrap: \"nowrap\",\r\n            justifyContent: \"space-between\",\r\n            cursor: \"pointer\"\r\n        },\r\n        '& .MuiChip-root': {\r\n            margin: 3,\r\n            maxWidth: '100%'\r\n        },\r\n        '& .MuiInputBase-input': {\r\n            padding: 4,\r\n            width: 0,\r\n            maxWidth: 30,\r\n            opacity: 1,\r\n            flexGrow: 1,\r\n            textOverflow: 'ellipsis',\r\n            visibility: \"hidden\"\r\n        }\r\n    },\r\n    selected: {\r\n        background: `${theme.palette.primary.main} !important`,\r\n        color: `${theme.palette.secondary.contrastText} !important`\r\n\r\n    },\r\n    max100: {\r\n        maxWidth: \"100%\"\r\n    }\r\n}));\r\n\r\nfunction SelectTreeView(\r\n    {\r\n        formikProps,\r\n        id,\r\n        label,\r\n        items,\r\n        multiple = false,\r\n        noError,\r\n        className,\r\n        required,\r\n        disabled,\r\n        onChange = () => {\r\n        },\r\n        unmountOnExit,\r\n        skipCheckTouched,\r\n        useObjectInsteadOfValues,\r\n        prefixLabelsWithKeys = false\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [expanded, setExpanded] = React.useState([]);\r\n    const [searchText, setSearchText] = React.useState(\"\");\r\n    const [itemsFiltered, setItemsFiltered] = useState(items);\r\n\r\n    const keyToData = useMemo(() => {\r\n        const map = new Map();\r\n        const doItem = (item) => {\r\n            const hasChildren = Array.isArray(item.items) && item.items.length > 0;\r\n            map.set(item.value, {label: prefixLabelsWithKeys ? item.value + \" - \" + item.label : item.label, last: !hasChildren, value: item})\r\n            if (hasChildren) {\r\n                item.items.forEach(doItem)\r\n            }\r\n        }\r\n\r\n        items.forEach(doItem)\r\n\r\n        return map;\r\n    }, [items, prefixLabelsWithKeys])\r\n\r\n    useEffect(()=> {\r\n        setSearchText(\"\")\r\n        setItemsFiltered(items);\r\n    }, [items])\r\n\r\n\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    const touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched)\r\n    const _value = getObjectValue(id, formikProps.values, null)\r\n    const selected = _value !== null ? multiple ? _value : [_value] : []\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const isError = !noError && (!!errorValue && !!touched)\r\n\r\n    let _label = label;\r\n    if (required) _label += '*';\r\n\r\n    const getLabel = (node) => {\r\n        return prefixLabelsWithKeys ? node.value + ' - ' + node.label : node.label\r\n    }\r\n\r\n    const renderTree = (nodes, i) => {\r\n        return (!unmountOnExit || open) && nodes.map(node => {\r\n            if (Array.isArray(node.items) && node.items.length > 0) {\r\n                return (<TreeItem key={node.value} nodeId={node.value} label={getLabel(node)}>\r\n                    {Array.isArray(node.items) && node.items.length > 0 ? renderTree(node.items, i + 1) : null}\r\n                </TreeItem>)\r\n            } else {\r\n                const chosen = isSelected(node.value);\r\n                const icon = multiple ? chosen ? <CheckBoxIcon/> : <CheckBoxOutlineBlankIcon/> : undefined;\r\n\r\n                return (\r\n                    <TreeItem\r\n                        key={node.value}\r\n                        nodeId={node.value}\r\n                        label={getLabel(node)}\r\n                        icon={icon}\r\n                    />\r\n                )\r\n            }\r\n        })\r\n    }\r\n\r\n    const handleToggle = (event, nodeIds) => {\r\n        setExpanded(nodeIds);\r\n    };\r\n\r\n    const isSelected = (nodeValue) => {\r\n        if(useObjectInsteadOfValues) {\r\n            return selected.find(e => e.value === nodeValue) !== undefined;\r\n        } else {\r\n            return selected.indexOf(nodeValue) !== -1\r\n        }\r\n    }\r\n\r\n    const handleSelect = (event, nodeId) => {\r\n        const elemObject = keyToData.get(nodeId);\r\n        if (elemObject.last) {\r\n            if (multiple) {\r\n                let newSelected;\r\n                if (!isSelected(nodeId)) {\r\n                    const elem = useObjectInsteadOfValues ? elemObject.value : nodeId;\r\n                    newSelected = [...selected, elem];\r\n                } else {\r\n                    newSelected = selected.filter(x => useObjectInsteadOfValues ? x.value !== nodeId : x !== nodeId)\r\n                }\r\n                formikProps.setFieldValue(id, newSelected);\r\n                onChange(newSelected)\r\n            } else {\r\n                formikProps.setFieldValue(id, nodeId);\r\n                setOpen(false)\r\n                onChange(nodeId)\r\n            }\r\n        }\r\n    };\r\n\r\n    const handleDelete = (nodeId) => {\r\n        if (multiple) {\r\n            const newSelected = selected.filter(x => useObjectInsteadOfValues ? x.value !== nodeId.value : x !== nodeId);\r\n            formikProps.setFieldValue(id, newSelected);\r\n            onChange(newSelected)\r\n        } else {\r\n            formikProps.setFieldValue(id, null);\r\n            onChange(null)\r\n        }\r\n    }\r\n\r\n    const [open, setOpen] = useState(false);\r\n    const handleClick = (event) => {\r\n        if(editable && !disabled)\r\n            setOpen(true);\r\n    };\r\n\r\n    useDebouncedEffect(() => {\r\n\r\n\r\n        if (searchText === \"\") {\r\n            if (items !== itemsFiltered) {\r\n                setItemsFiltered(items);\r\n                setExpanded([])\r\n            }\r\n        } else {\r\n\r\n            const fExp = []\r\n            const filter = (text, nodes, parentVisible) => {\r\n                const arr = [];\r\n                for (const node of nodes) {\r\n                    let includes = parentVisible || getLabel(node).search(new RegExp(text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), \"i\")) > -1;\r\n                    const hasChildren = Array.isArray(node.items) && node.items.length > 0;\r\n\r\n                    let childrenFiltered;\r\n                    if (hasChildren) {\r\n                        childrenFiltered = filter(text, node.items, includes);\r\n                        if (childrenFiltered.length > 0)\r\n                            includes = true;\r\n                    }\r\n\r\n                    if (includes) {\r\n                        arr.push({label: node.label, value: node.value, items: childrenFiltered})\r\n                        if (hasChildren) {\r\n                            fExp.push(node.value);\r\n                        }\r\n                    }\r\n                }\r\n                return arr;\r\n            }\r\n\r\n            const itemsF = filter(searchText, items, false);\r\n            setItemsFiltered(itemsF);\r\n            setExpanded(fExp);\r\n        }\r\n\r\n\r\n    }, {timeout: 800, ignoreInitialCall: true}, [searchText])\r\n\r\n    const onClosePopup = ()=> setOpen(false);\r\n\r\n    return (<div className={classes.root} data-id={id}>\r\n            <TextField\r\n                fullWidth\r\n                label={_label}\r\n                error={isError}\r\n                helperText={noError ? undefined : isError ? errorValue : undefined}\r\n                value=\"\"\r\n                onClick={handleClick}\r\n                classes={{\r\n                    root: classes.textField\r\n                }}\r\n                InputProps={{\r\n                    startAdornment: selected.length === 0 ? undefined : (\r\n                        <div className={classes.max100}>\r\n                            {selected.map(x => (\r\n                                <Chip className={className} key={useObjectInsteadOfValues ? x.value : x} variant=\"outlined\" onDelete={!editable || disabled ? undefined : () => handleDelete(x)} label={useObjectInsteadOfValues ? x.label : keyToData.get(x)?.label}/>))}\r\n                        </div>\r\n                    ),\r\n                    endAdornment: <ExpandMoreIcon />\r\n                }}\r\n                disabled={!editable || disabled}\r\n            />\r\n\r\n            <Dialog\r\n                classes={{paper: classes.dialogPaper}}\r\n                onClose={onClosePopup}\r\n                open={editable && !disabled && open}\r\n                maxWidth=\"sm\"\r\n                title={<TextField className={classes.search} value={searchText} onChange={(e) => setSearchText(e.target.value)} label={Tr('search2')}></TextField>}\r\n                dialogActions={!!multiple && <SingleButton\r\n                    justify='flex-end'\r\n                    label={Tr('close')}\r\n                    onClick={onClosePopup}/>}\r\n            >\r\n                <TreeView\r\n                    className={classes.root}\r\n                    defaultCollapseIcon={<ExpandMoreIcon/>}\r\n                    defaultExpandIcon={<ChevronRightIcon/>}\r\n                    expanded={expanded}\r\n                    selected={useObjectInsteadOfValues ? selected.map(x => x.value) : selected}\r\n                    onNodeToggle={handleToggle}\r\n                    onNodeSelect={handleSelect}\r\n                >\r\n                    {renderTree(itemsFiltered)}\r\n                </TreeView>\r\n            </Dialog>\r\n        </div>\r\n    )\r\n}\r\n\r\nSelectTreeView.propTypes = {\r\n    className: PropTypes.string,\r\n    formikProps: PropTypes.object,\r\n    id: PropTypes.string.isRequired,\r\n    label: PropTypes.string,\r\n    items: PropTypes.arrayOf(\r\n        PropTypes.oneOfType([\r\n            PropTypes.shape({\r\n                value: PropTypes.any.isRequired,\r\n                label: PropTypes.string.isRequired,\r\n            }),\r\n            PropTypes.string.isRequired,\r\n        ])\r\n    )\r\n}\r\n\r\nSelectTreeView.defaultProps = {\r\n    items: []\r\n}\r\n\r\nexport default SelectTreeView\r\n","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport SelectTreeView from \"components/SelectTreeView\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\n\r\nfunction NoticeGlossaryInput\r\n({\r\n     id,\r\n     label,\r\n     formikProps,\r\n     items,\r\n     multiple,\r\n     required,\r\n     unmountOnExit,\r\n     onChange,\r\n     useObjectInsteadOfValues,\r\n     prefixLabelsWithKeys,\r\n     disabled,\r\n     className\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(label ? label : id);\r\n\r\n\r\n    const input = <SelectTreeView\r\n        id={id}\r\n        label={formTr(label ? label : id)}\r\n        items={items}\r\n        formikProps={formikProps}\r\n        multiple={multiple}\r\n        required={required}\r\n        unmountOnExit={unmountOnExit}\r\n        skipCheckTouched\r\n        onChange={onChange}\r\n        useObjectInsteadOfValues={useObjectInsteadOfValues}\r\n        prefixLabelsWithKeys={prefixLabelsWithKeys}\r\n        disabled={disabled}\r\n        className={className}\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={<div dangerouslySetInnerHTML={{__html: tip}}></div>}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeGlossaryInput;","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport TextInput from \"components/TextInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport INPUT_TYPE from \"../../../../../constants/INPUT_TYPE\";\r\n\r\nfunction NoticeNumericInput\r\n({\r\n     id,\r\n     label,\r\n     formikProps,\r\n     disabled,\r\n     required\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(label ? label : id);\r\n\r\n\r\n    const input = <TextInput\r\n        id={id}\r\n        type={INPUT_TYPE.NUMBER_19}\r\n        label={formTr(label ? label : id)}\r\n        formikProps={formikProps}\r\n        required={required}\r\n        disabled={disabled}\r\n        skipCheckTouched\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeNumericInput;","import React, {useEffect, useState} from \"react\";\r\nimport Form from 'components/Form';\r\nimport {withRouter} from \"react-router\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport DemandAdditionalInfoService from \"services/DemandAdditionalInfoService\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeYesNoInput from \"components/complex/nationalNotice/components/inputs/NoticeYesNoInput\";\r\nimport {connect} from \"react-redux\";\r\nimport {setFormDraftLoaded, setOpenForm, setOpenImporter} from \"redux/actions\";\r\nimport NoticeIntegerInput from \"components/complex/nationalNotice/components/inputs/NoticeIntegerInput\";\r\nimport {Accordion, AccordionDetails, AccordionSummary, Collapse, makeStyles} from \"@material-ui/core\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    },\r\n    exceptionChip: {\r\n        \"& .MuiChip-label\": {\r\n            maxWidth: \"100%\"\r\n        }\r\n    },\r\n}))\r\n\r\nfunction getKey(id) {\r\n    const split = id.split(\".\").filter(x => !/^\\d+$/.test(x));\r\n    split.unshift(\"common.form.demandadditionalinfo\");\r\n    return split.join(\".\");\r\n}\r\n\r\nfunction PreparingAdditionalInfo(\r\n    {\r\n        match,\r\n        sectionId,\r\n        formId,\r\n        demandValidation,\r\n        stepperState,\r\n        demandHeader,\r\n        setFormDraftLoaded\r\n    }) {\r\n    const classes = useStyle();\r\n    const section = demandValidation.find(x => x.section === sectionId);\r\n    const editable = section ? section.editable : false;\r\n    const id = match.params.id;\r\n    const [initData, setInitData] = useState(null);\r\n    const [dictionaries, setDictionaries] = useState(null);\r\n    const [translations, setTranslations] = useState(null);\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(formId, undefined,\r\n        autoSaveFormDraftActive ? () => DemandAdditionalInfoService.deleteDraft(id) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(id, DemandAdditionalInfoService.saveDraft, formId) : undefined);\r\n\r\n    const formTr = (id) => {\r\n        const key = getKey(id);\r\n        return translations.labels[key] || key;\r\n    }\r\n    const formTip = (id) => {\r\n        const key = getKey(id);\r\n        return translations.tips[key];\r\n    }\r\n\r\n    const getDict = (id) => {\r\n        return dictionaries[id].items;\r\n    }\r\n\r\n\r\n    useEffect(() => {\r\n        DemandAdditionalInfoService.getDemandAdditionalInfoWrapper(id).then(values => {\r\n            setInitData(values.form);\r\n            setDictionaries(values.dictionaries);\r\n            setTranslations(values.translations);\r\n            if (autoSaveFormDraftActive)\r\n                DemandAdditionalInfoService.checkForDraft(id).then(res => setDraftConfirm(res.result));\r\n        })\r\n    }, [id, autoSaveFormDraftActive])\r\n\r\n    const handleSubmit = (values, formikProps) => {\r\n        DemandAdditionalInfoService.saveDemandAdditionalInfo(id, values, sectionId)\r\n\r\n    }\r\n\r\n    const loadAdditionalInfoDraft = () => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        DemandAdditionalInfoService.loadDraft(id).then(res => {\r\n            setInitData(res.result);\r\n            setFormDraftLoaded(formId, res.success);\r\n        });\r\n        setWorking(false);\r\n    }\r\n\r\n    if (!initData || !dictionaries || !translations || working) return (<Loading/>)\r\n\r\n    return (\r\n        <>\r\n            <Form\r\n                initialValues={initData}\r\n                validationSchema={ValidationShema.any()}\r\n                onSubmit={handleSubmit}\r\n                id={formId}\r\n            >{(formikProps) => (\r\n                <FormTranslationContext.Provider value={{\r\n                    formTr, formTip, getDict\r\n                }}>\r\n                    <SaveFormikValues\r\n                        formikProps={formikProps}\r\n                        id={formId}\r\n                        save={formId === stepperState}\r\n                    />\r\n                    {autoSaveFormDraftActive &&\r\n                    <AutoSaveFormValues\r\n                        formikProps={formikProps}\r\n                        id={id}\r\n                        formId={formId}\r\n                        saveFunc={(formValues) => {\r\n                            DemandAdditionalInfoService.saveDraft(id, formValues)\r\n                        }}\r\n                    />\r\n                    }\r\n                    <Accordion defaultExpanded expanded>\r\n                        <AccordionSummary>\r\n                            <div>\r\n                                <BoldTypography>{formTr(\"table_iv\")}</BoldTypography>\r\n                                <Typography className={classes.italic}>{formTr(\"table_iv_desc\")}</Typography>\r\n                            </div>\r\n                        </AccordionSummary>\r\n                        <AccordionDetails>\r\n                            <GridBlock column>\r\n                                <NoticeIntegerInput\r\n                                    id=\"numberConflictOfInterest\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeIntegerInput\r\n                                    id=\"detectedAgreements\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeIntegerInput\r\n                                    id=\"rejectedContractorOffer\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                            </GridBlock>\r\n                        </AccordionDetails>\r\n                    </Accordion>\r\n\r\n                    <Accordion defaultExpanded expanded>\r\n                        <AccordionSummary>\r\n                            <div>\r\n                                <BoldTypography>{formTr(\"table_v\")}</BoldTypography>\r\n                                <Typography className={classes.italic}>{formTr(\"table_v_desc\")}</Typography>\r\n                            </div>\r\n                        </AccordionSummary>\r\n                        <AccordionDetails>\r\n                            <GridBlock column>\r\n                                <NoticeYesNoInput\r\n                                    id=\"communityReservedTender\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                            </GridBlock>\r\n                        </AccordionDetails>\r\n                    </Accordion>\r\n\r\n                    <Accordion defaultExpanded expanded>\r\n                        <AccordionSummary>\r\n                            <div>\r\n                                <BoldTypography>{formTr(\"table_vi\")}</BoldTypography>\r\n                                <Typography className={classes.italic}>{formTr(\"table_vi_desc\")}</Typography>\r\n                            </div>\r\n                        </AccordionSummary>\r\n                        <AccordionDetails>\r\n                            <GridBlock column>\r\n                                <NoticeYesNoInput\r\n                                    id=\"socialReservedTender\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"definedSocialAspects\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"definedAccessibility\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"definedEmploymentRelationship\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"definedSocialAspectsRequirements\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"definedLabelSocialAspects\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeGlossaryInput\r\n                                    id=\"contractorType\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                    items={getDict(\"SL.MMiA.062\")}\r\n                                />\r\n                            </GridBlock>\r\n                        </AccordionDetails>\r\n                    </Accordion>\r\n\r\n                    <Accordion defaultExpanded expanded>\r\n                        <AccordionSummary>\r\n                            <div>\r\n                                <BoldTypography>{formTr(\"table_vii\")}</BoldTypography>\r\n                                <Typography className={classes.italic}>{formTr(\"table_vii_desc\")}</Typography>\r\n                            </div>\r\n                        </AccordionSummary>\r\n                        <AccordionDetails>\r\n                            <GridBlock column>\r\n                                <NoticeYesNoInput\r\n                                    id=\"envRequirements\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"envSystemStandards\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"envAspectsInEvaluationCriteria\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"lifeCycleCostingApplied\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"envAspectsRequirements\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"definedLabelEnvAspects\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"innAspectsInEvaluationCriteria\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                                <NoticeYesNoInput\r\n                                    id=\"innAspectsRequirements\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                />\r\n                            </GridBlock>\r\n                        </AccordionDetails>\r\n                    </Accordion>\r\n\r\n                    <Accordion defaultExpanded expanded>\r\n                        <AccordionSummary>\r\n                            <div>\r\n                                <BoldTypography>{formTr(\"table_viii\")}</BoldTypography>\r\n                                <Typography className={classes.italic}>{formTr(\"table_viii_desc\")}</Typography>\r\n                            </div>\r\n                        </AccordionSummary>\r\n                        <AccordionDetails>\r\n                            <GridBlock column>\r\n                                <NoticeGlossaryInput\r\n                                    className={classes.exceptionChip}\r\n                                    id=\"exclusionReason\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                    items={getDict(\"SL.MMiA.063\").map((item, index) => ({\r\n                                        label: index + \" - \" + item.label,\r\n                                        value: item.value\r\n                                    })).filter(x => x.value !== \"0\")}\r\n                                />\r\n                            </GridBlock>\r\n                        </AccordionDetails>\r\n                    </Accordion>\r\n\r\n                    <Accordion defaultExpanded expanded>\r\n                        <AccordionSummary>\r\n                            <div>\r\n                                <BoldTypography>{formTr(\"table_ix\")}</BoldTypography>\r\n                                <Typography className={classes.italic}>{formTr(\"table_ix_desc\")}</Typography>\r\n                            </div>\r\n                        </AccordionSummary>\r\n                        <AccordionDetails>\r\n                            <GridBlock column>\r\n                                <NoticeGlossaryInput\r\n                                    id=\"notIncludeReason\"\r\n                                    formikProps={formikProps}\r\n                                    disabled={!editable}\r\n                                    items={getDict(\"SL.MMiA.064\")}\r\n                                    prefixLabelsWithKeys\r\n                                />\r\n                            </GridBlock>\r\n                        </AccordionDetails>\r\n                    </Accordion>\r\n\r\n                    <Collapse in={demandHeader.passiveOfferForm}>\r\n                        <Accordion defaultExpanded expanded>\r\n                            <AccordionSummary>\r\n                                <div>\r\n                                    <BoldTypography>{formTr(\"contract\")}</BoldTypography>\r\n                                    <Typography className={classes.italic}>{formTr(\"contract_desc\")}</Typography>\r\n                                </div>\r\n                            </AccordionSummary>\r\n                            <AccordionDetails>\r\n                                <GridBlock column>\r\n                                    <NoticeNumericInput\r\n                                        id=\"contractValue\"\r\n                                        formikProps={formikProps}\r\n                                        disabled={!editable}\r\n                                    />\r\n                                </GridBlock>\r\n                            </AccordionDetails>\r\n                        </Accordion>\r\n                    </Collapse>\r\n\r\n                </FormTranslationContext.Provider>\r\n            )}\r\n\r\n            </Form>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={loadAdditionalInfoDraft}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nPreparingAdditionalInfo.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n    stepperState: state.stepper.state,\r\n    demandHeader: state.resources.demandHeader\r\n}), {\r\n    setOpenForm, setOpenImporter, setFormDraftLoaded\r\n})(withRouter(PreparingAdditionalInfo));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {DemandValidation, DemandValidationKeys} from \"constants/DemandValidation\";\r\nimport PreparingAdditionalInfo from \"../../../part1/panels/additionalInfo/PreparingAdditionalInfo\";\r\n\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded &&\r\n        <PreparingAdditionalInfo sectionId={DemandValidation.EVALUATION_ADDITIONAL_INFO} formId={DemandValidationKeys.EVALUATION_ADDITIONAL_INFO}/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import {\r\n    AdditionalRoundPassive,\r\n    AgreementsPanel,\r\n    ContractorVerification,\r\n    DemandAdditionalInfo,\r\n    DocumentsPanel,\r\n    EvaluationFinish,\r\n    OfferChoice,\r\n    OffersChoiceResult,\r\n    OffersEvaluation,\r\n    OffersPanel,\r\n    PapersGenerator,\r\n    PrimaryTenderChoice,\r\n    StageFinish\r\n} from \"./panels\";\r\nimport ContractorVerificationService from \"services/ContractorVerificationService\";\r\nimport OfferEvaluationService from \"services/OfferEvaluationService\";\r\nimport OfferChoiceService from \"services/OfferChoiceService\";\r\nimport OffersChoiceResultService from \"services/OffersChoiceResultService\";\r\nimport AgreementsService from \"services/AgreementsService\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport AdditionalRoundPassiveService from \"services/AdditionalRoundPassiveService\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport DemandAdditionalInfoService from \"services/DemandAdditionalInfoService\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\n\r\nexport default {\r\n    mp_3_offers: OffersPanel,\r\n    mp_3_documents: DocumentsPanel,\r\n    mp_3_contractor_verification: ContractorVerification,\r\n    mp_3_offers_evaluation: OffersEvaluation,\r\n    mp_3_offer_choice: OfferChoice,\r\n    mp_3_additional_round_passive: AdditionalRoundPassive,\r\n    mp_3_primary_tender_choice: PrimaryTenderChoice,\r\n    mp_3_offers_choice_result: OffersChoiceResult,\r\n    mp_3_evaluation_finish: EvaluationFinish,\r\n    mp_3_stage_finish: StageFinish,\r\n    mp_3_papers_generator: PapersGenerator,\r\n    mp_3_agreements: AgreementsPanel,\r\n    mp_3_evaluation_additional_info: DemandAdditionalInfo,\r\n}\r\n\r\nexport const panelsValidationKeys = {\r\n    mp_3_offers: (id) => DemandOffersService.validate(id),\r\n    mp_3_documents: (id) => SiwzService.validateDocuments(id),\r\n    mp_3_contractor_verification: (id) => ContractorVerificationService.validate(id),\r\n    mp_3_offers_evaluation: (id) => OfferEvaluationService.validate(id),\r\n    mp_3_offer_choice: (id) => OfferChoiceService.validate(id),\r\n    mp_3_additional_round_passive: (id) => AdditionalRoundPassiveService.validate(id),\r\n    mp_3_primary_tender_choice: (id) => null,\r\n    mp_3_offers_choice_result: (id) => OffersChoiceResultService.validate(id),\r\n    mp_3_evaluation_finish: (id) => null,\r\n    mp_3_stage_finish: (id) => null,\r\n    mp_3_papers_generator: (id) => null,\r\n    mp_3_agreements: (id) => AgreementsService.validate(id),\r\n    mp_3_evaluation_additional_info: (id) => DemandAdditionalInfoService.validate(id, DemandValidation.EVALUATION_ADDITIONAL_INFO),\r\n}","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport {clearResource, setResource, setSaveStatusError} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport downloadFileWithPreloadUrl from \"../libs/downloadFileWithPreloadUrl\";\r\nimport Tr from \"../translations/Translations\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\n\r\nconst RESULT_NOTICE_RESOURCE_ID = 'resultNotice';\r\n\r\nconst getResultNotice = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.RESULT_NOTICE(demandId));\r\n    reduxStore.dispatch(setResource(RESULT_NOTICE_RESOURCE_ID, resp));\r\n    await validateSection(DemandValidation.RESULT_NOTICE, demandId,false);\r\n};\r\n\r\nconst addResultNoticeAttachments = async (demandId, files) => {\r\n    const resp = await RestRequestPOST(Endpoints.RESULT_NOTICE(demandId), {list: files});\r\n    reduxStore.dispatch(setResource(RESULT_NOTICE_RESOURCE_ID, resp))\r\n    await validateSection(DemandValidation.RESULT_NOTICE, demandId,false);\r\n};\r\n\r\nconst publishOjsResultNotice = async (demandId) => {\r\n    return await RestRequestPOST(Endpoints.RESULT_NOTICE_PUBLISH_OJS_NOTICE(demandId));\r\n};\r\n\r\nconst checkOjsResultNotice = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.RESULT_NOTICE_CHECK_OJS_NOTICE(demandId));\r\n        reduxStore.dispatch(\r\n            setResource('resultOjsPublicationStatus', res)\r\n        )\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n};\r\n\r\nconst rollbackOjsResultNotice = async (demandId) => {\r\n    return await RestRequestPOST(Endpoints.RESULT_NOTICE_ROLLBACK_OJS_NOTICE(demandId));\r\n};\r\n\r\nconst getDownloadFile = async (demandId, resultNoticeId, resultFileId, openInBrowser) => {\r\n    await downloadFileWithPreloadUrl(\r\n        Endpoints.RESULT_NOTICE_DOWNLOAD_FILE_URL(demandId, resultNoticeId, resultFileId, openInBrowser),\r\n        openInBrowser);\r\n}\r\n\r\nconst deleteResultNotice = async (demandId, resultNoticeId, resultNoticeAttachmentId) => {\r\n    const resp = await RestRequestDELETE(Endpoints.RESULT_NOTICE_DELETE(demandId, resultNoticeId, resultNoticeAttachmentId))\r\n    const {resources} = reduxStore.getState();\r\n    const res = {\r\n        ...resources[RESULT_NOTICE_RESOURCE_ID],\r\n        attachments: resources[RESULT_NOTICE_RESOURCE_ID].attachments.filter(x => x.identity !== resp.result)\r\n    };\r\n    reduxStore.dispatch(setResource(RESULT_NOTICE_RESOURCE_ID, res))\r\n    await validateSection(DemandValidation.RESULT_NOTICE, demandId,false);\r\n}\r\n\r\nconst publishResultNoticeAttachment = async (demandId, resultNoticeId, resultNoticeAttachmentId) => {\r\n    const resp = await RestRequestPUT(Endpoints.RESULT_NOTICE_ATTACHMENT_PUBLISH(demandId, resultNoticeId, resultNoticeAttachmentId));\r\n    checkAndUpdateAttachment(resp);\r\n    await validateSection(DemandValidation.RESULT_NOTICE, demandId,false);\r\n};\r\n\r\nconst unpublishResultNoticeAttachment = async (demandId, resultNoticeId, resultNoticeAttachmentId) => {\r\n    const resp = await RestRequestPUT(Endpoints.RESULT_NOTICE_ATTACHMENT_UNPUBLISH(demandId, resultNoticeId, resultNoticeAttachmentId));\r\n    checkAndUpdateAttachment(resp);\r\n    await validateSection(DemandValidation.RESULT_NOTICE, demandId,false);\r\n};\r\n\r\nconst publishResultNotice = async (demandId) => {\r\n    const resp = await RestRequestPUT(Endpoints.RESULT_NOTICE_PUBLISH(demandId));\r\n    reduxStore.dispatch(setResource(RESULT_NOTICE_RESOURCE_ID, resp.result));\r\n    return resp;\r\n};\r\n\r\nconst unpublishResultNotice = async (demandId) => {\r\n    const resp = await RestRequestPUT(Endpoints.RESULT_NOTICE_UNPUBLISH(demandId));\r\n    reduxStore.dispatch(setResource(RESULT_NOTICE_RESOURCE_ID, resp.result));\r\n    return resp;\r\n};\r\n\r\nconst updateDescription = async (demandId, {resultNoticeId, resultNoticeAttachmentId}, description) => {\r\n    const resp = await RestRequestPUT(Endpoints.RESULT_NOTICE_DESCRIPTION(demandId, resultNoticeId, resultNoticeAttachmentId), {description});\r\n    checkAndUpdateAttachment(resp);\r\n};\r\n\r\nconst updateNoticeReferenceNumber = async (demandId,  {resultNoticeId, resultNoticeAttachmentId}, noticeReferenceNumber) => {\r\n    const resp = await RestRequestPUT(Endpoints.RESULT_NOTICE_REFERENCE_NUMBER(demandId, resultNoticeId, resultNoticeAttachmentId), {noticeReferenceNumber});\r\n    checkAndUpdateAttachment(resp);\r\n}\r\n\r\nconst checkAndUpdateAttachment = (resp) => {\r\n    try {\r\n        if (resp?.success) {\r\n            const {resources} = reduxStore.getState();\r\n            const res = {\r\n                ...resources[RESULT_NOTICE_RESOURCE_ID],\r\n                attachments: resources[RESULT_NOTICE_RESOURCE_ID].attachments.map(x => x.identity === resp.result.identity ? resp.result : x)\r\n            };\r\n            reduxStore.dispatch(setResource(RESULT_NOTICE_RESOURCE_ID, res))\r\n        } else {\r\n            throw new Error(resp);\r\n        }\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\nconst getDownloadHistory = async (demandId, {resultNoticeId, resultNoticeAttachmentId}, pagination) => {\r\n\r\n    const params = {\r\n        ...pagination\r\n    }\r\n\r\n    const url = Endpoints.RESULT_NOTICE_DOWNLOAD_FILE_HISTORY(demandId, resultNoticeId, resultNoticeAttachmentId, params);\r\n    const siwzDownloadHistory = await RestRequestGET(url, {params});\r\n    return siwzDownloadHistory;\r\n}\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.RESULT_NOTICE_VALIDATE(id));\r\n}\r\n\r\nconst clearResultNoticeResources = () => {\r\n    reduxStore.dispatch(clearResource(RESULT_NOTICE_RESOURCE_ID));\r\n};\r\n\r\nconst addBzpNotice = async (demandId, bzpNoticeId) => {\r\n    const url = Endpoints.RESULT_NOTICE_BZP(demandId)\r\n\r\n    const data = {\r\n        bzpNoticeId\r\n    }\r\n\r\n    return await RestRequestPOST(url, data);\r\n}\r\n\r\nconst buildIdentity = (resultNoticeId, resultNoticeAttachmentId) => ({resultNoticeId, resultNoticeAttachmentId});\r\n\r\nexport default {\r\n    getResultNotice,\r\n    publishOjsResultNotice,\r\n    checkOjsResultNotice,\r\n    rollbackOjsResultNotice,\r\n    addResultNoticeAttachments,\r\n    getDownloadFile,\r\n    deleteResultNotice,\r\n    publishResultNotice,\r\n    unpublishResultNotice,\r\n    unpublishResultNoticeAttachment,\r\n    publishResultNoticeAttachment,\r\n    getDownloadHistory,\r\n    updateDescription,\r\n    updateNoticeReferenceNumber,\r\n    validate,\r\n    clearResultNoticeResources,\r\n    addBzpNotice,\r\n    buildIdentity,\r\n    RESULT_NOTICE_RESOURCE_ID\r\n}","import React, {useReducer} from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport ResultNoticeService from \"services/ResultNoticeService\";\r\nimport {makeStyles, TableCell, TableRow} from \"@material-ui/core\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment from \"libs/moment\";\r\nimport WorkableIconDownloadButton from \"components/button/WorkableIconDownloadButton\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport WorkableIconDownloadCountButton from \"components/button/WorkableIconDownloadCountButton\";\r\nimport WorkableIconUnpublishButton from \"components/button/WorkableIconUnpublishButton\";\r\nimport WorkableIconPublishButton from \"components/button/WorkableIconPublishButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport {createDownloadHistoryFile} from \"components/popup/DownloadHistoryPopup\";\r\nimport Tr from \"translations/Translations\";\r\nimport {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport WorkableIconEditButton from \"../../../../../../../../components/button/WorkableIconEditButton\";\r\nimport {\r\n    createEditNoticeReferenceNumberFile\r\n} from \"../../../../../../../../components/complex/documentsTables/swz/AddNoticeReferenceNumberPopup\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    descriptionTooltip: {\r\n        whiteSpace: 'pre-line'\r\n    }\r\n}))\r\n\r\nfunction AttachmentResultNoticeRow(\r\n    {\r\n        demandId,\r\n        editable,\r\n        resultNotice,\r\n        attachment,\r\n        onEditDescriptionFile,\r\n        onDownloadHistory,\r\n        onEditNoticeReferenceNumberFile\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        preview: false,\r\n        download: false,\r\n        publish: false,\r\n        downloadCount: false,\r\n        delete: false\r\n    });\r\n\r\n    const onDownloadCount = () => {\r\n        onDownloadHistory(createDownloadHistoryFile(attachment.name, demandId, ResultNoticeService.buildIdentity(resultNotice.identity, attachment.identity)))\r\n    };\r\n\r\n\r\n    const downloadFile = (file, openInBrowser) => {\r\n        dispatchIconWorks({type: openInBrowser ? 'preview' : 'download', works: true})\r\n        ResultNoticeService.getDownloadFile(demandId, resultNotice.identity, file.identity, openInBrowser)\r\n            .finally(() => dispatchIconWorks({type: openInBrowser ? 'preview' : 'download', works: false}));\r\n    };\r\n\r\n    const deleteResultNotice = (file) => {\r\n        dispatchIconWorks({type: 'delete', works: true})\r\n        ResultNoticeService.deleteResultNotice(demandId, resultNotice.identity, file.identity).finally(() => dispatchIconWorks({\r\n            type: 'delete',\r\n            works: false\r\n        }));\r\n    };\r\n\r\n    const noticePublication = (file, publish) => {\r\n        dispatchIconWorks({type: 'publish', works: true})\r\n        const func = publish ? ResultNoticeService.publishResultNoticeAttachment : ResultNoticeService.unpublishResultNoticeAttachment;\r\n        func(demandId, resultNotice.identity, file.identity).finally(() => dispatchIconWorks({type: 'publish', works: false}));\r\n    };\r\n\r\n    return (\r\n        <TableRow key={attachment.identity}>\r\n            <TableCell>{attachment.name}</TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconSearchButton\r\n                    onClick={() => onEditDescriptionFile(createEditDescriptionFile(demandId, ResultNoticeService.buildIdentity(resultNotice.identity, attachment.identity),\r\n                        attachment.name, attachment.description, !editable, false))}\r\n                    tooltip={attachment.description ? <p className={classes.descriptionTooltip}>{attachment.description}</p> : <i>{Tr('no_description')}</i>}\r\n                    disabled={iconWorks.anyWorks}\r\n                />\r\n            </TableCell>\r\n            <TableCell>{moment(attachment.createDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}</TableCell>\r\n            <TableCell>{attachment.publishDate && moment(attachment.publishDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}</TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconEditButton\r\n                    tooltip={Tr('enter_notice_reference_number')}\r\n                    onClick={() => onEditNoticeReferenceNumberFile(createEditNoticeReferenceNumberFile(demandId, ResultNoticeService.buildIdentity(resultNotice.identity, attachment.identity),\r\n                        attachment.noticeReferenceNumber))}\r\n                    disabled={iconWorks.anyWorks}\r\n                    working={iconWorks.enterNoticeReferenceNumber}\r\n                />\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconPreviewButton\r\n                    working={iconWorks.preview} disabled={!attachment.actions.preview || iconWorks.anyWorks}\r\n                    onClick={() => downloadFile(attachment, true)}\r\n                />\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconDownloadButton\r\n                    working={iconWorks.download} disabled={!attachment.actions.download || iconWorks.anyWorks}\r\n                    onClick={() => downloadFile(attachment, false)}/>\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                {\r\n                    attachment.published ?\r\n                        <WorkableIconUnpublishButton\r\n                            working={iconWorks.publish} disabled={!editable || !attachment.actions.unpublish || iconWorks.anyWorks}\r\n                            onClick={() => noticePublication(attachment, false)}\r\n                        /> :\r\n                        <WorkableIconPublishButton\r\n                            working={iconWorks.publish} disabled={!editable || !attachment.actions.publish || iconWorks.anyWorks}\r\n                            onClick={() => noticePublication(attachment, true)}\r\n                        />\r\n                }\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconDownloadCountButton\r\n                    tooltip={Tr(\"download_count_x\", {downloadCount: attachment.downloadCount})}\r\n                    working={iconWorks.downloadCount}\r\n                    disabled={!editable || !attachment.actions.downloadCount || iconWorks.anyWorks}\r\n                    onClick={onDownloadCount}\r\n                />\r\n\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconDeleteButton\r\n                    working={iconWorks.delete} disabled={!editable || !attachment.actions.delete || iconWorks.anyWorks}\r\n                    onClick={() => deleteResultNotice(attachment)}\r\n                />\r\n            </TableCell>\r\n        </TableRow>\r\n\r\n    )\r\n}\r\n\r\nAttachmentResultNoticeRow.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    resultNotice: PropTypes.object.isRequired,\r\n    onEditDescriptionFile: PropTypes.func.isRequired,\r\n    onDownloadHistory: PropTypes.func.isRequired\r\n}\r\n\r\n\r\nexport default AttachmentResultNoticeRow;","import React, {useState} from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport ResultNoticeService from \"services/ResultNoticeService\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Tr from \"translations/Translations\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport AttachmentResultNoticeRow from \"./AttachmentResultNoticeRow\";\r\nimport EditDescriptionPopup from \"components/popup/EditDescriptionPopup\";\r\nimport DownloadHistoryPopup from \"components/popup/DownloadHistoryPopup\";\r\nimport AddNoticeReferenceNumberPopup\r\n    from \"../../../../../../../../components/complex/documentsTables/swz/AddNoticeReferenceNumberPopup\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        tableLayout: 'fixed',\r\n        '& td, th': {\r\n            overflow: 'hidden',\r\n        }\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateColumn: theme.components.table.dateTimeColumn\r\n}))\r\n\r\nfunction AttachmentResultNotice(\r\n    {\r\n        demandId,\r\n        editable,\r\n        resultNotice\r\n    }) {\r\n    const classes = useStyles();\r\n    const [addWorking, setAddWorking] = useState(false);\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(null);\r\n    const [editNoticeReferenceNumberFile, setEditNoticeReferenceNumberFile] = useState(null);\r\n    const [downloadHistory, setDownloadHistory] = useState(null);\r\n\r\n    const handleSendFiles = (files) => {\r\n        if (files.length) {\r\n            setAddWorking(true);\r\n            ResultNoticeService.addResultNoticeAttachments(demandId, files).finally(() => setAddWorking(false));\r\n        }\r\n    }\r\n\r\n\r\n    return (<>\r\n            <TableContainer>\r\n                <Table className={clsx(classes.table)}>\r\n                    <TableHead>\r\n                        <TableRow>\r\n                            <TableCell>{Tr(\"name\")}</TableCell>\r\n                            <TableCell className={classes.buttonColumn}>{Tr(\"description\")}</TableCell>\r\n                            <TableCell className={classes.dateColumn}>{Tr(\"add_data\")}</TableCell>\r\n                            <TableCell className={classes.dateColumn}>{Tr(\"publish_data\")}</TableCell>\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                            <TableCell className={classes.buttonColumn}></TableCell>\r\n                        </TableRow>\r\n                    </TableHead>\r\n                    <TableBody>\r\n                        {!!resultNotice.attachments && resultNotice.attachments.map(attachment => (\r\n                            <AttachmentResultNoticeRow\r\n                                key={attachment.identity}\r\n                                demandId={demandId}\r\n                                resultNotice={resultNotice}\r\n                                editable={editable}\r\n                                attachment={attachment}\r\n                                onEditDescriptionFile={setEditDescriptionFile}\r\n                                onDownloadHistory={setDownloadHistory}\r\n                                onEditNoticeReferenceNumberFile={setEditNoticeReferenceNumberFile}\r\n                            />\r\n\r\n                        ))}\r\n                    </TableBody>\r\n                </Table>\r\n            </TableContainer>\r\n            {editable &&\r\n                <UploadFile\r\n                    working={addWorking}\r\n                    onUploadPopupClosed={handleSendFiles}\r\n                />\r\n            }\r\n            {!!editDescriptionFile &&\r\n                <EditDescriptionPopup\r\n                    editDescriptionFile={editDescriptionFile} service={ResultNoticeService}\r\n                    onUpdated={() => setEditDescriptionFile(null)} onClose={() => setEditDescriptionFile(null)}/>\r\n            }\r\n            {downloadHistory &&\r\n                <DownloadHistoryPopup downloadHistoryFile={downloadHistory} service={ResultNoticeService} onClose={() => setDownloadHistory(null)}/>\r\n            }\r\n            {!!editNoticeReferenceNumberFile && <AddNoticeReferenceNumberPopup\r\n                editNoticeReferenceNumberFile={editNoticeReferenceNumberFile}\r\n                onUpdated={() => setEditNoticeReferenceNumberFile(null)}\r\n                onClose={() => setEditNoticeReferenceNumberFile(null)}\r\n                service={ResultNoticeService}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nAttachmentResultNotice.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    resultNotice: PropTypes.object.isRequired\r\n}\r\n\r\n\r\nexport default AttachmentResultNotice;","export const PublishConst = {\r\n\tNOT_SENT: \"NOT_SENT\",\r\n\tSENT: \"SENT\",\r\n\tPUBLISHED: \"PUBLISHED\",\r\n\tCONFIRMED: \"CONFIRMED\",\r\n\tERROR: \"ERROR\",\r\n\tUNAVAILABLE: \"UNAVAILABLE\",\r\n\tUE_VALIDATION_ERROR: \"UE_VALIDATION_ERROR\",\r\n\tNOT_PUBLISHED: \"NOT_PUBLISHED\",\r\n}\r\n","export const ResultNoticeType = {\r\n    OJS: \"OJS\",\r\n    ATTACHMENT: \"ATTACHMENT\"\r\n}\r\nexport default ResultNoticeType;","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations'\r\nimport ResultNoticeService from \"services/ResultNoticeService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport Typography from \"components/Typography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport validateSection from \"../../../../../../../../services/helpers/validateSection\";\r\nimport {DemandValidation} from \"../../../../../../../../constants/DemandValidation\";\r\nimport {connect} from \"react-redux\";\r\nimport {PublishConst} from 'constants/PublicationConst';\r\nimport ResultNoticeType from \"../constants/ResultNoticeType\";\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    text: {\r\n        marginBottom: theme.spacing(1),\r\n        marginTop: theme.spacing(4)\r\n    },\r\n    text1: {\r\n        marginBottom: theme.spacing(1),\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    error: {\r\n        color: theme.palette.common.error\r\n    }\r\n}))\r\n\r\nfunction OjsResultNotice(\r\n    {\r\n        demandId,\r\n        editable,\r\n        ojsAdmin,\r\n        resultNotice,\r\n        ojsResultNoticeSend,\r\n        canPublishOjsResultNotice,\r\n        resultOjsPublicationStatus\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [error, setError] = useState(null);\r\n    const hasOjsNotice = useMemo(() => resultNotice ? resultNotice.type === ResultNoticeType.OJS && resultNotice.identity > 0 && resultNotice.complete : false, [resultNotice]);\r\n    const [resultNoticeStatusInterval, setResultNoticeStatusInterval] = useState();\r\n\r\n    useEffect(() => {\r\n        if (hasOjsNotice) {\r\n            ResultNoticeService.checkOjsResultNotice(demandId).then(resp => {\r\n                setWorking(false);\r\n                if (resp && resp.status === PublishConst.SENT) {\r\n                    startResultNoticeStatusInterval();\r\n                }\r\n            })\r\n        } else {\r\n            setWorking(false);\r\n        }\r\n\r\n        return () => {\r\n            if (resultNoticeStatusInterval) clearInterval(resultNoticeStatusInterval);\r\n        }\r\n        //eslint-disable-next-line\r\n    }, []);\r\n\r\n    const startResultNoticeStatusInterval = () => {\r\n        const interval = setInterval(async () => {\r\n            const resp = await ResultNoticeService.checkOjsResultNotice(demandId);\r\n            if (resp.status !== PublishConst.SENT) {\r\n                clearInterval(interval);\r\n                //clearPublishResources();\r\n            }\r\n        }, 10000);\r\n        setResultNoticeStatusInterval(interval);\r\n    };\r\n\r\n    const goToNotice = () => {\r\n        window.location.href = resultNotice.url;\r\n    };\r\n\r\n    const publishOjsResultNotice = () => {\r\n        setWorking(true)\r\n        ResultNoticeService.publishOjsResultNotice(demandId).then(resp => {\r\n            if (isResponseValid(resp, setError)) {\r\n                startResultNoticeStatusInterval();\r\n                validateSection(DemandValidation.RESULT_NOTICE, demandId, false).finally(() => setWorking(false));\r\n            }\r\n        })\r\n    };\r\n\r\n    const rollbackOjsResultNotice = () => {\r\n        setWorking(true)\r\n        ResultNoticeService.rollbackOjsResultNotice(demandId).then(resp => {\r\n            ResultNoticeService.checkOjsResultNotice(demandId).then(resp => {\r\n                setWorking(false);\r\n                startResultNoticeStatusInterval();\r\n            });\r\n            //clearPublishResources();\r\n            if (isResponseValid(resp, setError)) {\r\n                validateSection(DemandValidation.RESULT_NOTICE, demandId, false).finally(() => setWorking(false));\r\n            }\r\n        });\r\n    };\r\n\r\n    const unpublishResultNotice = () => {\r\n        setWorking(true);\r\n        ResultNoticeService.unpublishResultNotice(demandId).then(resp => {\r\n            if (isResponseValid(resp, setError)) {\r\n                validateSection(DemandValidation.RESULT_NOTICE, demandId, false).finally(() => setWorking(false));\r\n            }\r\n        });\r\n    };\r\n\r\n    const publishResultNotice = () => {\r\n        setWorking(true);\r\n        ResultNoticeService.publishResultNotice(demandId).then(resp => {\r\n            if (isResponseValid(resp, setError)) {\r\n                validateSection(DemandValidation.RESULT_NOTICE, demandId, false).finally(() => setWorking(false));\r\n            }\r\n        });\r\n    }\r\n\r\n\r\n    return (<GridBlock\r\n        direction='column'\r\n        alignItems='center'\r\n    >\r\n        {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n\r\n        {!canPublishOjsResultNotice && !ojsResultNoticeSend && <Typography className={classes.text1}>{Tr('result_notice_ojs_prepare')}</Typography>}\r\n        <Button disabled={working}\r\n                onClick={goToNotice}>{Tr(ojsResultNoticeSend ? 'preview_union_result_annoucement' : 'create_union_result_annoucement')}</Button>\r\n\r\n        {hasOjsNotice && (resultOjsPublicationStatus && resultOjsPublicationStatus.message && resultOjsPublicationStatus.status !== PublishConst.UNAVAILABLE) &&\r\n        <Typography className={clsx(classes.text, {\r\n            [classes.error]: resultOjsPublicationStatus.status === PublishConst.ERROR\r\n            || resultOjsPublicationStatus.status === PublishConst.UE_VALIDATION_ERROR || resultOjsPublicationStatus.status === PublishConst.NOT_PUBLISHED\r\n        })}>\r\n            {resultOjsPublicationStatus.message}\r\n        </Typography>\r\n        }\r\n        {hasOjsNotice && !resultOjsPublicationStatus &&\r\n        <Typography className={clsx(classes.text)}>\r\n        </Typography>\r\n        }\r\n        {hasOjsNotice && (!resultOjsPublicationStatus || (resultOjsPublicationStatus.status !== PublishConst.NOT_PUBLISHED && resultOjsPublicationStatus.status !== PublishConst.UE_VALIDATION_ERROR)) &&\r\n        <Button disabled={working || !editable || !canPublishOjsResultNotice} onClick={publishOjsResultNotice}>{Tr('send_eu_publish')}</Button>\r\n        }\r\n\r\n        {hasOjsNotice && resultOjsPublicationStatus && resultOjsPublicationStatus.status === PublishConst.NOT_PUBLISHED &&\r\n        <Button disabled={working || !editable} onClick={rollbackOjsResultNotice}>{Tr('send_eu_publish_rollback')}</Button>\r\n        }\r\n\r\n        {hasOjsNotice && resultOjsPublicationStatus && resultOjsPublicationStatus.status === PublishConst.UE_VALIDATION_ERROR &&\r\n        <Button disabled={working || !editable || !ojsAdmin} onClick={rollbackOjsResultNotice}>{Tr('send_eu_publish_rollback')}</Button>\r\n        }\r\n\r\n        {hasOjsNotice && <Typography className={classes.text}>{Tr(resultNotice.published ? 'result_notice_published' : 'result_notice_not_published')}</Typography>}\r\n\r\n        {hasOjsNotice && resultNotice.published &&\r\n        <Button disabled={working || !editable} onClick={unpublishResultNotice}>{Tr('result_notice_unpublish')}</Button>\r\n        }\r\n\r\n        {hasOjsNotice && !resultNotice.published &&\r\n        <Button disabled={working || !editable} onClick={publishResultNotice}>{Tr('result_notice_publish')}</Button>\r\n        }\r\n    </GridBlock>)\r\n}\r\n\r\nOjsResultNotice.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    resultNotice: PropTypes.shape({\r\n        url: PropTypes.string.isRequired\r\n    }).isRequired,\r\n    canPublishOjsResultNotice: PropTypes.bool.isRequired,\r\n    ojsResultNoticeSend: PropTypes.bool.isRequired,\r\n\r\n}\r\n\r\nexport default connect((state) => ({\r\n    resultOjsPublicationStatus: state.resources.resultOjsPublicationStatus\r\n}), {})(OjsResultNotice);","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Loading from \"components/Loading\";\r\nimport Button from \"components/Button\";\r\nimport PropTypes from \"prop-types\";\r\nimport ResultNoticeService from \"services/ResultNoticeService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    }\r\n}));\r\n\r\nfunction AddBzpResultNoticePopup(\r\n    {\r\n        demandId,\r\n        onClose,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [errorText, setErrorText] = useState();\r\n    const [downloadSuccess, setDownloadSuccess] = useState(false);\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const processResponse = async (resp) => {\r\n        if (resp.success) {\r\n            await ResultNoticeService.getResultNotice(demandId);\r\n            setDownloadSuccess(true);\r\n        } else {\r\n            setErrorText(resp.errors.shift());\r\n        }\r\n\r\n    }\r\n\r\n    const onSubmit = ({bzpNoticeId}) => {\r\n        setWorking(true);\r\n        setErrorText();\r\n        ResultNoticeService.addBzpNotice(demandId, bzpNoticeId.trim()).then(processResponse).catch(() => {\r\n        }).finally(() => {\r\n            setWorking(false);\r\n        });\r\n    }\r\n\r\n\r\n    if(downloadSuccess) {\r\n        return (\r\n            <Dialog\r\n                title={Tr(\"add_bzp_result_notice\")}\r\n                maxWidth={'sm'}\r\n                open={true}\r\n                onClose={onClose}\r\n            >\r\n                <Typography>\r\n                    {Tr('bzp_notice_downloaded')}\r\n                </Typography>\r\n                <div className={classes.buttonRow}>\r\n                    <Button\r\n                        onClick={onClose}\r\n                    >\r\n                        {Tr('close')}\r\n                    </Button>\r\n                </div>\r\n            </Dialog>)\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"add_bzp_result_notice\")}\r\n            open={true}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    bzpNoticeId: \"\",\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    bzpNoticeId: VS.string().test('bzp-nitice', Tr(\"bzp_notice_number_invalid\"), (bzpNoticeId) => {\r\n                        if(!!bzpNoticeId) {\r\n                            bzpNoticeId = bzpNoticeId.trim();\r\n                            if(bzpNoticeId.includes(\"-N-\")) {\r\n                                const split = bzpNoticeId.split(\"-N-\");\r\n                                if(split.length === 2) {\r\n                                    return /^[0-9]{6,9}$/.test(split[0]) && /^[0-9]{4}$/.test(split[1]);\r\n                                }\r\n                            } else if(bzpNoticeId.includes(\"/BZP\")) {\r\n                                return /^[0-9]{4}\\/BZP\\s?[0-9]{8}\\/[0-9]{2}$/.test(bzpNoticeId);\r\n                            }\r\n                        }\r\n                        return false;\r\n                    }),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        {working && <Loading className={classes.loading}/>}\r\n\r\n                        <TextInput\r\n                            id='bzpNoticeId'\r\n                            formikProps={formikProps}\r\n                            label={Tr('bzp_notice_number')}\r\n                            disabled={working}\r\n                        />\r\n\r\n                        {!!errorText && <Typography\r\n                            variant='body1'\r\n                            color='error'\r\n                        >\r\n                            {Tr(errorText)}\r\n                        </Typography>}\r\n\r\n                        <div className={classes.actions}>\r\n                            <DoubleButton\r\n                                justify='flex-end'\r\n                                labelFirst={Tr('cancel')}\r\n                                labelSecond={Tr('confirm')}\r\n                                onClickFirst={onClose}\r\n                                onClickSecond={handleSubmit}\r\n                                disabledFirst={working}\r\n                                disabledSecond={working}\r\n                            />\r\n                        </div>\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAddBzpResultNoticePopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired\r\n};\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddBzpResultNoticePopup);","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport {connect} from 'react-redux'\r\nimport Form from 'components/Form';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport Loading from \"components/Loading\";\r\nimport ResultNoticeService from \"services/ResultNoticeService\";\r\nimport AttachmentResultNotice from \"./components/AttachmentResultNotice\";\r\nimport OjsResultNotice from \"./components/OjsResultNotice\";\r\nimport ResultNoticeType from \"./constants/ResultNoticeType\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Tr from \"translations/Translations\";\r\nimport {isNationalProcedure} from \"libs/getDemandStatus\";\r\nimport AddBzpResultNoticePopup from \"components/complex/documentsTables/swz/AddBzpResultNoticePopup\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    }\r\n}))\r\n\r\nfunction ResultNoticePanel(\r\n    {\r\n        match,\r\n        demandValidation,\r\n        resultNotice,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const demandId = match.params.id;\r\n\r\n    const currentDemandValidation = DemandValidation.RESULT_NOTICE;\r\n    const section = demandValidation.find(x => x.section === currentDemandValidation);\r\n    const editable = section ? section.editable : true;\r\n    const ojsAdmin = section ? section.ojsAdmin : false;\r\n    const bzpEditable = section ? !!section.bzpEditable : false;\r\n    // eslint-disable-next-line\r\n    const nationalProcedure = useMemo(() => isNationalProcedure(), [demandHeader]);\r\n    const [addBzpNoticePopupOpened, setAddBzpNoticePopupOpened] = useState(false);\r\n\r\n    useEffect(() => {\r\n        ResultNoticeService.getResultNotice(demandId);\r\n        return () => {\r\n            ResultNoticeService.clearResultNoticeResources();\r\n        }\r\n    }, [demandId])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        if (nationalProcedure && bzpEditable) {\r\n            buttons.push(createButton(Tr(\"add_bzp_result_notice\"), () => setAddBzpNoticePopupOpened(true)))\r\n        }\r\n\r\n        if (buttons.length)\r\n            return <MultiButton buttons={buttons} justify=\"flex-start\"/>\r\n    }\r\n\r\n    if (!resultNotice) return <Loading/>\r\n\r\n    return (\r\n        <Form\r\n            initialValues={{}}\r\n            validationSchema={ValidationShema.any()}\r\n            id={DemandValidationKeys.RESULT_NOTICE}\r\n        >{(formikProps) =>\r\n            (<div className={classes.root}>\r\n                {getButtons()}\r\n\r\n                <DemandValidationMessages editable={editable} section={section}/>\r\n                {resultNotice.type === ResultNoticeType.ATTACHMENT &&\r\n                <AttachmentResultNotice editable={editable} demandId={demandId} resultNotice={resultNotice}/>}\r\n                {resultNotice.type === ResultNoticeType.OJS  &&\r\n                    <OjsResultNotice\r\n                        demandId={demandId}\r\n                        editable={editable}\r\n                        ojsAdmin={ojsAdmin}\r\n                        resultNotice={resultNotice}\r\n                        canPublishOjsResultNotice={!!section && section.canPublishOjsResultNotice}\r\n                        ojsResultNoticeSend={!!section && section.ojsResultNoticeSend}\r\n                    />}\r\n\r\n                {addBzpNoticePopupOpened && <AddBzpResultNoticePopup demandId={demandId} onClose={() => setAddBzpNoticePopupOpened(false)}/>}\r\n            </div>)}\r\n        </Form>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    resultNotice: state.resources[ResultNoticeService.RESULT_NOTICE_RESOURCE_ID],\r\n    demandValidation: state.resources.demandValidation,\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(withRouter(ResultNoticePanel));","import React from 'react'\r\nimport ResultNoticePanel from \"./ResultNoticePanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <ResultNoticePanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestGET, RestRequestPOST} from \"../libs/RestRequest\";\r\nimport Endpoints from \"../constants/Endpoints\";\r\n\r\nconst DEMAND_ARCHIVING_RESOURCE_ID = 'demandArchiving';\r\n\r\nconst getDemandArchiving = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.ARCHIVING(demandId));\r\n    reduxStore.dispatch(setResource(DEMAND_ARCHIVING_RESOURCE_ID, resp))\r\n}\r\n\r\nconst scheduleArchive = async (demandId) => {\r\n    clearDemandArchiving();\r\n    const resp = await RestRequestPOST(Endpoints.ARCHIVING_SCHEDULE(demandId));\r\n    reduxStore.dispatch(setResource(DEMAND_ARCHIVING_RESOURCE_ID, resp))\r\n}\r\n\r\nconst validate = async (demandId) => {\r\n    return await RestRequestGET(Endpoints.ARCHIVING_VALIDATE(demandId));\r\n}\r\n\r\nconst clearDemandArchiving = () => {\r\n    reduxStore.dispatch(clearResource(DEMAND_ARCHIVING_RESOURCE_ID));\r\n}\r\n\r\nexport default {\r\n    getDemandArchiving,\r\n    scheduleArchive,\r\n    validate,\r\n    clearDemandArchiving,\r\n    DEMAND_ARCHIVING_RESOURCE_ID\r\n}","export const ArchivingStatus = {\r\n    WAITING: \"WAITING\",\r\n    ARCHIVED: \"ARCHIVED\",\r\n    ARCHIVE_EXPIRED: \"ARCHIVE_EXPIRED\"\r\n}\r\n\r\nexport const statusScheduleAvailable = (status) => {\r\n    return !status || ArchivingStatus.ARCHIVE_EXPIRED === status;\r\n}","import React, {useEffect, useState} from \"react\";\r\nimport {connect} from 'react-redux'\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport Loading from \"components/Loading\";\r\nimport ArchivingService from \"services/ArchivingService\";\r\nimport Tr from \"translations/Translations\";\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport ArchiveIcon from '@material-ui/icons/Archive';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport {ArchivingStatus, statusScheduleAvailable} from \"./constants/ArchivingStatus\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment from \"libs/moment\";\r\nimport downloadFile from \"libs/downloadFile\";\r\nimport {getUserFullNameWithDeputy} from \"libs/userNameGetter\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    icon: theme.components.icon,\r\n    text: {\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction ArchivingPanel(\r\n    {\r\n        match,\r\n        demandValidation,\r\n        demandArchiving\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const curDemandValidation = DemandValidation.ARCHIVING;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n    const [working, setWorking] = useState(false)\r\n\r\n    useEffect(() => {\r\n        ArchivingService.getDemandArchiving(demandId);\r\n        return () => {\r\n            ArchivingService.clearDemandArchiving();\r\n        }\r\n    }, [demandId])\r\n\r\n    const scheduleArchive = () => {\r\n        ArchivingService.scheduleArchive(demandId);\r\n    };\r\n\r\n    const downloadArchive = () => {\r\n        const archiveUrl = demandArchiving?.info?.archiveUrl;\r\n        if (archiveUrl) {\r\n            setWorking(true);\r\n            downloadFile({url: archiveUrl.url, name: archiveUrl.name});\r\n        }\r\n    };\r\n\r\n    const getDescription = () => {\r\n\r\n        if (!demandArchiving.archivingStatus) {\r\n            if (editable) {\r\n                return Tr('demand_archiving_schedule_available')\r\n            } else {\r\n                return Tr('demand_archiving_schedule_unavailable')\r\n            }\r\n        } else {\r\n            return Tr('demand_archiving_' + demandArchiving.archivingStatus.toLowerCase())\r\n        }\r\n    }\r\n\r\n    const getButton = () => {\r\n\r\n        if (!demandArchiving.archivingStatus || demandArchiving.archivingStatus === ArchivingStatus.ARCHIVE_EXPIRED) {\r\n            return <Button\r\n                onClick={scheduleArchive}\r\n                disabled={!editable || !statusScheduleAvailable(demandArchiving.archivingStatus)}\r\n            >\r\n                {Tr('demand_archiving_button')}\r\n            </Button>\r\n        } else if (demandArchiving.archivingStatus === ArchivingStatus.ARCHIVED) {\r\n            return <Button\r\n                onClick={downloadArchive}\r\n                disabled={!editable || working}\r\n            >\r\n                {Tr('demand_archiving_button_download')}\r\n            </Button>\r\n        }\r\n\r\n    }\r\n\r\n    if (!demandArchiving) return <Loading/>\r\n    return (\r\n        <GridBlock\r\n            className={classes.root}\r\n            direction='column'\r\n            alignItems='center'\r\n\r\n        >\r\n            <ArchiveIcon className={classes.icon} color='primary'/>\r\n            <Typography className={classes.text}>{getDescription()}</Typography>\r\n\r\n            {!!demandArchiving.info &&\r\n            <SimpleTable\r\n                className={classes.text}\r\n                headers={[\r\n                    Tr('case_number'),\r\n                    Tr('proceedings_subject'),\r\n                    Tr('demand_archiving_order_date'),\r\n                    Tr('demand_archiving_create_date'),\r\n                    Tr('demand_archiving_user')\r\n                ]\r\n                }\r\n                items={[[\r\n                    demandArchiving.info.demandNumber,\r\n                    demandArchiving.info.demandName,\r\n                    moment(demandArchiving.info.orderDate).format(DateFormats.DATETIME_FORMAT),\r\n                    demandArchiving.info.createDate ? moment(demandArchiving.info.createDate).format(DateFormats.DATETIME_FORMAT) : null,\r\n                    getUserFullNameWithDeputy(demandArchiving.info.user)\r\n                ]]}\r\n            />\r\n            }\r\n            {getButton()}\r\n\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n    demandArchiving: state.resources[ArchivingService.DEMAND_ARCHIVING_RESOURCE_ID]\r\n}), {})(withRouter(ArchivingPanel));","import React from 'react'\r\nimport ArchivingPanel from \"./ArchivingPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <ArchivingPanel />)\r\n}\r\n\r\n\r\nexport default Index;","import {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestGET, RestRequestPOST} from \"libs/RestRequest\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport HeaderService from \"./HeaderService\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\n\r\nconst FINISH_DEMAND_RESOURCE_ID = 'finishDemand';\r\n\r\nconst getFinishDemand = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.FINISH_DEMAND(demandId));\r\n    reduxStore.dispatch(setResource(FINISH_DEMAND_RESOURCE_ID, resp))\r\n}\r\n\r\nconst backToOfferEvaluation = async (demandId) => {\r\n    clearFinishDemand();\r\n    return await RestRequestPOST(Endpoints.FINISH_DEMAND_BACK_TO_OFFER_EVALUATION(demandId));\r\n}\r\n\r\nconst backToResultNotice = async (demandId) => {\r\n    clearFinishDemand();\r\n    const resp = await RestRequestPOST(Endpoints.FINISH_DEMAND_BACK_TO_RESULT_NOTICE(demandId));\r\n    reduxStore.dispatch(setResource(FINISH_DEMAND_RESOURCE_ID, resp));\r\n    await validateSection(DemandValidation.FINISH_DEMAND, demandId, false);\r\n    await validateSection(DemandValidation.RESULT_NOTICE, demandId, false);\r\n}\r\n\r\nconst withdrawalNoticeDate = async (demandId, values) => {\r\n    const data = {\r\n        ...values,\r\n        unpublishDate: values.unpublishDate ? values.unpublishDate.format() : null\r\n    }\r\n    return await RestRequestPOST(Endpoints.FINISH_DEMAND_WITHDRAWAL_NOTICE_DATE(demandId), data);\r\n}\r\n\r\nconst cancelDemand = async (demandId) => {\r\n    clearFinishDemand();\r\n    const resp = await RestRequestPOST(Endpoints.FINISH_DEMAND_CANCEL(demandId));\r\n    reduxStore.dispatch(setResource(FINISH_DEMAND_RESOURCE_ID, resp));\r\n    await validateSection(DemandValidation.FINISH_DEMAND, demandId, false);\r\n    await validateSection(DemandValidation.ARCHIVING, demandId, false);\r\n    await validateSection(DemandValidation.DEMAND_PLAN_REALIZATION, demandId, false);\r\n    await HeaderService.get(demandId)\r\n}\r\n\r\nconst finishDemand = async (demandId) => {\r\n    clearFinishDemand();\r\n    const resp = await RestRequestPOST(Endpoints.FINISH_DEMAND_FINISH(demandId));\r\n    reduxStore.dispatch(setResource(FINISH_DEMAND_RESOURCE_ID, resp))\r\n    await validateSection(DemandValidation.FINISH_DEMAND, demandId, false);\r\n    await validateSection(DemandValidation.ARCHIVING, demandId, false);\r\n    await validateSection(DemandValidation.DEMAND_PLAN_REALIZATION, demandId, false);\r\n    await HeaderService.get(demandId)\r\n}\r\n\r\nconst validate = async (demandId) => {\r\n    return await RestRequestGET(Endpoints.FINISH_DEMAND_VALIDATE(demandId));\r\n}\r\n\r\nconst clearFinishDemand = () => {\r\n    reduxStore.dispatch(clearResource(FINISH_DEMAND_RESOURCE_ID));\r\n}\r\n\r\nexport default {\r\n    getFinishDemand,\r\n    backToOfferEvaluation,\r\n    backToResultNotice,\r\n    cancelDemand,\r\n    finishDemand,\r\n    validate,\r\n    withdrawalNoticeDate,\r\n    clearFinishDemand,\r\n    FINISH_DEMAND_RESOURCE_ID\r\n}","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Loading from \"components/Loading\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport FinishDemandService from \"services/FinishDemandService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport moment from \"libs/moment\";\r\n\r\n\r\nfunction UnpublishNoticePopup(\r\n    {\r\n        demandId,\r\n        onSuccess,\r\n        onCancel,\r\n        initialDate,\r\n        formSubmit\r\n    }) {\r\n\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n    const [working, setWorking] = useState(false);\r\n    const [error, setError] = useState(null);\r\n\r\n    const onSubmit = (values) => {\r\n        setError(null);\r\n        setWorking(true);\r\n        const resp = FinishDemandService.withdrawalNoticeDate(demandId, values);\r\n        if(isResponseValid(resp, setError)) {\r\n            onSuccess();\r\n        }\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(!initialDate ? 'demand_finish_withdraw_notice' : 'demand_finish_withdraw_notice_update')}\r\n            open={true}\r\n            maxWidth={'xs'}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={Tr('cancel')}\r\n                labelSecond={Tr('confirm')}\r\n                onClickFirst={onCancel}\r\n                onClickSecond={handleSubmit}\r\n                disabledFirst={working}\r\n                disabledSecond={working}\r\n            />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    unpublishDate: initialDate ? moment(initialDate) : null\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    unpublishDate: VS.dateTimeMinNoRq(new Date(), Tr('v_data_can_not_be_past'))\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        {working && <Loading/>}\r\n                        {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n                        <DateTimePicker\r\n                            formikProps={formikProps}\r\n                            id='unpublishDate'\r\n                            label={Tr('demand_finish_withdrawal_notice_label')}\r\n                            disabled={working}\r\n                            minDate={new Date()}\r\n                        />\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form,\r\n}), {})(UnpublishNoticePopup);","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport {connect} from 'react-redux'\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport Loading from \"components/Loading\";\r\nimport Tr from \"translations/Translations\";\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport FinishDemandService from \"services/FinishDemandService\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport {LABELS as ProcedureStatusLabels, VALUES as ProcedureStatusValues} from \"constants/ProcedureStatus\";\r\nimport UnpublishNoticePopup from \"./components/UnpublishNoticePopup\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    icon: theme.components.icon,\r\n    italic: {\r\n        fontStyle: 'italic',\r\n    },\r\n    text: {\r\n        marginBottom: theme.spacing(1),\r\n        marginTop: theme.spacing(4)\r\n    },\r\n    exPostButton: {\r\n        marginBottom: theme.spacing(1)\r\n    },\r\n    exPostBackButton: {\r\n        marginTop: theme.spacing(4)\r\n    }\r\n}))\r\n\r\nconst rp = RouterPath.myProcedure;\r\n\r\nfunction FinishDemandPanel(\r\n    {\r\n        match,\r\n        demandValidation,\r\n        finishDemand,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const curDemandValidation = DemandValidation.FINISH_DEMAND;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n    const [backConfirm, setBackConfirm] = useState(false);\r\n    const [backToResultConfirm, setBackToResultConfirm] = useState(false);\r\n    const [unpublishDatePopup, setUnpublishDatePopup] = useState(false);\r\n    const prevErrors = useMemo(() => demandValidation.filter((x) => x.section !== curDemandValidation && x.status === 'ERROR'), [demandValidation, curDemandValidation]);\r\n\r\n    useEffect(() => {\r\n        FinishDemandService.getFinishDemand(demandId);\r\n        return () => {\r\n            FinishDemandService.clearFinishDemand();\r\n        }\r\n    }, [demandId])\r\n\r\n    const backToOfferEvaluation = () => {\r\n        setBackConfirm(false);\r\n        FinishDemandService.backToOfferEvaluation(demandId).then((resp) => RouterPath.redirect(RouterPath.createPath(rp.steps.MP_3_ID, {id: demandId})))\r\n    };\r\n\r\n    const backToPreparing = () => {\r\n        setBackConfirm(false);\r\n        FinishDemandService.backToOfferEvaluation(demandId).then((resp) => RouterPath.redirect(RouterPath.createPath(rp.steps.MP_1_ID, {id: demandId})))\r\n    };\r\n\r\n    const backToResultNotice = () => {\r\n        setBackToResultConfirm(false);\r\n        FinishDemandService.backToResultNotice(demandId);\r\n    };\r\n\r\n    const doCancelFinish = () => {\r\n        if (finishDemand.canCancel)\r\n            FinishDemandService.cancelDemand(demandId);\r\n        else if (finishDemand.canFinish)\r\n            FinishDemandService.finishDemand(demandId);\r\n    };\r\n    const doCancel = () => {\r\n        if (finishDemand.canCancel)\r\n            FinishDemandService.cancelDemand(demandId);\r\n    };\r\n    const doFinish = () => {\r\n        if (finishDemand.canFinish)\r\n            FinishDemandService.finishDemand(demandId);\r\n    };\r\n\r\n    if (!finishDemand) return <Loading/>\r\n\r\n    return (<div className={classes.root}>\r\n            {!demandHeader.exPost &&\r\n            <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n\r\n            >\r\n                <CheckBoxIcon className={classes.icon} color='primary'/>\r\n                {\r\n                    prevErrors.length > 0 ?\r\n                        <Typography className={classes.text}>{Tr('to_finish_done_sections')}:\r\n                            \"{prevErrors.map((x) => Tr(DemandValidationKeys[x.section])).join(\"\\\", \\\"\")}\"</Typography>\r\n                        :\r\n                        (ProcedureStatusValues.FINISHED === finishDemand.status || ProcedureStatusValues.CANCELLED === finishDemand.status) ?\r\n                            <Typography\r\n                                className={classes.text}>{ProcedureStatusLabels[finishDemand.status]}</Typography>\r\n                            :\r\n                            <Typography className={classes.text}>{Tr('demand_finish_finish_info')}</Typography>\r\n                }\r\n\r\n                <Button\r\n                    onClick={doCancelFinish}\r\n                    disabled={!editable || !(finishDemand.canCancel || finishDemand.canFinish) || prevErrors.length > 0}\r\n\r\n                >\r\n                    {Tr(finishDemand.status === ProcedureStatusValues.CANCELLED || finishDemand.canCancel ? 'demand_finish_cancel_button' : 'demand_finish_finish_button')}\r\n                </Button>\r\n\r\n                {!finishDemand.ojsResultNoticeSent && <Typography className={classes.text}>{Tr('demand_finish_back_to_evaluation_info')}</Typography>}\r\n                {!finishDemand.ojsResultNoticeSent &&\r\n                <Button\r\n                    onClick={() => setBackConfirm(true)}\r\n                    disabled={!finishDemand.canBackState}\r\n                >\r\n                    {Tr('demand_finish_back_to_evaluation_button')}\r\n                </Button>\r\n                }\r\n\r\n                {finishDemand.ojsResultNoticeSent && <Typography className={classes.text}>{Tr('demand_finish_back_to_result_notice_info')}</Typography>}\r\n                {finishDemand.ojsResultNoticeSent &&\r\n                <Button\r\n                    onClick={() => setBackToResultConfirm(true)}\r\n                    disabled={!finishDemand.canBackToResultNotice}\r\n                >\r\n                    {Tr('demand_finish_back_to_result_notice_button')}\r\n                </Button>\r\n                }\r\n\r\n                <Typography className={classes.text}>\r\n                    {Tr('demand_finish_withdrawal_notice_info')}\r\n                    {!!finishDemand.withdrawalNoticeDate && <><br/><Typography component='span' color=\"primary\"\r\n                                                                               className={classes.italic}>{Tr('demand_finish_withdrawal_notice_set_info', {date: moment(finishDemand.withdrawalNoticeDate).format(DateFormats.DATETIME_FORMAT)})}</Typography></>}\r\n                </Typography>\r\n                <Button\r\n                    onClick={() => setUnpublishDatePopup(true)}\r\n                    disabled={!finishDemand.canSetWithdrawalNoticeDate}\r\n                >\r\n                    {Tr(finishDemand.withdrawalNoticeDate ? 'demand_finish_withdraw_notice_update' : 'demand_finish_withdraw_notice')}\r\n                </Button>\r\n            </GridBlock>\r\n            }\r\n\r\n            {demandHeader.exPost &&\r\n            <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n\r\n            >\r\n                <CheckBoxIcon className={classes.icon} color='primary'/>\r\n                {\r\n                    prevErrors.length > 0 ?\r\n                        <Typography className={classes.text}>{Tr('to_finish_done_sections')}:\r\n                            \"{prevErrors.map((x) => Tr(DemandValidationKeys[x.section])).join(\"\\\", \\\"\")}\"</Typography>\r\n                        :\r\n                        (ProcedureStatusValues.FINISHED === finishDemand.status || ProcedureStatusValues.CANCELLED === finishDemand.status) ?\r\n                            <Typography\r\n                                className={classes.text}>{ProcedureStatusLabels[finishDemand.status]}</Typography>\r\n                            :\r\n                            <Typography className={classes.text}>{Tr('demand_finish_finish_info_ex_post')}</Typography>\r\n                }\r\n                <Button\r\n                    className={classes.exPostButton}\r\n                    onClick={doCancel}\r\n                    disabled={!editable || !finishDemand.canCancel || prevErrors.length > 0}\r\n                >\r\n                    {Tr('demand_finish_cancel_button')}\r\n                </Button>\r\n                <Button\r\n                    onClick={doFinish}\r\n                    disabled={!editable || !finishDemand.canFinish || prevErrors.length > 0}\r\n                >\r\n                    {Tr('demand_finish_finish_button')}\r\n                </Button>\r\n\r\n                <Button\r\n                    className={classes.exPostBackButton}\r\n                    onClick={() => setBackConfirm(true)}\r\n                    disabled={!finishDemand.canBackState}\r\n                >\r\n                    {Tr('demand_finish_back_to_evaluation_button_exPost')}\r\n                </Button>\r\n            </GridBlock>\r\n            }\r\n            <Confirm\r\n                confirmText={demandHeader && demandHeader.exPost ? 'demand_finish_back_to_evaluation_confirm_message_exPost' : 'demand_finish_back_to_evaluation_confirm_message'}\r\n                open={backConfirm}\r\n                onConfirm={demandHeader && demandHeader.exPost ? backToPreparing : backToOfferEvaluation}\r\n                onCancel={() => setBackConfirm(false)}\r\n            />\r\n            <Confirm\r\n                confirmText='demand_finish_back_to_result_notice_confirm_message'\r\n                open={backToResultConfirm}\r\n                onConfirm={backToResultNotice}\r\n                onCancel={() => setBackToResultConfirm(false)}\r\n            />\r\n            {\r\n                unpublishDatePopup && <UnpublishNoticePopup\r\n                    demandId={demandId}\r\n                    onSuccess={() => {\r\n                        FinishDemandService.getFinishDemand(demandId).finally(() => setUnpublishDatePopup(false));\r\n                    }}\r\n                    onCancel={() => setUnpublishDatePopup(false)}\r\n                    initialDate={finishDemand.withdrawalNoticeDate}\r\n                />\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n    finishDemand: state.resources[FinishDemandService.FINISH_DEMAND_RESOURCE_ID],\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(withRouter(FinishDemandPanel));","import React from 'react'\r\nimport FinishDemandPanel from \"./FinishDemandPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <FinishDemandPanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import React from \"react\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {connect} from \"react-redux\";\r\nimport DocumentsTables from \"components/complex/documentsTables/DocumentsTables\";\r\nimport {DemandValidationProvider} from \"context/DemandValidationContext\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    }\r\n}));\r\n\r\nfunction FinishDocumentsPanel(\r\n    {\r\n        match,\r\n        demandValidation\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const demandId = match.params.id;\r\n\r\n    const currentDemandValidation = DemandValidation.FINISH_DOCUMENTS;\r\n    const section = demandValidation.find(x => x.section === currentDemandValidation);\r\n    const siwzEditable = section ? !!section.siwzEditable : false;\r\n    const repoEditable = section ? !!section.repoEditable : false;\r\n\r\n    return (<div className={classes.root}>\r\n            <DemandValidationProvider value={currentDemandValidation}>\r\n                <DemandValidationMessages editable={repoEditable || siwzEditable} section={section}/>\r\n                <DocumentsTables\r\n                    demandId={demandId}\r\n                    siwzEditable={siwzEditable}\r\n                    repoEditable={repoEditable}\r\n                />\r\n            </DemandValidationProvider>\r\n\r\n        </div>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation\r\n}), {})(withRouter(FinishDocumentsPanel));\r\n\r\n","import React from 'react'\r\nimport FinishDocumentsPanel from \"./FinishDocumentsPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n    return (expanded && <FinishDocumentsPanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import {clearResource, setResource, setSaveStatusDialog, setSaveStatusError, setStepperState} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestGET, RestRequestPOST} from \"libs/RestRequest\";\r\nimport Endpoints from \"constants/Endpoints\";\r\nimport Tr from \"../translations/Translations\";\r\nimport validateSection from \"./helpers/validateSection\";\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\n\r\nconst DEMAND_PLAN_REALIZATIONS_RESOURCE_ID = 'demandPlanRealizations';\r\n\r\nconst getRealizations = async (demandId) => {\r\n    const resp = await RestRequestGET(Endpoints.DEMAND_PLAN_REALIZATION(demandId));\r\n    reduxStore.dispatch(setResource(DEMAND_PLAN_REALIZATIONS_RESOURCE_ID, resp))\r\n}\r\n\r\nconst saveRealizations = async (demandId, values) => {\r\n\r\n    const valuesTouched = values.filter(x => x._touched).map(x => {\r\n        const y = {...x};\r\n        delete y._touched\r\n        return y;\r\n    })\r\n\r\n    let resp;\r\n    if (valuesTouched.length > 0) {\r\n        try {\r\n            resp = await RestRequestPOST(Endpoints.DEMAND_PLAN_REALIZATION(demandId), {list: valuesTouched});\r\n        } catch (e) {\r\n            console.error(e)\r\n        }\r\n    }\r\n\r\n    if (!resp) {\r\n        reduxStore.dispatch(setStepperState());\r\n    } else if(resp.success) {\r\n        reduxStore.dispatch(setSaveStatusDialog());\r\n        await validateSection(DemandValidation.DEMAND_PLAN_REALIZATION, demandId, false);\r\n        reduxStore.dispatch(setStepperState());\r\n    } else {\r\n        if (resp && Array.isArray(resp.errors) && resp.errors.length > 0) {\r\n            reduxStore.dispatch(setSaveStatusError(resp.errors[0]));\r\n        } else {\r\n            reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')));\r\n        }\r\n    }\r\n\r\n\r\n}\r\n\r\n\r\nconst validate = async (demandId) => {\r\n    return await RestRequestGET(Endpoints.DEMAND_PLAN_REALIZATION_VALIDATE(demandId));\r\n}\r\n\r\nconst clearResources = () => {\r\n    reduxStore.dispatch(clearResource(DEMAND_PLAN_REALIZATIONS_RESOURCE_ID));\r\n}\r\n\r\nexport default {\r\n    getRealizations,\r\n    saveRealizations,\r\n    validate,\r\n    clearResources,\r\n    DEMAND_PLAN_REALIZATIONS_RESOURCE_ID\r\n}","import React from 'react'\r\nimport SvgIcon from \"@material-ui/core/SvgIcon\";\r\n\r\n//https://uxwing.com/calculate-math-icon/\r\n//licence: https://uxwing.com/license/\r\nfunction CalcIcon(props) {\r\n    return (<SvgIcon viewBox=\"0 0 122.88 121.05\">\r\n            <path\r\n                d=\"M105.43,92.42c0.85,0,1.61,0.34,2.17,0.9l0.04,0.05c0.53,0.55,0.85,1.3,0.85,2.12c0,0.85-0.34,1.61-0.9,2.17 c-0.55,0.55-1.32,0.9-2.17,0.9H77.28c-0.85,0-1.61-0.34-2.17-0.9c-0.55-0.55-0.9-1.32-0.9-2.17c0-0.84,0.34-1.61,0.9-2.16 c0.55-0.56,1.32-0.9,2.16-0.9H105.43L105.43,92.42z M20.77,80.74l-0.04-0.05c-0.57-0.59-0.85-1.35-0.85-2.12 c0-0.78,0.3-1.56,0.9-2.16v0c0.6-0.6,1.38-0.9,2.17-0.9s1.57,0.3,2.17,0.9l7.79,7.79l7.79-7.79c0.6-0.6,1.38-0.9,2.17-0.9 c0.78,0,1.57,0.3,2.17,0.9c0.6,0.6,0.9,1.38,0.9,2.17c0,0.78-0.3,1.57-0.9,2.17l-7.79,7.79L45,96.31c0.6,0.6,0.9,1.38,0.9,2.17 s-0.3,1.57-0.9,2.17c-0.6,0.6-1.38,0.9-2.17,0.9c-0.78,0-1.57-0.3-2.17-0.9l-7.79-7.79l-7.79,7.79c-0.6,0.6-1.38,0.9-2.17,0.9 s-1.57-0.3-2.17-0.9l-0.04-0.05c-0.57-0.59-0.85-1.35-0.85-2.12c0-0.78,0.3-1.56,0.9-2.16l7.79-7.79L20.77,80.74L20.77,80.74z M122.88,60.53v49.3c0,1.51-0.3,2.96-0.85,4.29c-0.57,1.38-1.41,2.61-2.44,3.65l-0.04,0.04c-1.03,1.02-2.25,1.84-3.6,2.4 c-1.32,0.55-2.77,0.85-4.29,0.85H11.23c-1.51,0-2.96-0.3-4.29-0.85c-1.37-0.57-2.61-1.41-3.65-2.44c-1.04-1.03-1.87-2.27-2.44-3.65 C0.3,112.78,0,111.33,0,109.82V11.23c0-1.51,0.3-2.96,0.85-4.29C1.43,5.57,2.26,4.33,3.3,3.3l0.04-0.04 c1.03-1.02,2.25-1.84,3.6-2.4C8.27,0.3,9.72,0,11.23,0h100.42c1.51,0,2.96,0.3,4.29,0.85c1.37,0.57,2.61,1.41,3.65,2.44 c1.04,1.03,1.87,2.27,2.44,3.65c0.55,1.32,0.85,2.77,0.85,4.29V60.53L122.88,60.53z M116.75,109.82V63.59H64.5v51.34h47.15 c0.69,0,1.35-0.14,1.94-0.39c0.62-0.26,1.19-0.64,1.66-1.12C116.18,112.5,116.75,111.22,116.75,109.82L116.75,109.82z M116.75,57.46V11.23c0-0.69-0.14-1.35-0.39-1.94c-0.26-0.62-0.64-1.19-1.12-1.66c-0.47-0.47-1.04-0.86-1.66-1.12 c-0.6-0.25-1.25-0.39-1.94-0.39H64.5v51.34H116.75L116.75,57.46z M6.13,11.23v46.23h52.25V6.13H11.23c-0.69,0-1.35,0.14-1.94,0.39 C8.67,6.77,8.1,7.15,7.63,7.63C6.7,8.55,6.13,9.83,6.13,11.23L6.13,11.23z M6.13,63.59v46.23c0,0.69,0.14,1.35,0.39,1.94 c0.26,0.62,0.64,1.19,1.12,1.66c0.47,0.47,1.04,0.86,1.66,1.12c0.6,0.25,1.25,0.39,1.94,0.39h47.15V63.59H6.13L6.13,63.59z M29.82,16.92c0-0.85,0.34-1.61,0.9-2.17c0.55-0.55,1.32-0.9,2.17-0.9c0.85,0,1.61,0.34,2.17,0.9c0.55,0.55,0.9,1.32,0.9,2.17 v11.01h11.01c0.85,0,1.61,0.34,2.17,0.9c0.55,0.55,0.9,1.32,0.9,2.17c0,0.85-0.34,1.61-0.9,2.17c-0.55,0.55-1.32,0.9-2.17,0.9 H35.95v11.01c0,0.85-0.34,1.61-0.9,2.17c-0.55,0.55-1.32,0.9-2.17,0.9c-0.85,0-1.61-0.34-2.17-0.9c-0.55-0.55-0.9-1.32-0.9-2.17 V34.06H18.81c-0.85,0-1.61-0.34-2.17-0.9c-0.55-0.55-0.9-1.32-0.9-2.17c0-0.85,0.34-1.61,0.9-2.17s1.32-0.9,2.17-0.9h11.01V16.92 L29.82,16.92z M105.43,27.93c0.85,0,1.61,0.34,2.17,0.9c0.55,0.55,0.9,1.32,0.9,2.17c0,0.85-0.34,1.61-0.9,2.17 c-0.55,0.55-1.32,0.9-2.17,0.9H77.28c-0.85,0-1.61-0.34-2.17-0.9c-0.55-0.55-0.9-1.32-0.9-2.17c0-0.85,0.34-1.61,0.9-2.17 c0.55-0.55,1.32-0.9,2.17-0.9H105.43L105.43,27.93z M105.43,79.02c0.85,0,1.61,0.34,2.17,0.9l0.04,0.05 c0.53,0.55,0.85,1.3,0.85,2.12c0,0.85-0.34,1.61-0.9,2.17c-0.55,0.55-1.32,0.9-2.17,0.9H77.28c-0.85,0-1.61-0.34-2.17-0.9 c-0.55-0.55-0.9-1.32-0.9-2.17c0-0.84,0.34-1.61,0.9-2.16c0.55-0.56,1.32-0.9,2.16-0.9H105.43L105.43,79.02z\"/>\r\n        </SvgIcon>\r\n\r\n    );\r\n}\r\n\r\nexport default CalcIcon;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport CalcIcon from \"../icon/CalcIcon\";\r\n\r\nfunction WorkableIconCalcButton(\r\n    {\r\n        tooltip = Tr('calculate'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={CalcIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconCalcButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconCalcButton;","import React, {useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport VATItems, {SELECT_VALUE} from \"constants/VATItems\";\r\nimport {FormControl, InputAdornment, RadioGroup as RadioGroupUI, TextField} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport RadioGroupElement from \"components/RadioGroupElement\";\r\nimport {calcGrossValue, calcNetValue} from \"libs/netGrosCalculations\";\r\nimport toFloat from \"libs/toFloat\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    grid: {\r\n        '&>*': {\r\n            flexGrow: 1,\r\n            '&:not(:first-child)': {\r\n                marginLeft: theme.spacing(2)\r\n            }\r\n        }\r\n    },\r\n    iconButton: {\r\n        padding: theme.spacing(1) / 2,\r\n    },\r\n    otherTextInput: {\r\n        width: 100,\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}));\r\n\r\n\r\nconst NetGrossCalcPopup = (\r\n    {\r\n        open,\r\n        onClose,\r\n        disabled,\r\n        tooltip,\r\n        netValue,\r\n        setNetValue,\r\n        grossValue,\r\n        setGrossValue\r\n\r\n    }) => {\r\n    const classes = useStyle();\r\n    const [optionValue, setOptionValue] = useState(null);\r\n    const [otherValue, setOtherValue] = useState(\"\");\r\n\r\n    const notSelected = optionValue === null || (optionValue === SELECT_VALUE.OTHER && !otherValue)\r\n\r\n    const doCalcNetValue = () => {\r\n        let otherVatValue;\r\n        if (optionValue === SELECT_VALUE.OTHER)\r\n            otherVatValue = Number.parseFloat(otherValue);\r\n        let newNetValue = calcNetValue(toFloat(grossValue), optionValue, otherVatValue);\r\n        setNetValue(newNetValue);\r\n        onClose();\r\n    }\r\n    const doCalcGrossValue = () => {\r\n        let otherVatValue;\r\n        if (optionValue === SELECT_VALUE.OTHER)\r\n            otherVatValue = Number.parseFloat(otherValue);\r\n\r\n        let newGrossValue = calcGrossValue(toFloat(netValue), optionValue, otherVatValue);\r\n        setGrossValue(newGrossValue);\r\n        onClose();\r\n    }\r\n\r\n\r\n    const handleOtherChange = (e) => {\r\n        let reg = /(?!(\\d|[.,]))\\D/\r\n        const value = e.target.value;\r\n        let _value = value;\r\n        if (_value.length > 0) {\r\n            _value = _value.replace(reg, \"\")\r\n            _value = _value.replace(/,/g, '.')\r\n            _value = _value.replace(/\\.\\./g, '.')\r\n        }\r\n        let valueSplit = _value.split('.')\r\n        if (valueSplit.length > 2) {\r\n            valueSplit = valueSplit.slice(0, 2)\r\n        }\r\n        if (valueSplit.length > 1) {\r\n            valueSplit[1] = valueSplit[1].slice(0, 2);\r\n        }\r\n        valueSplit[0] = valueSplit[0].slice(0, 2)\r\n        _value = valueSplit.join('.');\r\n        setOtherValue(_value);\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('calc_net'), doCalcNetValue, undefined, notSelected || !grossValue));\r\n        buttons.push(createButton(Tr('close'), onClose, 'outlined', false));\r\n        buttons.push(createButton(Tr('calc_gross'), doCalcGrossValue, undefined, notSelected || !netValue));\r\n        return buttons;\r\n    }\r\n\r\n    return (<Dialog\r\n        onClose={onClose}\r\n        open={open}\r\n        title={Tr('vat_calc')}\r\n        maxWidth='xs'\r\n        dialogActions={\r\n            <MultiButton\r\n                buttons={getButtons()}\r\n            />\r\n        }\r\n    >\r\n\r\n        <FormControl>\r\n            <RadioGroupUI\r\n                onChange={(e) => {\r\n                    setOptionValue(e.target.value);\r\n                }}\r\n                value={optionValue}\r\n            >\r\n                {VATItems.map((item, i) => {\r\n                    const value = String(item.value);\r\n                    const label = item.label;\r\n\r\n                    return (\r\n                        <RadioGroupElement\r\n                            key={value}\r\n                            value={value}\r\n                            disabled={value === SELECT_VALUE.DIFFRENT_VAT}\r\n                        >\r\n                            {label}\r\n                            {value === SELECT_VALUE.OTHER &&\r\n                                <TextField\r\n                                    onClick={() => setOptionValue(SELECT_VALUE.OTHER)}\r\n                                    className={classes.otherTextInput}\r\n                                    InputProps={{\r\n                                        endAdornment:\r\n                                            <InputAdornment position='end'>%</InputAdornment>\r\n                                    }}\r\n                                    value={otherValue}\r\n                                    onChange={handleOtherChange}\r\n                                />\r\n\r\n                            }\r\n\r\n                        </RadioGroupElement>\r\n                    )\r\n                })}\r\n            </RadioGroupUI>\r\n        </FormControl>\r\n\r\n\r\n    </Dialog>)\r\n}\r\n\r\nNetGrossCalcPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default NetGrossCalcPopup;","import React, {useState} from 'react';\r\nimport WorkableIconCalcButton from \"../../button/WorkableIconCalcButton\";\r\nimport PropTypes from \"prop-types\";\r\nimport NetGrossCalcPopup from \"./NetGrossCalcPopup\";\r\nimport Tr from \"../../../translations/Translations\";\r\n\r\n\r\nconst NetGrossCalc = (\r\n    {\r\n        disabled,\r\n        netValue,\r\n        setNetValue,\r\n        grossValue,\r\n        setGrossValue\r\n    }\r\n) => {\r\n    const [calcOpen, setCalcOpen] = useState(false);\r\n\r\n    const noValues = !netValue && !grossValue;\r\n\r\n    return (\r\n        <>\r\n            <NetGrossCalcPopup\r\n                open={calcOpen}\r\n                onClose={() => setCalcOpen(false)}\r\n                disabled={noValues || disabled}\r\n                netValue={netValue}\r\n                setNetValue={setNetValue}\r\n                grossValue={grossValue}\r\n                setGrossValue={setGrossValue}\r\n            />\r\n            <WorkableIconCalcButton tooltip={noValues ? Tr('calc_no_values') : undefined} disabled={noValues || disabled} onClick={() => setCalcOpen(true)}/>\r\n        </>\r\n    );\r\n};\r\n\r\n\r\nNetGrossCalc.propTypes = {\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string\r\n}\r\n\r\nexport default NetGrossCalc;","import React from \"react\";\r\nimport {makeStyles, TableCell, TableRow, Typography} from \"@material-ui/core\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport TextInput from \"components/TextInput\";\r\nimport INPUT_TYPE from \"constants/INPUT_TYPE\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Checkbox from \"components/Checkbox\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport NetGrossCalc from \"components/complex/netGrossCalc/NetGrossCalc\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    cancelColumn: {\r\n        textAlign: 'center'\r\n    },\r\n    cell: {\r\n        padding: theme.spacing()\r\n    },\r\n    valueInput: {\r\n        width: 150\r\n    },\r\n    italic: {\r\n        fontStyle: 'italic'\r\n    }\r\n\r\n}));\r\n\r\nfunction DemandPlanRealizationRow(\r\n    {\r\n        demandId,\r\n        index,\r\n        editable,\r\n        realization,\r\n        formikProps,\r\n        passiveOfferForm,\r\n        exPost\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const isCancelled = getObjectValue(`${index}.canceled`, formikProps.values, false)\r\n\r\n\r\n    return (<TableRow>\r\n        <TableCell className={classes.cell}>{index + 1}.</TableCell>\r\n        <TableCell className={classes.cell}>{realization.dealingName}</TableCell>\r\n        <TableCell className={classes.cell}>\r\n            <Typography variant='body1'>{realization.planItemName}</Typography>\r\n            <Typography className={classes.italic} variant='body2'>{realization.planItemNumber}</Typography>\r\n        </TableCell>\r\n        <TableCell className={classes.cell}>\r\n            <GridBlock\r\n                justify='space-between'>\r\n                <TextInput\r\n                    className={classes.valueInput}\r\n                    formikProps={formikProps}\r\n                    id={`${index}.realizationValue`}\r\n                    label={Tr('plan_item_realization_net')}\r\n                    type={INPUT_TYPE.NUMBER_19}\r\n                    step=\"0.01\"\r\n                    disabled={isCancelled || !editable}\r\n                    onChange={() => formikProps.setFieldValue(`${index}._touched`, true)}\r\n                />\r\n                <NetGrossCalc\r\n                    disabled={isCancelled || !editable}\r\n                    netValue={getObjectValue(`${index}.realizationValue`, formikProps.values, \"\")}\r\n                    setNetValue={(value) => {\r\n                        formikProps.setFieldValue(`${index}.realizationValue`, value);\r\n                        formikProps.setFieldValue(`${index}._touched`, true)\r\n                    }}\r\n                    setGrossValue={(value) => {\r\n                        formikProps.setFieldValue(`${index}.realizationGrossValue`, value);\r\n                        formikProps.setFieldValue(`${index}._touched`, true)\r\n                    }}\r\n                    grossValue={getObjectValue(`${index}.realizationGrossValue`, formikProps.values, \"\")}\r\n\r\n                />\r\n                <TextInput\r\n                    className={classes.valueInput}\r\n                    formikProps={formikProps}\r\n                    id={`${index}.realizationGrossValue`}\r\n                    label={Tr('plan_item_realization_gross')}\r\n                    type={INPUT_TYPE.NUMBER_19}\r\n                    step=\"0.01\"\r\n                    disabled={isCancelled || !editable}\r\n                    onChange={() => formikProps.setFieldValue(`${index}._touched`, true)}\r\n                />\r\n            </GridBlock>\r\n        </TableCell>\r\n        {(!!passiveOfferForm || !!exPost) &&\r\n            <TableCell className={classes.cancelColumn}>\r\n                <Checkbox\r\n                    formikProps={formikProps}\r\n                    id={`${index}.canceled`}\r\n                    disabled={!editable}\r\n                    tooltip='invalidate'\r\n                    onChange={() => formikProps.setFieldValue(`${index}._touched`, true)}\r\n                />\r\n            </TableCell>}\r\n    </TableRow>)\r\n}\r\n\r\nDemandPlanRealizationRow.propTypes = {\r\n    index: PropTypes.number.isRequired,\r\n    realization: PropTypes.shape({\r\n        realizationId: PropTypes.number.isRequired\r\n    }),\r\n    editable: PropTypes.bool.isRequired,\r\n    passiveOfferForm: PropTypes.bool.isRequired,\r\n    exPost: PropTypes.bool.isRequired,\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n};\r\n\r\nexport default DemandPlanRealizationRow;\r\n\r\n","import React from \"react\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport DemandPlanRealizationRow from \"./DemandPlanRealizationRow\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    table: {\r\n        tableLayout: 'fixed',\r\n\r\n        '& td, th': {\r\n            overflow: 'hidden',\r\n        }\r\n    },\r\n    cell: {\r\n        padding: theme.spacing(1)\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    cancelColumn: {\r\n        width: 100,\r\n        padding: '0 !important'\r\n    },\r\n    partName: {\r\n        width: 310\r\n    },\r\n    valueColumn: {\r\n        width: 350\r\n    },\r\n}));\r\n\r\nfunction DemandPlanRealizationTable(\r\n    {\r\n        demandId,\r\n        editable,\r\n        demandPlanRealizations,\r\n        formikProps,\r\n        passiveOfferForm,\r\n        exPost\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    return (<TableContainer>\r\n        <Table className={clsx(classes.table)}>\r\n            <TableHead>\r\n                <TableRow>\r\n                    <TableCell className={clsx(classes.lpColumn, classes.cell)}>{Tr(\"column_lp\")}</TableCell>\r\n                    <TableCell className={clsx(classes.partName, classes.cell)}>{Tr(\"part_name\")}</TableCell>\r\n                    <TableCell className={classes.cell}>{Tr(\"plan_item_name_number\")}</TableCell>\r\n                    <TableCell className={clsx(classes.valueColumn, classes.cell)}>{Tr(\"plan_item_realization_value\")}</TableCell>\r\n                    {(!!passiveOfferForm || !!exPost) && <TableCell className={classes.cancelColumn}>{Tr(\"agreement_state_annuled\")}</TableCell>}\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {demandPlanRealizations.map((realization, index) =>\r\n                    <DemandPlanRealizationRow\r\n                        key={realization.realizationId}\r\n                        realization={realization}\r\n                        index={index}\r\n                        editable={editable}\r\n                        demandId={demandId}\r\n                        formikProps={formikProps}\r\n                        passiveOfferForm={passiveOfferForm}\r\n                        exPost={exPost}\r\n                    />\r\n                )}\r\n            </TableBody>\r\n        </Table>\r\n    </TableContainer>)\r\n}\r\n\r\nDemandPlanRealizationTable.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n    passiveOfferForm: PropTypes.bool.isRequired,\r\n    exPost: PropTypes.bool.isRequired,\r\n    demandPlanRealizations: PropTypes.array.isRequired\r\n}\r\n\r\nexport default DemandPlanRealizationTable;\r\n\r\n","import React, {useEffect} from \"react\";\r\nimport {connect} from 'react-redux'\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport Loading from \"components/Loading\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport DemandPlanRealizationService from \"services/DemandPlanRealizationService\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport DemandPlanRealizationTable from \"./components/DemandPlanRealizationTable\";\r\nimport Form from \"components/Form\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Tr from \"translations/Translations\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport SaveFormikValues from \"../../../../../../../components/SaveFormikValues\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    icon: theme.components.icon,\r\n    italic: {\r\n        fontStyle: 'italic',\r\n    },\r\n    text: {\r\n        marginBottom: theme.spacing(1),\r\n        marginTop: theme.spacing(4)\r\n    }\r\n}))\r\n\r\nfunction DemandPlanRealizationPanel(\r\n    {\r\n        match,\r\n        demandValidation,\r\n        demandHeader,\r\n        demandPlanRealizations\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const curDemandValidation = DemandValidation.DEMAND_PLAN_REALIZATION;\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === curDemandValidation);\r\n    const editable = section ? section.editable : false;\r\n\r\n    useStepperStateCloseValidator('mp_4_demand_plan_realization')\r\n\r\n    useEffect(() => {\r\n        DemandPlanRealizationService.getRealizations(demandId);\r\n        return () => {\r\n            DemandPlanRealizationService.clearResources();\r\n        }\r\n    }, [demandId])\r\n\r\n\r\n    const onSubmit = (values) => {\r\n\r\n        DemandPlanRealizationService.saveRealizations(demandId, values).then();\r\n\r\n    }\r\n\r\n    const validationSchema = VS.arrayOf(VS.lazy(realization => {\r\n        if (realization.canceled)\r\n            return VS.any();\r\n\r\n        const shape = {\r\n            realizationValue: VS.numberPositiveOptional().when('realizationGrossValue', {\r\n                is: (realizationGrossValue) => !!realizationGrossValue,\r\n                then: VS.numberPositiveNoZero()\r\n            }),\r\n            realizationGrossValue: VS.numberPositiveOptional().when('realizationValue', {\r\n                is: (realizationValue) => !!realizationValue,\r\n                then: VS.number().min(VS.ref('realizationValue'), Tr('gross_less'))\r\n            })\r\n        }\r\n        return VS.object(shape, [['realizationValue', 'realizationGrossValue']])\r\n    }))\r\n\r\n\r\n    if (!demandPlanRealizations || !demandHeader) return <Loading/>\r\n\r\n    return (<div className={classes.root}>\r\n            <DemandValidationMessages editable={editable} section={section}/>\r\n            <Form\r\n                id='mp_4_demand_plan_realization'\r\n                initialValues={demandPlanRealizations.map(x => ({...x, _touched: false}))}\r\n                validationSchema={validationSchema}\r\n                onSubmit={onSubmit}\r\n            >\r\n                {(formikProps) => (<>\r\n                    <SaveFormikValues\r\n                        formikProps={formikProps}\r\n                        id='mp_4_demand_plan_realization'\r\n                    />\r\n                    <DemandPlanRealizationTable\r\n                        demandPlanRealizations={demandPlanRealizations}\r\n                        editable={editable}\r\n                        demandId={demandId}\r\n                        formikProps={formikProps}\r\n                        passiveOfferForm={demandHeader.passiveOfferForm}\r\n                        exPost={demandHeader.exPost}\r\n                    />\r\n                </>)}\r\n            </Form>\r\n        </div>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    demandValidation: state.resources.demandValidation,\r\n    demandPlanRealizations: state.resources[DemandPlanRealizationService.DEMAND_PLAN_REALIZATIONS_RESOURCE_ID]\r\n}), {})(withRouter(DemandPlanRealizationPanel));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {DemandValidation, DemandValidationKeys} from \"constants/DemandValidation\";\r\nimport PreparingAdditionalInfo from \"../../../part1/panels/additionalInfo/PreparingAdditionalInfo\";\r\n\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded &&\r\n        <PreparingAdditionalInfo sectionId={DemandValidation.FINISH_ADDITIONAL_INFO} formId={DemandValidationKeys.FINISH_ADDITIONAL_INFO}/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import {ArchivingPanel, DemandAdditionalInfo, DemandPlanRealizationPanel, FinishDemandPanel, FinishDocumentsPanel, ResultNoticePanel} from \"./panels\";\r\nimport ResultNoticeService from \"services/ResultNoticeService\";\r\nimport FinishDemandService from \"services/FinishDemandService\";\r\nimport ArchivingService from \"services/ArchivingService\";\r\nimport DemandPlanRealizationService from \"services/DemandPlanRealizationService\";\r\nimport DemandAdditionalInfoService from \"services/DemandAdditionalInfoService\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\n\r\nexport default {\r\n    mp_4_result_notice: ResultNoticePanel,\r\n    mp_4_finish_documents: FinishDocumentsPanel,\r\n    mp_4_demand_plan_realization: DemandPlanRealizationPanel,\r\n    mp_4_finish_demand: FinishDemandPanel,\r\n    mp_4_archiving: ArchivingPanel,\r\n    mp_4_finish_additional_info: DemandAdditionalInfo,\r\n}\r\n\r\nexport const panelsValidationKeys = {\r\n    mp_4_result_notice: (id) => ResultNoticeService.validate(id),\r\n    mp_4_finish_documents: (id) => null,\r\n    mp_4_demand_plan_realization: (id) => DemandPlanRealizationService.validate(id),\r\n    mp_4_finish_demand: (id) => FinishDemandService.validate(id),\r\n    mp_4_archiving: (id) => ArchivingService.validate(id),\r\n    mp_4_finish_additional_info: (id) => DemandAdditionalInfoService.validate(id, DemandValidation.FINISH_ADDITIONAL_INFO),\r\n}","import React from 'react'\r\nimport DemandPlanRealizationPanel from \"./DemandPlanRealizationPanel\";\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (expanded && <DemandPlanRealizationPanel/>)\r\n}\r\n\r\n\r\nexport default Index;","import reduxStore from 'redux/store'\r\nimport {setResource, setStepperState} from 'redux/actions';\r\nimport {panelsValidationKeys as panelsValidationKeys1} from 'pages/purchaser/MyProcedure/scenes/part1/part1.panels.components'\r\nimport {panelsValidationKeys as panelsValidationKeys3} from 'pages/purchaser/MyProcedure/scenes/part3/part3.panels.components'\r\nimport {panelsValidationKeys as panelsValidationKeys4} from 'pages/purchaser/MyProcedure/scenes/part4/part4.panels.components'\r\nimport {DemandValidationKeys} from \"constants/DemandValidation\";\r\nimport DemandSectionsService from \"services/DemandSectionsService\";\r\n\r\nexport default async (sectionId, objectId, closeSection = true) => {\r\n    const panelsValidationKeys = {...panelsValidationKeys1, ...panelsValidationKeys3, ...panelsValidationKeys4};\r\n\r\n    const {resources} = reduxStore.getState();\r\n    const demandValidation = resources.demandValidation;\r\n    if (!demandValidation || !demandValidation.find(x => x.section === sectionId)?.validateAfterSave)\r\n        return;\r\n\r\n    const sectionIndex = demandValidation.findIndex(x => x.section === sectionId)\r\n    const res = await panelsValidationKeys[DemandValidationKeys[sectionId]](objectId);\r\n    let data = JSON.parse(JSON.stringify(demandValidation));\r\n    data[sectionIndex] = res;\r\n\r\n    reduxStore.dispatch(setResource(DemandSectionsService.DEMAND_VALIDATION_RESOURCE_ID, data));\r\n\r\n    if (res.status === 'OK' || res.status === 'EMPTY') {\r\n        if (closeSection) {\r\n            reduxStore.dispatch(setStepperState());\r\n        }\r\n    }\r\n}","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport ChangeHistory from 'components/popup/changeHistory/ChangeHistory';\r\nimport StartScreen from './StartScreen';\r\nimport DealingsService from 'services/DealingsService';\r\nimport {withRouter} from \"react-router\";\r\nimport PositionAndPartsForm from './PositionAndPartsForm';\r\nimport Loading from 'components/Loading';\r\nimport {connect} from 'react-redux'\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {setOpenForm, setOpenImporter, setStepperState} from 'redux/actions'\r\nimport ImportScreen from \"./ImportScreen\";\r\nimport reduxStore from 'redux/store'\r\nimport DemandService from \"services/DemandService\";\r\nimport validateSection from \"services/helpers/validateSection\";\r\n\r\nconst clear = () => {\r\n    DealingsService.clearResources('dealing');\r\n    DealingsService.clearResources('dealingsList');\r\n    reduxStore.dispatch(setOpenForm(undefined));\r\n    reduxStore.dispatch(setOpenImporter(undefined));\r\n}\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n        match,\r\n        dealingsList,\r\n        demandValidation,\r\n        setOpenForm,\r\n        setOpenImporter,\r\n        openForm,\r\n        openImporter,\r\n        demandHeader\r\n    }) {\r\n    const [historyOpen, setHistoryOpen] = useState(false);\r\n\r\n    const id = match.params.id;\r\n\r\n    useEffect(() => {\r\n        if (expanded) {\r\n            DealingsService.getList(id);\r\n        } else {\r\n            clear();\r\n        }\r\n        return clear\r\n    }, [expanded, id])\r\n\r\n    const isOpenImporter = () => {\r\n        return openImporter;\r\n    };\r\n\r\n    const isOpenForm = () => {\r\n        const validationObj = demandValidation.find(x => x.section === DemandValidation.DEALINGS);\r\n        if (validationObj === undefined) return openForm;\r\n        if (validationObj.status === 'OK') return true;\r\n        if(demandHeader && demandHeader.hasPlanItems) return true;\r\n        if (dealingsList && dealingsList.dealings && dealingsList.dealings.length > 1) return true;\r\n        return openForm;\r\n    };\r\n\r\n    const saveSuccessCallback = () => {\r\n        reduxStore.dispatch(setStepperState());\r\n        DemandService.getValidate(id, false)\r\n    }\r\n\r\n    const saveErrorCallback = () => {\r\n        validateSection(DemandValidation.DEALINGS, id, false);\r\n    }\r\n\r\n    return (\r\n        <>\r\n            {openForm === null ?\r\n                <Loading/> :\r\n                (isOpenImporter()) ?\r\n                    <ImportScreen id={id}/>\r\n                    :\r\n                    (isOpenForm()) ?\r\n                        <>\r\n                            <PositionAndPartsForm\r\n                                expanded={expanded}\r\n                                section={demandValidation ? demandValidation.find(x => x.section === DemandValidation.DEALINGS) : null}\r\n                                formId=\"mp_1_dealings\"\r\n                                saveSuccessCallback={saveSuccessCallback}\r\n                                saveErrorCallback={saveErrorCallback}\r\n                            />\r\n                            <ChangeHistory\r\n                                open={historyOpen}\r\n                                onClose={() => setHistoryOpen(false)}\r\n                            />\r\n                        </> :\r\n                        <StartScreen onFormOpen={() => setOpenForm(true)} onImporterOpen={() => setOpenImporter(true)}/>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    dealingsList: state.resources.dealingsList,\r\n    demandValidation: state.resources.demandValidation,\r\n    openForm: state.store.openForm,\r\n    openImporter: state.store.openImporter,\r\n    demandHeader: state.resources.demandHeader,\r\n}), {\r\n    setOpenForm, setOpenImporter\r\n})(withRouter(Index));\r\n","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport DateTimePicker from 'components/DateTimePicker';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tmarginLeft: theme.spacing(2),\r\n\t\tmarginTop: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction FormElement({\r\n\tclasses,\r\n\tformikProps,\r\n\tid,\r\n\ttitle,\r\n\trequired,\r\n\tonChange,\r\n}) {\r\n\tlet label = title;\r\n\tif (required) label += '*'\r\n\r\n\treturn (\r\n\t\t<TitledComponent\r\n\t\t\tclassName={classes.root}\r\n\t\t\ttitle={label}\r\n\t\t>\r\n\t\t\t<DateTimePicker\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tid={id}\r\n\t\t\t\tonChange={onChange}\r\n\t\t\t\tminDate={new Date()}\r\n\t\t\t/>\r\n\t\t</TitledComponent>\r\n\t)\r\n}\r\n\r\nFormElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tid: PropTypes.string,\r\n\ttitle: PropTypes.string,\r\n\tformikProps: PropTypes.object,\r\n}\r\n\r\nFormElement.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(FormElement);","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (value) => ({label: `${value} ${Tr('days')}`, value})\r\n\r\nexport const elements = {\r\n\t30: createItem(30),\r\n\t60: createItem(60),\r\n\t90: createItem(90),\r\n\t120: createItem(120),\r\n\t150: createItem(150),\r\n}\r\n\r\nexport default Object.values(elements)\r\n","import React, {useEffect} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport RadioGroup from 'components/RadioGroup';\r\nimport Tr from 'translations/Translations';\r\nimport Select from 'components/Select';\r\nimport GridBlock from 'components/GridBlock';\r\nimport periodValues from '../constants/period.values'\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport DatePicker from 'components/DatePicker';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginLeft: theme.spacing(2),\r\n        marginTop: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction DateBind(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        title,\r\n        initialPickDateInsteadOfPeriod\r\n    }) {\r\n\r\n    const radioId = 'bindWithOfferPeriodOrDate.pickDateInsteadOfPeriod'\r\n    const dateId = \"bindWithOfferPeriodOrDate.date\"\r\n\r\n    const conditionalValue = getObjectValue(radioId, formikProps.values, '')\r\n\r\n    useEffect(() => {\r\n        if (conditionalValue === \"true\") formikProps.setFieldTouched(dateId, true)\r\n        // eslint-disable-next-line\r\n    }, [conditionalValue])\r\n\r\n\r\n    const getRadioValues = () => {\r\n        const values = [\r\n            {label: Tr('not_applicable'), value: \"empty\"},\r\n            {label: Tr('date'), value: \"true\"},\r\n        ]\r\n        if(initialPickDateInsteadOfPeriod === 'false') {\r\n            values.push({label: Tr('period'), value: \"false\"})\r\n        }\r\n        return values;\r\n    }\r\n\r\n    return (\r\n        <TitledComponent\r\n            className={classes.root}\r\n            title={title}\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                <RadioGroup\r\n                    id={radioId}\r\n                    formikProps={formikProps}\r\n                    items={getRadioValues()}\r\n                />\r\n                {\r\n                    conditionalValue === \"empty\" ? \"\"\r\n                        : (conditionalValue === 'true' ?\r\n                        <DatePicker\r\n                            formikProps={formikProps}\r\n                            id={dateId}\r\n                        /> :\r\n                        <Select\r\n                            formikProps={formikProps}\r\n                            id={'bindWithOfferPeriodOrDate.period.length'}\r\n                            items={periodValues}\r\n                        />)\r\n                }\r\n            </GridBlock>\r\n        </TitledComponent>\r\n    )\r\n}\r\n\r\nDateBind.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(DateBind);","import reduxStore from 'redux/store'\r\nimport {clearResource, setResource, setSaveStatusDialog, setSaveStatusError, setSaveStatusLoading} from 'redux/actions'\r\nimport Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport validateSection from './helpers/validateSection'\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport objectExtension from 'libs/objectExtension';\r\n\r\nconst SCHEDULE_RESOURCE_ID = 'schedule';\r\n\r\nconst getList = async (id) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.SCHEDULE(id))\r\n\r\n        reduxStore.dispatch(\r\n            setResource(SCHEDULE_RESOURCE_ID, res)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\n\r\nconst _save = async (url, values) => {\r\n    const data = _prepareData(values);\r\n\r\n    const {resources} = reduxStore.getState()\r\n    const {schedule} = resources;\r\n    const diff = objectExtension.diff(data, schedule);\r\n    if (diff === null) return null;\r\n\r\n    try {\r\n        return await RestRequestPOST(url, data)\r\n    } catch (error) {\r\n        throw error;\r\n    }\r\n}\r\n\r\nconst _prepareData = (values) => {\r\n    const {\r\n        offerEndDate,\r\n        offerOpenDate,\r\n        bindWithOfferPeriodOrDate,\r\n        ...other\r\n    } = values;\r\n\r\n    let isDate = bindWithOfferPeriodOrDate.pickDateInsteadOfPeriod;\r\n\r\n    let offer;\r\n    if (isDate === \"empty\") offer = null\r\n    else if (isDate === \"true\") offer = {date: bindWithOfferPeriodOrDate.date.format()}\r\n    else offer = {period: bindWithOfferPeriodOrDate.period}\r\n\r\n    const data = {\r\n        schedules: [{\r\n            offerEndDate: offerEndDate ? offerEndDate.format() : null,\r\n            offerOpenDate: offerOpenDate ? offerOpenDate.format() : null,\r\n            bindWithOfferPeriodOrDate: offer,\r\n            ...other\r\n        }]\r\n    }\r\n    return data;\r\n}\r\n\r\nconst save = async (id, values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const res = await _save(Endpoints.SCHEDULE_SAVE(id), values)\r\n        if (res === null || res.success) {\r\n            await getList(id);\r\n            reduxStore.dispatch(setSaveStatusDialog());\r\n            await validateSection(DemandValidation.SCHEDULE, id);\r\n            const {resources} = reduxStore.getState();\r\n            const {demandHeader} = resources;\r\n            if (demandHeader && demandHeader.noticeOjsType)\r\n                await validateSection(DemandValidation.NOTICE, id);\r\n            if (demandHeader && demandHeader.noticeBzpType)\r\n                await validateSection(DemandValidation.NATIONAL_NOTICE, id);\r\n\r\n            await validateSection(DemandValidation.PUBLICATION, id);\r\n        } else {\r\n            reduxStore.dispatch(setSaveStatusError());\r\n            await validateSection(DemandValidation.SCHEDULE, id, false);\r\n        }\r\n        return res;\r\n    } catch (error) {\r\n        console.error(error)\r\n    }\r\n}\r\n\r\nconst clearSchedule = async () => {\r\n    reduxStore.dispatch(clearResource(SCHEDULE_RESOURCE_ID))\r\n}\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.SCHEDULE_VALIDATE(id));\r\n}\r\n\r\nconst checkForDraft = async (id) => {\r\n    return await RestRequestGET(Endpoints.SCHEDULE_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraft = async (id) => {\r\n    const res = await RestRequestGET(Endpoints.SCHEDULE_AUTOSAVE(id));\r\n    reduxStore.dispatch(setResource(SCHEDULE_RESOURCE_ID, res.result));\r\n    return res;\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n    const data = _prepareData(formValues);\r\n    await RestRequestPOST(Endpoints.SCHEDULE_AUTOSAVE(id), data);\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n    await RestRequestDELETE(Endpoints.SCHEDULE_AUTOSAVE(id));\r\n}\r\n\r\nexport default {\r\n    save,\r\n    getList,\r\n    validate,\r\n    clearSchedule,\r\n    checkForDraft,\r\n    loadDraft,\r\n    saveDraft,\r\n    deleteDraft,\r\n    SCHEDULE_RESOURCE_ID\r\n    //auto Save,\r\n    //auto SaveCheck,\r\n    //auto SaveDelete,\r\n    //auto SaveLoad,\r\n    //restoreAuto save,\r\n}","import React, {useEffect, useState} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport FormElement from './FormElement';\r\nimport moment from 'moment';\r\nimport DateBind from './DateBind';\r\nimport periodValues from '../constants/period.values'\r\nimport Loading from 'components/Loading';\r\nimport {connect} from 'react-redux'\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport * as Yup from 'yup';\r\nimport ScheduleService from 'services/ScheduleService';\r\nimport {withRouter} from \"react-router\";\r\nimport SaveFormikValues from 'components/SaveFormikValues';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport VS from \"constants/ValidationShema\";\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport {setFormDraftLoaded} from \"redux/actions\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\nfunction Deadlines(\r\n    {\r\n        scheduleList,\r\n        stepperState,\r\n        demandValidation,\r\n        match,\r\n        setFormDraftLoaded,\r\n        demandHeader\r\n    }) {\r\n    const id = match.params.id;\r\n    const section = demandValidation.find(x => x.section === DemandValidation.SCHEDULE);\r\n    const FORM_ID = 'mp_1_schedule';\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(FORM_ID, undefined,\r\n        autoSaveFormDraftActive ? () => ScheduleService.deleteDraft(id) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(id, ScheduleService.saveDraft, FORM_ID) : undefined);\r\n\r\n    useEffect(() => {\r\n        ScheduleService.getList(id).then(() => {\r\n            if (autoSaveFormDraftActive)\r\n                ScheduleService.checkForDraft(id).then(res => setDraftConfirm(res.result))\r\n        });\r\n\r\n        return () => ScheduleService.clearSchedule()\r\n    }, [id, autoSaveFormDraftActive])\r\n\r\n    const handleSubmit = (values, formikProps) => {\r\n        ScheduleService.save(id, values)\r\n            .then((result) => {\r\n                if (result && !result.success) {\r\n                    const errors = result.errors;\r\n                    let errorObj = {}\r\n                    Object.keys(errors).forEach((errorId) => {\r\n                        const erId = errorId.split('.')[1];\r\n                        errorObj[erId] = errors[errorId];\r\n                    })\r\n                    formikProps.setErrors(errorObj)\r\n                }\r\n            })\r\n    }\r\n\r\n    const getField = (id, defaultValue = '') => getObjectValue(id, scheduleList.schedules.length > 0 ? scheduleList.schedules[0] : {}, defaultValue)\r\n\r\n    const validationSchema = Yup.lazy((value) => {\r\n        const schema = {\r\n            offerEndDate: VS.dateTimeMin(new Date(), Tr('v_time_can_not_be_past')),\r\n            offerOpenDate: VS.dateTimeValid()\r\n                .when('offerEndDate', (offerEndDate, schema) => {\r\n                    return schema.test('EndDateLessOpenDate', Tr(\"EndDateLessOpenDate\"), (offerOpenDate) => {\r\n                        if (offerEndDate && offerOpenDate) {\r\n                            return !offerOpenDate.isBefore(offerEndDate);\r\n                        }\r\n                        return false;\r\n                    })\r\n                })\r\n        }\r\n\r\n        let offerOpenDateClone = moment.isMoment(value.offerOpenDate) ? (value.offerOpenDate.isValid() ? value.offerOpenDate.clone().startOf(\"day\") : moment()) : moment();\r\n        offerOpenDateClone = offerOpenDateClone.isBefore(moment().add(1, 'day')) ? moment().add(1, 'day') : offerOpenDateClone;\r\n\r\n        if (value.bindWithOfferPeriodOrDate.pickDateInsteadOfPeriod === 'true') {\r\n            schema['bindWithOfferPeriodOrDate'] = Yup.object().shape({\r\n                date: VS.dateMin(offerOpenDateClone, Tr('periodDateLessThanOpenDate'))\r\n            })\r\n\r\n        }\r\n\r\n        return Yup.object().shape(schema);\r\n    })\r\n\r\n    const getPickDateInsteadOfPeriod = () => {\r\n        const date = getField('bindWithOfferPeriodOrDate.date', null);\r\n        if (date === null) {\r\n            const periodLen = getField('bindWithOfferPeriodOrDate.period.length', null);\r\n            if (periodLen === null) return 'empty'\r\n            return 'false'\r\n        }\r\n        return 'true'\r\n    }\r\n    const handleEndDate = (formikProps, value) => {\r\n        formikProps.setFieldValue('offerOpenDate', value);\r\n        formikProps.setFieldTouched('offerOpenDate', true);\r\n        formikProps.validateField('offerOpenDate');\r\n    }\r\n    const getInitValues = () => ({\r\n        _editable: section ? section.editable : true,\r\n        stageNumber: getField('stageNumber'),\r\n        stageName: getField('stageName'),\r\n        questionEndDate: getField('questionEndDate', null),\r\n\r\n        identity: getField('identity'),\r\n        offerEndDate: moment(getField('offerEndDate', new Date())),\r\n        offerOpenDate: moment(getField('offerOpenDate', new Date())),\r\n        bindWithOfferPeriodOrDate: {\r\n            date: moment(getField('bindWithOfferPeriodOrDate.date', new Date())),\r\n            period: {\r\n                length: getField('bindWithOfferPeriodOrDate.period.length', periodValues[0].value),\r\n                name: getField('bindWithOfferPeriodOrDate.period.name', 'day'),\r\n            },\r\n            pickDateInsteadOfPeriod: getPickDateInsteadOfPeriod(),\r\n        }\r\n    })\r\n\r\n    const loadScheduleDraft = () => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        ScheduleService.loadDraft(id).then(res => setFormDraftLoaded(FORM_ID, res.success));\r\n        setWorking(false);\r\n    }\r\n\r\n    if (!scheduleList || working) {\r\n        return <Loading/>\r\n    }\r\n\r\n    return (\r\n        <div>\r\n            <Form\r\n                initialValues={getInitValues()}\r\n                validationSchema={validationSchema}\r\n                onSubmit={handleSubmit}\r\n                id={FORM_ID}\r\n                afterSubmitFunc={() => {\r\n                    if (isDemandModification()) {\r\n                        ModificationService.isDemandChanged(id);\r\n                    }\r\n                }}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={FORM_ID}\r\n                            save={FORM_ID === stepperState}\r\n                        />\r\n                        {autoSaveFormDraftActive &&\r\n                        <AutoSaveFormValues\r\n                            formikProps={formikProps}\r\n                            id={id}\r\n                            formId={FORM_ID}\r\n                            saveFunc={(formValues) => {\r\n                                ScheduleService.saveDraft(id, formValues)\r\n                            }}\r\n                        />\r\n                        }\r\n                        <GridBlock\r\n                            direction='column'\r\n                        >\r\n                            <Typography variant='h6'>\r\n                                {Tr('offers')}\r\n                            </Typography>\r\n                            <FormElement\r\n                                title={Tr('deadline_for_offers')}\r\n                                formikProps={formikProps}\r\n                                id={'offerEndDate'}\r\n                                onChange={(value) => handleEndDate(formikProps, value)}\r\n                                required\r\n                            />\r\n                            <FormElement\r\n                                title={Tr('date_opening_offers')}\r\n                                formikProps={formikProps}\r\n                                id={'offerOpenDate'}\r\n                                required\r\n                            />\r\n                            <DateBind\r\n                                title={Tr('date_binding_offer')}\r\n                                formikProps={formikProps}\r\n                                initialPickDateInsteadOfPeriod={getPickDateInsteadOfPeriod()}\r\n                            />\r\n                        </GridBlock>\r\n                    </>\r\n                )}\r\n            </Form>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={loadScheduleDraft}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </div>\r\n    )\r\n}\r\n\r\nDeadlines.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nDeadlines.defaultProps = {}\r\n\r\nexport default connect((state) => ({\r\n    scheduleList: state.resources.schedule,\r\n    stepperState: state.stepper.state,\r\n    demandValidation: state.resources.demandValidation,\r\n    demandHeader: state.resources.demandHeader\r\n}), {setFormDraftLoaded})(withRouter(Deadlines));\r\n\r\n","import React from 'react'\r\nimport DeadlinesEdit from './deadlinesEdit/DeadlinesEdit';\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (\r\n        expanded && <DeadlinesEdit/>\r\n    )\r\n}\r\n\r\nexport default Index;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport CommissionService from 'services/CommissionService';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport CommissionForm from \"components/complex/commissionForm/CommissionForm\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport {setFormDraftLoaded} from \"redux/actions\";\r\nimport Loading from 'components/Loading';\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\nfunction DemandCommissionForm(\r\n    {\r\n        classes,\r\n        stepperState,\r\n        match,\r\n        commissionUserList,\r\n        userListAvailable,\r\n        establishmentDate,\r\n        demandValidation,\r\n        setFormDraftLoaded,\r\n        demandHeader\r\n    }) {\r\n    const section = demandValidation.find(x => x.section === DemandValidation.COMMISSION);\r\n    const FORM_ID = 'mp_1_commission'\r\n    const demandId = match.params.id;\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(FORM_ID, undefined,\r\n        autoSaveFormDraftActive ? () => CommissionService.deleteDraft(demandId) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(demandId, CommissionService.saveDraft, FORM_ID) : undefined);\r\n\r\n    useEffect(() => {\r\n        CommissionService.getUsers(demandId).then(() => {\r\n            if (autoSaveFormDraftActive)\r\n                CommissionService.checkForDraft(demandId).then(res => setDraftConfirm(res.result));\r\n        });\r\n        CommissionService.getAvailableUsers(demandId);\r\n\r\n        return () => {\r\n            CommissionService.clearResources(CommissionService.COMMISSION_USER_LIST_RESOURCE_ID);\r\n            CommissionService.clearResources(CommissionService.COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID);\r\n            CommissionService.clearResources(CommissionService.COMMISSION_ESTABLISHMENT_RESOURCE_ID);\r\n        }\r\n    }, [demandId, autoSaveFormDraftActive])\r\n\r\n\r\n    const markHistorical = (memnerId) => {\r\n        simpleConfirm(\"archive_commission_member_info\", () => CommissionService.markHistorical(demandId, memnerId))\r\n    }\r\n\r\n    const handleSubmit = (values) => {\r\n        CommissionService.saveUserList(demandId, values)\r\n    }\r\n\r\n    const doLoadHistory = async () => {\r\n        return await CommissionService.getHistory(demandId);\r\n    }\r\n\r\n    const loadCommissionDraft = () => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        CommissionService.loadDraft(demandId).then(res => setFormDraftLoaded(FORM_ID, res.success));\r\n        setWorking(false);\r\n    }\r\n\r\n    if (working) return <Loading/>\r\n    else return (\r\n        <>\r\n            <CommissionForm\r\n                commissionUserList={commissionUserList}\r\n                userListAvailable={userListAvailable}\r\n                establishmentDate={establishmentDate}\r\n                afterSubmitFunc={() => {\r\n                    if (isDemandModification()) {\r\n                        ModificationService.isDemandChanged(demandId);\r\n                    }\r\n                }}\r\n                editable={section ? section.editable : true}\r\n                handleSubmit={handleSubmit}\r\n                formId={FORM_ID}\r\n                demandId={demandId}\r\n                doLoadHistory={doLoadHistory}\r\n                markHistorical={markHistorical}\r\n                saveDraftFunc={CommissionService.saveDraft}\r\n                autoSaveFormDraftActive={autoSaveFormDraftActive}\r\n            />\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={loadCommissionDraft}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nDemandCommissionForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stepperState: state.stepper.state,\r\n    commissionUserList: state.resources[CommissionService.COMMISSION_USER_LIST_RESOURCE_ID],\r\n    userListAvailable: state.resources[CommissionService.COMMISSION_USER_LIST_AVAILABLE_RESOURCE_ID],\r\n    establishmentDate: state.resources[CommissionService.COMMISSION_ESTABLISHMENT_RESOURCE_ID],\r\n    demandValidation: state.resources.demandValidation,\r\n    demandHeader: state.resources.demandHeader\r\n}), {setFormDraftLoaded})(withRouter(DemandCommissionForm));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport DemandCommissionForm from './DemandCommissionForm';\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <DemandCommissionForm/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import Tr from 'translations/Translations';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst createItem = (titleKey, descriptionKey, id, elements = [], type = 'deafult') => ({\r\n    title: Tr(titleKey),\r\n    description: Tr(descriptionKey),\r\n    id,\r\n    elements,\r\n    type\r\n})\r\n\r\nconst createElement = (titleKey, descriptionKey, id, type = 'deafult', checked) => ({\r\n    title: Tr(titleKey),\r\n    description: Tr(descriptionKey),\r\n    id,\r\n    type,\r\n    checked,\r\n})\r\n\r\nconst elements = {\r\n    e1: createItem(\r\n        'jedz_ex_a_t',\r\n        'jedz_ex_a_d',\r\n        'e1',\r\n        [\r\n            createElement('jedz_ex_a_1_t', 'jedz_ex_a_1_d', 'exclusionA1', \"disabled\", true),\r\n            createElement('jedz_ex_a_2_t', 'jedz_ex_a_2_d', 'exclusionA2', \"disabled\", true\r\n            ),\r\n            createElement('jedz_ex_a_3_t', 'jedz_ex_a_3_d', 'exclusionA3', \"disabled\", true),\r\n            createElement('jedz_ex_a_4_t', 'jedz_ex_a_4_d', 'exclusionA4', \"disabled\", true),\r\n            createElement('jedz_ex_a_5_t', 'jedz_ex_a_5_d', 'exclusionA5', \"disabled\", true),\r\n            createElement('jedz_ex_a_6_t', 'jedz_ex_a_6_d', 'exclusionA6', \"disabled\", true),\r\n        ],\r\n        \"disabled\"\r\n    ),\r\n    e2: createItem(\r\n        'jedz_ex_b_t',\r\n        'jedz_ex_b_d',\r\n        'e2',\r\n        [\r\n            createElement('jedz_ex_b_1_t', 'jedz_ex_b_1_d', \"exclusionB1\", \"disabled\", true),\r\n            createElement('jedz_ex_b_2_t', 'jedz_ex_b_2_d', \"exclusionB2\", \"disabled\", true),\r\n        ],\r\n        \"disabled\"),\r\n    e3: createItem(\r\n        'jedz_ex_c_t',\r\n        'jedz_ex_c_d',\r\n        'e3',\r\n        [\r\n            createElement('jedz_ex_c_1_t', 'jedz_ex_c_1_d', 'exclusionC1'),\r\n            createElement('jedz_ex_c_2_t', 'jedz_ex_c_2_d', 'exclusionC2'),\r\n            createElement('jedz_ex_c_3_t', 'jedz_ex_c_3_d', 'exclusionC3'),\r\n            createElement('jedz_ex_c_4_t', 'jedz_ex_c_4_d', 'exclusionC4'),\r\n            createElement('jedz_ex_c_5_t', 'jedz_ex_c_5_d', 'exclusionC5'),\r\n            createElement('jedz_ex_c_6_t', 'jedz_ex_c_6_d', 'exclusionC6'),\r\n            createElement('jedz_ex_c_7_t', 'jedz_ex_c_7_d', 'exclusionC7'),\r\n            createElement('jedz_ex_c_8_t', 'jedz_ex_c_8_d', 'exclusionC8'),\r\n            createElement('jedz_ex_c_9_t', 'jedz_ex_c_9_d', 'exclusionC9'),\r\n            createElement('jedz_ex_c_10_t', 'jedz_ex_c_10_d', 'exclusionC10'),\r\n            createElement('jedz_ex_c_11_t', 'jedz_ex_c_11_d', 'exclusionC11'),\r\n            createElement('jedz_ex_c_12_t', 'jedz_ex_c_12_d', 'exclusionC12'),\r\n            createElement('jedz_ex_c_13_t', 'jedz_ex_c_13_d', 'exclusionC13'),\r\n            createElement('jedz_ex_c_14_t', 'jedz_ex_c_14_d', 'exclusionC14'),\r\n            createElement('jedz_ex_c_15_t', 'jedz_ex_c_15_d', 'exclusionC15'),\r\n        ]),\r\n    e4: createItem(\r\n        'jedz_ex_d_t',\r\n        'jedz_ex_d_d',\r\n        'e4',\r\n        [\r\n            createElement('jedz_ex_d_1_t', 'jedz_ex_d_1_d', 'exclusionD1'),\r\n        ]\r\n    )\r\n}\r\nexport default Object.values(elements);\r\n\r\nexport const getInitValues = (sectionId, espdList, idPrefix) => {\r\n\r\n    const item = elements[sectionId];\r\n\r\n    const e = item.elements.reduce((prev, curr) => {\r\n        return {\r\n            ...prev,\r\n            [curr.id]: getObjectValue(`${idPrefix}.${curr.id}`, espdList),\r\n        }\r\n    }, {})\r\n\r\n    return e;\r\n}\r\n\r\n\r\n","import Tr from 'translations/Translations';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst createItem = (titleKey, descriptionKey, id, elements = [], type = 'deafult') => ({\r\n    title: Tr(titleKey),\r\n    description: Tr(descriptionKey),\r\n    id,\r\n    elements,\r\n    type\r\n})\r\n\r\nconst createElement = (titleKey, descriptionKey, id, type = 'deafult') => ({\r\n    title: Tr(titleKey),\r\n    description: Tr(descriptionKey),\r\n    id,\r\n    type,\r\n})\r\n\r\nconst elements = {\r\n    s1: createItem('jedz_se_y_a_t', 'jedz_se_y_a_d', 's1', [\r\n        createElement('jedz_se_y_a_1_t', 'jedz_se_y_a_1_d', 'selectionA1'),\r\n        createElement('jedz_se_y_a_2_t', 'jedz_se_y_a_2_d', 'selectionA2'),\r\n        createElement('jedz_se_y_a_3_t', 'jedz_se_y_a_3_d', 'selectionA3'),\r\n        createElement('jedz_se_y_a_4_t', 'jedz_se_y_a_4_d', 'selectionA4'),\r\n    ]),\r\n    s2: createItem('jedz_se_y_b_t', 'jedz_se_y_b_d', 's2', [\r\n        createElement('jedz_se_y_b_1_t', 'jedz_se_y_b_1_d', 'selectionB1'),\r\n        createElement('jedz_se_y_b_2_t', 'jedz_se_y_b_2_d', 'selectionB2'),\r\n        createElement('jedz_se_y_b_3_t', 'jedz_se_y_b_3_d', 'selectionB3'),\r\n        createElement('jedz_se_y_b_4_t', 'jedz_se_y_b_4_d', 'selectionB4'),\r\n        createElement('jedz_se_y_b_5_t', 'jedz_se_y_b_5_d', 'selectionB5'),\r\n        createElement('jedz_se_y_b_6_t', 'jedz_se_y_b_6_d', 'selectionB6'),\r\n        createElement('jedz_se_y_b_7_t', 'jedz_se_y_b_7_d', 'selectionB7'),\r\n        createElement('jedz_se_y_b_8_t', 'jedz_se_y_b_8_d', 'selectionB8'),\r\n    ]),\r\n    s3: createItem('jedz_se_y_c_t', 'jedz_se_y_c_d', 's3', [\r\n        createElement('jedz_se_y_c_1_t', 'jedz_se_y_c_1_d', 'selectionC1'),\r\n        createElement('jedz_se_y_c_2_t', 'jedz_se_y_c_2_d', 'selectionC2'),\r\n        createElement('jedz_se_y_c_3_t', 'jedz_se_y_c_3_d', 'selectionC3'),\r\n        createElement('jedz_se_y_c_4_t', 'jedz_se_y_c_4_d', 'selectionC4'),\r\n        createElement('jedz_se_y_c_5_t', 'jedz_se_y_c_5_d', 'selectionC5'),\r\n        createElement('jedz_se_y_c_6_t', 'jedz_se_y_c_6_d', 'selectionC6'),\r\n        createElement('jedz_se_y_c_7_t', 'jedz_se_y_c_7_d', 'selectionC7'),\r\n        createElement('jedz_se_y_c_8_t', 'jedz_se_y_c_8_d', 'selectionC8'),\r\n        createElement('jedz_se_y_c_9_t', 'jedz_se_y_c_9_d', 'selectionC9'),\r\n        createElement('jedz_se_y_c_10_t', 'jedz_se_y_c_10_d', 'selectionC10'),\r\n        createElement('jedz_se_y_c_11_t', 'jedz_se_y_c_11_d', 'selectionC11'),\r\n        createElement('jedz_se_y_c_12_t', 'jedz_se_y_c_12_d', 'selectionC12'),\r\n        createElement('jedz_se_y_c_13_t', 'jedz_se_y_c_13_d', 'selectionC13'),\r\n        createElement('jedz_se_y_c_14_t', 'jedz_se_y_c_14_d', 'selectionC14'),\r\n        createElement('jedz_se_y_c_15_t', 'jedz_se_y_c_15_d', 'selectionC15'),\r\n        createElement('jedz_se_y_c_16_t', 'jedz_se_y_c_16_d', 'selectionC16'),\r\n        createElement('jedz_se_y_c_17_t', 'jedz_se_y_c_17_d', 'selectionC17'),\r\n        createElement('jedz_se_y_c_18_t', 'jedz_se_y_c_18_d', 'selectionC18'),\r\n    ]),\r\n    s4: createItem('jedz_se_y_d_t', 'jedz_se_y_d_d', 's4', [\r\n        createElement('jedz_se_y_d_1_t', 'jedz_se_y_d_1_d', 'selectionD1'),\r\n        createElement('jedz_se_y_d_2_t', 'jedz_se_y_d_2_d', 'selectionD2'),\r\n    ]),\r\n}\r\n\r\nconst elements2 = {\r\n    n1: createItem('jedz_se_n_a_t', 'jedz_se_n_a_d', 'n1',\r\n        [\r\n            createElement('jedz_se_n_1_t', 'jedz_se_n_1_d', '1', 'disabled')],\r\n        'disabled'),\r\n}\r\n\r\nexport default {\r\n    true: Object.values(elements),\r\n    false: Object.values(elements2),\r\n};\r\n\r\nexport const getInitValues = (sectionId, espdList, idPrefix) => {\r\n    const item = elements[sectionId]\r\n    return item.elements.reduce((prev, curr) => {\r\n        return {\r\n            ...prev,\r\n            [curr.id]: getObjectValue(`${idPrefix}.${curr.id}`, espdList),\r\n        }\r\n    }, {})\r\n}\r\n\r\n\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource, setSaveStatusDialog, setSaveStatusLoading} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport validateSection from './helpers/validateSection';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\n\r\nconst ESPD_LIST_RESOURCE_KEY = 'espdList'\r\n\r\nconst getList = async (id, separateForEachDealing) => {\r\n\r\n    separateForEachDealing = separateForEachDealing === undefined ? undefined : separateForEachDealing === 'true' || separateForEachDealing === true;\r\n    const params = {\r\n        separateForEachDealing\r\n    }\r\n\r\n    try {\r\n        const espdList = await RestRequestGET(Endpoints.ESPD(id), {params});\r\n        espdList.separateForEachDealing = String(espdList.separateForEachDealing);\r\n        reduxStore.dispatch(setResource(ESPD_LIST_RESOURCE_KEY, espdList));\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst _formatSingleEspd = (espd) => {\r\n\r\n    const {\r\n        e1, e2, e3, e4,\r\n        s1, s2, s3, s4,\r\n        n1,\r\n        qualifications,\r\n        _editable,\r\n        ...other\r\n    } = espd;\r\n\r\n    let data = {\r\n        ...e1, ...e2, ...e3, ...e4,\r\n        ...s1, ...s2, ...s3, ...s4,\r\n        selection: qualifications,\r\n        declaration: qualifications === \"no\" ? true : false,\r\n        ...other\r\n    };\r\n\r\n    return data;\r\n}\r\n\r\nconst _save = async (url, values, force = false) => {\r\n    const data = _formatData(values);\r\n\r\n    try {\r\n        await RestRequestPOST(url, data)\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst _formatData = (values) => {\r\n    const {espd, separateForEachDealing, espds} = values;\r\n    const separate = separateForEachDealing === 'true' || separateForEachDealing === true;\r\n    const data = {separateForEachDealing: separate, espds: null, espd: null};\r\n\r\n    if (separate) {\r\n        data.espds = [];\r\n        for (let i = 0; i < espds.length; i++)\r\n            data.espds.push(_formatSingleEspd(espds[i]));\r\n    } else {\r\n        data.espd = _formatSingleEspd(espd);\r\n    }\r\n    return data;\r\n}\r\n\r\nconst save = async (id, values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading())\r\n    try {\r\n        const res = await _save(Endpoints.ESPD_SAVE(id), values, true)\r\n        reduxStore.dispatch(setSaveStatusDialog())\r\n        if (res !== null) {\r\n            await validateSection(DemandValidation.ESPD, id);\r\n        }\r\n    } catch (error) {\r\n        console.error(error)\r\n    }\r\n}\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.ESPD_VALIDATE(id));\r\n}\r\n\r\nconst checkForDraft = async (id) => {\r\n    return await RestRequestGET(Endpoints.ESPD_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraft = async (id) => {\r\n    const res = await RestRequestGET(Endpoints.ESPD_AUTOSAVE(id));\r\n    res.result.separateForEachDealing = String(res.result.separateForEachDealing);\r\n    reduxStore.dispatch(setResource(ESPD_LIST_RESOURCE_KEY, res.result));\r\n    return res;\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n    const data = _formatData(formValues);\r\n    await RestRequestPOST(Endpoints.ESPD_AUTOSAVE(id), data);\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n    await RestRequestDELETE(Endpoints.ESPD_AUTOSAVE(id));\r\n}\r\n\r\nexport const clearEspdList = () => {\r\n    reduxStore.dispatch(clearResource(ESPD_LIST_RESOURCE_KEY));\r\n}\r\n\r\nconst exportPDF = async (demandId, dealingId) => {\r\n    if (dealingId) {\r\n        return RestRequestBLOB(Endpoints.ESPD_PRINT_FOR_DEALING(demandId, dealingId));\r\n    } else {\r\n        return RestRequestBLOB(Endpoints.ESPD_PRINT_FOR_DEMAND(demandId));\r\n    }\r\n}\r\nconst exportXML = async (demandId, dealingId) => {\r\n    if (dealingId) {\r\n        return RestRequestBLOB(Endpoints.ESPD_EXPORT_FOR_DEALING(demandId, dealingId));\r\n    } else {\r\n        return RestRequestBLOB(Endpoints.ESPD_EXPORT_FOR_DEMAND(demandId));\r\n    }\r\n}\r\n\r\nexport default {\r\n    save,\r\n    validate,\r\n    getList,\r\n    checkForDraft,\r\n    loadDraft,\r\n    saveDraft,\r\n    deleteDraft,\r\n    clearEspdList,\r\n    exportPDF,\r\n    exportXML,\r\n    ESPD_LIST_RESOURCE_KEY\r\n}","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value=Tr(trKey)) => ({\r\n\tlabel: Tr(trKey),\r\n\tvalue,\r\n})\r\n\r\nexport default [\r\n\tcreateItem('procedure_type_s_1', '1'),\r\n\tcreateItem('procedure_type_s_2', '2'),\r\n\tcreateItem('procedure_type_s_3', '3'),\r\n\tcreateItem('procedure_type_s_4', '4'),\r\n\tcreateItem('procedure_type_s_5', '5'),\r\n]\r\n\r\n\r\n\r\n\r\n\r\n","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (key) => ({\r\n    value: key,\r\n    label: Tr('espd_buyer_type_' + key),\r\n});\r\n\r\nexport default [\r\n    createItem('CLASSIC'),\r\n    createItem('SECTOR')\r\n]","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Title from 'components/Title';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport TitledComponent from 'components/TitledComponent';\r\nimport Select from 'components/Select';\r\nimport selectItems from './constants/procedureType.values'\r\nimport buyerTypes from './constants/buyerType.values'\r\nimport TextInput from 'components/TextInput';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*:not(:first-child)': {\r\n            marginTop: theme.spacing(2),\r\n        }\r\n    }\r\n})\r\n\r\nfunction ProcedureSection({\r\n                              classes,\r\n                              formikProps,\r\n                              idPrefix,\r\n                              onBuyerTypeChanged\r\n                          }) {\r\n\r\n    const show = (tr, text) => {\r\n        return <TitledComponent title={Tr(tr)}>\r\n            <Typography variant='body2'>\r\n                {text}\r\n            </Typography>\r\n        </TitledComponent>\r\n    }\r\n\r\n    return (\r\n        <GridBlock\r\n            column\r\n            className={classes.root}\r\n        >\r\n            <Title align='center'>\r\n                {Tr('procedure')}\r\n            </Title>\r\n            <HelpComponent text={<div> {Tr('tooltip_espd_buyer_type_1')}<br/>{Tr('tooltip_espd_buyer_type_2')}</div>}>\r\n                <TitledComponent title={Tr('espd_buyer_type')}>\r\n                    <Select\r\n                        id={`${idPrefix}.espdBuyerType`}\r\n                        formikProps={formikProps}\r\n                        items={buyerTypes}\r\n                        onChange={onBuyerTypeChanged}\r\n                    />\r\n                </TitledComponent>\r\n            </HelpComponent>\r\n            {show('title', getObjectValue(`${idPrefix}.name`, formikProps.values))}\r\n            {show('description', getObjectValue(`${idPrefix}.description`, formikProps.values))}\r\n            {show('reference_number', getObjectValue(`${idPrefix}.number`, formikProps.values))}\r\n            {show('official_name', getObjectValue(`${idPrefix}.orgName`, formikProps.values))}\r\n            {show('state', getObjectValue(`${idPrefix}.orgCountry`, formikProps.values))}\r\n            <TitledComponent title={Tr('procedure_type')}>\r\n                <Select\r\n                    id={`${idPrefix}.procedureType`}\r\n                    formikProps={formikProps}\r\n                    items={selectItems}\r\n                />\r\n            </TitledComponent>\r\n            <TitledComponent title={Tr('number_of_ad')}>\r\n                <TextInput\r\n                    id={`${idPrefix}.noticeReferenceNumber`}\r\n                    formikProps={formikProps}\r\n                    placeholder={Tr('number_of_ad')}\r\n                />\r\n            </TitledComponent>\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nProcedureSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ProcedureSection);\r\n","import React, { useState } from 'react'\r\nimport { withStyles, Typography, Paper, Collapse, Checkbox, Tooltip } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport clsx from 'clsx';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowDown'\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ttitle: {\r\n\t\tbackgroundColor: theme.palette.background.greyBackground,\r\n\t\tborder: `1px solid ${theme.palette.common.white}`,\r\n\t\tcursor: 'pointer',\r\n\t\t'&>*:nth-child(2)': {\r\n\t\t\tflexGrow: 1,\r\n\t\t}\r\n\t},\r\n\tpadding: {\r\n\t\tpadding: theme.spacing(1) / 2,\r\n\t},\r\n\trotate: {\r\n\t\ttransform: 'rotate(180deg)'\r\n\t},\r\n\tarrow: {\r\n\t\tpadding: theme.spacing(1),\r\n\t},\r\n\tnoCheckbox: {\r\n\t\tmarginLeft: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction Section({\r\n\tclasses,\r\n\tid,\r\n\tformikProps,\r\n\ttitle,\r\n\tdescription,\r\n\tchildren,\r\n\tdisabled,\r\n\tchecked\r\n}) {\r\n\tconst [open, setOpen] = useState(false)\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n\tconst isChecked = () => {\r\n\t\tconst elements = getObjectValue(id, formikProps.values);\r\n\t\tfor (let key in elements) {\r\n\t\t\tif (elements[key]) return true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\tconst handleChange = () => {\r\n\r\n\t\tconst elements =  getObjectValue(id, formikProps.values);\r\n\t\tif (isChecked()) {\r\n\t\t\tfor (let key in elements) {\r\n\t\t\t\tif (elements[key]) formikProps.setFieldValue(`${id}.${key}`, false);\r\n\t\t\t}\r\n\t\t\treturn\r\n\t\t} else {\r\n\t\t\tfor (let key in elements) {\r\n\t\t\t\tformikProps.setFieldValue(`${id}.${key}`, true)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tconst checkedValue = checked ? checked : isChecked()\r\n\treturn (\r\n\t\t<Paper\r\n\t\t\televation={0}\r\n\t\t>\r\n\t\t\t<GridBlock\r\n\t\t\t\tcolumn\r\n\t\t\t\tclassName={classes.root}\r\n\t\t\t>\r\n\t\t\t\t<GridBlock\r\n\t\t\t\t\twrap='nowrap'\r\n\t\t\t\t\talignItems='center'\r\n\t\t\t\t\tclassName={clsx(\r\n\t\t\t\t\t\tclasses.padding,\r\n\t\t\t\t\t\tclasses.title\r\n\t\t\t\t\t)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{id &&\r\n\t\t\t\t\t\t<Tooltip title={checkedValue ? Tr('checkbox_uncheck') : Tr('checkbox_check')}>\r\n\t\t\t\t\t\t\t<Checkbox\r\n\t\t\t\t\t\t\t\tcolor='primary'\r\n\t\t\t\t\t\t\t\tchecked={checkedValue}\r\n\t\t\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\t\t\tdisabled={disabled || !editable}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t}\r\n\t\t\t\t\t<Typography\r\n\t\t\t\t\t\tvariant='h5'\r\n\t\t\t\t\t\tonClick={() => setOpen(!open)}\r\n\t\t\t\t\t\tclassName={clsx({\r\n\t\t\t\t\t\t\t[classes.noCheckbox]: !Boolean(id)\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{title}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t<Tooltip title={open ? Tr('collapse') : Tr('expand')} placement='top'>\r\n\t\t\t\t\t\t<ArrowIcon\r\n\t\t\t\t\t\t\tonClick={() => setOpen(!open)}\r\n\t\t\t\t\t\t\tclassName={clsx(classes.arrow, {\r\n\t\t\t\t\t\t\t\t[classes.rotate]: open\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Tooltip>\r\n\t\t\t\t</GridBlock>\r\n\t\t\t\t<Typography\r\n\t\t\t\t\tvariant='body1'\r\n\t\t\t\t\tclassName={classes.padding}\r\n\t\t\t\t>\r\n\t\t\t\t\t{description}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Collapse in={open}>\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclassName={classes.padding}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{children}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</Collapse>\r\n\t\t\t</GridBlock>\r\n\t\t</Paper>\r\n\t)\r\n}\r\n\r\nSection.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(Section);","import React, { useEffect } from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Checkbox from 'components/Checkbox';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport { connect } from 'react-redux'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tmarginBottom: theme.spacing(2),\r\n\t},\r\n\ttitle: {\r\n\t\tfontWeight: theme.typography.fontWeightBold\r\n\t},\r\n\tdescription: {\r\n\t\tmarginLeft: theme.spacing(2),\r\n\t\t'&:not(:first-child)': {\r\n\t\t\tpaddingTop: theme.spacing(1),\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction Element({\r\n\tclasses,\r\n\ttitle,\r\n\tdescription,\r\n\tid,\r\n\tformikProps,\r\n\tdisabled,\r\n\tchecked,\r\n\tespdList\r\n}) {\r\n\tconst descArr = description.split('\\n')\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n\t// useEffect(() => {\r\n\t// \tif (checked) formikProps.setFieldValue(id, checked)\r\n\t// \t// eslint-disable-next-line\r\n\t// }, [checked])\r\n\r\n\r\n\r\n\tuseEffect(() => {\r\n\t\tif (espdList) {\r\n\t\t\tlet newId = id.split(\".\")[1]\r\n\t\t\tlet isChecked = getObjectValue(newId, espdList)\r\n\t\t\tif (isChecked) formikProps.setFieldValue(id, isChecked)\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [])\r\n\r\n\r\n\tconst titleComponent = (\r\n\t\t<Typography variant='body1' className={classes.title}>\r\n\t\t\t{title}\r\n\t\t</Typography>)\r\n\r\n\treturn (\r\n\t\t<GridBlock\r\n\t\t\tclassName={classes.root}\r\n\t\t\tcolumn\r\n\t\t>\r\n\t\t\t<GridBlock\r\n\t\t\t\twrap='nowrap'\r\n\t\t\t\talignItems='center'\r\n\t\t\t>\r\n\t\t\t\t{Boolean(id) ?\r\n\t\t\t\t\t<Checkbox\r\n\t\t\t\t\t\tid={id}\r\n\t\t\t\t\t\tformikProps={formikProps}\r\n\t\t\t\t\t\tlabel={titleComponent}\r\n\t\t\t\t\t\tdisabled={disabled || !editable}\r\n\t\t\t\t\t/> : titleComponent\r\n\t\t\t\t}\r\n\t\t\t</GridBlock>\r\n\t\t\t<>\r\n\t\t\t\t{descArr.map((text, i) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\tvariant='body1'\r\n\t\t\t\t\t\t\tclassName={classes.description}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{text}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)\r\n\t\t\t\t})}\r\n\t\t\t</>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n\tespdList: state.resources.espdList\r\n}), {\r\n\t})(withStyles(style)(Element));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Element from './Element';\r\n\r\nfunction AllElements(\r\n    {\r\n        id,\r\n        formikProps,\r\n        elements,\r\n        disabled\r\n    }) {\r\n    return elements.map((item, i) => {\r\n        const elId = Boolean(item.id) && Boolean(id) ? `${id}.${item.id}` : undefined;\r\n        return (\r\n            <Element\r\n                key={i}\r\n                formikProps={formikProps}\r\n                title={item.title}\r\n                disabled={item.type === 'disabled' && disabled}\r\n                id={elId}\r\n                description={item.description}\r\n            />\r\n        )\r\n    })\r\n}\r\n\r\nAllElements.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default AllElements;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Section from './Section';\r\nimport AllElements from './AllElements';\r\n\r\nfunction AllSections(\r\n    {\r\n        values,\r\n        formikProps,\r\n        idPrefix,\r\n        sectorBuyer\r\n    }) {\r\n    return values.map(\r\n        ({\r\n             title,\r\n             description,\r\n             id,\r\n             type,\r\n             elements,\r\n         }, i) => {\r\n            return (\r\n                <Section\r\n                    key={i}\r\n                    title={title}\r\n                    id={`${idPrefix}.${id}`}\r\n                    formikProps={formikProps}\r\n                    description={description}\r\n                    disabled={type === 'disabled' && !sectorBuyer}\r\n                >\r\n                    <AllElements\r\n                        id={`${idPrefix}.${id}`}\r\n                        formikProps={formikProps}\r\n                        elements={elements}\r\n                        disabled={!sectorBuyer}\r\n                    />\r\n                </Section>\r\n            )\r\n        })\r\n}\r\n\r\nAllSections.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default AllSections;","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Title from 'components/Title';\r\nimport exclusionValues from './constants/exclusion.values'\r\nimport AllSections from './components/AllSections';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\tmarginTop: theme.spacing(2)\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction ExclusionSection({\r\n\tclasses,\r\n\tformikProps,\r\n\tidPrefix,\r\n\tsectorBuyer\r\n}) {\r\n\treturn (\r\n\t\t<GridBlock\r\n\t\t\tcolumn\r\n\t\t\tclassName={classes.root}\r\n\t\t>\r\n\t\t\t<Title align='center'>\r\n\t\t\t\t{Tr('exclusion_ground')}\r\n\t\t\t</Title>\r\n\t\t\t<AllSections\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tvalues={exclusionValues}\r\n\t\t\t\tidPrefix={idPrefix}\r\n\t\t\t\tsectorBuyer={sectorBuyer}\r\n\t\t\t/>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nExclusionSection.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ExclusionSection);","import Tr from 'translations/Translations';\r\n\r\nconst createItem = (trKey, value=Tr(trKey)) => ({\r\n\tlabel: Tr(trKey),\r\n\tvalue,\r\n})\r\n\r\nexport default [\r\n\tcreateItem('yes', 'yes'),\r\n\tcreateItem('no', 'no'),\r\n]\r\n\r\n","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Title from 'components/Title';\r\nimport AllSections from './components/AllSections';\r\nimport Tr from 'translations/Translations';\r\nimport elements from './constants/selection.values'\r\nimport RadioGroup from 'components/RadioGroup';\r\nimport EspdBooleanItems from 'constants/EspdBooleanItems';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\t'&>*': {\r\n\t\t\tmarginTop: theme.spacing(2)\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction SelectionSection({\r\n\tclasses,\r\n\tformikProps,\r\n\tidPrefix\r\n}) {\r\n\tconst variant = getObjectValue(`${idPrefix}.qualifications`, formikProps.values)\r\n\r\n\treturn (\r\n\t\t<GridBlock\r\n\t\t\tcolumn\r\n\t\t\tclassName={classes.root}\r\n\t\t>\r\n\t\t\t<Title align='center'>\r\n\t\t\t\t{Tr('qualifications')}\r\n\t\t\t</Title>\r\n\t\t\t<Typography variant='body1'>\r\n\t\t\t\t{Tr('jedz_se')}\r\n\t\t\t</Typography>\r\n\r\n\t\t\t<RadioGroup\r\n\t\t\t\tid={`${idPrefix}.qualifications`}\r\n\t\t\t\titems={EspdBooleanItems}\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t/>\r\n\r\n\t\t\t<AllSections\r\n\t\t\t\tformikProps={formikProps}\r\n\t\t\t\tvalues={elements[variant==='yes']}\r\n\t\t\t\tidPrefix={idPrefix}\r\n\t\t\t/>\r\n\t\t</GridBlock>\r\n\t)\r\n}\r\n\r\nSelectionSection.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(SelectionSection);","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Button from \"components/Button\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '& > *': {\r\n            marginLeft: theme.spacing(1),\r\n        },\r\n        whiteSpace: 'nowrap',\r\n    }\r\n})\r\n\r\nfunction ExportJedzButtons(\r\n    {\r\n        classes,\r\n        dealingId,\r\n        demandId,\r\n        setConfirmPopupData,\r\n    }) {\r\n\r\n    const exportPdfClick = () => {\r\n        setConfirmPopupData({open: true, dealingId, demandId, type: 'pdf'})\r\n    };\r\n\r\n    const exportXmlClick = () => {\r\n        setConfirmPopupData({open: true, dealingId, demandId, type: 'xml'})\r\n    };\r\n\r\n    return (<div className={classes.root}>\r\n            <Button\r\n                onClick={exportPdfClick}\r\n                variant=\"outlined\"\r\n                size='small'\r\n                tooltip={Tr('export_to_pdf')}\r\n            >\r\n                pdf\r\n            </Button>\r\n            <Button\r\n                onClick={exportXmlClick}\r\n                variant=\"outlined\"\r\n                size='small'\r\n                tooltip={Tr('export_to_xml')}\r\n            >\r\n                xml\r\n            </Button>\r\n\r\n        </div>)\r\n}\r\n\r\nExportJedzButtons.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(ExportJedzButtons);","import React, {useState} from 'react'\r\nimport {Box, Divider, Paper, Tooltip, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport clsx from 'clsx';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowDown'\r\nimport Tr from 'translations/Translations';\r\nimport ExportJedzButtons from \"./ExportJedzButtons\";\r\nimport WarningIcon from \"@material-ui/icons/Warning\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*:nth-child(1)': {\r\n            flexGrow: 1,\r\n        }\r\n    },\r\n    cursorPointer: {\r\n        cursor: 'pointer'\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2),\r\n    },\r\n    buttonRow: {\r\n        '& > *': {\r\n            marginLeft: theme.spacing(1),\r\n        },\r\n        whiteSpace: 'nowrap',\r\n    },\r\n    title: {\r\n        padding: '10px 0'\r\n    },\r\n    padding: {\r\n        padding: theme.spacing(4)\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    arrow: {\r\n        padding: theme.spacing(1),\r\n    }\r\n})\r\n\r\nfunction DealingJedzSection(\r\n    {\r\n        classes,\r\n        index,\r\n        idPrefix,\r\n        dealingId,\r\n        demandId,\r\n        setConfirmPopupData,\r\n        title,\r\n        formikProps,\r\n        children,\r\n    }) {\r\n    const [open, setOpen] = useState(false);\r\n    const error = getObjectValue(`${idPrefix}.qualifications`, formikProps.errors, false);\r\n\r\n    const getTitleComponent = () => (\r\n        <Box\r\n            className={clsx(\r\n                classes.marginLeft,\r\n                classes.cursorPointer\r\n            )}\r\n            component='span'\r\n            fontWeight='fontWeightBold'\r\n            onClick={() => setOpen(!open)}\r\n        >\r\n            {title}\r\n        </Box>\r\n    )\r\n    return (\r\n        <Paper\r\n            elevation={0}\r\n        >\r\n            <GridBlock\r\n                wrap='nowrap'\r\n                alignItems='center'\r\n                className={classes.root}\r\n            >\r\n                <div>\r\n                    <Typography\r\n                        variant='body1'\r\n                        className={classes.title}\r\n                    >\r\n                        {index + 1}.\r\n                        {getTitleComponent()}\r\n                    </Typography>\r\n                </div>\r\n                {error && <Tooltip title={Tr('complete_missing_data')} placement=\"top\">\r\n                    <WarningIcon color='error' />\r\n                </Tooltip>}\r\n                <ExportJedzButtons demandId={demandId} dealingId={dealingId} setConfirmPopupData={setConfirmPopupData} />\r\n                <Tooltip title={open ? Tr('collapse') : Tr('expand')} placement='top'>\r\n                    <ArrowIcon\r\n                        onClick={() => setOpen(!open)}\r\n                        className={clsx(classes.arrow, classes.cursorPointer, {\r\n                            [classes.rotate]: open\r\n                        })}\r\n                    />\r\n                </Tooltip>\r\n            </GridBlock>\r\n            {open &&\r\n            <div\r\n                className={\r\n                    clsx(classes.padding)}\r\n            >\r\n                {children}\r\n            </div>\r\n            }\r\n            <Divider/>\r\n        </Paper>\r\n    )\r\n}\r\n\r\nDealingJedzSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(DealingJedzSection);","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport ProcedureSection from \"./ProcedureSection\";\r\nimport ExclusionSection from \"./ExclusionSection\";\r\nimport SelectionSection from \"./SelectionSection\";\r\nimport DealingJedzSection from \"./components/DealingJedzSection\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport EspdService from \"services/EspdService\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport RadioGroup from \"components/RadioGroup\";\r\nimport BooleanItems from \"constants/BooleanItems\";\r\nimport Tr from \"translations/Translations\";\r\nimport ExportJedzButtons from \"./components/ExportJedzButtons\";\r\nimport LoadingScreen from \"components/complex/loadingScreen/LoadingScreen\";\r\nimport {Typography} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport Button from \"components/Button\";\r\nimport Dialog from \"components/Dialog\";\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    buttonRow: {\r\n        marginTop: theme.spacing(1),\r\n        textAlign: \"end\"\r\n    }\r\n}));\r\n\r\nconst defaultConfirmData = {open: false, demandId: undefined, dealingId: undefined, type: undefined};\r\n\r\nfunction JEDZFormContent(\r\n    {\r\n        formikProps,\r\n        demandId,\r\n        handleJedzTypeChange,\r\n        sectionCompleted\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [confirmPopupData, setConfirmPopupData] = useState(defaultConfirmData);\r\n    const [downloadingInProgress, setDownloadingInProgress] = useState(false);\r\n\r\n    const isSectorBuyer = (buyerType) => {\r\n        return 'SECTOR' === buyerType;\r\n    }\r\n\r\n    const exportTemplate = ({demandId, dealingId, type}) => {\r\n\r\n        setDownloadingInProgress(true);\r\n        if (type === 'xml') {\r\n            EspdService.exportXML(demandId, dealingId).finally(() => {\r\n                setDownloadingInProgress(false);\r\n            })\r\n        } else if (type === 'pdf') {\r\n            EspdService.exportPDF(demandId, dealingId).finally(() => {\r\n                setDownloadingInProgress(false);\r\n            })\r\n        }\r\n        setConfirmPopupData(defaultConfirmData);\r\n    }\r\n\r\n    const handleBuyerTypeChanged = (newBuyerType, fieldPath) => {\r\n        if (!isSectorBuyer(newBuyerType)) {\r\n            for (let s of ['e1', 'e2']) {\r\n                const elements = getObjectValue(`${fieldPath}.${s}`, formikProps.values);\r\n                for (let key in elements) {\r\n                    if (!elements[key])\r\n                        formikProps.setFieldValue(`${fieldPath}.${s}.${key}`, true);\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    const separateForDealing = formikProps.values.separateForEachDealing === 'true';\r\n    const idPrefix = separateForDealing ? 'espds' : 'espd';\r\n    let demandSectorBuyer = separateForDealing ? false : isSectorBuyer(formikProps.values.espd.espdBuyerType);\r\n    return (\r\n        <>\r\n            <GridBlock justify='space-between'>\r\n                <RadioGroup\r\n                    id='separateForEachDealing'\r\n                    items={BooleanItems}\r\n                    formikProps={formikProps}\r\n                    label={Tr('jedz_separate_for_each_dealing')}\r\n                    onChange={() => handleJedzTypeChange(!separateForDealing)}\r\n                />\r\n                {!separateForDealing && <ExportJedzButtons demandId={demandId} setConfirmPopupData={setConfirmPopupData}/>}\r\n            </GridBlock>\r\n\r\n            {separateForDealing ?\r\n                <>\r\n                    {formikProps.values.espds.map((el, index) => {\r\n                        const dealingIdPrefix = `${idPrefix}.${index}`;\r\n                        let dealingSectorBuyer = isSectorBuyer(el.espdBuyerType);\r\n                        return <DealingJedzSection key={el.identity} idPrefix={dealingIdPrefix} title={el.name} index={index} dealingId={el.identity} demandId={demandId}\r\n                                                   setConfirmPopupData={setConfirmPopupData} sectionCompleted={sectionCompleted} formikProps={formikProps}>\r\n                            <ProcedureSection formikProps={formikProps} idPrefix={dealingIdPrefix} onBuyerTypeChanged={(event) => handleBuyerTypeChanged(event.target.value, dealingIdPrefix)}/>\r\n                            <ExclusionSection formikProps={formikProps} idPrefix={dealingIdPrefix} sectorBuyer={dealingSectorBuyer} />\r\n                            <SelectionSection formikProps={formikProps} idPrefix={dealingIdPrefix} />\r\n                        </DealingJedzSection>\r\n                    })}\r\n                </>\r\n                :\r\n                <>\r\n                    <ProcedureSection formikProps={formikProps} idPrefix={idPrefix} onBuyerTypeChanged={(event) => handleBuyerTypeChanged(event.target.value, idPrefix)}/>\r\n                    <ExclusionSection formikProps={formikProps} idPrefix={idPrefix} sectorBuyer={demandSectorBuyer}/>\r\n                    <SelectionSection formikProps={formikProps} idPrefix={idPrefix}/>\r\n                </>\r\n            }\r\n\r\n            <Dialog\r\n                open={!sectionCompleted && confirmPopupData.open}\r\n                titleCentered\r\n                maxWidth={'sm'}\r\n                onClose={() => setConfirmPopupData(defaultConfirmData)}\r\n            >\r\n                <Typography>\r\n                    {Tr('make_sure_section_save')}\r\n                </Typography>\r\n                <div className={clsx(classes.buttonRow, classes.dropzone)}>\r\n                    <Button\r\n                        onClick={() => setConfirmPopupData(defaultConfirmData)}\r\n                    >\r\n                        {Tr('close')}\r\n                    </Button>\r\n                </div>\r\n            </Dialog>\r\n\r\n            <Confirm\r\n                confirmText='make_sure_section_save'\r\n                onCancel={() => setConfirmPopupData(defaultConfirmData)}\r\n                onConfirm={() => exportTemplate(confirmPopupData)}\r\n                open={sectionCompleted && confirmPopupData.open}\r\n                labelConfirm='export'\r\n                labelCancel='cancel'\r\n            />\r\n            {downloadingInProgress && <LoadingScreen/>}\r\n        </>\r\n    )\r\n}\r\n\r\nJEDZFormContent.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default JEDZFormContent;\r\n","import React, {memo, useEffect, useRef, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport {getInitValues as getExInitValues} from './constants/exclusion.values';\r\nimport {getInitValues as getSeInitValues} from './constants/selection.values';\r\nimport {connect} from 'react-redux'\r\nimport EspdService from 'services/EspdService';\r\nimport {withRouter} from \"react-router\";\r\nimport Loading from 'components/Loading';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport JEDZFormContent from \"./JEDZFormContent\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Tr from \"translations/Translations\";\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport SaveFormikValues from \"components/SaveFormikValues\";\r\nimport reduxStore from \"redux/store\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport {setFormDraftLoaded} from \"redux/actions\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    icon: {\r\n        marginRight: theme.spacing(1),\r\n    }\r\n})\r\n\r\nfunction JEDZ(\r\n    {\r\n        classes,\r\n        stepperState,\r\n        match,\r\n        demandValidation,\r\n        espdList,\r\n        setFormDraftLoaded,\r\n        demandHeader\r\n    }) {\r\n    const id = match.params.id;\r\n    const section = demandValidation.find(x => x.section === DemandValidation.ESPD);\r\n    const sectionCompleted = section ? section.status === 'OK' : false;\r\n    const FORM_ID = DemandValidationKeys.ESPD;\r\n    const typeChanged = useRef(false);\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(FORM_ID, ()=> {\r\n            if(typeChanged.current)\r\n                return false;\r\n            const dirty = reduxStore.getState()?.formValues?.[FORM_ID + \"_dirty\"];\r\n            const draftLoaded = reduxStore.getState()?.formValues?.[FORM_ID + \"_draftLoaded\"];\r\n            return dirty !== true && !draftLoaded;\r\n        },\r\n        autoSaveFormDraftActive ? () => EspdService.deleteDraft(id) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(id, EspdService.saveDraft, FORM_ID) : undefined);\r\n\r\n    useEffect(() => {\r\n        EspdService.getList(id).then(() => {\r\n            if (autoSaveFormDraftActive)\r\n                EspdService.checkForDraft(id).then(res => setDraftConfirm(res.result))\r\n        });\r\n\r\n        return () => EspdService.clearEspdList();\r\n    }, [id, autoSaveFormDraftActive])\r\n\r\n\r\n    const handleSubmit = (values) => {\r\n        EspdService.save(id, values)\r\n    }\r\n\r\n    const handleJedzTypeChange = (separateForEachDealing) => {\r\n        typeChanged.current = true;\r\n        EspdService.clearEspdList();\r\n        EspdService.getList(id, separateForEachDealing);\r\n    }\r\n\r\n    const loadEspdDraft = () => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        EspdService.loadDraft(id).then(res => setFormDraftLoaded(FORM_ID, res.success));\r\n        setWorking(false);\r\n    }\r\n\r\n\r\n    const getField = (id, defaultValue = '') => getObjectValue(id, espdList, defaultValue)\r\n    const getSingleJedzValue = (idPrefix) => {\r\n        return {\r\n            identity: getField(`${idPrefix}.identity`),\r\n            espdBuyerType: getField(`${idPrefix}.espdBuyerType`),\r\n            procedureType: getField(`${idPrefix}.procedureType`),\r\n            noticeReferenceNumber: getField(`${idPrefix}.noticeReferenceNumber`, null),\r\n            e1: getExInitValues('e1', espdList, idPrefix),\r\n            e2: getExInitValues('e2', espdList, idPrefix),\r\n            e3: getExInitValues('e3', espdList, idPrefix),\r\n            e4: getExInitValues('e4', espdList, idPrefix),\r\n            s1: getSeInitValues('s1', espdList, idPrefix),\r\n            s2: getSeInitValues('s2', espdList, idPrefix),\r\n            s3: getSeInitValues('s3', espdList, idPrefix),\r\n            s4: getSeInitValues('s4', espdList, idPrefix),\r\n            n1: {1: true},\r\n            qualifications: getField(`${idPrefix}.selection`),\r\n            name: getField(`${idPrefix}.name`),\r\n            description: getField(`${idPrefix}.description`),\r\n            number: getField(`${idPrefix}.number`),\r\n            orgName: getField(`${idPrefix}.orgName`),\r\n            orgCountry: getField(`${idPrefix}.orgCountry`),\r\n        }\r\n    }\r\n\r\n\r\n    const getInitialValues = () => {\r\n\r\n        const separateForEachDealing = getField(\"separateForEachDealing\", \"false\") === 'true';\r\n\r\n        const initVal = {\r\n            _editable: section ? section.editable : true,\r\n            separateForEachDealing: separateForEachDealing.toString(),\r\n        };\r\n        if (separateForEachDealing) {\r\n            const espds = espdList.espds.map((el, index) => {\r\n                return getSingleJedzValue(`espds.${index}`);\r\n            });\r\n            initVal.espds = espds;\r\n        } else {\r\n            const espd = getSingleJedzValue('espd');\r\n            initVal.espd = espd;\r\n        }\r\n        return initVal;\r\n    };\r\n\r\n    const searchForBooleanValue = (espd, sections, searchedBooleanValue) => {\r\n        let found = false;\r\n        for (let s of sections) {\r\n            found = findBooleanValue(espd, s, searchedBooleanValue) ? true : false;\r\n            if (found)\r\n                break;\r\n        }\r\n        return found;\r\n    }\r\n\r\n    const findBooleanValue = (espd, section, searchedBooleanValue) => {\r\n        return Object.values(espd[section]).some(x => {\r\n            return searchedBooleanValue ? x : !x;\r\n        });\r\n    }\r\n\r\n    const validationSchema = () => VS.lazy((values) => {\r\n        const separateForEachDealing = getObjectValue('separateForEachDealing', values, 'true');\r\n\r\n        const getEspdVSObject = (espd) => {\r\n            const qualifications = getObjectValue('qualifications', espd, 'no');\r\n            const buyerType = getObjectValue('espdBuyerType', espd, 'CLASSIC');\r\n\r\n            const qualiOk = qualifications === 'no' || searchForBooleanValue(espd, ['s1', 's2', 's3', 's4'], true);\r\n            const buyerTypeOk = buyerType === 'SECTOR' || !searchForBooleanValue(espd, ['e1', 'e2'], false);\r\n            return VS.object({\r\n                qualifications: VS.string().test('ESPDQualifications', Tr(\"jedz_qualifications_missing\"), (qualifications) => {\r\n                    return qualiOk;\r\n                }),\r\n                espdBuyerType: VS.string().test('ESPDBuyerType', Tr(\"espd_buyer_type_CLASSIC_all_e1_e2_must_be_true\"), () => {\r\n                    return buyerTypeOk;\r\n                })\r\n            });\r\n        };\r\n\r\n        if (separateForEachDealing === 'true') {\r\n            if (values.espds) {\r\n                return VS.object({\r\n                    espds: VS.arrayOf(VS.lazy(espd => getEspdVSObject(espd)))\r\n                })\r\n            }\r\n        } else {\r\n            if (values.espd) {\r\n                return VS.object(\r\n                    {\r\n                        espd: VS.lazy(espd => getEspdVSObject(espd))\r\n                    })\r\n            }\r\n        }\r\n        return VS.any();\r\n    });\r\n    if (!espdList || working) return <Loading/>;\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n\r\n            <Form\r\n                initialValues={getInitialValues()}\r\n                onSubmit={handleSubmit}\r\n                validationSchema={validationSchema()}\r\n                id={FORM_ID}\r\n                afterSubmitFunc={() => {\r\n                    if (isDemandModification()) {\r\n                        ModificationService.isDemandChanged(id);\r\n                    }\r\n                }}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={FORM_ID}\r\n                            save={FORM_ID === stepperState}\r\n                        />\r\n                        {autoSaveFormDraftActive &&\r\n                        <AutoSaveFormValues\r\n                            formikProps={formikProps}\r\n                            id={id}\r\n                            formId={FORM_ID}\r\n                            saveFunc={(formValues) => {\r\n                                EspdService.saveDraft(id, formValues)\r\n                            }}\r\n                        />\r\n                        }\r\n                        <JEDZFormContent\r\n                            formikProps={formikProps}\r\n                            handleJedzTypeChange={handleJedzTypeChange}\r\n                            demandId={id}\r\n                            sectionCompleted={sectionCompleted}\r\n                        />\r\n                    </>\r\n                )}\r\n            </Form>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={loadEspdDraft}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </div>\r\n    )\r\n}\r\n\r\nJEDZ.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stepperState: state.stepper.state,\r\n    espdList: state.resources.espdList,\r\n    demandValidation: state.resources.demandValidation,\r\n    demandHeader: state.resources.demandHeader\r\n}), {setFormDraftLoaded})(withRouter(withStyles(style)(memo(JEDZ))));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport JEDZ from './jedz/JEDZ';\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n    return expanded && <JEDZ />\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import React, {useEffect} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport SiwzService from 'services/SiwzService';\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from 'react-redux'\r\nimport Form from 'components/Form';\r\nimport DocumentsTables from 'components/complex/documentsTables/DocumentsTables';\r\nimport {DemandValidation, DemandValidationKeys} from 'constants/DemandValidation';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport {DemandValidationProvider} from 'context/DemandValidationContext';\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport HeaderService from \"services/HeaderService\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%'\r\n    }\r\n}));\r\n\r\nfunction Documents(\r\n    {\r\n        expanded,\r\n        match,\r\n        demandValidation,\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const demandId = match.params.id\r\n    const currentDemandValidation = DemandValidation.SIWZ;\r\n    const FORM_ID = DemandValidationKeys[currentDemandValidation];\r\n\r\n    const section = demandValidation.find(x => x.section === currentDemandValidation);\r\n    const siwzEditable = section ? !!section.siwzEditable : false;\r\n    const repoEditable = section ? !!section.repoEditable : false;\r\n\r\n    useEffect(()=> {\r\n        HeaderService.get(demandId);\r\n    },[demandId])\r\n\r\n    const handleSubmit = () => SiwzService.save(demandId, currentDemandValidation);\r\n    return (\r\n        <div className={classes.root}>\r\n            <>\r\n                <Form\r\n                    onSubmit={handleSubmit}\r\n                    id={FORM_ID}\r\n                    validationSchema={ValidationShema.any()}\r\n                    afterSubmitFunc={() => {\r\n                        if (isDemandModification()) {\r\n                            ModificationService.isDemandChanged(demandId);\r\n                        }\r\n                    }}\r\n                >\r\n                    {() => (<>\r\n                    </>)}\r\n                </Form>\r\n                <DemandValidationProvider value={currentDemandValidation}>\r\n                    <DemandValidationMessages editable={siwzEditable || repoEditable} section={section}/>\r\n                    <DocumentsTables\r\n                        demandId={demandId}\r\n                        siwzEditable={siwzEditable}\r\n                        repoEditable={repoEditable}\r\n                    />\r\n                </DemandValidationProvider>\r\n            </>\r\n        </div>\r\n    )\r\n}\r\n\r\nDocuments.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(Documents));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Documents from './documents/Documents';\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <Documents expanded={expanded}/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import React, {useState} from 'react'\r\nimport {withStyles, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport TextInput from 'components/TextInput';\r\nimport GridBlock from 'components/GridBlock';\r\nimport INPUT_TYPE from 'constants/INPUT_TYPE'\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    text: {\r\n        marginLeft: theme.spacing(2),\r\n    }\r\n})\r\n\r\nfunction WadiumField(\r\n    {\r\n        classes,\r\n        formikProps,\r\n        index,\r\n    }) {\r\n\r\n    const id = `dealings.${index}.value`;\r\n    const estimatedNetValueId = `dealings.${index}.estimatedNetValue`;\r\n    const warningThreshold = getObjectValue('warningThreshold', formikProps.values, 1);\r\n\r\n    const isWarning = (guaranteeValue) => {\r\n        let estimatedNetValue = getObjectValue(estimatedNetValueId, formikProps.values, null);\r\n\r\n        if (!estimatedNetValue || guaranteeValue === null) {\r\n            return true;\r\n        }\r\n\r\n        return warningThreshold * estimatedNetValue < guaranteeValue;\r\n    }\r\n\r\n    const [warning, setWarning] = useState(() => isWarning(getObjectValue(id, formikProps.values, null)));\r\n\r\n\r\n    const change = (val) => {\r\n        let number = parseFloat(val);\r\n        setWarning(isWarning(number));\r\n    }\r\n\r\n    return (<>\r\n            <GridBlock wrap='nowrap' alignItems='center'>\r\n                <TextInput\r\n                    formikProps={formikProps}\r\n                    id={id}\r\n                    noErrorSpace\r\n                    type={INPUT_TYPE.NUMBER_POSITIVE_AMOUNT}\r\n                    onChange={change}\r\n\r\n                />\r\n                <Typography\r\n                    variant='body1'\r\n                    className={classes.text}\r\n                >\r\n                    PLN\r\n                </Typography>\r\n            </GridBlock>\r\n            {warning && <Typography variant='body2' color='textSecondary'>\r\n                {Tr('valuebiggerthanthreshold', {value: (warningThreshold * 100)})}\r\n            </Typography>}\r\n        </>\r\n    )\r\n}\r\n\r\nWadiumField.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(WadiumField);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport SimpleTable from 'components/complex/simpleTable/SimpleTable';\r\nimport WadiumField from './WadiumField';\r\nimport Tr from 'translations/Translations';\r\nimport { withRouter } from \"react-router\";\r\nimport { connect } from 'react-redux'\r\nimport Loading from 'components/Loading';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tlpColumn: theme.components.table.lpColumn,\r\n\twadiumColumn: {\r\n\t\twidth: 300,\r\n\t},\r\n\ttext: {\r\n\t\t...theme.typography.cutLines(1),\r\n\t}\r\n})\r\n\r\nfunction WadiumTable({\r\n\tclasses,\r\n\tformikProps,\r\n\tguaranteeList\r\n}) {\r\n\r\n\tconst createItems = (item, i) => {\r\n\t\treturn [\r\n\t\t\ti+1,\r\n\t\t\titem.name,\r\n\t\t\t<WadiumField index={i} value={item.value} formikProps={formikProps} />\r\n\t\t]\r\n\t}\r\n\r\n\tconst createTab = () => {\r\n\t\tconst tab = []\r\n\t\tguaranteeList.dealings.forEach((x, i) => tab.push(createItems(x, i)));\r\n\t\treturn tab\r\n\t}\r\n\r\n\r\n\tif (!guaranteeList) return <Loading />\r\n\treturn (\r\n\t\t<div className={classes.root}>\r\n\t\t\t<SimpleTable\r\n\t\t\t\tcolumnClasses={[\r\n\t\t\t\t\tclasses.lpColumn,\r\n\t\t\t\t\tundefined,\r\n\t\t\t\t\tclasses.wadiumColumn,\r\n\t\t\t\t]}\r\n\t\t\t\theaders={[\r\n\t\t\t\t\tTr('column_lp'),\r\n\t\t\t\t\tTr('ordered_object'),\r\n\t\t\t\t\tTr('wadium')\r\n\t\t\t\t]}\r\n\t\t\t\titems={createTab()}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nWadiumTable.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tguaranteeList: state.resources.guaranteeList\r\n}), {\r\n})(withRouter(withStyles(style)(WadiumTable)));\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {clearResource, setResource, setSaveStatusClosed, setSaveStatusDialog, setSaveStatusLoading} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport validateSection from './helpers/validateSection';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport objectExtension from 'libs/objectExtension';\r\n\r\nconst GUARANTEE_LIST_RESOURCE_ID = 'guaranteeList';\r\n\r\nconst get = async (id) => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(Endpoints.GUARANTEE(id))\r\n\t\treduxStore.dispatch(setResource(GUARANTEE_LIST_RESOURCE_ID, res))\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst _save = async (url, values, force = false) => {\r\n\tconst data = values;\r\n\r\n\tconst { resources } = reduxStore.getState()\r\n\tconst { guaranteeList } = resources;\r\n\tconst diff = objectExtension.diff(data, guaranteeList);\r\n\tif (!force && diff === null) return null;\r\n\r\n\ttry {\r\n\t\treturn await RestRequestPOST(url, data)\r\n\t} catch (error) {\r\n\t\tthrow error;\r\n\t}\r\n}\r\n\r\nconst save = async (id, values) => {\r\n\treduxStore.dispatch(setSaveStatusLoading())\r\n\ttry {\r\n\t\tconst res = await _save(Endpoints.GUARANTEE(id), values, true)\r\n\t\tif (res.success) {\r\n\t\t\treduxStore.dispatch(setSaveStatusDialog())\r\n\t\t\tif (res !== null) {\r\n\t\t\t\tawait validateSection(DemandValidation.GUARANTEE, id);\r\n\t\t\t\tawait validateSection(DemandValidation.NATIONAL_NOTICE, id, false);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\treduxStore.dispatch(setSaveStatusClosed())\r\n\t\t}\r\n\t\treturn res;\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst validate = async (id) => {\r\n\treturn RestRequestGET(Endpoints.GUARANTEE_VALIDATE(id))\r\n}\r\n\r\nconst checkForDraft = async (id) => {\r\n\treturn await RestRequestGET(Endpoints.GUARANTEE_AUTOSAVE_CHECK(id));\r\n}\r\n\r\nconst loadDraft = async (id) => {\r\n\tconst res = await RestRequestGET(Endpoints.GUARANTEE_AUTOSAVE(id));\r\n\treduxStore.dispatch(setResource(GUARANTEE_LIST_RESOURCE_ID, res.result));\r\n\treturn res;\r\n}\r\n\r\nconst saveDraft = async (id, formValues) => {\r\n\tawait RestRequestPOST(Endpoints.GUARANTEE_AUTOSAVE(id), formValues);\r\n}\r\n\r\nconst deleteDraft = async (id) => {\r\n\tawait RestRequestDELETE(Endpoints.GUARANTEE_AUTOSAVE(id));\r\n}\r\n\r\nconst clearGuaranteeList = () => {\r\n\treduxStore.dispatch(clearResource(GUARANTEE_LIST_RESOURCE_ID));\r\n}\r\n\r\nexport default {\r\n\tGUARANTEE_LIST_RESOURCE_ID,\r\n\tclearGuaranteeList,\r\n\tget,\r\n\tsave,\r\n\tvalidate,\r\n\tcheckForDraft,\r\n\tloadDraft,\r\n\tsaveDraft,\r\n\tdeleteDraft\r\n}\r\n","import ValidationShema from 'constants/ValidationShema';\r\n\r\nexport default ValidationShema.lazy( values => {\r\n\tlet shape = {}\r\n\tif(values.enabled){\r\n\t\tshape = {\r\n\t\t\tdealings: ValidationShema.arrayOfShape({\r\n\t\t\t\tvalue: ValidationShema.amount()\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\treturn ValidationShema.object(shape)\r\n})","import React, {useEffect, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport Select from 'components/Select';\r\nimport BooleanItems from 'constants/BooleanItems';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport WadiumTable from './components/WadiumTable';\r\nimport {connect} from 'react-redux'\r\nimport SaveFormikValues from 'components/SaveFormikValues';\r\nimport GuaranteeService from 'services/GuaranteeService';\r\nimport {withRouter} from \"react-router\";\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport Loading from 'components/Loading';\r\nimport validation from './constants/validation';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport useStepperStateCloseValidator from \"hooks/useStepperStateCloseValidator\";\r\nimport {setFormDraftLoaded} from \"redux/actions\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport AutoSaveFormValues from \"components/AutoSaveFormValues\";\r\nimport saveFormDraft from \"libs/saveFormDraft\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        width: '100%'\r\n    },\r\n    container: {\r\n        \"&>*\": {\r\n            width: '100%'\r\n        }\r\n    }\r\n})\r\n\r\nfunction Wadium(\r\n    {\r\n        classes,\r\n        stepperState,\r\n        match,\r\n        demandValidation,\r\n        guaranteeList,\r\n        setFormDraftLoaded,\r\n        demandHeader\r\n    }) {\r\n    const FORM_ID = 'mp_1_guarantee'\r\n    const section = demandValidation.find(x => x.section === DemandValidation.GUARANTEE);\r\n    const id = match.params.id;\r\n    const [draftConfirm, setDraftConfirm] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const autoSaveFormDraftActive = demandHeader?.applicationClientSettings.autoSaveFormDraft.active;\r\n    useStepperStateCloseValidator(FORM_ID, undefined,\r\n        autoSaveFormDraftActive ? () => GuaranteeService.deleteDraft(id) : undefined,\r\n        autoSaveFormDraftActive ? () => saveFormDraft(id, GuaranteeService.saveDraft, FORM_ID) : undefined);\r\n\r\n    useEffect(() => {\r\n        GuaranteeService.get(id).then(() => {\r\n            if (autoSaveFormDraftActive)\r\n                GuaranteeService.checkForDraft(id).then(res => setDraftConfirm(res.result))\r\n        });\r\n\r\n        return () => GuaranteeService.clearGuaranteeList();\r\n    }, [id, autoSaveFormDraftActive])\r\n\r\n    const handleSubmit = (values, formikProps) => {\r\n        GuaranteeService.save(id, values)\r\n            .then((result) => {\r\n                if (!result.success) {\r\n                    const errors = result.errors;\r\n                    Object.keys(errors).forEach((errorId) => {\r\n                        formikProps.setFieldError(errorId.replaceAll(\"[\", \".\").replaceAll(\"]\", \"\"), errors[errorId])\r\n                    })\r\n                }\r\n            });\r\n    }\r\n\r\n    const loadGuaranteeDraft = () => {\r\n        setDraftConfirm(false);\r\n        setWorking(true);\r\n        GuaranteeService.loadDraft(id).then(res => setFormDraftLoaded(FORM_ID, res.success));\r\n        setWorking(false);\r\n    }\r\n\r\n    const getField = (id, defaultValue = '') => getObjectValue(id, guaranteeList, defaultValue);\r\n\r\n    if (!guaranteeList || working) {\r\n        return <Loading/>\r\n    }\r\n    return (\r\n        <>\r\n            <Form\r\n                className={classes.root}\r\n                initialValues={{\r\n                    _editable: section ? section.editable : true,\r\n                    identity: getField('identity'),\r\n                    enabled: getField('enabled'),\r\n                    warningThreshold: getField('warningThreshold'),\r\n                    dealings: getField('dealings'),\r\n                }}\r\n                validationSchema={validation}\r\n                id={FORM_ID}\r\n                onSubmit={handleSubmit}\r\n                afterSubmitFunc={() => {\r\n                    if (isDemandModification()) {\r\n                        ModificationService.isDemandChanged(id);\r\n                    }\r\n                }}\r\n            >\r\n                {(formikProps) => (\r\n                    <>\r\n                        <SaveFormikValues\r\n                            formikProps={formikProps}\r\n                            id={FORM_ID}\r\n                            save={FORM_ID === stepperState}\r\n                        />\r\n                        {autoSaveFormDraftActive &&\r\n                        <AutoSaveFormValues\r\n                            formikProps={formikProps}\r\n                            id={id}\r\n                            formId={FORM_ID}\r\n                            saveFunc={(formValues) => {\r\n                                GuaranteeService.saveDraft(id, formValues)\r\n                            }}\r\n                        />\r\n                        }\r\n                        <GridBlock direction='column' className={classes.container}>\r\n                            <Select\r\n                                label={Tr('wadium_question')}\r\n                                id='enabled'\r\n                                formikProps={formikProps}\r\n                                items={BooleanItems}\r\n                            />\r\n                            {formikProps.values.enabled &&\r\n                            <WadiumTable formikProps={formikProps}/>\r\n                            }\r\n                        </GridBlock>\r\n                    </>\r\n                )}\r\n            </Form>\r\n            <Confirm\r\n                open={draftConfirm}\r\n                onConfirm={loadGuaranteeDraft}\r\n                onCancel={() => setDraftConfirm(false)}\r\n                confirmText=\"form_draft_load_confirm_text\"\r\n                confirmTitle=\"form_draft_load_confirm_title\"\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nWadium.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stepperState: state.stepper.state,\r\n    guaranteeList: state.resources.guaranteeList,\r\n    demandValidation: state.resources.demandValidation,\r\n    demandHeader: state.resources.demandHeader\r\n}), {setFormDraftLoaded})(withRouter(withStyles(style)(Wadium)));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Wadium from './Wadium';\r\n\r\nfunction Index(\r\n    {\r\n        expanded,\r\n    }) {\r\n    return expanded && <Wadium/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default Index;","import React from 'react'\r\nimport LocationSearchingIcon from '@material-ui/icons/LocationSearching';\r\nimport LocationDisabledIcon from '@material-ui/icons/LocationDisabled';\r\nimport Tr from 'translations/Translations';\r\nimport IconButton from './IconButton';\r\n\r\nfunction IconExternalSignButton({\r\n    enabled,\r\n    ...props\r\n}) {\r\n    return <IconButton\r\n        tooltip={Tr(enabled ? 'rfx_supplier_disable_externalSign' : 'rfx_supplier_enable_externalSign')}\r\n        Icon={enabled ? LocationDisabledIcon : LocationSearchingIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nexport default IconExternalSignButton;","import React, {useMemo} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport SimpleTable from 'components/complex/simpleTable/SimpleTable';\r\nimport Loading from 'components/Loading';\r\nimport moment from 'moment';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport IconExternalSignButton from \"components/button/IconExternalSignButton\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport PropTypes from 'prop-types';\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    cell: {\r\n        padding: theme.spacing(1)\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    dateColumn: theme.components.table.dateColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    nameColumn: {\r\n        wordBreak: \"break-all\",\r\n        paddingRight: theme.spacing(2),\r\n    },\r\n    nipColumn: {\r\n        width: 150,\r\n    },\r\n    addressColumn: {\r\n        width: 200,\r\n        whiteSpace: \"pre-line\"\r\n    },\r\n    emailColumn: {\r\n        width: 170,\r\n        wordBreak: \"break-all\"\r\n    }\r\n}));\r\n\r\nfunction ContractorTable(\r\n    {\r\n        contractors,\r\n        handleDelete,\r\n        handleExternalSign,\r\n        showJoinDate\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const showExternalSignColumn = !!handleExternalSign && contractors && contractors.items.findIndex((item, i) => item.externalOfferSign !== null) >= 0;\r\n\r\n    const createItem = (item, i) => {\r\n        const {contractor, invitationDate, externalOfferSign, joinMethod, joinDate} = item;\r\n\r\n        const arr = [\r\n            `${i + 1}`,\r\n            contractor.name,\r\n            `${contractor.vatin.prefix} ${contractor.vatin.number}`,\r\n            `${contractor.address} \\n ${contractor.postCode} ${contractor.city}`,\r\n            contractor.email,\r\n        ];\r\n\r\n        if(showJoinDate)\r\n            arr.push(joinMethod === \"self\" ? moment(joinDate).format(DateFormats.DATETIME_FORMAT) : '')\r\n\r\n        arr.push(invitationDate ? moment(invitationDate).format(DateFormats.DATETIME_FORMAT) : '');\r\n        if (handleDelete)\r\n            arr.push(<WorkableIconDeleteButton onClick={() => handleDelete(item)}/>);\r\n        if (showExternalSignColumn)\r\n            arr.push(externalOfferSign !== null ? <IconExternalSignButton enabled={externalOfferSign} onClick={() => handleExternalSign(item)}/> : '');\r\n        return arr;\r\n    }\r\n\r\n    const columnClasses = useMemo(() => {\r\n        const arr = [\r\n            classes.lpColumn,\r\n            classes.nameColumn,\r\n            classes.nipColumn,\r\n            classes.addressColumn,\r\n            classes.emailColumn,\r\n        ];\r\n        if(showJoinDate)\r\n            arr.push(classes.dateColumn);\r\n\r\n        arr.push(classes.dateColumn);\r\n\r\n        if (handleDelete)\r\n            arr.push(classes.buttonColumn);\r\n\r\n        if (showExternalSignColumn)\r\n            arr.push(classes.buttonColumn)\r\n        return arr;\r\n    }, [showExternalSignColumn, handleDelete, showJoinDate, classes]);\r\n\r\n\r\n    const headers = useMemo(() => {\r\n        const arr = [\r\n            Tr('column_lp'),\r\n            Tr('name'),\r\n            Tr('nip_pesel'),\r\n            Tr('adres'),\r\n            Tr('email')\r\n        ]\r\n        if(showJoinDate)\r\n            arr.push(Tr('join_demand_date'));\r\n\r\n        arr.push(Tr('forwarding_invitation_date'));\r\n\r\n        if (handleDelete)\r\n            arr.push('');\r\n\r\n        if (showExternalSignColumn)\r\n            arr.push('');\r\n        return arr;\r\n    }, [showExternalSignColumn, showJoinDate, handleDelete])\r\n\r\n    if (!contractors) return <Loading/>\r\n    return (\r\n        <div className={classes.root}>\r\n            <SimpleTable\r\n                headers={headers}\r\n                items={\r\n                    contractors.items.map((item, i) => [\r\n                        ...createItem(item, i)\r\n                    ])\r\n                }\r\n                columnClasses={columnClasses}\r\n                cellClassName={classes.cell}\r\n            />\r\n        </div>\r\n    )\r\n}\r\n\r\nContractorTable.propTypes = {\r\n    contractors: PropTypes.object,\r\n    handleDelete: PropTypes.func,\r\n    handleExternalSign: PropTypes.func,\r\n    showJoinDate: PropTypes.bool\r\n}\r\n\r\nexport default ContractorTable;\r\n","import React, {useEffect, useState} from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ContractorTable from 'components/complex/contractor/ContractorTable';\r\nimport InviteContactor from 'components/popup/inviteContactor/InviteContactor';\r\nimport AddContactor from 'components/popup/addContactor/AddContactor';\r\nimport {withRouter} from \"react-router\";\r\nimport ContractorService from 'services/ContractorService';\r\nimport {connect} from 'react-redux'\r\nimport Form from 'components/Form';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction ContactorPage(\r\n    {\r\n        classes,\r\n        match,\r\n        contractorList,\r\n        demandValidation\r\n    }) {\r\n    const [invitePopup, setInvitePopup] = useState(false)\r\n    const [addPopup, setAddPopup] = useState(false)\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === DemandValidation.CONTRACTOR);\r\n    const editable = section ? section.editable : true;\r\n\r\n\r\n    useEffect(() => {\r\n        ContractorService.getList(demandId);\r\n        return () => ContractorService.clearResources(ContractorService.CONTRACTOR_LIST_ID)\r\n        // eslint-disable-next-line\r\n    }, [demandId])\r\n\r\n    const handleSubmit = () => {\r\n        ContractorService.save(demandId)\r\n    }\r\n\r\n\r\n    const handleDelete = (data) => {\r\n        ContractorService.deleteUser(match.params.id, data)\r\n    }\r\n\r\n\r\n    const handleInvite = (values) => {\r\n        ContractorService.invite(demandId, values)\r\n        setInvitePopup(false);\r\n    }\r\n\r\n    function addContractorsTab(data) {\r\n        ContractorService.sendTabContractor(demandId, data.platformAdded)\r\n        setAddPopup(false);\r\n    }\r\n\r\n    return (\r\n        <Form\r\n            onSubmit={handleSubmit}\r\n            id='mp_1_contractor'\r\n            validationSchema={ValidationShema.any()}\r\n            afterSubmitFunc={() => {\r\n                if (isDemandModification()) {\r\n                    ModificationService.isDemandChanged(match.params.id);\r\n                }\r\n            }}\r\n        >\r\n            {() => (\r\n                <>\r\n                    <DemandValidationMessages section={section} editable={editable}/>\r\n                    <Typography variant='h6'>\r\n                        {Tr('selected_contractors_list')}\r\n                    </Typography>\r\n                    <GridBlock>\r\n                        {editable && <>\r\n                            <Button\r\n                                onClick={() => setAddPopup(true)}\r\n                            >\r\n                                {Tr('add_contractor')}\r\n                            </Button>\r\n                            <Button\r\n                                className={classes.marginLeft}\r\n                                onClick={() => setInvitePopup(true)}\r\n                            >\r\n                                {Tr('suggest_contractor')}\r\n                            </Button>\r\n                        </>}\r\n                    </GridBlock>\r\n                    <ContractorTable\r\n                        contractors={contractorList}\r\n                        handleDelete={editable ? handleDelete : undefined}\r\n                    />\r\n                    {invitePopup && <InviteContactor\r\n                        demandId={demandId}\r\n                        open\r\n                        onClose={() => setInvitePopup(false)}\r\n                        title={Tr('invitation_contractor')}\r\n                        contractorList={contractorList}\r\n                        handleInvite={handleInvite}\r\n                        collectPostCode\r\n                        collectAddress\r\n                        addressRequired={false}\r\n                        collectCity\r\n                        cityRequired={false}\r\n                    />}\r\n                    {addPopup && <AddContactor\r\n                        demandId={demandId}\r\n                        onClose={() => setAddPopup(false)}\r\n                        addContractorsTab={addContractorsTab}\r\n                    />}\r\n                </>\r\n            )}\r\n        </Form>\r\n    )\r\n}\r\n\r\nContactorPage.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    contractorList: state.resources.contractorList,\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withStyles(style)(withRouter(ContactorPage)));\r\n","import React from 'react'\r\nimport ContactorPage from './ContactorPage';\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <ContactorPage />\r\n}\r\n\r\nexport default Index;","import {RestRequestGET} from 'libs/RestRequest'\r\nimport Endpoints from 'constants/Endpoints'\r\nimport reduxStore from 'redux/store'\r\nimport {clearResource, setResource, setSaveStatusDialog, setSaveStatusLoading} from 'redux/actions'\r\nimport validateSection from './helpers/validateSection'\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\n\r\nconst NOTICE_LINK_RESOURCE_ID = 'noticeLink';\r\nconst NOTICE_PREVIEW_RESOURCE_ID = 'noticePreview';\r\n\r\nconst getLink = async (demandId) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.NOTICE(demandId));\r\n        reduxStore.dispatch(\r\n            setResource(NOTICE_LINK_RESOURCE_ID, res)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst save = async (demandId) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n\r\n    try {\r\n        reduxStore.dispatch(setSaveStatusDialog());\r\n        await validateSection(DemandValidation.NOTICE, demandId);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst validate = async (id) => {\r\n    return RestRequestGET(Endpoints.NOTICE_VALIDATE(id));\r\n}\r\n\r\nconst getPreviewUrl = async (id = -1) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.NOTICE_PREVIEW(id))\r\n        reduxStore.dispatch(\r\n            setResource(NOTICE_PREVIEW_RESOURCE_ID, res)\r\n        )\r\n    } catch (error) {\r\n        reduxStore.dispatch(\r\n            setResource(NOTICE_PREVIEW_RESOURCE_ID, {error: true})\r\n        )\r\n    }\r\n}\r\n\r\nconst clearResources = (id) => reduxStore.dispatch(clearResource(id));\r\n\r\n\r\nexport default {\r\n    getLink,\r\n    getPreviewUrl,\r\n    save,\r\n    validate,\r\n    clearResources,\r\n    NOTICE_PREVIEW_RESOURCE_ID,\r\n    NOTICE_LINK_RESOURCE_ID\r\n};","import React, {useEffect} from 'react'\r\nimport Button from 'components/Button';\r\nimport Tr from 'translations/Translations';\r\nimport NoticeService from 'services/NoticeService';\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from 'react-redux'\r\nimport Loading from 'components/Loading';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\n\r\nfunction NoticePage(\r\n    {\r\n        match,\r\n        noticeLink,\r\n        demandValidation\r\n    }) {\r\n    const section = demandValidation.find(x => x.section === DemandValidation.NOTICE);\r\n    const editable = section ? section.editable : false;\r\n\r\n\r\n    const demandId = match.params.id;\r\n    const handleClick = () => window.location.href = noticeLink.link.url\r\n\r\n    useEffect(() => {\r\n        NoticeService.getLink(demandId);\r\n        return () => NoticeService.clearResources(NoticeService.NOTICE_LINK_RESOURCE_ID);\r\n    }, [demandId])\r\n\r\n    const handleSubmit = () => NoticeService.save(demandId)\r\n\r\n    if (!noticeLink) return <Loading/>\r\n    return (\r\n        <div style={{width: \"100%\"}}>\r\n            <DemandValidationMessages section={section} editable={editable}/>\r\n            <GridBlock justify=\"center\" alignItems=\"center\">\r\n                <Form\r\n                    onSubmit={handleSubmit}\r\n                    id='mp_1_notice'\r\n                    validationSchema={ValidationShema.any()}\r\n                    afterSubmitFunc={() => {\r\n                        if (isDemandModification()) {\r\n                            ModificationService.isDemandChanged(demandId);\r\n                        }\r\n                    }}\r\n                >\r\n                    {(formikProps) => (\r\n                        <Button onClick={handleClick}>{Tr(\"create_union_annoucement\")}</Button>\r\n                    )}\r\n                </Form>\r\n            </GridBlock>\r\n        </div>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    noticeLink: state.resources.noticeLink,\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(NoticePage));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport NoticePage from './NoticePage';\r\n\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <NoticePage />\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import Endpoints from \"../constants/Endpoints\";\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from \"../libs/RestRequest\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {clearResource, setResource, setSaveStatusDialog, setSaveStatusError, setSaveStatusLoading, setStepperState} from \"../redux/actions\";\r\nimport Tr from \"../translations/Translations\";\r\n\r\nconst BZP_CONTRACT_NOTICE_STATUS = 'bzpContractNoticeStatus';\r\n\r\nconst showError = (message) => {\r\n\treduxStore.dispatch(setSaveStatusError(message))\r\n}\r\n\r\nconst getContractNotice = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\nconst deleteLastContractNoticeVersion = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestDELETE(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE(demandId));\r\n\t\treturn isResponseValid(resp, showError);\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst createNewContractNoticeVersion = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_CREATE_NEW_VERSION(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst getContractNoticeDynamicDictionaries = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_DYNAMIC_DICTIONARIES(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst getContractNoticeTranslations = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_TRANSLATIONS(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst getContractNoticeDictionaries = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_DICTIONARIES(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst saveContractNoticeDraft = async (demandId, form) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestPOST(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_DRAFT(demandId), form);\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treturn resp.result;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst saveContractNotice = async (demandId, form) => {\r\n\ttry {\r\n\t\treturn await RestRequestPOST(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE(demandId), form);\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t\tthrow e;\r\n\t}\r\n}\r\n\r\nconst publishContractNotice = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestPOST(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t\tthrow e;\r\n\t}\r\n}\r\n\r\nconst rollbackContractNotice = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestPOST(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_ROLLBACK(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t\tthrow e;\r\n\t}\r\n}\r\n\r\nconst publishContractNoticeUpdate = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestPOST(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_UPDATE(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t\tthrow e;\r\n\t}\r\n}\r\n\r\nconst rollbackContractNoticeUpdate = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestPOST(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_PUBLISH_UPDATE_ROLLBACK(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t\tthrow e;\r\n\t}\r\n}\r\n\r\nconst saveContractNoticeSection = async (demandId) => {\r\n\treduxStore.dispatch(setSaveStatusLoading());\r\n\r\n\ttry {\r\n\t\treduxStore.dispatch(setSaveStatusDialog());\r\n\t\treduxStore.dispatch(setStepperState());\r\n\t\t//await validateSection(DemandValidation.NATIONAL_NOTICE, demandId);\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst printDemandNoticePreview = async (demandId) => {\r\n\ttry {\r\n\t\tawait RestRequestBLOB(Endpoints.NOTICE_DOWNLOAD_PREVIEW(demandId));\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t}\r\n}\r\n\r\nconst getContractNoticeStatus = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_STATUS(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst getContractModificationNoticeStatus = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestGET(Endpoints.NATIONAL_NOTICE_CONTRACT_MODIFICATION_NOTICE_STATUS(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst checkContractNoticeStatus = async (demandId) => {\r\n\ttry {\r\n\t\tconst resp = await RestRequestPUT(Endpoints.NATIONAL_NOTICE_CONTRACT_NOTICE_STATUS(demandId));\r\n\t\tif(isResponseValid(resp, showError)) {\r\n\t\t\treduxStore.dispatch(setResource(BZP_CONTRACT_NOTICE_STATUS, resp.result))\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.error(e);\r\n\t\tshowError(Tr('internal_server_error'));\r\n\t}\r\n}\r\n\r\nconst validate = (id) => {\r\n\treturn RestRequestGET(Endpoints.NATIONAL_NOTICE_VALIDATE(id));\r\n}\r\n\r\nconst clearResources = (id) => reduxStore.dispatch(clearResource(id));\r\n\r\nexport default {\r\n\tgetContractNotice,\r\n\tgetContractNoticeTranslations,\r\n\tgetContractNoticeDictionaries,\r\n\tgetContractNoticeDynamicDictionaries,\r\n\tsaveContractNoticeSection,\r\n\tsaveContractNotice,\r\n\tsaveContractNoticeDraft,\r\n\tprintDemandNoticePreview,\r\n\tpublishContractNotice,\r\n\tgetContractNoticeStatus,\r\n\tgetContractModificationNoticeStatus,\r\n\tcheckContractNoticeStatus,\r\n\tclearResources,\r\n\tvalidate,\r\n\tcreateNewContractNoticeVersion,\r\n\tpublishContractNoticeUpdate,\r\n\tdeleteLastContractNoticeVersion,\r\n\trollbackContractNotice,\r\n\trollbackContractNoticeUpdate,\r\n\tBZP_CONTRACT_NOTICE_STATUS\r\n};\r\n","import React, {useMemo} from 'react'\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from 'react-redux'\r\nimport Form from \"components/Form\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport ModificationService from \"services/ModificationService\";\r\nimport Button from \"components/Button\";\r\nimport Tr from \"translations/Translations\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport NationalNoticeService from \"services/NationalNoticeService\";\r\nimport {DemandValidation, DemandValidationKeys} from \"constants/DemandValidation\";\r\nimport DemandValidationMessages from \"components/DemandValidationMessages\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport {Typography} from \"@material-ui/core\";\r\n\r\nfunction NationalNoticeSection(\r\n    {\r\n        match,\r\n        demandValidation,\r\n        demandHeader,\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n    const section = demandValidation.find(x => x.section === DemandValidation.NATIONAL_NOTICE);\r\n    const editable = section ? section.editable : false;\r\n    const handleSubmit = () => NationalNoticeService.saveContractNoticeSection(demandId)\r\n\r\n\r\n    const reqSectionsError = useMemo(() => {\r\n        const sections = [];\r\n        sections.push(demandValidation.find(x => x.section === DemandValidation.SCHEDULE));\r\n        if (!demandHeader.passiveOfferForm) {\r\n            sections.push(demandValidation.find(x => x.section === DemandValidation.DEALINGS));\r\n        }\r\n        const errorSections = sections.filter(s => s.status !== DemandValidationSectionStatus.OK).map(s => Tr(DemandValidationKeys[s.section]));\r\n\r\n        if (errorSections.length > 0) {\r\n            return `${Tr(\"national_notice_sections_missing\")}: '${errorSections.join(\"', '\")}'`\r\n        }\r\n        return undefined;\r\n    }, [demandValidation, demandHeader]);\r\n\r\n    const handleClick = () => {\r\n        const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_NATIONAL_NOTICE_FORM_TYPE_ID, {formType: \"contractNotice\", id: demandId});\r\n        RouterPath.redirect(href);\r\n    }\r\n\r\n    return (<div style={{width: \"100%\"}}>\r\n        {!!reqSectionsError && <Typography color=\"error\">{reqSectionsError}</Typography>}\r\n        <DemandValidationMessages section={section} editable={editable}/>\r\n        <Form\r\n            onSubmit={handleSubmit}\r\n            id='mp_1_national_notice'\r\n            validationSchema={ValidationShema.any()}\r\n            afterSubmitFunc={() => {\r\n                if (isDemandModification()) {\r\n                    ModificationService.isDemandChanged(demandId);\r\n                }\r\n            }}\r\n        >\r\n            {(formikProps) => (<>\r\n                    <GridBlock justify=\"center\" alignItems=\"center\">\r\n                        <Button disabled={!!reqSectionsError}\r\n                                onClick={handleClick}>{Tr(\"bzp_notice_create\")}</Button>\r\n                        <Typography><br/>{Tr(\"bzp_notice_create_info\")}<br/><br/></Typography>\r\n                        <br/><br/>\r\n                    </GridBlock>\r\n                </>\r\n            )}\r\n        </Form>\r\n    </div>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(withRouter(NationalNoticeSection));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport NationalNoticeSection from \"./NationalNoticeSection\";\r\n\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <NationalNoticeSection/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import React, {useEffect} from \"react\";\r\nimport Form from 'components/Form';\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidationKeys} from 'constants/DemandValidation';\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport PapersGeneratorService from \"services/PapersGeneratorService\";\r\nimport PapersGeneratorList from \"components/complex/papersGenerator/PapersGeneratorList\";\r\n\r\nfunction PreparingPapersGenerator(\r\n    {\r\n        match\r\n    }) {\r\n    const FORM_ID = DemandValidationKeys.PREPARING_PAPERS_GENERATOR;\r\n    const id = match.params.id;\r\n\r\n    useEffect(() => {\r\n        PapersGeneratorService.getAvailablePapers(id);\r\n        return () => {\r\n            PapersGeneratorService.clearResources(PapersGeneratorService.PAPERS_GENERATOR_LIST_RESOURCE_ID);\r\n        }\r\n    }, [id])\r\n\r\n    return (\r\n        <Form\r\n            initialValues={{}}\r\n            validationSchema={ValidationShema.any()}\r\n            id={FORM_ID}\r\n        >{(formikProps) => (\r\n            <PapersGeneratorList id={id}/>)}\r\n        </Form>\r\n    )\r\n}\r\n\r\nPreparingPapersGenerator.propTypes = {\r\n}\r\n\r\nexport default withRouter(PreparingPapersGenerator);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport PreparingPapersGenerator from \"./PreparingPapersGenerator\";\r\n\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <PreparingPapersGenerator/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import reduxStore from 'redux/store'\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest'\r\nimport Endpoints from 'constants/Endpoints'\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport validateSection from './helpers/validateSection'\r\nimport {DemandValidation} from 'constants/DemandValidation'\r\n\r\nconst _FIRST_PUBLICATION_RESOURCE_ID = \"firstPublication\";\r\n\r\nconst publish = async (id = -1) => {\r\n\r\n    const setError = () => {\r\n        reduxStore.dispatch(\r\n            setResource('publish', {error: true})\r\n        )\r\n    }\r\n\r\n    if (id < 0) {\r\n        setError();\r\n        return null;\r\n    }\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.PUBLISH_DEMAND(id));\r\n        if (res.success) {\r\n            return res.result;\r\n        }\r\n        setError();\r\n    } catch (error) {\r\n        setError();\r\n    }\r\n    return null;\r\n}\r\n\r\nconst save = async () => {\r\n    await validateSection(DemandValidation.PUBLICATION);\r\n}\r\n\r\n\r\nconst checkPublishOjs = async (id = -1) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.CHECK_OJS_NOTICE(id))\r\n        reduxStore.dispatch(\r\n            setResource('ojsPublicationStatus', res)\r\n        )\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst clearOjsStatus = () => {\r\n    clearResource('ojsPublicationStatus')\r\n}\r\n\r\nconst publishOjsNotice = async (id = -1) => {\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.PUBLISH_OJS_NOTICE(id))\r\n        return res\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst rollbackOjsNotice = async (id = -1) => {\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.ROLLBACK_OJS_NOTICE(id))\r\n        return res\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst markFirstPublication = (demandId) => {\r\n    reduxStore.dispatch(setResource(_FIRST_PUBLICATION_RESOURCE_ID, demandId))\r\n}\r\n\r\nconst isFirstPublication = (demandId) => {\r\n    const {resources} = reduxStore.getState();\r\n    const curRes = resources[_FIRST_PUBLICATION_RESOURCE_ID];\r\n    if(curRes)\r\n        reduxStore.dispatch(clearResource(_FIRST_PUBLICATION_RESOURCE_ID));\r\n    const result = curRes === demandId;\r\n    return result;\r\n}\r\n\r\nconst publishExPost = async (id = -1) => {\r\n\r\n    const setError = () => {\r\n        reduxStore.dispatch(\r\n            setResource('publish', {error: true})\r\n        )\r\n    }\r\n\r\n    if (id < 0) {\r\n        setError();\r\n        return null;\r\n    }\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.PUBLISH_DEMAND_EX_POST(id));\r\n        if (res.success) {\r\n            return res.result;\r\n        }\r\n        setError();\r\n    } catch (error) {\r\n        setError();\r\n    }\r\n    return null;\r\n}\r\n\r\nexport default {\r\n    publish,\r\n    save,\r\n    checkPublishOjs,\r\n    publishOjsNotice,\r\n    rollbackOjsNotice,\r\n    clearOjsStatus,\r\n    markFirstPublication,\r\n    isFirstPublication,\r\n    publishExPost\r\n}","import React, {useMemo} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {wasEverPublished} from \"libs/getDemandStatus\";\r\nimport {connect} from \"react-redux\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\n\r\nfunction ConfirmPublish(\r\n    {\r\n        open,\r\n        onConfirm,\r\n        onCancel,\r\n        demandHeader\r\n    }) {\r\n\r\n    const confirmText = useMemo(() => {\r\n        let wasPublished = wasEverPublished() === true;\r\n        let noticeOjsType = !!demandHeader?.noticeOjsType;\r\n        return wasPublished ? (noticeOjsType ? 'publish_modification_ojs_popup_text' : 'publish_modification_popup_text') : 'publish_popup_text';\r\n    }, [demandHeader]);\r\n\r\n\r\n    return (\r\n        <Confirm\r\n            open={open}\r\n            onConfirm={onConfirm}\r\n            onCancel={onCancel}\r\n            confirmText={confirmText}\r\n        />\r\n    )\r\n}\r\n\r\nConfirmPublish.propTypes = {\r\n    open: PropTypes.bool.isRequired,\r\n    onConfirm: PropTypes.func.isRequired,\r\n    onCancel: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(ConfirmPublish);\r\n","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Form from 'components/Form';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport GridBlock from 'components/GridBlock';\r\nimport PublishService from 'services/PublishService';\r\nimport {isDemandModification, isDemandPreparing} from 'libs/getDemandStatus';\r\nimport ModificationService from \"services/ModificationService\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport ValidationShema from \"constants/ValidationShema\";\r\nimport ConfirmPublish from \"./ConfirmPublish\";\r\nimport Alert from \"components/popup/alert/Alert\";\r\n\r\nfunction PublishSection(\r\n    {\r\n        id,\r\n        isPublishActive,\r\n        isCancelActive,\r\n        moveToOfferCollection = () => {\r\n        },\r\n        editable,\r\n        classesRoot,\r\n        setWorking,\r\n        clearPublishResources\r\n    }) {\r\n\r\n    const handleSubmit = () => {\r\n        PublishService.save()\r\n    }\r\n\r\n    const [openCancelModificationPopup, setOpenCancelModificationPopup] = useState(false);\r\n    const [openPublishPopup, setOpenPublishPopup] = useState(false);\r\n    const [showPublishLimitUsedAlert, setShowPublishLimitUsedAlert] = useState(false);\r\n\r\n\r\n    const handleConfirmCancelModification = () => {\r\n        setOpenCancelModificationPopup(false);\r\n        setWorking(true);\r\n        ModificationService.cancel(id).then((resp) => {\r\n            if (resp) {\r\n                moveToOfferCollection();\r\n            }\r\n        });\r\n    };\r\n\r\n    const handleConfirmPublish = () => {\r\n\r\n        if (isDemandPreparing()) {\r\n            setOpenPublishPopup(false);\r\n            setWorking(true);\r\n            PublishService.publish(id).then((resp) => {\r\n                if (resp != null) {\r\n                    if (resp) {\r\n                        HeaderService.get(id);\r\n                        PublishService.markFirstPublication(id);\r\n                        moveToOfferCollection();\r\n                    } else {\r\n                        setWorking(false);\r\n                        setShowPublishLimitUsedAlert(true);\r\n                    }\r\n                } else {\r\n                    setWorking(false);\r\n                    clearPublishResources();\r\n                }\r\n            });\r\n        } else if (isDemandModification()) {\r\n            setOpenPublishPopup(false);\r\n            setWorking(true);\r\n\r\n            ModificationService.publish(id).then((resp) => {\r\n                if (resp) {\r\n                    HeaderService.get(id);\r\n                    moveToOfferCollection();\r\n                } else {\r\n                    setWorking(false);\r\n                    clearPublishResources();\r\n                }\r\n            });\r\n        }\r\n    };\r\n\r\n    return (\r\n        <div>\r\n        <Form\r\n            onSubmit={handleSubmit}\r\n            id={'mp_1_publication'}\r\n            validationSchema={ValidationShema.any()}\r\n        >\r\n            {(formikProps) => (\r\n                <>\r\n                    <GridBlock\r\n                        direction='column'\r\n                        alignItems='center'\r\n                        className={classesRoot}\r\n                    >\r\n\r\n                        <Button\r\n                            disabled={!editable || !isPublishActive}\r\n                            onClick={() => setOpenPublishPopup(true)}\r\n                        >\r\n                            {Tr('publish')}\r\n                        </Button>\r\n\r\n                        {isDemandModification() && <Button\r\n                            disabled={!editable || !isCancelActive}\r\n                            onClick={() => setOpenCancelModificationPopup(true)}\r\n                        >\r\n                            {Tr('modification_cancel')}\r\n                        </Button>\r\n                        }\r\n                    </GridBlock>\r\n                    <Confirm\r\n                        open={openCancelModificationPopup}\r\n                        onConfirm={handleConfirmCancelModification}\r\n                        onCancel={() => setOpenCancelModificationPopup(false)}\r\n                        confirmText=\"modification_cancel_popup_text\"\r\n                    />\r\n                    <ConfirmPublish\r\n                        open={openPublishPopup}\r\n                        onConfirm={handleConfirmPublish}\r\n                        onCancel={() => setOpenPublishPopup(false)}\r\n                    />\r\n                </>\r\n            )}\r\n        </Form>\r\n            {showPublishLimitUsedAlert && <Alert\r\n                confirmText={Tr('publish.limit.used')}\r\n                open={true}\r\n                onClose={() => setShowPublishLimitUsedAlert(false)}\r\n                maxWidth='sm'\r\n            />}\r\n        </div>\r\n    )\r\n}\r\n\r\nPublishSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default PublishSection;","import { DemandValidation } from 'constants/DemandValidation';\r\nimport {DemandValidationSectionStatus} from \"../constants/DemandValidationSectionStatus\";\r\n\r\nexport default (demandValidation = []) => demandValidation.reduce( (acc, item) => {\r\n\tif (item.section === DemandValidation.PUBLICATION || item.section === DemandValidation.EX_POST_GO_TO_FINISH) return acc;\r\n\tif (item.status === DemandValidationSectionStatus.UNAVAILABLE) return acc;\r\n\tif ((item.required && item.status !== DemandValidationSectionStatus.OK) || item.status === DemandValidationSectionStatus.ERROR) return [\r\n\t\t...acc,\r\n\t\titem.section\r\n\t]\r\n\treturn acc;\r\n}, [])","export default {\r\n    NONE: \"NONE\",\r\n    DRAFT: \"DRAFT\",\r\n    COMPLETED: \"COMPLETED\",\r\n    SEND: \"SEND\",\r\n    PUBLISHED: \"PUBLISHED\",\r\n    PUBLICATION_ERROR: \"PUBLICATION_ERROR\",\r\n    INTEGRATION_ERROR: \"INTEGRATION_ERROR\"\r\n}","import getUncompletedSections from './getUncompletedSections';\r\nimport {DemandValidation} from \"../constants/DemandValidation\";\r\nimport {PublishConst} from \"../constants/PublicationConst\";\r\nimport {isDemandModification, isDemandPreparing} from \"./getDemandStatus\";\r\nimport {DemandValidationSectionStatus} from \"../constants/DemandValidationSectionStatus\";\r\nimport NationalNoticeStatus from \"../components/complex/nationalNotice/constants/NationalNoticeStatus\";\r\n\r\nexport default (demandValidation, ojsPublicationStatus, bzpContractNoticeStatus, isDemandChanged) => {\r\n    if (!demandValidation) return false;\r\n    if (!(isDemandPreparing() || (isDemandModification() && isDemandChanged && isDemandChanged.result))) {\r\n        return false;\r\n    }\r\n\r\n    const uncompleted = getUncompletedSections(demandValidation);\r\n    const hasUncompletedSections = uncompleted.length > 0;\r\n    if (hasUncompletedSections) {\r\n        return false;\r\n    }\r\n\r\n    const notice = demandValidation.find((x) => x.section === DemandValidation.NOTICE);\r\n    const isNoticeAvailable = notice ? notice.status !== DemandValidationSectionStatus.UNAVAILABLE : false;\r\n    if (isNoticeAvailable) {\r\n        if (ojsPublicationStatus && (ojsPublicationStatus.status === PublishConst.PUBLISHED || ojsPublicationStatus.status === PublishConst.CONFIRMED || ojsPublicationStatus.status === PublishConst.UNAVAILABLE)) {\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    const nationalNotice = demandValidation.find((x) => x.section === DemandValidation.NATIONAL_NOTICE);\r\n    const isNationalNoticeAvailable = nationalNotice ? nationalNotice.status !== 'UNAVAILABLE' : false;\r\n    if (isNationalNoticeAvailable) {\r\n        if (bzpContractNoticeStatus && (bzpContractNoticeStatus.status === NationalNoticeStatus.PUBLISHED || bzpContractNoticeStatus.status === NationalNoticeStatus.NONE)) {\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n\r\n    return true;\r\n}\r\n","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport PublishService from 'services/PublishService';\r\nimport ModificationService from 'services/ModificationService';\r\nimport {PublishConst} from 'constants/PublicationConst';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {isDemandModification, isDemandPreparing} from 'libs/getDemandStatus';\r\nimport clsx from 'clsx';\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    error: {\r\n        color: theme.palette.common.error\r\n    },\r\n    minusMargin: {\r\n        marginBottom: theme.spacing(-1),\r\n        textAlign: \"center\"\r\n    },\r\n})\r\n\r\nfunction NoticeButtons(\r\n    {\r\n        classes,\r\n        id,\r\n        editable,\r\n        ojsAdmin,\r\n        noticePreview,\r\n        ojsPublicationStatus,\r\n        isPublicOjsActive,\r\n        isPreviewOjsActive,\r\n        classesRoot,\r\n        checkNoticeStatus,\r\n        setWorking,\r\n        clearPublishResources\r\n    }) {\r\n    const handlePreviewEUForm = () => {\r\n        window.location.href = noticePreview.url\r\n    }\r\n\r\n    const handleSendEU = () => {\r\n        if (isDemandPreparing()) {\r\n            setWorking(true);\r\n            PublishService.publishOjsNotice(id).then((res) => {\r\n                PublishService.checkPublishOjs(id).then(resp => {\r\n                    setWorking(false);\r\n                    checkNoticeStatus();\r\n                });\r\n                clearPublishResources();\r\n            });\r\n        } else if (isDemandModification()) {\r\n            setWorking(true);\r\n            ModificationService.publishOjsNotice(id).then((res) => {\r\n                ModificationService.noticeOjsStatus(id).then(resp => {\r\n                    setWorking(false);\r\n                    checkNoticeStatus();\r\n                });\r\n                clearPublishResources();\r\n            });\r\n        }\r\n    }\r\n\r\n    const handleRollback = () => {\r\n        if (isDemandPreparing()) {\r\n            setWorking(true);\r\n            PublishService.rollbackOjsNotice(id).then((res) => {\r\n                PublishService.checkPublishOjs(id).then(resp => {\r\n                    setWorking(false);\r\n                    checkNoticeStatus();\r\n                });\r\n                clearPublishResources();\r\n            });\r\n        } else if (isDemandModification()) {\r\n            setWorking(true);\r\n            ModificationService.rollbackOjsNotice(id).then((res) => {\r\n                ModificationService.noticeOjsStatus(id).then(resp => {\r\n                    setWorking(false);\r\n                    checkNoticeStatus();\r\n                });\r\n                clearPublishResources();\r\n            });\r\n        }\r\n    }\r\n\r\n    return (\r\n        <GridBlock\r\n            className={classesRoot}\r\n            direction='column'\r\n            alignItems=\"center\"\r\n        >\r\n            <Button\r\n                onClick={handlePreviewEUForm}\r\n                disabled={!isPreviewOjsActive}\r\n            >\r\n                {Tr('preview_of_eu_form')}\r\n            </Button>\r\n\r\n            {(ojsPublicationStatus && ojsPublicationStatus.message && ojsPublicationStatus.status !== PublishConst.UNAVAILABLE) &&\r\n            <Typography className={clsx(classes.minusMargin, {\r\n                [classes.error]: ojsPublicationStatus.status === PublishConst.ERROR || ojsPublicationStatus.status === PublishConst.CONFIRMED\r\n                    || ojsPublicationStatus.status === PublishConst.UE_VALIDATION_ERROR || ojsPublicationStatus.status === PublishConst.NOT_PUBLISHED\r\n            })}>\r\n                {ojsPublicationStatus.message}\r\n            </Typography>\r\n            }\r\n\r\n            {(!ojsPublicationStatus || (ojsPublicationStatus.status !== PublishConst.NOT_PUBLISHED && ojsPublicationStatus.status !== PublishConst.UE_VALIDATION_ERROR)) &&\r\n                <Button\r\n                    onClick={handleSendEU}\r\n                    disabled={!isPublicOjsActive || !editable}\r\n                >\r\n                    {Tr('send_eu_publish')}\r\n                </Button>\r\n            }\r\n\r\n            {ojsPublicationStatus && ojsPublicationStatus.status === PublishConst.NOT_PUBLISHED &&\r\n            <Button\r\n                onClick={handleRollback}\r\n                disabled={!editable}\r\n            >\r\n                {Tr('send_eu_publish_rollback')}\r\n            </Button>\r\n            }\r\n\r\n            {ojsPublicationStatus && ojsPublicationStatus.status === PublishConst.UE_VALIDATION_ERROR &&\r\n            <Button\r\n                onClick={handleRollback}\r\n                disabled={!editable || !ojsAdmin}\r\n            >\r\n                {Tr('send_eu_publish_rollback')}\r\n            </Button>\r\n            }\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nNoticeButtons.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(NoticeButtons);","import React, {useMemo} from 'react'\r\nimport {Box, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Icon from '@material-ui/icons/CheckBox'\r\nimport IconOff from '@material-ui/icons/HighlightOff';\r\nimport Tr from 'translations/Translations';\r\nimport {DemandValidationTr} from 'constants/DemandValidation';\r\nimport {isDemandModification, isDemandPreparing} from 'libs/getDemandStatus';\r\nimport DemandService from \"services/DemandService\";\r\nimport Button from \"components/Button\";\r\nimport isBzpAttachmentNoticeType from \"libs/isBzpAttachmentNoticeType\";\r\nimport RouterPath from \"libs/RouterPath\";\r\n/*import NationalNoticeService from \"services/NationalNoticeService\";*/\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    icon: theme.components.icon,\r\n    center: {\r\n        textAlign: \"center\"\r\n    }\r\n})\r\n\r\nfunction InformationSection(\r\n    {\r\n        classes,\r\n        id,\r\n        classesRoot,\r\n        isPublishActive,\r\n        isPreviewActive,\r\n        isPreviewNoticeActive,\r\n        isPreviewDemandPublicFormActive,\r\n        isPublicOjsActive,\r\n        isOjsProcessing,\r\n        uncompletedSections,\r\n        demandHeader,\r\n        section,\r\n        isBzpPublishActive,\r\n        isBzpProcessing\r\n    }) {\r\n\r\n    const isPreparing = isDemandPreparing();\r\n    const isModification = isDemandModification();\r\n\r\n    const isBzpAttachmentNotice = useMemo(() => isBzpAttachmentNoticeType(demandHeader), [demandHeader]);\r\n\r\n    const openBzp = () => {\r\n        let a = document.createElement('a');\r\n        a.href = 'https://ezamowienia.gov.pl/mo-client-board/bzp/list'\r\n        a.target = '_blank'\r\n        a.click();\r\n    }\r\n\r\n    return (\r\n        <GridBlock\r\n            className={classesRoot}\r\n            direction='column'\r\n            alignItems=\"center\"\r\n        >\r\n            {\r\n                isPublishActive || isPublicOjsActive || isOjsProcessing || isBzpPublishActive || isBzpProcessing ?\r\n                    <Icon className={classes.icon} color='primary'/>\r\n                    :\r\n                    <IconOff className={classes.icon} color='primary'/>\r\n            }\r\n            {\r\n                isPublishActive &&\r\n                <Typography variant='h5'>\r\n                    {Tr('congratulations').toUpperCase()}!\r\n                </Typography>\r\n            }\r\n\r\n            <Typography variant='body1'>\r\n                {\r\n                    isPublishActive || isPublicOjsActive || isOjsProcessing || isBzpPublishActive || isBzpProcessing ?\r\n                        Tr('p1_pf_1') /*Udało Ci się pomyślnie uzupełnić wszystkie sekcje kreatora postępowania.*/ :\r\n                        (isModification && uncompletedSections.length === 0 ?\r\n                                <>{Tr('p1_pf_1_m_f')} {/*Nie dokonano żadnej modyfikacji lub dokonane zmiany nie wymagają ponownej publikacji postępowania.*/}</>\r\n                                :\r\n                                <>\r\n                                    {Tr('p1_pf_1_f')}{/*Aby przejść do publikacji postępowania wypełnij wymagane sekcje:*/}\r\n                                    {\r\n                                        uncompletedSections.map((x, i) =>\r\n                                            ` \"${DemandValidationTr[x]}\"${\r\n                                                i === uncompletedSections.length - 1 ? '.' : ','\r\n                                            } `\r\n                                        )}\r\n                                </>\r\n                        )\r\n                }\r\n            </Typography>\r\n\r\n            {isPreparing &&\r\n                <Typography variant='body1' align='center'>\r\n                    {Tr('p1_pf_2_1')}{' '} {/*Sprawdź jak Twoje postępowanie będzie wyglądać z perspektywy wykonawcy wybierając przycisk Podgląd.*/}\r\n                    <Box component='span' fontWeight='fontWeightBold'>\r\n                        {Tr('p1_pf_2_2')}{/*Podgląd nie spowoduje jego publikacji.*/}\r\n                    </Box>\r\n                </Typography>\r\n            }\r\n            {isBzpAttachmentNotice && <Typography variant='body1' align='center'>{Tr('bzp_or_ojs_info')}</Typography>}\r\n\r\n            {isPreparing &&\r\n                <>\r\n                    {\r\n                        demandHeader.apiVersion < 3 ?\r\n                            <div className={classes.center}>\r\n                                <Button\r\n                                    onClick={() => DemandService.preview(id)}\r\n                                    disabled={!isPreviewActive}\r\n                                >\r\n                                    {Tr('preview')}\r\n                                </Button>\r\n                            </div>\r\n                            : <div className={classes.center}>\r\n                                <Button\r\n\r\n                                    onClick={() => DemandService.preview(id)}\r\n                                    disabled={!isPreviewDemandPublicFormActive}\r\n                                >\r\n                                    {Tr(\"preview_demand_public_form\")}\r\n                                </Button>\r\n                                {/*<br/><br/>\r\n                                <Button\r\n                                    onClick={() => NationalNoticeService.printDemandNoticePreview(id)}\r\n                                    disabled={!isPreviewNoticeActive}\r\n                                >\r\n                                    {Tr(\"preview_notice\")}\r\n                                </Button>*/}\r\n                                <br/><br/>\r\n                                <Button\r\n                                    onClick={() => RouterPath.redirect(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_PREVIEW, {id: id}))}\r\n                                    disabled={!isPreviewActive}\r\n                                >\r\n                                    {Tr(\"preview_offer_form\")}\r\n                                </Button>\r\n                            </div>\r\n                    }\r\n                    {!!section?.competitivenessBaseLink && <div className={classes.center}>\r\n                        <Typography variant='body1' align='center'>\r\n                            {Tr('competitiveness_base.info')}\r\n                        </Typography>\r\n                        <br/>\r\n                        <Button\r\n                            onClick={() => {\r\n                                window.open(section.competitivenessBaseLink, '_blank').focus();\r\n                            }}\r\n                        >\r\n                            {Tr('competitiveness_base.link')}\r\n                        </Button>\r\n                    </div>\r\n                    }\r\n                </>\r\n            }\r\n\r\n            {/*{isModification &&\r\n            <>\r\n                {\r\n                    demandHeader.apiVersion >= 3 &&\r\n                        <div className={classes.center}>\r\n                            <Button\r\n                                onClick={() => NationalNoticeService.printDemandNoticePreview(id)}\r\n                                disabled={!isPreviewNoticeActive}\r\n                            >\r\n                                {Tr(\"preview_notice\")}\r\n                            </Button>\r\n                        </div>\r\n                }\r\n            </>\r\n            }*/}\r\n\r\n            {isBzpAttachmentNotice &&\r\n                <Button\r\n                    onClick={openBzp}\r\n                >\r\n                    {Tr('bzp_link')}\r\n                </Button>\r\n            }\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nInformationSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(InformationSection);","import {DemandValidation} from \"../constants/DemandValidation\";\r\nimport {PublishConst} from \"../constants/PublicationConst\";\r\nimport {isDemandModification} from \"./getDemandStatus\";\r\nimport {DemandValidationSectionStatus} from \"../constants/DemandValidationSectionStatus\";\r\nimport NationalNoticeStatus from \"../components/complex/nationalNotice/constants/NationalNoticeStatus\";\r\n\r\nexport default (demandValidation, ojsPublicationStatus, bzpContractNoticeStatus) => {\r\n    if (!demandValidation) return false;\r\n\r\n    if (!(isDemandModification())) {\r\n        return false;\r\n    }\r\n\r\n    const notice = demandValidation.find((x) => x.section === DemandValidation.NOTICE);\r\n    const isNoticeAvailable = notice ? notice.status !== DemandValidationSectionStatus.UNAVAILABLE : false;\r\n    const bzpNotice = demandValidation.find((x) => x.section === DemandValidation.NATIONAL_NOTICE);\r\n    const isBzpNoticeAvailable = bzpNotice ? bzpNotice.status !== DemandValidationSectionStatus.UNAVAILABLE : false;\r\n    if (isNoticeAvailable) {\r\n        return ojsPublicationStatus ? (ojsPublicationStatus.status === PublishConst.NOT_SENT || ojsPublicationStatus.status === PublishConst.UNAVAILABLE) : false;\r\n    } else if (isBzpNoticeAvailable) {\r\n        return bzpContractNoticeStatus ? (bzpContractNoticeStatus.status === NationalNoticeStatus.NONE\r\n            || bzpContractNoticeStatus.status === NationalNoticeStatus.DRAFT || bzpContractNoticeStatus.status === NationalNoticeStatus.COMPLETED) : false;\r\n    }\r\n\r\n    return true;\r\n}\r\n","import getUncompletedSections from './getUncompletedSections';\r\nimport {isDemandPreparing} from \"./getDemandStatus\";\r\nimport {previewDemandPublicFormDisabled} from \"./getDemandStatus\";\r\n\r\nexport default (demandValidation) => {\r\n    if (!demandValidation || !isDemandPreparing() || previewDemandPublicFormDisabled()) return false;\r\n    const uncompleted = getUncompletedSections(demandValidation);\r\n    return uncompleted.length === 0;\r\n}\r\n","export const PP_REQUIRED_GROUPS = [\"PUBLISHER\", \"PPCREATE\", \"PPREAD\", \"PPUPDATE\"]\r\nexport const MO_REQUIRED_GROUPS = [\"NCREATE\", \"NCONFIRM\", \"NUPDATE\"]\r\nexport const MMiA_REQUIRED_GROUPS = [\"MMiAANNREPUSER\"]\r\n","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport GridBlock from 'components/GridBlock';\r\nimport NationalNoticeStatus from \"components/complex/nationalNotice/constants/NationalNoticeStatus\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Typography from \"components/Typography\";\r\nimport useEzamowieniaOauth from \"hooks/useEzamowieniaOauth\";\r\nimport NationalNoticeService from \"services/NationalNoticeService\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport {isDemandModification, isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport Loading from \"components/Loading\";\r\nimport PropTypes from \"prop-types\";\r\nimport {withStyles} from \"@material-ui/styles\";\r\nimport {MO_REQUIRED_GROUPS} from \"constants/EzamowieniaRequiredGroups\";\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    error: {\r\n        color: theme.palette.common.error\r\n    },\r\n    minusMargin: {\r\n        marginBottom: theme.spacing(-1),\r\n        textAlign: \"center\"\r\n    },\r\n})\r\n\r\nfunction BzpNoticeButtons(\r\n    {\r\n        classes,\r\n        id,\r\n        classesRoot,\r\n        editable,\r\n        setWorking,\r\n        clearPublishResources,\r\n        bzpContractNoticeStatus\r\n    }) {\r\n    const [ezWorking, setEzWorking] = useState(false);\r\n    const {authorizeEzamowienia} = useEzamowieniaOauth();\r\n\r\n    const goToNationalNotice = () => {\r\n        const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_NATIONAL_NOTICE_FORM_TYPE_ID, {formType: \"contractNotice\", id});\r\n        RouterPath.redirect(href);\r\n    }\r\n\r\n    const sendContractNotice = () => {\r\n        setEzWorking(true);\r\n\r\n        if (isDemandModification()) {\r\n            authorizeEzamowienia(() => {\r\n                NationalNoticeService.publishContractNoticeUpdate(id).catch((e) => console.error(e)).finally(() => {\r\n                    setEzWorking(false);\r\n                    NationalNoticeService.getContractModificationNoticeStatus(id);\r\n                })\r\n            }, () => {\r\n                setEzWorking(false)\r\n            }, MO_REQUIRED_GROUPS)\r\n        } else {\r\n            authorizeEzamowienia(() => {\r\n                NationalNoticeService.publishContractNotice(id).catch((e) => console.error(e)).finally(() => {\r\n                    setEzWorking(false);\r\n                    NationalNoticeService.getContractNoticeStatus(id)\r\n                })\r\n            }, () => {\r\n                setEzWorking(false)\r\n            }, MO_REQUIRED_GROUPS)\r\n        }\r\n    }\r\n\r\n    const rollbackContractNotice = () => {\r\n        setEzWorking(true);\r\n        if (isDemandModification()) {\r\n            NationalNoticeService.rollbackContractNoticeUpdate(id).catch((e) => console.error(e)).finally(() => setEzWorking(false))\r\n        } else {\r\n            NationalNoticeService.rollbackContractNotice(id).catch((e) => console.error(e)).finally(() => setEzWorking(false))\r\n        }\r\n    }\r\n\r\n    const checkContractNoticeStatus = () => {\r\n        setEzWorking(true);\r\n        authorizeEzamowienia(() => {\r\n            NationalNoticeService.checkContractNoticeStatus(id).catch((e) => console.error(e)).finally(() => setEzWorking(false))\r\n        }, () => {\r\n            setEzWorking(false)\r\n        }, MO_REQUIRED_GROUPS)\r\n    }\r\n\r\n    if(!bzpContractNoticeStatus ) return <Loading/>\r\n    return (\r\n        <GridBlock\r\n            className={classesRoot}\r\n            direction='column'\r\n            alignItems='center'\r\n        >\r\n                <Typography variant='body1' align='center'>{Tr('ezamowienia_state_' + bzpContractNoticeStatus.status.toLowerCase())}</Typography>\r\n                {\r\n                    (bzpContractNoticeStatus.status === NationalNoticeStatus.DRAFT) && <>\r\n                        <Button\r\n                            onClick={goToNationalNotice}\r\n                        >\r\n                            {Tr('bzp_notice_create')}\r\n                        </Button>\r\n                    </>\r\n                }\r\n                {\r\n                    bzpContractNoticeStatus.status === NationalNoticeStatus.COMPLETED && <>\r\n                        <WorkableButton\r\n                            onClick={sendContractNotice}\r\n                            disabled={!editable || ezWorking}\r\n                            working={ezWorking}\r\n                        >\r\n                            {Tr(isDemandPreparing() ? 'bzp_notice_publish' : 'bzp_notice_publish_update')}\r\n                        </WorkableButton>\r\n                    </>\r\n                }\r\n                {\r\n                    bzpContractNoticeStatus.status === NationalNoticeStatus.SEND && <>\r\n                        <WorkableButton\r\n                            onClick={checkContractNoticeStatus}\r\n                            disabled={!editable || ezWorking}\r\n                            working={ezWorking}\r\n                        >\r\n                            {Tr('bzp_notice_status')}\r\n                        </WorkableButton>\r\n                    </>\r\n                }\r\n                {\r\n                    (bzpContractNoticeStatus.status === NationalNoticeStatus.PUBLICATION_ERROR || bzpContractNoticeStatus.status === NationalNoticeStatus.INTEGRATION_ERROR) && <>\r\n                        <WorkableButton\r\n                            onClick={rollbackContractNotice}\r\n                            disabled={!editable || ezWorking}\r\n                            working={ezWorking}\r\n                        >\r\n                            {Tr('bzp_notice_rollback_' + bzpContractNoticeStatus.status.toLowerCase())}\r\n                        </WorkableButton>\r\n                    </>\r\n                }\r\n\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nBzpNoticeButtons.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(BzpNoticeButtons);","import React, {useEffect, useMemo, useState} from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport ModificationService from 'services/ModificationService';\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from 'react-redux'\r\nimport PublishSection from './PublishSection';\r\nimport NoticeService from 'services/NoticeService';\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport isPublishButtonActive from 'libs/isPublishButtonActive';\r\nimport getUncompletedSections from 'libs/getUncompletedSections';\r\nimport NoticeButtons from './NoticeButtons';\r\nimport InformationSection from './InformationSection';\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {PublishConst} from 'constants/PublicationConst';\r\nimport isCancelModificationButtonActive from \"libs/isCancelModificationButtonActive\";\r\nimport {isDemandModification, isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport PublishService from \"services/PublishService\";\r\nimport Loading from \"components/Loading\";\r\nimport isPreviewButtonActive from \"libs/isPreviewButtonActive\";\r\nimport isPreviewNoticeButtonActive from \"libs/isPreviewNoticeButtonActive\";\r\nimport isPreviewDemandPublicFormButtonActive from \"libs/isPreviewDemandPublicFormButtonActive\";\r\nimport DemandService from \"services/DemandService\";\r\nimport {clearResource} from \"redux/actions\";\r\nimport clsx from 'clsx';\r\nimport BzpNoticeButtons from \"./BzpNoticeButtons\";\r\nimport NationalNoticeService from \"services/NationalNoticeService\";\r\nimport NationalNoticeStatus from \"components/complex/nationalNotice/constants/NationalNoticeStatus\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            '&>*': {\r\n                marginTop: theme.spacing(2)\r\n            }\r\n        }\r\n    },\r\n    hidden: {\r\n        display: 'none'\r\n    }\r\n})\r\n\r\nfunction Publication(\r\n    {\r\n        classes,\r\n        expanded,\r\n        match,\r\n        demandValidation,\r\n        noticePreview = {error: true},\r\n        ojsPublicationStatus,\r\n        isDemandChanged = {},\r\n        demandHeader,\r\n        bzpContractNoticeStatus\r\n    }) {\r\n    const id = match.params.id;\r\n\r\n    const [working, setWorking] = useState(true);\r\n    const uncompletedSections = getUncompletedSections(demandValidation);\r\n    const [noticeStatusInterval, setNoticeStatusInterval] = useState();\r\n\r\n    const findSection = (compareSection) => demandValidation.find(x => x.section === compareSection);\r\n\r\n    const section = findSection(DemandValidation.PUBLICATION);\r\n\r\n    const editable = section ? section.editable : false;\r\n    const ojsAdmin = section ? section.ojsAdmin : false;\r\n    const hasOjsNotice = demandHeader?.noticeOjsType === true;\r\n    const hasBzpNotice = demandHeader?.noticeBzpType === true;\r\n\r\n    const clearPublishResources = () => {\r\n        DemandService.getValidate(id, false);\r\n    }\r\n\r\n\r\n    useEffect(() => {\r\n\r\n        if (hasOjsNotice && id > 0) {\r\n            if (isDemandPreparing()) {\r\n                PublishService.checkPublishOjs(id).then(resp => {\r\n                    setWorking(false);\r\n                    if (resp && resp.status === PublishConst.SENT) {\r\n                        startNoticeStatusInterval();\r\n                    }\r\n                })\r\n            } else if (isDemandModification()) {\r\n                ModificationService.noticeOjsStatus(id).then(resp => {\r\n                    setWorking(false);\r\n                    if (resp && resp.status === PublishConst.SENT) {\r\n                        startNoticeStatusInterval();\r\n                    }\r\n                })\r\n            } else {\r\n                setWorking(false);\r\n            }\r\n        } else {\r\n            setWorking(false);\r\n        }\r\n\r\n\r\n        return () => {\r\n            if (noticeStatusInterval) clearInterval(noticeStatusInterval);\r\n        }\r\n        //eslint-disable-next-line\r\n    }, []);\r\n\r\n    const startNoticeStatusInterval = () => {\r\n        if (isDemandPreparing()) {\r\n            const interval = setInterval(async () => {\r\n                const resp = await PublishService.checkPublishOjs(id);\r\n                if (resp.status !== PublishConst.SENT) {\r\n                    clearInterval(interval);\r\n                    clearPublishResources();\r\n                }\r\n            }, 10000);\r\n            setNoticeStatusInterval(interval);\r\n        } else if (isDemandModification()) {\r\n            const interval = setInterval(async () => {\r\n                const resp = await ModificationService.noticeOjsStatus(id);\r\n                if (resp.status !== PublishConst.SENT) {\r\n                    clearInterval(interval);\r\n                    clearPublishResources();\r\n                }\r\n            }, 10000);\r\n            setNoticeStatusInterval(interval);\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (isDemandModification()) {\r\n            ModificationService.isDemandChanged(id);\r\n        }\r\n\r\n        if (expanded) {\r\n            if (hasOjsNotice && uncompletedSections.length === 0) {\r\n                NoticeService.getPreviewUrl(id);\r\n                DemandService.clearResources(DemandService.DEMAND_RESOURCE_ID);\r\n            }\r\n\r\n            if (hasBzpNotice && uncompletedSections.length === 0) {\r\n                if (isDemandModification()) {\r\n                    NationalNoticeService.getContractModificationNoticeStatus(id);\r\n                } else if (isDemandPreparing()) {\r\n                    NationalNoticeService.getContractNoticeStatus(id);\r\n                }\r\n            }\r\n        }\r\n        return ()=> {\r\n            NoticeService.clearResources(NoticeService.NOTICE_PREVIEW_RESOURCE_ID);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [expanded, id])\r\n\r\n\r\n    const rp = RouterPath.myProcedure;\r\n\r\n    const moveToOfferCollection = () => {\r\n        const href = RouterPath.createPath(rp.steps.MP_2_ID, {id});\r\n        RouterPath.redirect(href)\r\n    };\r\n    const isPublishActive = useMemo(() => isPublishButtonActive(demandValidation, ojsPublicationStatus, bzpContractNoticeStatus, isDemandChanged), [demandValidation, ojsPublicationStatus, isDemandChanged, bzpContractNoticeStatus]);\r\n    const isCancelActive = isCancelModificationButtonActive(demandValidation, ojsPublicationStatus, bzpContractNoticeStatus);\r\n    // eslint-disable-next-line\r\n    const isPreviewActive = useMemo(() => isPreviewButtonActive(demandValidation), [demandValidation]);\r\n    const isPreviewNoticeActive = useMemo(() => isPreviewNoticeButtonActive(demandValidation, bzpContractNoticeStatus), [demandValidation, bzpContractNoticeStatus]);\r\n    const isPreviewDemandPublicFormActive = useMemo(() => isPreviewDemandPublicFormButtonActive(demandValidation), [demandValidation]);\r\n    const isOjsProcessing = uncompletedSections.length === 0 && ojsPublicationStatus ? ojsPublicationStatus.status === PublishConst.SENT : false;\r\n    const isPublicOjsActive = uncompletedSections.length === 0 && ojsPublicationStatus ? ojsPublicationStatus.status === PublishConst.NOT_SENT : false;\r\n    const isPreviewOjsActive = uncompletedSections.length === 0 && !Boolean(noticePreview.error);\r\n\r\n    const isBzpPublishActive = uncompletedSections.length === 0 && bzpContractNoticeStatus ? bzpContractNoticeStatus.status === NationalNoticeStatus.COMPLETED : false;\r\n    const isBzpProcessing = uncompletedSections.length === 0 && bzpContractNoticeStatus ? bzpContractNoticeStatus.status === NationalNoticeStatus.SEND : false;\r\n\r\n    if (!demandValidation) return <Loading/>\r\n\r\n    return (\r\n        <>\r\n            {working && <Loading/>}\r\n            <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n                className={clsx({[classes.hidden]:working})}\r\n            >\r\n                <InformationSection\r\n                    id={id}\r\n                    classesRoot={classes.root}\r\n                    isPublishActive={isPublishActive}\r\n                    isPreviewActive={isPreviewActive}\r\n                    isPreviewNoticeActive={isPreviewNoticeActive}\r\n                    isPreviewDemandPublicFormActive={isPreviewDemandPublicFormActive}\r\n                    isPublicOjsActive={isPublicOjsActive}\r\n                    isPreviewOjsActive={isPreviewOjsActive}\r\n                    isOjsProcessing={isOjsProcessing}\r\n                    uncompletedSections={uncompletedSections}\r\n                    demandHeader={demandHeader}\r\n                    section={section}\r\n                    isBzpProcessing={isBzpProcessing}\r\n                    isBzpPublishActive={isBzpPublishActive}\r\n                />\r\n\r\n                {(hasOjsNotice) &&\r\n                <NoticeButtons\r\n                    id={id}\r\n                    editable={editable}\r\n                    ojsAdmin={ojsAdmin}\r\n                    noticePreview={noticePreview}\r\n                    ojsPublicationStatus={ojsPublicationStatus}\r\n                    isPublicOjsActive={isPublicOjsActive}\r\n                    isPreviewOjsActive={isPreviewOjsActive}\r\n                    classesRoot={classes.root}\r\n                    checkNoticeStatus={startNoticeStatusInterval}\r\n                    setWorking={setWorking}\r\n                    clearPublishResources={clearPublishResources}\r\n                />\r\n                }\r\n\r\n                {\r\n                    (hasBzpNotice && uncompletedSections.length === 0) && <BzpNoticeButtons\r\n                        id={id}\r\n                        editable={editable}\r\n                        classesRoot={classes.root}\r\n                        setWorking={setWorking}\r\n                        clearPublishResources={clearPublishResources}\r\n                        bzpContractNoticeStatus={bzpContractNoticeStatus}\r\n                    />\r\n                }\r\n\r\n\r\n                <PublishSection\r\n                    id={id}\r\n                    classesRoot={classes.root}\r\n                    moveToOfferCollection={moveToOfferCollection}\r\n                    isPublishActive={isPublishActive}\r\n                    isCancelActive={isCancelActive}\r\n                    editable={editable}\r\n                    setWorking={setWorking}\r\n                    clearPublishResources={clearPublishResources}\r\n                />\r\n\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nPublication.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    isDemandChanged: state.resources.isDemandChanged,\r\n    noticePreview: state.resources.noticePreview,\r\n    demandValidation: state.resources.demandValidation,\r\n    ojsPublicationStatus: state.resources.ojsPublicationStatus,\r\n    bzpContractNoticeStatus: state.resources[NationalNoticeService.BZP_CONTRACT_NOTICE_STATUS],\r\n    demandHeader: state.resources.demandHeader\r\n}), {\r\n\r\n    clearResource\r\n})(withStyles(style)(withRouter(Publication)));","import getUncompletedSections from './getUncompletedSections';\r\nimport {isDemandPreparing} from \"./getDemandStatus\";\r\n\r\nexport default (demandValidation) => {\r\n    if (!demandValidation || !isDemandPreparing()) return false;\r\n    const uncompleted = getUncompletedSections(demandValidation);\r\n    return uncompleted.length === 0;\r\n}\r\n","import getUncompletedSections from './getUncompletedSections';\r\nimport {isDemandModification, isDemandPreparing} from \"./getDemandStatus\";\r\n\r\nexport default (demandValidation, bzpContractNoticeStatus) => {\r\n    if (!demandValidation || (!isDemandPreparing() && !isDemandModification()) || !bzpContractNoticeStatus) return false;\r\n    const uncompleted = getUncompletedSections(demandValidation);\r\n    return uncompleted.length === 0 && bzpContractNoticeStatus.status !== 'NONE';\r\n}\r\n","import React, {useMemo, useState} from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from \"prop-types\";\r\nimport {connect} from \"react-redux\";\r\nimport {withRouter} from \"react-router\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {DemandValidation} from 'constants/DemandValidation';\r\nimport isPublishButtonActive from 'libs/isPublishButtonActive';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport DemandService from \"services/DemandService\";\r\nimport PublishService from \"services/PublishService\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from 'components/GridBlock';\r\nimport {clearResource} from \"redux/actions\";\r\nimport clsx from \"clsx\";\r\nimport Icon from \"@material-ui/icons/CheckBox\";\r\nimport IconOff from \"@material-ui/icons/HighlightOff\";\r\nimport {isDemandFinished, isDemandFinishing} from \"libs/getDemandStatus\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            '&>*': {\r\n                marginTop: theme.spacing(2)\r\n            }\r\n        }\r\n    },\r\n\r\n    hidden: {\r\n        display: 'none'\r\n    },\r\n\r\n    finishButton: {\r\n        marginTop: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction ExPostGoToFinish(\r\n    {\r\n        match,\r\n        classes,\r\n        demandValidation,\r\n        ojsPublicationStatus,\r\n        isDemandChanged = {}\r\n    }) {\r\n\r\n    const id = match.params.id;\r\n    const rp = RouterPath.myProcedure;\r\n\r\n    const [openGoToFinishPopup, setOpenGoToFinishPopup] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n\r\n    const findSection = (compareSection) => demandValidation.find(x => x.section === compareSection);\r\n    const section = findSection(DemandValidation.EX_POST_GO_TO_FINISH);\r\n\r\n    const editable = section ? section.editable : false;\r\n    const isPublishActive = useMemo(() => isPublishButtonActive(demandValidation, ojsPublicationStatus, isDemandChanged), [demandValidation, ojsPublicationStatus, isDemandChanged]);\r\n    const isDemandFinish = useMemo(() => isDemandFinished() || isDemandFinishing(), []);\r\n\r\n    const handleGoToFinish = () => {\r\n        setOpenGoToFinishPopup(false);\r\n        setWorking(true);\r\n        PublishService.publishExPost(id).then((resp) => {\r\n            if (resp != null) {\r\n                if (resp) {\r\n                    HeaderService.get(id);\r\n                    PublishService.markFirstPublication(id);\r\n                    const href = RouterPath.createPath(rp.steps.MP_4_ID, {id});\r\n                    RouterPath.redirect(href)\r\n                } else {\r\n                    setWorking(false);\r\n                }\r\n            } else {\r\n                setWorking(false);\r\n                DemandService.getValidate(id, false);\r\n            }\r\n        });\r\n    };\r\n\r\n    return (\r\n        <>\r\n            {working && <Loading/>}\r\n\r\n            <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n                className={clsx({[classes.hidden]: working})}\r\n            >\r\n                {\r\n                    isPublishActive || isDemandFinish ?\r\n                        <Icon className={classes.icon} color='primary'/>\r\n                        :\r\n                        <IconOff className={classes.icon} color='primary'/>\r\n                }\r\n                <Typography variant='h5'>\r\n                    {isDemandFinish ? Tr('p1_pf_1_epf') : (isPublishActive ? Tr('p1_pf_1') : Tr('p1_pf_1_f'))}\r\n                </Typography>\r\n\r\n                <Button\r\n                    className={classes.finishButton}\r\n                    disabled={!editable || !isPublishActive}\r\n                    onClick={() => setOpenGoToFinishPopup(true)}\r\n                >\r\n                    {Tr('exPost_goToFinish')}\r\n                </Button>\r\n\r\n                <Confirm\r\n                    open={openGoToFinishPopup}\r\n                    onConfirm={handleGoToFinish}\r\n                    onCancel={() => setOpenGoToFinishPopup(false)}\r\n                    confirmText={Tr('exPost_goToFinish_confirm')}\r\n                />\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nExPostGoToFinish.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n}), {\r\n    clearResource\r\n})(withStyles(style)(withRouter(ExPostGoToFinish)));","import PropTypes from \"prop-types\";\r\nimport {connect} from \"react-redux\";\r\nimport {withRouter} from \"react-router\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\nimport Tr from \"translations/Translations\";\r\nimport Button from \"components/Button\";\r\nimport React from \"react\";\r\nimport GridBlock from \"../../../../../../../components/GridBlock\";\r\n\r\nfunction Questionnaire(\r\n    {\r\n        demandValidation\r\n    }) {\r\n\r\n    const findSection = (compareSection) => demandValidation.find(x => x.section === compareSection);\r\n\r\n    const section = findSection(DemandValidation.QUESTIONNAIRE);\r\n\r\n    const handleClick = () => {\r\n        window.location.href = section.questionnaireTabUrl;\r\n    }\r\n\r\n    return (\r\n        <div style={{width: \"100%\"}}>\r\n            <GridBlock justify=\"center\" alignItems=\"center\">\r\n                <Button onClick={handleClick}>{Tr(\"move_to_questionnaire_tab\")}</Button>\r\n            </GridBlock>\r\n        </div>\r\n    )\r\n}\r\n\r\nQuestionnaire.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n}), {})(withRouter(Questionnaire));","import {Commission, Contractor, Dealings, Demand, Espd, Guarantee, Notice, PreparingPapersGenerator, Publication, Schedule, Siwz, NationalNotice, ExPostGoToFinish,\r\nDemandAdditionalInfo, Questionnaire} from './panels';\r\nimport DealingsService from \"services/DealingsService\";\r\nimport ScheduleService from \"services/ScheduleService\";\r\nimport CommissionService from \"services/CommissionService\";\r\nimport EspdService from \"services/EspdService\";\r\nimport GuaranteeService from \"services/GuaranteeService\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport ContractorService from \"services/ContractorService\";\r\nimport NoticeService from \"services/NoticeService\";\r\nimport NationalNoticeService from \"services/NationalNoticeService\";\r\nimport DemandAdditionalInfoService from \"services/DemandAdditionalInfoService\";\r\nimport {DemandValidation} from \"constants/DemandValidation\";\r\n\r\nexport default {\r\n    mp_1_demand: Demand,\r\n    mp_1_dealings: Dealings,\r\n    mp_1_schedule: Schedule,\r\n    mp_1_commission: Commission,\r\n    mp_1_espd: Espd,\r\n    mp_1_siwz: Siwz,\r\n    mp_1_guarantee: Guarantee,\r\n    mp_1_contractor: Contractor,\r\n    mp_1_notice: Notice,\r\n    mp_1_national_notice: NationalNotice,\r\n    mp_1_publication: Publication,\r\n    mp_1_ex_post_go_to_finish: ExPostGoToFinish,\r\n    mp_1_preparing_papers_generator: PreparingPapersGenerator,\r\n    mp_1_preparing_additional_info: DemandAdditionalInfo,\r\n    mp_1_questionnaire: Questionnaire\r\n}\r\n\r\nexport const panelsValidationKeys = {\r\n    mp_1_demand: (id) => null,\r\n    mp_1_dealings: (id) => DealingsService.validate(id),\r\n    mp_1_schedule: (id) => ScheduleService.validate(id),\r\n    mp_1_commission: (id) => CommissionService.validate(id),\r\n    mp_1_espd: (id) => EspdService.validate(id),\r\n    mp_1_siwz: (id) => SiwzService.validateSIWZ(id),\r\n    mp_1_guarantee: (id) => GuaranteeService.validate(id),\r\n    mp_1_contractor: (id) => ContractorService.validate(id),\r\n    mp_1_notice: (id) => NoticeService.validate(id),\r\n    mp_1_national_notice: (id) => NationalNoticeService.validate(id),\r\n    mp_1_publication: (id) => null,\r\n    mp_1_ex_post_go_to_finish: (id) => null,\r\n    mp_1_preparing_papers_generator: (id) => null,\r\n    mp_1_preparing_additional_info: (id) => DemandAdditionalInfoService.validate(id, DemandValidation.PREPARING_ADDITIONAL_INFO),\r\n    mp_1_questionnaire: (id) => null,\r\n}\r\n\r\n\r\nexport const isInitialHidden = (step, procedureType, passive, exPost) => {\r\n    if(!procedureType || !step)\r\n        return false;\r\n\r\n    const func = hidden[step.key];\r\n    return func && func(procedureType, passive, exPost);\r\n}\r\n\r\nconst hidden = {\r\n    mp_1_dealings: (procedureType, passive, exPost) => {\r\n        return passive === 'true' || exPost === 'true';\r\n    },\r\n    mp_1_notice: (procedureType, passive, exPost) => {\r\n        return \"true\" === passive || exPost === 'true' || [\"europePublic\", \"europeSocialServices\"].indexOf(procedureType) === -1\r\n    },\r\n    mp_1_guarantee: (procedureType, passive, exPost) => {\r\n        return \"true\" === passive || exPost === 'true' || [\"europePublic\", \"europeSocialServices\", \"nationalPublic\", \"nationalSocialServices\"].indexOf(procedureType) === -1\r\n    },\r\n    mp_1_espd: (procedureType, passive, exPost) => {\r\n        return exPost === 'true' || !procedureType.startsWith(\"europe\")\r\n    },\r\n    mp_1_contractor: (procedureType, passive, exPost) => {\r\n        return exPost === 'true';\r\n    },\r\n    mp_1_schedule: (procedureType, passive, exPost) => {\r\n        return exPost === 'true';\r\n    },\r\n    mp_1_publication: (procedureType, passive, exPost) => {\r\n        return exPost === 'true';\r\n    },\r\n    mp_1_ex_post_go_to_finish: (procedureType, passive, exPost) => {\r\n        return exPost !== 'true';\r\n    },\r\n    mp_1_questionnaire: (procedureType, passive, exPost) => {\r\n        return exPost === 'true';\r\n    },\r\n}\r\n\r\n","import React from 'react'\r\nimport ExPostGoToFinish from './ExPostGoToFinish';\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return (\r\n        expanded && <ExPostGoToFinish/>\r\n    )\r\n}\r\n\r\nexport default Index;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport PreparingAdditionalInfo from \"./PreparingAdditionalInfo\";\r\nimport {DemandValidation, DemandValidationKeys} from \"constants/DemandValidation\";\r\n\r\n\r\nfunction Index(\r\n    {\r\n        expanded\r\n    }) {\r\n    return expanded && <PreparingAdditionalInfo sectionId={DemandValidation.PREPARING_ADDITIONAL_INFO} formId={DemandValidationKeys.PREPARING_ADDITIONAL_INFO}/>\r\n}\r\n\r\nIndex.propTypes = {\r\n    expanded: PropTypes.bool,\r\n}\r\n\r\nexport default Index;","import React from 'react'\r\nimport {makeStyles, Tooltip, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ExpansionPanel from 'components/ExpansionPanel';\r\nimport {setConfirmCloseStepper, setStepperState} from 'redux/actions'\r\nimport {connect} from 'react-redux'\r\nimport NavigationBar from 'components/complex/floatingMenu/NavigationBar';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowUp'\r\nimport clsx from 'clsx';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport Loading from 'components/Loading';\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport {DemandValidationSectionStatus as sectionStatus} from \"constants/DemandValidationSectionStatus\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        height: '100%',\r\n        '&>*:not(:first-child)': {\r\n            marginTop: theme.spacing(2)\r\n        }\r\n    },\r\n    floatingMenu: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        top: 109\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    adornmentGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(2)\r\n        }\r\n    }\r\n}))\r\n\r\nfunction AccordionPart(\r\n    {\r\n        navigationBarButtons,\r\n        working,\r\n        steps,\r\n        panels,\r\n        stepperState,\r\n        setStepperState,\r\n        demandValidation,\r\n        redirectOldPlatform,\r\n        stateCloseValidator,\r\n        deleteFormDraftFunc,\r\n        saveFormDraftFunc,\r\n        setConfirmCloseStepper\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const handleClick = id => (e) => {\r\n        if (stateCloseValidator && stateCloseValidator() === false) {\r\n            if (!!saveFormDraftFunc) {\r\n                setConfirmCloseStepper(() => doHandleClick(id), Tr(stepperState), () => doHandleClickWithDraftSave(id));\r\n            } else {\r\n                setConfirmCloseStepper(() => doHandleClick(id), Tr(stepperState));\r\n            }\r\n            return\r\n        }\r\n        doHandleClick(id)\r\n    }\r\n\r\n    const doHandleClick = id => {\r\n        if (!!deleteFormDraftFunc)\r\n            deleteFormDraftFunc();\r\n        _doHandleClick(id);\r\n    }\r\n\r\n    const doHandleClickWithDraftSave = id => {\r\n        if (!!saveFormDraftFunc) {\r\n            saveFormDraftFunc();\r\n        }\r\n        _doHandleClick(id);\r\n    }\r\n\r\n    const _doHandleClick = id => {\r\n        if (stepperState !== id) setStepperState(id);\r\n        else setStepperState(null);\r\n    }\r\n\r\n    const createTitle = (variant, label) => {\r\n        return (\r\n            <GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={variant}/>\r\n                <Typography variant='h6'>\r\n                    {label}\r\n                </Typography>\r\n            </GridBlock>\r\n        )\r\n    }\r\n\r\n    if (!steps || !demandValidation || working || redirectOldPlatform) return <Loading/>\r\n    return (\r\n        <div className={classes.root}>\r\n            {(!!navigationBarButtons && navigationBarButtons.length > 0) &&\r\n                <div className={classes.floatingMenu}>\r\n                    <NavigationBar buttons={navigationBarButtons}/>\r\n                </div>\r\n            }\r\n\r\n            {steps.filter(({apiId}) => {\r\n                const section = demandValidation.find(x => x.section === apiId)\r\n                if (!section) return true;\r\n                return section.status !== sectionStatus.UNAVAILABLE;\r\n            })\r\n                .map(({key, label, apiId}) => {\r\n                    const section = demandValidation.find(x => x.section === apiId)\r\n                    const variant = section ? (section.status === sectionStatus.OK ? 'Done' : (section.status === sectionStatus.DISABLED ? 'Wait' : (section.status === sectionStatus.ERROR ? 'Required' : (section.required ? 'Required' : 'Optional')))) : \"Wait\";\r\n                    const _label = label;\r\n                    const Component = panels[key]\r\n                    return (\r\n                        <ExpansionPanel\r\n                            disabled={variant === 'Wait'}\r\n                            key={key}\r\n                            title={createTitle(variant, _label)}\r\n                            titleAdornment={\r\n                                <GridBlock\r\n                                    wrap='nowrap'\r\n                                    className={classes.adornmentGrid}\r\n                                    alignItems='center'\r\n                                >\r\n                                    <div/>\r\n                                    <Tooltip title={stepperState === key ? Tr('collapse') : Tr('expand')} placement='top'>\r\n                                        <ArrowIcon\r\n                                            className={clsx({\r\n                                                [classes.rotate]: stepperState !== key\r\n                                            })}\r\n                                        />\r\n                                    </Tooltip>\r\n                                </GridBlock>\r\n                            }\r\n                            expanded={stepperState === key}\r\n                            onChange={handleClick(key)}\r\n                        >\r\n                            <Component expanded={stepperState === key}/>\r\n                        </ExpansionPanel>\r\n                    )\r\n                })}\r\n\r\n\r\n        </div>\r\n    )\r\n}\r\n\r\nAccordionPart.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stepperState: state.stepper.state,\r\n    stateCloseValidator: state.stepper.stateCloseValidator,\r\n    deleteFormDraftFunc: state.stepper.deleteFormDraftFunc,\r\n    saveFormDraftFunc: state.stepper.saveFormDraftFunc,\r\n    demandValidation: state.resources.demandValidation,\r\n    redirectOldPlatform: state.resources.redirectOldPlatform,\r\n}), {\r\n    setStepperState,\r\n    setConfirmCloseStepper\r\n})(AccordionPart);","import React, {useEffect, useState} from 'react'\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport Loading from \"components/Loading\";\r\nimport DemandService from \"services/DemandService\";\r\nimport PropTypes from 'prop-types';\r\nimport BoldTypography from \"../../BoldTypography\";\r\nimport Link from \"@material-ui/core/Link\";\r\nimport {Typography} from \"@material-ui/core\";\r\nimport SingleButton from \"../components/SingleButton\";\r\n\r\n\r\nfunction DemandRelatedObjects(\r\n    {\r\n        label,\r\n        rels\r\n    }) {\r\n\r\n\r\n    return (\r\n        <>\r\n            <BoldTypography>{label}</BoldTypography>\r\n            {\r\n                rels.map((x, i) => {\r\n                    if (!!x.url)\r\n                        return (<Typography key={i} variant=\"body1\"><Link key={i} target=\"_blank\" href={x.url}>{x.name}</Link></Typography>)\r\n                    else\r\n                        return (<Typography key={i} variant=\"body1\">{x.name}</Typography>)\r\n                })\r\n            }\r\n            <br/>\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nfunction DemandRelatedObjectsPopup(\r\n    {\r\n        relatedObjectServiceFunction = DemandService.getRelatedObjects,\r\n        demandId,\r\n        onClose\r\n    }) {\r\n\r\n    const [rel, setRel] = useState(null);\r\n\r\n    useEffect(() => {\r\n        relatedObjectServiceFunction(demandId).then((resp) => setRel(resp));\r\n    }, [demandId, relatedObjectServiceFunction])\r\n\r\n\r\n    return (\r\n        <>\r\n            <Dialog\r\n                title={Tr('related_objects')}\r\n                open={true}\r\n                maxWidth='sm'\r\n                onClose={onClose}\r\n                dialogActions={<SingleButton\r\n                    justify='flex-end'\r\n                    label={Tr('close')}\r\n                    onClick={onClose}\r\n                />}\r\n            >\r\n                {!rel ?\r\n                    <Loading/>\r\n                    :\r\n                    <>\r\n                        {!!rel.planItems && <DemandRelatedObjects label={Tr(\"plan_items\")} rels={rel.planItems}/>}\r\n                        {!!rel.purchaseRequests && <DemandRelatedObjects label={Tr(\"purchase_requests\")} rels={rel.purchaseRequests}/>}\r\n                        {!!rel.purchasingGroups && <DemandRelatedObjects label={Tr(\"purchase_groups\")} rels={rel.purchasingGroups}/>}\r\n                        {!!rel.demands && <DemandRelatedObjects label={Tr(\"procedures\")} rels={rel.demands}/>}\r\n                    </>\r\n                }\r\n            </Dialog>\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nDemandRelatedObjectsPopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    onClose: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default DemandRelatedObjectsPopup;","import React, {useEffect, useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport panels, {isInitialHidden} from './part1.panels.components'\r\nimport {setStepperState} from 'redux/actions'\r\nimport {connect} from 'react-redux'\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowUp'\r\nimport RefreshIcon from '@material-ui/icons/Refresh'\r\nimport MailIcon from '@material-ui/icons/Mail';\r\nimport ListIcon from '@material-ui/icons/List';\r\nimport DemandService from 'services/DemandService';\r\nimport PublishService from 'services/PublishService';\r\nimport ModificationService, {modify} from 'services/ModificationService';\r\nimport {isDemandModification, isDemandNew, isDemandOfferCollection, isDemandPreparing} from \"libs/getDemandStatus\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport Alert from \"components/popup/alert/Alert\";\r\nimport createButton, {createSubmitFormButton} from \"components/complex/floatingMenu/createButton\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport SaveIcon from \"@material-ui/icons/Save\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from 'translations/Translations';\r\n\r\nimport isCancelModificationButtonActive from \"libs/isCancelModificationButtonActive\";\r\nimport AccordionPart from \"pages/purchaser/MyProcedure/scenes/components/AccordionPart\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport reduxStore from \"redux/store\";\r\nimport DemandSectionsService from \"services/DemandSectionsService\";\r\nimport DemandRelatedObjectsPopup from \"components/popup/relatedObjects/DemandRelatedObjectsPopup\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport RfxRoundService from \"services/RfxRoundService\";\r\nimport NationalNoticeService from \"services/NationalNoticeService\";\r\n\r\n\r\nfunction Part1(\r\n    {\r\n        stepperState,\r\n        setStepperState,\r\n        steps,\r\n        match,\r\n        location,\r\n        demandValidation,\r\n        demandHeader,\r\n        ojsPublicationStatus,\r\n        bzpContractNoticeStatus,\r\n        rfxPrivileges = {},\r\n        demandPrivileges = {}\r\n    }) {\r\n\r\n    const [openCancelModificationPopup, setOpenCancelModificationPopup] = useState(false);\r\n    const [relatedObjectPopup, setRelatedObjectPopup] = useState(false);\r\n    const [working, setWorking] = useState(true);\r\n    const [openDemandPublicLinkPopup, setOpenDemandPublicLinkPopup] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    //const scrollPosition = useWindowScroll();\r\n    //const [nodeRef, topOffset] = useNodeTopPosition([scrollPosition]);\r\n    const id = match.params.id;\r\n\r\n    // eslint-disable-next-line\r\n    const isModification = useMemo(() => isDemandModification(), [demandHeader]);\r\n    // eslint-disable-next-line\r\n    const isPreparing = useMemo(() => isDemandPreparing(), [demandHeader]);\r\n    // eslint-disable-next-line\r\n    const isNew = useMemo(() => isDemandNew(), [demandHeader]);\r\n    // eslint-disable-next-line\r\n    const isExPost = useMemo(() => demandHeader && demandHeader.exPost, [demandHeader]);\r\n    // eslint-disable-next-line\r\n    const isOfferCollection = useMemo(() => isDemandOfferCollection(), [demandHeader]);\r\n\r\n\r\n    useEffect(() => {\r\n        DemandService.getValidate(id).then(() => setWorking(false));\r\n        if (id !== undefined && id > 0) {\r\n            DemandService.getBuyerPrivileges(id);\r\n            if (isPreparing === false && isNew === false && isExPost === false) {\r\n                StatisticsService.getCurrentRound(id).then((resp) => {\r\n                    if(resp) RfxRoundService.getBuyerPrivileges(resp.id);\r\n                })\r\n            }\r\n        }\r\n\r\n        return () => {\r\n            reduxStore.dispatch(setStepperState(null));\r\n            DemandSectionsService.clearDemandValidationResources();\r\n            HeaderService.clear();\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY)\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.RFX_PRIVILEGE_STORE_KEY)\r\n            StatisticsService.clearCurrentRound();\r\n        };\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    useEffect(() => {\r\n        if (id !== undefined && id > 0) {\r\n\r\n            if (isPreparing) {\r\n                if (demandHeader?.noticeOjsType === true) {\r\n                    PublishService.checkPublishOjs(id);\r\n                } else if(demandHeader?.noticeBzpType === true) {\r\n                    NationalNoticeService.getContractNoticeStatus(id);\r\n                }\r\n            } else if (isModification) {\r\n                if (demandHeader?.noticeOjsType === true) {\r\n                    ModificationService.noticeOjsStatus(id);\r\n                } else if(demandHeader?.noticeBzpType === true) {\r\n                    NationalNoticeService.getContractModificationNoticeStatus(id);\r\n                }\r\n                ModificationService.isDemandChanged(id)\r\n            }\r\n        }\r\n        return () => {\r\n            PublishService.clearOjsStatus();\r\n            NationalNoticeService.clearResources(NationalNoticeService.BZP_CONTRACT_NOTICE_STATUS);\r\n            ModificationService.clearDemandChanged();\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [id, demandHeader])\r\n\r\n\r\n    const handleModifyClick = () => {\r\n        setWorking(true);\r\n        modify(id).then(() => {\r\n            if (stepperState !== null) {\r\n                setStepperState(null);\r\n            }\r\n            DemandService.getValidate(id).then(() => setWorking(false));\r\n        });\r\n    };\r\n\r\n    const updateDemandNumber = () => {\r\n        setWorking(true);\r\n        DemandService.updateNumber(id).then((resp) => {\r\n            if (resp.result) {\r\n                setWorking(false);\r\n                HeaderService.get(id);\r\n                enqueueSuccessSnackbar(Tr('update_demand_number_success'));\r\n            }\r\n        });\r\n    }\r\n\r\n    const getNavigationBarButtons = () => {\r\n        const buttons = [];\r\n        if (id) {\r\n            buttons.push(createButton('email_list', () => {\r\n                const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_EMAIL_LIST_ID, {id: id});\r\n                RouterPath.redirect(href)\r\n            }, undefined, MailIcon, 'primary', false, true));\r\n\r\n            if (demandHeader && (demandHeader.hasPlanItems || demandHeader.hasPurchaseRequests)) {\r\n                buttons.push(createButton('related_objects', () => setRelatedObjectPopup(true),\r\n                    \"outlined\", ListIcon, 'primary', false, true));\r\n\r\n            }\r\n        }\r\n\r\n        if (!isExPost) {\r\n            if (isPreparing && demandHeader && demandHeader.demandPublicLink) {\r\n                buttons.push(createButton('demand_public_link_button', () => {\r\n                    setOpenDemandPublicLinkPopup(true);\r\n                }, undefined, undefined, 'primary', false, true));\r\n            }\r\n\r\n            if (isModification) {\r\n                buttons.push(createButton(\"modification_cancel\", () => {\r\n                    setOpenCancelModificationPopup(true)\r\n                }, undefined, undefined, 'primary', !isCancelModificationButtonActive(demandValidation, ojsPublicationStatus, bzpContractNoticeStatus)));\r\n            }\r\n\r\n            if (isOfferCollection) {\r\n                buttons.push(createButton(\"modify\", handleModifyClick, undefined, undefined, \"primary\", (!demandPrivileges.MODIFY || !demandHeader || !isOfferCollection)));\r\n            }\r\n        }\r\n\r\n        if (demandHeader && demandHeader.showUpdateNumber && demandPrivileges.EDIT) {\r\n            buttons.push(createButton(\"update_number\",\r\n                updateDemandNumber,\r\n                undefined,\r\n                RefreshIcon,\r\n                'primary',\r\n                stepperState !== null,\r\n                false)\r\n            );\r\n        }\r\n\r\n        const isSaveButton = isNew || isPreparing || isModification || !stepperState || stepperState === \"mp_1_siwz\" || stepperState === \"mp_1_espd\" || stepperState === \"mp_1_commission\" || stepperState === \"mp_1_preparing_additional_info\";\r\n\r\n        buttons.push(createSubmitFormButton(isSaveButton ? \"save\" : \"close\",\r\n            undefined,\r\n            isSaveButton ? SaveIcon : ArrowIcon,\r\n            'primary',\r\n            stepperState === null,\r\n            isSaveButton)\r\n        );\r\n\r\n        return buttons;\r\n    }\r\n\r\n\r\n    const navigationBarButtons = getNavigationBarButtons();\r\n\r\n    const rp = RouterPath.myProcedure;\r\n    const handleConfirmCancelModification = () => {\r\n        setOpenCancelModificationPopup(false);\r\n        setWorking(true);\r\n        ModificationService.cancel(id).then((resp) => {\r\n            if (resp) {\r\n                setWorking(false);\r\n                const href = RouterPath.createPath(rp.steps.MP_2_ID, {id});\r\n                RouterPath.redirect(href);\r\n            }\r\n        });\r\n    };\r\n\r\n    const filterSteps = () => {\r\n        const params = new URLSearchParams(location.search);\r\n        return steps.filter(x => !isInitialHidden(x, params.get(\"procedureType\"), params.get(\"passive\"), params.get(\"exPost\")))\r\n    }\r\n\r\n    const stepsFiltered = !!id ? steps : filterSteps();\r\n\r\n    return (<>\r\n            <AccordionPart working={working} navigationBarButtons={navigationBarButtons} steps={stepsFiltered} panels={panels}/>\r\n            <Confirm\r\n                open={openCancelModificationPopup}\r\n                onConfirm={handleConfirmCancelModification}\r\n                onCancel={() => setOpenCancelModificationPopup(false)}\r\n                confirmText=\"modification_cancel_popup_text\"\r\n            />\r\n            {demandHeader &&\r\n            <Alert\r\n                title='demand_public_link'\r\n                open={openDemandPublicLinkPopup}\r\n                onClose={() => setOpenDemandPublicLinkPopup(false)}\r\n                confirmText={demandHeader.demandPublicLink || \"\"}\r\n                maxWidth='md'\r\n            />\r\n            }\r\n            {\r\n                relatedObjectPopup &&\r\n                <DemandRelatedObjectsPopup demandId={id} onClose={() => setRelatedObjectPopup(false)}/>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nPart1.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    stepperState: state.stepper.state,\r\n    steps: state.stepper.steps[0].steps,\r\n    demandValidation: state.resources.demandValidation,\r\n    form: state.form,\r\n    ojsPublicationStatus: state.resources.ojsPublicationStatus,\r\n    bzpContractNoticeStatus: state.resources.bzpContractNoticeStatus,\r\n    rfxPrivileges: state.privileges[PrivilegeService.RFX_PRIVILEGE_STORE_KEY],\r\n    demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY],\r\n}), {\r\n    setStepperState\r\n})(Part1);","import React from 'react'\r\nimport {Grid, Paper} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport {withStyles, withTheme} from '@material-ui/styles';\r\nimport clsx from 'clsx';\r\nimport Title from './Title';\r\nimport useNodeTopPosition from 'hooks/useNodeTopPosition';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        '&>*': {\r\n            marginBottom: theme.spacing(4),\r\n        }\r\n    },\r\n    fullHeight: {\r\n        height: '100%',\r\n    },\r\n    paper: theme.components.paper,\r\n    progressItem: {\r\n        top: 100,\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n    }\r\n})\r\n\r\nfunction Workspace(\r\n    {\r\n        title,\r\n        className,\r\n        children,\r\n        classes,\r\n        render,\r\n        fullHeight\r\n    }) {\r\n\r\n    const [nodeRef] = useNodeTopPosition()\r\n\r\n    return (\r\n        <Grid\r\n            ref={nodeRef}\r\n            container\r\n            direction='column'\r\n            className={clsx({\r\n                    [classes.fullHeight]: fullHeight\r\n                },\r\n                classes.root,\r\n                className\r\n            )}\r\n        >\r\n            {title &&\r\n            <Grid item>\r\n                <Title>\r\n                    {title}\r\n                </Title>\r\n            </Grid>}\r\n\r\n            {\r\n                render &&\r\n                <Grid item>\r\n                    {render}\r\n                </Grid>\r\n            }\r\n            {\r\n                children &&\r\n                <Grid item>\r\n                    <Paper className={classes.paper}>\r\n                        {children}\r\n                    </Paper>\r\n                </Grid>\r\n            }\r\n        </Grid>\r\n    )\r\n}\r\n\r\nWorkspace.propTypes = {\r\n    className: PropTypes.string,\r\n    title: PropTypes.string,\r\n    children: PropTypes.any,\r\n    render: PropTypes.any,\r\n    fullHeight: PropTypes.bool,\r\n}\r\n\r\nWorkspace.propDefault = {\r\n    fullHeight: true,\r\n}\r\n\r\nexport default withTheme(withStyles(style)(Workspace));\r\n","import { useState, useRef, useEffect } from 'react'\r\n\r\nexport default (params = []) => {\r\n\tconst rootRef = useRef();\r\n\tconst [topOffset, setTopOffset] = useState(0)\r\n\r\n\tuseEffect(() => {\r\n\t\tif (rootRef.current) {\r\n\t\t\tsetTopOffset(rootRef.current.offsetTop)\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [rootRef, ...params])\r\n\r\n\treturn [rootRef, topOffset]\r\n}","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Workspace from 'components/Workspace';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Title from 'components/Title';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ttitle: {\r\n\t\tmarginBottom: theme.spacing(1)\r\n\t}\r\n})\r\n\r\nfunction Section({\r\n\tclasses,\r\n\ttitle,\r\n\tchildren,\r\n\ttitleAdditional,\r\n}) {\r\n\treturn (\r\n\t\t<Workspace\r\n\t\t\tclassName={classes.root}\r\n\t\t>\r\n\t\t\t<GridBlock column>\r\n\t\t\t\t<GridBlock justify='space-between'>\r\n\t\t\t\t\t<Title className={classes.title}>\r\n\t\t\t\t\t\t{title}\r\n\t\t\t\t\t</Title>\r\n\t\t\t\t\t{titleAdditional}\r\n\t\t\t\t</GridBlock>\r\n\t\t\t\t{children}\r\n\t\t\t</GridBlock>\r\n\t\t</Workspace>\r\n\t)\r\n}\r\n\r\nSection.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(Section);","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\n\r\nexport const RESOURCE_ID = 'rfxSupplier';\r\n\r\nexport const clearSuppliers = () => {\r\n    reduxStore.dispatch(clearResource(RESOURCE_ID));\r\n}\r\nexport const getSuppliers = async (demandId, roundId, pagination ) => {\r\n\r\n    const params = {\r\n        ...pagination\r\n    }\r\n\r\n    try {\r\n\r\n        const res = await RestRequestGET(Endpoints.SUPPLIERS_LIST(demandId, roundId), {params});\r\n\r\n        if (pagination.page > 1) {\r\n            const state = reduxStore.getState();\r\n            if (state?.resources?.rfxSupplier) {\r\n                const res2 = {\r\n                    ...res,\r\n                    items: [...state.resources.rfxSupplier.items, ...res.items],\r\n                }\r\n                reduxStore.dispatch(setResource(RESOURCE_ID, res2));\r\n                return;\r\n            }\r\n        }\r\n        reduxStore.dispatch(setResource(RESOURCE_ID, res));\r\n\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst add = async (demandId, roundId, values) => {\r\n    try {\r\n        return await RestRequestPOST(Endpoints.SUPPLIERS_ADD(demandId, roundId), values)\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst invite = async (demandId, roundId, values) => {\r\n    try {\r\n        return await RestRequestPOST(Endpoints.SUPPLIERS_INVITE(demandId, roundId), values)\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst changeExternalSign = async (demandId, roundId, supplierId) => {\r\n    try {\r\n        const res = await RestRequestPOST(Endpoints.SUPPLIERS_CHANGE_EXTERNAL_SIGN(demandId, roundId, supplierId));\r\n        const state = reduxStore.getState();\r\n        if (state?.resources?.rfxSupplier && res !== null) {\r\n            const suppliers = state.resources.rfxSupplier;\r\n            const suppliers2 = {\r\n                ...suppliers,\r\n                items: suppliers.items.map((item) => item.id === res.id ? res : item)\r\n            }\r\n            reduxStore.dispatch(setResource(RESOURCE_ID, suppliers2));\r\n        }\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nexport default {\r\n    invite,\r\n    add,\r\n    getSuppliers,\r\n    clearSuppliers,\r\n    changeExternalSign,\r\n    RESOURCE_ID\r\n}","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Section from '../components/Section';\r\nimport {withRouter} from \"react-router\";\r\nimport RfxSupplierService from \"services/RfxSupplierService\";\r\nimport {connect} from \"react-redux\";\r\nimport Tr from \"translations/Translations\";\r\nimport Loading from \"components/Loading\";\r\nimport MoreButton from \"components/button/MoreButton\"\r\nimport ContractorTable from \"components/complex/contractor/ContractorTable\";\r\nimport AddContactor from \"components/popup/addContactor/AddContactor\";\r\nimport InviteContactor from 'components/popup/inviteContactor/InviteContactor';\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport {Typography} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport makeStyles from \"@material-ui/core/styles/makeStyles\";\r\nimport Dialog from \"components/Dialog\";\r\nimport useSearch, {getPaginationConfig} from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    dropzone: {\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nfunction ContractorSection(\r\n    {\r\n        demandStatistics,\r\n        currentRfxRound,\r\n        match,\r\n        supplier,\r\n        rfxPrivileges,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const demandId = match.params.id;\r\n\r\n    const [supplierLoading, setSupplierLoading] = useState(true);\r\n    const [externalOfferSignConfirm, setExternalOfferSignConfirm] = useState([false, '']);\r\n    const [invitePopup, setInvitePopup] = useState(false);\r\n    const [addPopup, setAddPopup] = useState(false);\r\n\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig} = useSearch();\r\n\r\n\r\n    useEffect(() => {\r\n        if (!!supplier && !!demandStatistics) {\r\n            if (supplier.totalCount !== demandStatistics.numberOfSuppliers) {\r\n                const loadedRows = supplier.items.length;\r\n                const {pagination} = searchData;\r\n                let curPageSize = loadedRows < pagination.pageSize ? pagination.pageSize : loadedRows;\r\n                RfxSupplierService.getSuppliers(demandId, currentRfxRound.id, getPaginationConfig(1, curPageSize));\r\n            }\r\n\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandStatistics])\r\n\r\n    useEffect(() => {\r\n        return () => RfxSupplierService.clearSuppliers()\r\n    }, [demandId, currentRfxRound])\r\n\r\n\r\n    useEffect(() => {\r\n        if (currentRfxRound?.id) {\r\n            setSupplierLoading(true);\r\n            const {pagination} = searchData;\r\n            RfxSupplierService.getSuppliers(demandId, currentRfxRound.id, pagination).then(() => (setSupplierLoading(false)));\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [searchData, currentRfxRound?.id])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (supplier?.totalCount !== undefined) {\r\n            setTotalCount(supplier.totalCount)\r\n        }\r\n    }, [supplier?.totalCount]);\r\n\r\n    const addContractorsTab = (data) => {\r\n        setSupplierLoading(true);\r\n        RfxSupplierService.add(demandId, currentRfxRound.id, data.platformAdded).then(() => {\r\n            setPaginationConfig({...searchData.pagination, page: 1})\r\n        });\r\n        setAddPopup(false);\r\n    }\r\n\r\n    const handleExternalSign = (item) => {\r\n        RfxSupplierService.changeExternalSign(demandId, currentRfxRound.id, item.id).then(response => {\r\n            if (response != null)\r\n                setExternalOfferSignConfirm([true, 'supplier_externalOfferSign_' + (response.externalOfferSign ? 'enabled' : 'disabled')]);\r\n        });\r\n    };\r\n\r\n    const handleInvite = (values) => {\r\n        setSupplierLoading(true);\r\n        RfxSupplierService.invite(demandId, currentRfxRound.id, values).then(() => {\r\n            setPaginationConfig({...searchData.pagination, page: 1})\r\n        });\r\n        setInvitePopup(false);\r\n    };\r\n\r\n    return (\r\n        <div id=\"contractorSection\">\r\n            <Section\r\n                title={Tr('contractors')}\r\n            >\r\n                {(!!supplier && !!currentRfxRound) &&\r\n                <>\r\n                    {!!rfxPrivileges.ADD_CONTRACTOR && !currentRfxRound.offerCollectionEnded &&\r\n                    <GridBlock>\r\n                        <Button\r\n                            onClick={() => setAddPopup(true)}\r\n                        >\r\n                            {Tr('add_contractor')}\r\n                        </Button>\r\n                        <Button\r\n                            className={classes.marginLeft}\r\n                            onClick={() => setInvitePopup(true)}\r\n                        >\r\n                            {Tr('suggest_contractor')}\r\n                        </Button>\r\n                    </GridBlock>\r\n                    }\r\n                    <ContractorTable\r\n                        contractors={supplier}\r\n                        handleExternalSign={handleExternalSign}\r\n                        showJoinDate={!!demandHeader.formType}\r\n                    />\r\n\r\n                    {supplierLoading && <Loading/>}\r\n\r\n                    <MoreButton\r\n                        config={searchData.pagination}\r\n                        setConfig={setPaginationConfig}\r\n                        totalCount={totalCount}\r\n                        loadedCount={supplier.items.length}\r\n                        captionTrKey='showing_x_of_y_suppliers'\r\n                        disabled={supplierLoading || !(currentRfxRound && currentRfxRound.id)}\r\n                    />\r\n\r\n                    {invitePopup && <InviteContactor\r\n                        demandId={demandId}\r\n                        open\r\n                        onClose={() => setInvitePopup(false)}\r\n                        contractorList={supplier}\r\n                        handleInvite={handleInvite}\r\n                        collectPostCode\r\n                        collectAddress\r\n                        addressRequired={false}\r\n                        collectCity\r\n                        cityRequired={false}\r\n                    />}\r\n                    {addPopup && <AddContactor\r\n                        demandId={match.params.id}\r\n                        onClose={() => setAddPopup(false)}\r\n                        addContractorsTab={addContractorsTab}\r\n                    />}\r\n                </>\r\n                }\r\n            </Section>\r\n\r\n            <Dialog\r\n                open={Boolean(externalOfferSignConfirm[0])}\r\n            >\r\n                <Typography>\r\n                    {Tr(externalOfferSignConfirm[1])}\r\n                </Typography>\r\n                <div className={clsx(classes.buttonRow, classes.dropzone)}>\r\n                    <Button\r\n                        onClick={() => setExternalOfferSignConfirm(false)}\r\n                    >\r\n                        {Tr('close')}\r\n                    </Button>\r\n                </div>\r\n            </Dialog>\r\n        </div>\r\n    )\r\n}\r\n\r\nContractorSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    supplier: state.resources[RfxSupplierService.RESOURCE_ID]\r\n}), {})(withRouter(ContractorSection));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Section from '../components/Section';\r\nimport {withRouter} from \"react-router\";\r\nimport Tr from \"translations/Translations\";\r\nimport Offers from \"components/complex/offer/Offers\";\r\n\r\n\r\nfunction OfferSection(\r\n    {\r\n\r\n        match,\r\n\r\n    }) {\r\n\r\n\r\n    return (\r\n        <div id=\"offersSection\">\r\n            <Section\r\n                title={Tr('offers')}\r\n            >\r\n                <Offers demandId={match.params.id}/>\r\n            </Section>\r\n        </div>\r\n    )\r\n}\r\n\r\nOfferSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withRouter(OfferSection);","import React from 'react';\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n    root: {\r\n        position: 'relative'\r\n    },\r\n    label: {\r\n        position: 'absolute',\r\n        width: '100%',\r\n        height: '100%',\r\n        textAlign: 'center',\r\n        color: theme.palette.text.primary\r\n    },\r\n    number: {\r\n        fontSize: \"3rem\",\r\n        //lineHeight: 1.6,\r\n    },\r\n    unit: {\r\n        fontSize: \"1rem\",\r\n        lineHeight: 1,\r\n    },\r\n    circle: {\r\n        transition: \"0.35s stroke-dashoffset\",\r\n        // axis compensation\r\n        transform: \"rotate(-90deg)\",\r\n        transformOrigin: \"50% 50%\",\r\n        stroke: theme.palette.text.primary,\r\n        fill: 'transparent',\r\n    }\r\n}));\r\nconst ProgressRing = (\r\n    {\r\n        number,\r\n        unit,\r\n        percent = 0,\r\n        width = 120,\r\n        borderWidth = 2,\r\n    }\r\n) => {\r\n\r\n    const classes = useStyles();\r\n    const center = (width / 2);\r\n    const radius = center - (2 * borderWidth);\r\n    const circumference = radius * 2 * Math.PI;\r\n\r\n    const offset = circumference - (percent / 100 * circumference);\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <div className={classes.label}>\r\n                <Typography className={classes.number} variant=\"subtitle1\">\r\n                    {number}\r\n                </Typography>\r\n                <Typography className={classes.unit} variant=\"subtitle2\">\r\n                    {unit}\r\n                </Typography>\r\n            </div>\r\n            <svg\r\n                className={classes.ring}\r\n                width={width}\r\n                height={width}>\r\n                <circle\r\n                    className={classes.circle}\r\n                    strokeWidth={borderWidth}\r\n                    r={radius}\r\n                    cx={center}\r\n                    cy={center}\r\n                    strokeDasharray={`${circumference} ${circumference}`}\r\n                    strokeDashoffset={offset}\r\n                />\r\n\r\n                <circle\r\n                    className={classes.circle}\r\n                    strokeWidth=\"1\"\r\n                    r={radius}\r\n                    cx={center}\r\n                    cy={center}/>\r\n\r\n            </svg>\r\n        </div>\r\n    );\r\n};\r\n\r\nexport default ProgressRing;","import React, {useEffect, useState} from 'react';\r\nimport ProgressRing from \"./ProgressRing\";\r\nimport {getDays, getDaysHoursMinutesSeconds} from \"libs/durations\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Typography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n    title: {\r\n        marginBottom: theme.spacing(1),\r\n        color: theme.palette.text.primary,\r\n    }\r\n}));\r\n\r\nconst RingCountdown = (\r\n    {\r\n        duration = 0,\r\n        baseDuration = 0,\r\n        endTimeCallback = () => {\r\n        },\r\n        title\r\n    }) => {\r\n    const classes = useStyles();\r\n\r\n    const [days, setDays] = useState([0, 0]);\r\n    const [hours, setHours] = useState([0, 0]);\r\n    const [minutes, setMinutes] = useState([0, 0]);\r\n    const [seconds, setSeconds] = useState([0, 0]);\r\n\r\n    const [baseDays, setBaseDays] = useState(1);\r\n\r\n    const [durationLeft, setDurationLeft] = useState(-1);\r\n\r\n    useEffect(() => {\r\n        const arr = getDaysHoursMinutesSeconds(durationLeft);\r\n        setPeriods(arr);\r\n        // eslint-disable-next-line\r\n    }, [durationLeft]);\r\n\r\n    const setPeriods = (arr) => {\r\n\r\n        const dayPercent = baseDays === 0 ? 0 : Math.floor(arr[0] / baseDays * 100);\r\n        let hourPercent = 100;\r\n        let minutePercent = 100;\r\n        let secondsPercent = 100;\r\n\r\n        if (dayPercent === 0) {\r\n            hourPercent = Math.floor(arr[1] / 24 * 100);\r\n            if (hourPercent === 0) {\r\n                minutePercent = Math.floor(arr[2] / 60 * 100);\r\n                if (minutePercent === 0) {\r\n                    secondsPercent = Math.floor(arr[3] / 60 * 100);\r\n                }\r\n            }\r\n        }\r\n\r\n        setDays([arr[0], dayPercent]);\r\n        setHours([arr[1], hourPercent]);\r\n        setMinutes([arr[2], minutePercent]);\r\n        setSeconds([arr[3], secondsPercent]);\r\n    }\r\n\r\n    useEffect(() => {\r\n            const arr = getDaysHoursMinutesSeconds(duration);\r\n            if (duration <= 0) {\r\n                setPeriods(arr);\r\n                return undefined;\r\n            }\r\n\r\n            const baseDays = getDays(baseDuration);\r\n            setBaseDays(baseDays);\r\n\r\n            const endTime = Math.floor(new Date().getTime() / 1000) + duration;\r\n\r\n            const intervalFunction = (endTime) => () => {\r\n                setDurationLeft((durationLeft) => {\r\n                    const newSeconds = endTime - Math.floor(new Date().getTime() / 1000);\r\n                    if (newSeconds !== durationLeft) {\r\n                        if (durationLeft === 0) {\r\n                            endTimeCallback();\r\n                            clearInterval(interval);\r\n                        }\r\n                        return newSeconds;\r\n                    }\r\n                    return durationLeft;\r\n                })\r\n            }\r\n            const interval = setInterval(intervalFunction(endTime), 200);\r\n\r\n            return () => {\r\n                clearInterval(interval);\r\n            }\r\n            // eslint-disable-next-line\r\n        }, [duration, baseDuration]\r\n    )\r\n\r\n    return (\r\n        <>\r\n            <GridBlock justify=\"center\" className={classes.title}>\r\n                <Typography>{title}</Typography>\r\n            </GridBlock>\r\n            <GridBlock justify=\"center\">\r\n                <ProgressRing number={days[0]} percent={days[1]} unit='dni' borderWidth={5}/>\r\n                <ProgressRing number={hours[0]} percent={hours[1]} unit='h' borderWidth={5}/>\r\n                <ProgressRing number={minutes[0]} percent={minutes[1]} unit='min' borderWidth={5}/>\r\n                <ProgressRing number={seconds[0]} percent={seconds[1]} unit='sec' borderWidth={5}/>\r\n            </GridBlock>\r\n\r\n        </>\r\n    );\r\n};\r\n\r\nexport default RingCountdown;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport moment from \"libs/moment\";\r\nimport RingCountdown from \"components/complex/countdown/RingCountdown\";\r\nimport Workspace from \"components/Workspace\";\r\nimport Tr from \"../../../../../../translations/Translations\";\r\n\r\nfunction StatisticSection(\r\n    {\r\n        endTimeCallback,\r\n        currentRfxRound\r\n    }) {\r\n\r\n\r\n    const [durations, setDurations] = useState([]);\r\n\r\n\r\n    useEffect(() => {\r\n        if (!currentRfxRound) {\r\n            return;\r\n        }\r\n        const end = moment(currentRfxRound.offerEndDate);\r\n        const nowTime = moment(currentRfxRound.now);\r\n        if (currentRfxRound.offerCollectionEnded) {\r\n            setDurations([0, 0]);\r\n            return;\r\n        }\r\n\r\n        const duration2 = moment.duration(end.diff(nowTime));\r\n        const number = duration2.asSeconds();\r\n\r\n        const startTime = moment(currentRfxRound.offerStartDate);\r\n        const startDuration = moment.duration(end.diff(startTime));\r\n        const startNumber = startDuration.asSeconds();\r\n\r\n        setDurations([number, startNumber]);\r\n    }, [currentRfxRound]);\r\n\r\n    return (\r\n        <Workspace\r\n            render={\r\n                <>\r\n                    {!durations.length || <RingCountdown duration={durations[0]} baseDuration={durations[1]} endTimeCallback={endTimeCallback} title={Tr(\"left_to_offer_end_date\")}/>}\r\n                </>}/>\r\n    )\r\n\r\n}\r\n\r\nStatisticSection.propTypes = {\r\n    demandStatistics: PropTypes.object,\r\n    endTimeCallback: PropTypes.func,\r\n}\r\n\r\nStatisticSection.defaultProps = {\r\n    endTimeCallback: () => {\r\n    },\r\n}\r\n\r\nexport default StatisticSection;","import React from 'react';\r\nimport {Grid, makeStyles} from \"@material-ui/core\";\r\nimport Accordion from '@material-ui/core/Accordion';\r\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\r\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\r\nimport AccordionActions from '@material-ui/core/AccordionActions';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Divider from '@material-ui/core/Divider';\r\nimport clsx from 'clsx';\r\nimport ErrorIcon from \"@material-ui/icons/Error\";\r\nimport CheckCircleIcon from \"@material-ui/icons/CheckCircle\";\r\nimport PlaylistAddRoundedIcon from '@material-ui/icons/PlaylistAddRounded';\r\nimport PlaylistAddCheckRoundedIcon from '@material-ui/icons/PlaylistAddCheckRounded';\r\nimport ProgressBar from \"components/ProgressBar\";\r\nimport PropTypes from \"prop-types\";\r\nimport Button from \"components/Button\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(4)\r\n    },\r\n\r\n    summary: {\r\n        margin: theme.spacing(0),\r\n        padding: theme.spacing(0),\r\n    },\r\n    summaryContent: {\r\n        margin: theme.spacing(0) + \" !important\",\r\n    },\r\n    summaryButton: {\r\n        margin: theme.spacing(0),\r\n    },\r\n    summaryGrid: {\r\n        cursor: 'auto',\r\n        userSelect: 'text',\r\n        padding: theme.spacing(1)\r\n    },\r\n    gridItemCommon: {\r\n        padding: theme.spacing(1),\r\n        display: 'flex',\r\n        alignItems: 'center',\r\n    },\r\n    gridItemButton: {\r\n        justifyContent: 'flex-end',\r\n    },\r\n    icon: {\r\n        fontSize: '3rem',\r\n    },\r\n    iconWait: {\r\n        color: theme.palette.common.error\r\n    },\r\n    iconWaitOptional: {\r\n        color: theme.palette.common.info\r\n    },\r\n    iconFinish: {\r\n        color: theme.palette.common.success\r\n    },\r\n}));\r\n\r\nconst ExpansionProgressPanel = (\r\n    {\r\n        iconWait,\r\n        iconFinish,\r\n        title,\r\n        progress,\r\n        queue,\r\n        progressAtlText,\r\n        showProgress = true,\r\n        optional,\r\n        buttonText,\r\n        buttonDisabled,\r\n        onButtonClick = () => {\r\n        },\r\n        details,\r\n        actions,\r\n        alwaysExpanded,\r\n        expanded\r\n\r\n    }) => {\r\n        const classes = useStyles();\r\n\r\n        const IconWait = iconWait || (optional ? PlaylistAddRoundedIcon : ErrorIcon);\r\n        const IconFinish = iconFinish || (optional ? PlaylistAddCheckRoundedIcon : CheckCircleIcon);\r\n\r\n        return (<>\r\n            <div className={classes.root}>\r\n                <Accordion defaultExpanded={alwaysExpanded} expanded={alwaysExpanded || expanded}>\r\n                    <AccordionSummary\r\n                        className={classes.summary}\r\n                        classes={{content: classes.summaryContent, expanded: classes.summaryExpanded, expandIcon: classes.summaryButton}}\r\n                        aria-controls=\"panel1c-content\"\r\n                        id=\"panel1c-header\"\r\n                    >\r\n                        <Grid\r\n                            container\r\n                            className={classes.summaryGrid}\r\n                            onClick={event => event.stopPropagation()}\r\n                            onFocus={event => event.stopPropagation()}\r\n                        >\r\n                            <Grid\r\n                                item\r\n                                className={classes.gridItemCommon}\r\n                            >\r\n                                {(!progress || progress < 100) &&\r\n                                <IconWait className={clsx(classes.icon, optional ? classes.iconWaitOptional : classes.iconWait)}/>}\r\n                                {progress >= 100 && <IconFinish className={clsx(classes.icon, classes.iconFinish)}/>}\r\n                            </Grid>\r\n\r\n                            <Grid\r\n                                item\r\n                                xs\r\n                                className={classes.gridItemCommon}>\r\n                                <Typography variant='h5'>\r\n                                    {title}{!optional && \"*\"}\r\n                                </Typography>\r\n                            </Grid>\r\n\r\n                            {showProgress && !progressAtlText && progress != null && (!queue || queue === 0) &&\r\n                            <Grid\r\n                                item\r\n                                xs={3}\r\n                                className={classes.gridItemCommon}\r\n                            >\r\n                                <ProgressBar max={100} value={progress}/>\r\n                            </Grid>\r\n                            }\r\n\r\n                            {showProgress && !progressAtlText && progress != null && !!queue && queue > 0 &&\r\n                            <Grid\r\n                                item\r\n                                xs={3}\r\n                                className={classes.gridItemCommon}\r\n                            >\r\n                                <Typography>{queue + ' ' + Tr('in_queue')}</Typography>\r\n                            </Grid>\r\n                            }\r\n\r\n                            {showProgress && progressAtlText &&\r\n                            <Grid\r\n                                item\r\n                                xs={3}\r\n                                className={classes.gridItemCommon}\r\n                            >\r\n                                <Typography>{progressAtlText}</Typography>\r\n                            </Grid>\r\n                            }\r\n\r\n                            {buttonText && <Grid\r\n                                item\r\n                                xs={3}\r\n                                className={clsx(classes.gridItemCommon, classes.gridItemButton)}\r\n                            >\r\n                                <Button\r\n                                    size='large'\r\n                                    color={optional ? 'primary' : 'secondary'}\r\n                                    disabled={buttonDisabled}\r\n                                    onClick={onButtonClick}\r\n                                >\r\n                                    {buttonText}\r\n                                </Button>\r\n                            </Grid>}\r\n                        </Grid>\r\n                    </AccordionSummary>\r\n\r\n\r\n                    {details && <>\r\n                        <Divider/>\r\n                        <AccordionDetails className={classes.details}>\r\n                            {details}\r\n                        </AccordionDetails>\r\n                    </>}\r\n\r\n                    {actions && <>\r\n                        <Divider/>\r\n                        <AccordionActions>\r\n                            {actions}\r\n                        </AccordionActions>\r\n                    </>}\r\n                </Accordion>\r\n            </div>\r\n        </>);\r\n    }\r\n;\r\n\r\nExpansionProgressPanel.propTypes = {\r\n    iconWait: PropTypes.object,\r\n    iconFinish: PropTypes.object,\r\n    optional: PropTypes.bool,\r\n    title: PropTypes.string,\r\n    progress: PropTypes.number,\r\n    queue: PropTypes.number,\r\n    buttonText: PropTypes.string,\r\n    buttonDisabled: PropTypes.bool,\r\n    onButtonClick: PropTypes.func,\r\n    details: PropTypes.object,\r\n    actions: PropTypes.object\r\n}\r\n\r\nExpansionProgressPanel.defaultProps = {}\r\nexport default ExpansionProgressPanel;","import React, {useEffect, useRef, useState} from 'react';\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Tr from \"translations/Translations\";\r\nimport ExpansionProgressPanel from \"./ExpansionProgressPanel\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport {connect} from \"react-redux\";\r\nimport {Typography} from \"@material-ui/core\";\r\nimport ProgressStatus from \"../../../../../../constants/ProgressStatus\";\r\n\r\nconst OfferDecryptionProgress = (\r\n    {\r\n        demandId,\r\n        roundId,\r\n        rfxOfferDecryptionStatus\r\n    }) => {\r\n    const [progress, setProgress] = useState([0, 0]);\r\n    const [working, setWorking] = useState(false);\r\n    const progressInterval = useRef(0);\r\n    const statusInterval = useRef(0);\r\n\r\n    useEffect(() => {\r\n\r\n        RfxOfferService.getOffersDecryptionStatus(roundId).then(resp => {\r\n            if (resp.status === ProgressStatus.IN_PROGRESS) {\r\n                startProgressInterval();\r\n            }\r\n\r\n            if (resp.status === ProgressStatus.PROCESSED) {\r\n                setProgress([100, 0]);\r\n            }\r\n        });\r\n\r\n        return () => {\r\n            if (progressInterval.current) clearInterval(progressInterval.current);\r\n            if (statusInterval.current) clearInterval(statusInterval.current);\r\n        }\r\n        //eslint-disable-next-line\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n\r\n        if (ProgressStatus.PROCESSED === rfxOfferDecryptionStatus.status) {\r\n            const rp = RouterPath.myProcedure;\r\n            RouterPath.redirect(RouterPath.createPath(rp.steps.MP_3_ID, {id: demandId}))\r\n        }\r\n\r\n    }, [rfxOfferDecryptionStatus, demandId])\r\n\r\n    const startProgressInterval = () => {\r\n\r\n        progressInterval.current = setInterval(async () => {\r\n            const resp = await RfxOfferService.getOffersDecryptionProgress(roundId);\r\n            setProgress(resp.result);\r\n            if (resp.result[0] === 100) {\r\n                clearInterval(progressInterval.current);\r\n                progressInterval.current = 0;\r\n                startOfferDecryptionStatusInterval();\r\n            }\r\n\r\n        }, 3000);\r\n    };\r\n\r\n    const startOfferDecryptionStatusInterval = () => {\r\n        statusInterval.current = setInterval(async () => {\r\n            const resp = RfxOfferService.getOffersDecryptionStatus(roundId);\r\n            if (resp.status === ProgressStatus.PROCESSED) {\r\n                clearInterval(statusInterval.current);\r\n                statusInterval.current = 0;\r\n            }\r\n        }, 3000);\r\n    };\r\n\r\n    const onDecryptionStart = () => {\r\n        setWorking(true);\r\n        RfxOfferService.startOffersDecryptionProcess(roundId)\r\n            .then(() => {\r\n                RfxOfferService.getOffersDecryptionStatus(roundId).then(() => startProgressInterval());\r\n            });\r\n    };\r\n\r\n    const openOffers = () => {\r\n        RfxOfferService.startOffersDecryptionProcess(roundId)\r\n            .then(() => {\r\n                const rp = RouterPath.myProcedure;\r\n                RouterPath.redirect(RouterPath.createPath(rp.steps.MP_3_ID, {id: demandId}));\r\n            });\r\n    }\r\n\r\n    const getDetails = () => {\r\n            if (rfxOfferDecryptionStatus?.errors?.length) {\r\n                return <><div>\r\n                    {rfxOfferDecryptionStatus.errors.map(x => {\r\n                            return <Typography key={x} color='error'>{Tr(x)}</Typography>\r\n                        }\r\n                    )}\r\n                </div>\r\n                </>\r\n            }\r\n            if (rfxOfferDecryptionStatus?.warnings?.length) {\r\n                return <><div>\r\n                    {rfxOfferDecryptionStatus.warnings.map(x => {\r\n                            return <Typography key={x} color='textSecondary'>{Tr(x)}</Typography>\r\n                        }\r\n                    )}\r\n                </div>\r\n                </>\r\n            }\r\n    };\r\n\r\n    return (\r\n        <>\r\n            <ExpansionProgressPanel\r\n                buttonText={Tr('open_offers')}\r\n                title={rfxOfferDecryptionStatus.decryptionEnabled ? Tr('decrypt_open_offers') : Tr('open_offers')}\r\n                progress={progress[0]} queue={progress[1]} showProgress={rfxOfferDecryptionStatus.decryptionEnabled && rfxOfferDecryptionStatus.status === ProgressStatus.IN_PROGRESS}\r\n                buttonDisabled={working || !rfxOfferDecryptionStatus.editable || rfxOfferDecryptionStatus.status !== ProgressStatus.CAN_START}\r\n                onButtonClick={rfxOfferDecryptionStatus.decryptionEnabled ? onDecryptionStart : openOffers}\r\n                optional={!rfxOfferDecryptionStatus.required}\r\n                details={getDetails()}\r\n                alwaysExpanded={true}\r\n            />\r\n        </>\r\n    );\r\n};\r\n\r\nOfferDecryptionProgress.propTypes = {};\r\n\r\nconst mapStateToProps = state => {\r\n    return {\r\n        rfxOfferDecryptionStatus: state.resources[RfxOfferService.RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS]\r\n    };\r\n};\r\n\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(OfferDecryptionProgress);\r\n","import Tr from 'translations/Translations';\r\nexport default {\r\n    FACEBOOK: \"facebook\",\r\n    YOUTUBE: \"youtube\",\r\n}\r\n\r\nexport const streamPlatformLabel = (x) => Tr(`stream.platform.${x}`)","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport TextInput from \"components/TextInput\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport Select from \"components/Select\";\r\nimport {streamPlatformLabel} from \"../constants/OnlinePlatforms\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    disabledEmpty: {\r\n        fontStyle: 'italic'\r\n    }\r\n}));\r\n\r\nfunction EditDescriptionPopup(\r\n    {\r\n        demandId,\r\n        roundId,\r\n        onClose = () => {\r\n        },\r\n        onUpdated = () => {\r\n        },\r\n        sessionOnlineStatus,\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n\r\n    const disabled = !sessionOnlineStatus.editable;\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const getTypeElements = () => {\r\n\r\n        const elements = sessionOnlineStatus.streamPlatforms.map(x => ({\r\n            label: streamPlatformLabel(x),\r\n            value: x\r\n        }))\r\n\r\n        return [{label: Tr('streaming_not_share'), value: \"\"}, ...elements]\r\n    }\r\n\r\n    const onSubmit = ({platform, link}) => {\r\n        RfxOfferService.saveOffersPublicSessionOnline(roundId, {platform, link: platform ? link : \"\"}).then(onUpdated)\r\n    }\r\n    return (\r\n        <Dialog\r\n            title={Tr('streaming_platform_form_title')}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    platform: sessionOnlineStatus.sessionOnline.platform,\r\n                    link: sessionOnlineStatus.sessionOnline.link\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    link: VS.stringMaxNoRq(2048)\r\n                        .when('platform',\r\n                            {\r\n                                is: (val) => Boolean(val),\r\n                                then: VS.string()\r\n                            }\r\n                        )\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <Select\r\n                            id=\"platform\"\r\n                            formikProps={formikProps}\r\n                            items={getTypeElements()}\r\n                            label={Tr('streaming_platform')}\r\n                        />\r\n\r\n                        {Boolean(formikProps.values.platform) &&\r\n                        <Typography dangerouslySetInnerHTML={{__html: Tr(`streaming_platform_description_${formikProps.values.platform}`)}}></Typography>}\r\n\r\n                        {Boolean(formikProps.values.platform) &&\r\n                        <TextInput\r\n                            id='link'\r\n                            formikProps={formikProps}\r\n                            label={Tr(`streaming_platform_link_${formikProps.values.platform}`)}\r\n                            disabled={disabled}\r\n                        />\r\n                        }\r\n\r\n\r\n                        <div className={classes.actions}>\r\n                            {disabled ?\r\n                                <SingleButton\r\n                                    justify='flex-end'\r\n                                    label={Tr('close')}\r\n                                    onClick={onClose}\r\n                                />\r\n                                :\r\n                                <DoubleButton\r\n                                    justify='flex-end'\r\n                                    labelFirst={Tr('cancel')}\r\n                                    labelSecond={Tr('confirm')}\r\n                                    onClickFirst={onClose}\r\n                                    onClickSecond={handleSubmit}\r\n                                />}\r\n                        </div>\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(EditDescriptionPopup);","import React, {useState} from 'react';\r\nimport Tr from \"translations/Translations\";\r\nimport ExpansionProgressPanel from \"./ExpansionProgressPanel\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport {connect} from \"react-redux\";\r\nimport ProgressStatus from \"../../../../../../constants/ProgressStatus\";\r\nimport EditSessionOnlinePopup from \"./EditSessionOnlinePopup\";\r\nimport {streamPlatformLabel} from \"../constants/OnlinePlatforms\";\r\n\r\nconst PublicSessionOnlineProgress = (\r\n    {\r\n        demandId,\r\n        roundId,\r\n        onlineSession\r\n    }) => {\r\n\r\n    const [editPopupOpen, setEditPopupOpen] = useState(false);\r\n\r\n    const onUpdated = () => {\r\n        RfxOfferService.getOffersPublicSessionOnlineStatus(roundId).then(() => {\r\n            setEditPopupOpen(false)\r\n        })\r\n    }\r\n    return (\r\n        <>\r\n            <ExpansionProgressPanel\r\n                buttonText={Tr('streaming_connect')}\r\n                title={Tr('streaming_platform_title')}\r\n                buttonDisabled={!onlineSession.editable}\r\n                onButtonClick={() => setEditPopupOpen(true)}\r\n                optional={!onlineSession.required}\r\n                progressAtlText={onlineSession.sessionOnline.platform ? Tr('streaming_connected', {platform: streamPlatformLabel(onlineSession.sessionOnline.platform)}) : Tr('streaming_not_connected')}\r\n                progress={onlineSession.status === ProgressStatus.PROCESSED ? 100 : 0}\r\n            />\r\n            {editPopupOpen && <EditSessionOnlinePopup\r\n                demandId={demandId}\r\n                roundId={roundId}\r\n                sessionOnlineStatus={onlineSession}\r\n                onClose={() => setEditPopupOpen(false)}\r\n                onUpdated={onUpdated}/>\r\n            }\r\n        </>\r\n    );\r\n};\r\n\r\nPublicSessionOnlineProgress.propTypes = {};\r\n\r\nconst mapStateToProps = state => {\r\n    return {\r\n        onlineSession: state.resources[RfxOfferService.RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS]\r\n    };\r\n};\r\n\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(PublicSessionOnlineProgress);\r\n","import React, {useEffect, useRef, useState} from 'react';\r\nimport Tr from \"translations/Translations\";\r\nimport ExpansionProgressPanel from \"./ExpansionProgressPanel\";\r\nimport {connect} from \"react-redux\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport ProgressStatus from \"constants/ProgressStatus\";\r\nimport Loading from \"components/Loading\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport RealizationAmountForm from \"components/complex/realizationAmount/RealizationAmountForm\";\r\nimport {Typography} from \"@material-ui/core\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {isNonpublicProcedure} from \"constants/ProcedureType\";\r\n\r\n\r\nconst RealizationAmountProgress = (\r\n    {\r\n        demandId,\r\n        roundId,\r\n        demandStatistics,\r\n        formSubmit,\r\n        dealingsRealizationValueStatus,\r\n        demandHeader\r\n    }) => {\r\n\r\n\r\n    const formId = 'realizationValuesForm';\r\n    const [expanded, setExpanded] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const [realizationValues, setRealizationValues] = useState(undefined);\r\n    const curOfferCount = useRef(demandStatistics.numberOfOffers);\r\n    const publishMode = useRef(null)\r\n\r\n    useEffect(() => {\r\n        if (curOfferCount.current === 0 && demandStatistics.numberOfOffers > 0) {\r\n            curOfferCount.current = 1;\r\n            DealingsService.getRealizationValueStatus(demandId);\r\n        }\r\n    }, [demandStatistics, demandId])\r\n\r\n\r\n    const handleSubmit = () => {\r\n        if (dealingsRealizationValueStatus.editable) {\r\n            publishMode.current = null;\r\n            formSubmit[formId]();\r\n        } else {\r\n            setExpanded(false);\r\n        }\r\n\r\n    }\r\n\r\n    useEffect(() => {\r\n\r\n\r\n        if (expanded) {\r\n            setWorking(true);\r\n            DealingsService.getRealizationValues(demandId).then(resp => {\r\n                setRealizationValues(resp);\r\n                setWorking(false);\r\n            })\r\n\r\n        } else {\r\n            setRealizationValues(undefined);\r\n        }\r\n\r\n    }, [expanded, demandId])\r\n\r\n    const processPublishUnpublish = async(publish) => {\r\n        const serviceMethod = publish ? DealingsService.publishRealizationAmountValue : DealingsService.unpublishRealizationAmountValue;\r\n        await serviceMethod(demandId);\r\n    }\r\n\r\n    const onSubmit = ({dealings}) => {\r\n\r\n        setWorking(true);\r\n\r\n        const toCompare = realizationValues.dealings;\r\n\r\n        const touched = dealings.filter((el, i) => {\r\n            return el.realizationGrossValue !== toCompare[i].realizationGrossValue\r\n        });\r\n\r\n        DealingsService.saveRealizationValues(demandId, {dealings: touched}, publishMode.current).then(() => {\r\n            if(publishMode.current !== null) {\r\n                processPublishUnpublish(publishMode.current).then(()=> {\r\n                    const arr = [];\r\n                    arr.push(DealingsService.getRealizationValueStatus(demandId))\r\n                    arr.push(RfxOfferService.getOffersDecryptionStatus(roundId))\r\n                    Promise.all(arr).finally(()=> {\r\n                        setExpanded(false);\r\n                        setWorking(false);\r\n                    })\r\n                })\r\n            } else {\r\n                const arr = [];\r\n                arr.push(DealingsService.getRealizationValueStatus(demandId))\r\n                arr.push(RfxOfferService.getOffersDecryptionStatus(roundId))\r\n                Promise.all(arr).finally(()=> {\r\n                    setExpanded(false);\r\n                    setWorking(false);\r\n                })\r\n            }\r\n        })\r\n    }\r\n\r\n    const handleCancel = () => setExpanded(false);\r\n\r\n\r\n    const handlePublish = (publish) => {\r\n        publishMode.current = publish;\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), handleCancel, 'outlined', working));\r\n        buttons.push(createButton(Tr('save'), handleSubmit, undefined, working));\r\n        if (dealingsRealizationValueStatus.realizationOfferAmountPublished)\r\n            buttons.push(createButton(Tr('unpublish'), () => handlePublish(false), undefined, working));\r\n        else\r\n            buttons.push(createButton(Tr('publish'), () => handlePublish(true), undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n    const getActions = () => {\r\n        if (!dealingsRealizationValueStatus.editable || working || !expanded) return\r\n        return <MultiButton buttons={getButtons()}/>\r\n    }\r\n    const getDetails = () => {\r\n        if (working || !expanded || !realizationValues) return <Loading/>\r\n\r\n        return <GridBlock column>\r\n            <Typography variant=\"h6\">{Tr(isNonpublicProcedure(demandHeader.procedureType) ? \"realization_value_info_pzp_excluded\" : \"realization_value_info\")}</Typography>\r\n            <RealizationAmountForm\r\n                formId={formId}\r\n                realizationValues={realizationValues}\r\n                onSubmit={onSubmit}\r\n                editable={dealingsRealizationValueStatus.editable}\r\n                required={dealingsRealizationValueStatus.required}\r\n            />\r\n        </GridBlock>\r\n    }\r\n\r\n    const handleExpandSave = () => {\r\n        if (expanded) {\r\n            handleSubmit();\r\n        } else {\r\n            setExpanded(true);\r\n        }\r\n    }\r\n\r\n    return (\r\n        <ExpansionProgressPanel\r\n            buttonText={expanded ? (dealingsRealizationValueStatus.editable ? Tr('save') : Tr('collapse')) : Tr('details')}\r\n            title={Tr('realization_demand_value')}\r\n            progressAtlText={`${Tr('filled_count_of_total', {\r\n                count: dealingsRealizationValueStatus.dealingsCount - dealingsRealizationValueStatus.notFilledCount,\r\n                total: dealingsRealizationValueStatus.dealingsCount\r\n            })} (${Tr(dealingsRealizationValueStatus.realizationOfferAmountPublished ? 'realization_demand_value_published' : 'realization_demand_value_not_published')})` }\r\n            progress={dealingsRealizationValueStatus.status === ProgressStatus.PROCESSED ? 100 : 0}\r\n            optional={!dealingsRealizationValueStatus.required}\r\n            buttonDisabled={working || dealingsRealizationValueStatus.status === ProgressStatus.UNAVAILABLE}\r\n            onButtonClick={handleExpandSave}\r\n            actions={getActions()}\r\n            details={getDetails()}\r\n            expanded={expanded}\r\n\r\n        />\r\n    );\r\n};\r\n\r\nRealizationAmountProgress.propTypes = {};\r\n\r\nconst mapStateToProps = state => {\r\n    return {\r\n        dealingsRealizationValueStatus: state.resources[DealingsService.RESOURCE_DEALING_REALIZATION_VALUE_STATUS],\r\n        formSubmit: state.form\r\n    };\r\n};\r\n\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(RealizationAmountProgress);\r\n","import React, {useEffect, useRef} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport OfferDecryptionProgress from \"../components/OfferDecryptionProgress\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport {withRouter} from \"react-router\";\r\nimport PublicSessionOnlineProgress from \"../components/PublicSessionOnlineProgress\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport RealizationAmountProgress from \"../components/RealizationAmountProgress\";\r\nimport {isDemandOfferCollection, isDemandOfferDecryption, isDemandModification} from \"libs/getDemandStatus\";\r\nimport moment from \"libs/moment\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(4)\r\n    }\r\n}));\r\n\r\nfunction OfferDecryptionSection(\r\n    {\r\n        demandStatistics,\r\n        currentRfxRound,\r\n        match,\r\n        rfxOfferDecryptionStatus,\r\n        onlineSessionStatus,\r\n        dealingsRealizationValueStatus,\r\n        demandHeader\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const demandId = match.params.id;\r\n    const isOfferCollection = isDemandOfferCollection();\r\n    const isModification = isDemandModification();\r\n    const isOfferDecryption = isDemandOfferDecryption();\r\n    const offerOpenTimeout = useRef(null);\r\n\r\n    useEffect(() => {\r\n        clearTimeout(offerOpenTimeout.current);\r\n        if (currentRfxRound) {\r\n            const offerOpenDate = moment(currentRfxRound.offerOpenDate);\r\n            const offerDeadline = moment(currentRfxRound.offerEndDate);\r\n            const now = moment(currentRfxRound.now);\r\n            if (offerOpenDate.isAfter(now) && offerOpenDate.isAfter(offerDeadline)) {\r\n                const diff = offerOpenDate.diff(now) + 500;\r\n                offerOpenTimeout.current = setTimeout(() => {\r\n                    RfxOfferService.getOffersDecryptionStatus(currentRfxRound.id);\r\n                }, diff);\r\n            }\r\n        }\r\n\r\n        return () => {\r\n            if (offerOpenTimeout.current) clearTimeout(offerOpenTimeout.current);\r\n        }\r\n    }, [demandStatistics, currentRfxRound])\r\n\r\n\r\n    useEffect(() => {\r\n\r\n        if (currentRfxRound) {\r\n            RfxOfferService.getOffersPublicSessionOnlineStatus(currentRfxRound.id);\r\n            RfxOfferService.getOffersDecryptionStatus(currentRfxRound.id);\r\n            if (demandHeader && !demandHeader.passiveOfferForm) {\r\n                DealingsService.getRealizationValueStatus(demandId);\r\n            }\r\n        }\r\n\r\n        return () => {\r\n            RfxOfferService.clearResources(RfxOfferService.RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS);\r\n            RfxOfferService.clearResources(RfxOfferService.RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS);\r\n            DealingsService.clearResources(DealingsService.RESOURCE_DEALING_REALIZATION_VALUE_STATUS);\r\n        }\r\n    }, [currentRfxRound, demandId, isOfferCollection, isOfferDecryption, demandHeader]);\r\n\r\n\r\n    if (!demandStatistics || !onlineSessionStatus || !rfxOfferDecryptionStatus || !currentRfxRound || !demandHeader || (!demandHeader.passiveOfferForm && isOfferCollection && !dealingsRealizationValueStatus)) {\r\n        return <Loading/>;\r\n    }\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            {(isOfferCollection || isModification) &&\r\n            <PublicSessionOnlineProgress demandId={demandId} roundId={currentRfxRound.id}/>}\r\n            {(!demandHeader.passiveOfferForm && Boolean(dealingsRealizationValueStatus)) &&\r\n            <RealizationAmountProgress demandHeader={demandHeader} demandStatistics={demandStatistics} demandId={demandId} roundId={currentRfxRound.id}/>}\r\n            {((isOfferCollection || isModification || isOfferDecryption)) && currentRfxRound.offerCollectionEnded && <OfferDecryptionProgress demandId={demandId} roundId={currentRfxRound.id}/>}\r\n        </div>\r\n    )\r\n}\r\n\r\n\r\nOfferDecryptionSection.propTypes = {\r\n    demandStatistics: PropTypes.object\r\n}\r\n\r\nconst mapStateToProps = state => {\r\n    return {\r\n        rfxOfferDecryptionStatus: state.resources[RfxOfferService.RESOURCE_ID_RFX_OFFER_DECRYPTION_STATUS],\r\n        onlineSessionStatus: state.resources[RfxOfferService.RESOURCE_ID_RFX_PUBLIC_SESSION_ONLINE_STATUS],\r\n        dealingsRealizationValueStatus: state.resources[DealingsService.RESOURCE_DEALING_REALIZATION_VALUE_STATUS],\r\n        demandHeader: state.resources.demandHeader,\r\n        //rfxOfferPublicSessionStatus: state.resources[RfxOfferService.RESOURCE_ID_RFX_OFFER_PUBLIC_SESSION_STATUS],\r\n    };\r\n};\r\n\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(OfferDecryptionSection));\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {withRouter} from \"react-router\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport DocumentsTables from \"components/complex/documentsTables/DocumentsTables\";\r\nimport Section from \"../components/Section\";\r\nimport Tr from \"translations/Translations\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '100%',\r\n        position: \"relative\"\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2),\r\n    }\r\n}));\r\n\r\nfunction DocumentsSection(\r\n    {\r\n        match,\r\n        siwzEditable,\r\n        repoEditable\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    let demandId = match.params.id;\r\n\r\n    return (\r\n        <div id=\"documentsSection\" className={classes.root}>\r\n            <Section\r\n                title={Tr('documents')}\r\n            >\r\n                <DocumentsTables\r\n                    demandId={demandId}\r\n                    repoEditable={repoEditable}\r\n                    siwzEditable={siwzEditable}\r\n                />\r\n            </Section>\r\n        </div>\r\n    )\r\n}\r\n\r\n\r\nDocumentsSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withRouter(DocumentsSection);","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport RfxOfferService from \"services/RfxOfferService\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    disabledEmpty: {\r\n        fontStyle: 'italic'\r\n    }\r\n}));\r\n\r\nfunction ResendOfferInvitationPopup(\r\n    {\r\n        demandId,\r\n        roundId,\r\n        onClose = () => {\r\n        },\r\n        formSubmit\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const formId = useId();\r\n    const [sent, setSent] = useState(false);\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = ({emails}, fp) => {\r\n        const emailsTab = getEmailsTab(emails);\r\n        if (emailsTab.length > 0) {\r\n            RfxOfferService.sendIvniteToOffers(roundId, emailsTab).then((resp) => {\r\n                if (resp.success) {\r\n                    setSent(true);\r\n                } else {\r\n                    const errors = resp.errors;\r\n                    const filter = emailsTab.filter((x, i) => errors.hasOwnProperty(`emails[${i}]`));\r\n                    fp.setFieldError(\"emails\", Tr('invalid_emails', {emails: filter.join(\",\")}))\r\n                }\r\n            }).catch(()=>{});\r\n        } else {\r\n            onClose();\r\n        }\r\n    }\r\n\r\n    const getEmailsTab = (emails) => {\r\n        if (!emails) {\r\n            return [];\r\n        }\r\n        return emails.split(';').map(x => x.trim()).filter(x => Boolean(x))\r\n\r\n    }\r\n\r\n\r\n    const emailValidator = VS.email();\r\n    return (\r\n        <Dialog\r\n            title={Tr('resend_offer_invitation_popup_title')}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n        >\r\n\r\n            {sent ?\r\n                <>\r\n\r\n                    <Typography>{Tr('resend_offer_invitation_success')}</Typography>\r\n\r\n                    <div className={classes.actions}>\r\n                        <SingleButton\r\n                            justify='flex-end'\r\n                            label={Tr('close')}\r\n                            onClick={onClose}\r\n                        />\r\n                    </div>\r\n\r\n                </>\r\n                :\r\n\r\n\r\n                <Form\r\n                    initialValues={{\r\n                        emails: \"\",\r\n                    }}\r\n                    validationSchema={Yup.object().shape({\r\n\r\n                        emails: VS.lazy(value => {\r\n                            if (!value)\r\n                                return VS.string();\r\n\r\n                            const emailsTab = getEmailsTab(value);\r\n\r\n                            const invalidEmails = emailsTab.filter(x => !emailValidator.isValidSync(x));\r\n\r\n                            return VS.string().test('valid-emails-comma-separated', Tr('invalid_emails', {emails: invalidEmails.join(\",\")}), value => invalidEmails.length === 0)\r\n\r\n\r\n                        })\r\n                    })}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock column>\r\n\r\n                            <TextInput\r\n                                id='emails'\r\n                                formikProps={formikProps}\r\n                                label={Tr('resend_offer_invitation_emails')}\r\n                            />\r\n\r\n                            <div className={classes.actions}>\r\n                                <DoubleButton\r\n                                    justify='flex-end'\r\n                                    labelFirst={Tr('cancel')}\r\n                                    labelSecond={Tr('confirm')}\r\n                                    onClickFirst={onClose}\r\n                                    onClickSecond={handleSubmit}\r\n                                />\r\n                            </div>\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n            }\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(ResendOfferInvitationPopup);","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Button from './Button';\r\n\r\nfunction Tile(\r\n    {\r\n        icon,\r\n        numberText,\r\n        text,\r\n        dangerouslySetText,\r\n        className,\r\n        onClick,\r\n    }) {\r\n    return (\r\n        <Button\r\n            className={className}\r\n            variant='outlined'\r\n            color='secondary'\r\n            onClick={onClick}\r\n        >\r\n            <GridBlock\r\n                direction='column'\r\n                alignItems='center'\r\n            >\r\n                {icon}\r\n                <Typography variant='h4'>\r\n                    {numberText}\r\n                </Typography>\r\n                <Typography variant='h5' dangerouslySetInnerHTML={dangerouslySetText ? {__html: text} : undefined}>\r\n                    {!dangerouslySetText ? text : null}\r\n                </Typography>\r\n            </GridBlock>\r\n        </Button>\r\n    )\r\n}\r\n\r\nTile.propTypes = {\r\n    classes: PropTypes.any,\r\n    icon: PropTypes.object.isRequired,\r\n    numberText: PropTypes.string,\r\n    text: PropTypes.string,\r\n}\r\n\r\nTile.defaultProps = {}\r\n\r\nexport default Tile;","import React from 'react'\r\nimport {makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tile from 'components/Tile';\r\nimport LocalOfferIcon from '@material-ui/icons/LocalOffer'\r\nimport ForumIcon from '@material-ui/icons/Forum'\r\nimport GroupIcon from '@material-ui/icons/Group'\r\nimport DescriptionIcon from '@material-ui/icons/Description'\r\nimport MailIcon from '@material-ui/icons/Mail';\r\nimport Tr from 'translations/Translations';\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {withRouter} from \"react-router\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n    root: {\r\n        display: 'flex',\r\n        justifyContent: 'center',\r\n        '&>*:not(:first-child)': {\r\n            marginLeft: theme.spacing(2),\r\n        },\r\n        marginBottom: theme.spacing(4)\r\n    },\r\n    icon: {\r\n        fontSize: theme.components.icon.fontSize,\r\n    },\r\n    mirror: {\r\n        transform: 'scaleX(-1)'\r\n    },\r\n    tile: {\r\n        width: 225,\r\n        height: 203,\r\n    }\r\n}));\r\n\r\nfunction TilesRow(\r\n    {\r\n        match,\r\n        offerCollectionOrModification,\r\n        demandStatistics\r\n    }) {\r\n    const classes = useStyles();\r\n    const demandId = match.params.id;\r\n\r\n    const handleCorrespondenceClick = () => {\r\n        if (!demandStatistics.operatorQnALink) {\r\n            const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_CORRESPONDENCE_ID, {id: demandId});\r\n            RouterPath.redirect(href)\r\n        } else {\r\n            window.location.href = demandStatistics.operatorQnALink.url;\r\n        }\r\n    };\r\n\r\n    const handleDocumentsClick = (e) => {\r\n        e.preventDefault();\r\n        if (offerCollectionOrModification) {\r\n            scrollTo(\"#documentsSection\")\r\n        } else {\r\n            const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_3_ID, {id: demandId});\r\n            RouterPath.redirect(href)\r\n        }\r\n    }\r\n\r\n    const handleOffersClick = (e) => {\r\n        e.preventDefault();\r\n        if (offerCollectionOrModification) {\r\n            scrollTo(\"#offersSection\")\r\n        } else {\r\n            const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_3_ID, {id: demandId});\r\n            RouterPath.redirect(href)\r\n        }\r\n    }\r\n\r\n\r\n    return (\r\n        <>\r\n            <div className={classes.root}>\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<ForumIcon className={classes.icon}/>}\r\n                    text={Tr('messages')}\r\n                    numberText={demandStatistics.numberOfUnreadMessagesFromSuppliers + ' / ' + demandStatistics.numberOfMessagesFromSuppliers}\r\n                    onClick={(e) => {\r\n                        e.preventDefault();\r\n                        handleCorrespondenceClick();\r\n                    }}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<LocalOfferIcon className={classes.icon}/>}\r\n                    text={Tr('offers')}\r\n                    numberText={demandStatistics.numberOfOffers.toString()}\r\n                    onClick={handleOffersClick}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<GroupIcon className={classes.icon}/>}\r\n                    text={Tr('contractors')}\r\n                    numberText={demandStatistics.numberOfSuppliers.toString()}\r\n                    onClick={(e) => {\r\n                        e.preventDefault();\r\n                        scrollTo(\"#contractorSection\")\r\n                    }}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<DescriptionIcon className={classes.icon}/>}\r\n                    text={Tr('documents')}\r\n                    numberText={demandStatistics.numberOfAttachments.toString()}\r\n                    onClick={handleDocumentsClick}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<MailIcon className={classes.icon}/>}\r\n                    text={Tr('email_list')}\r\n                    numberText={demandStatistics.numberOfEmails.toString()}\r\n                    onClick={(e) => {\r\n                        e.preventDefault();\r\n                        const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_EMAIL_LIST_ID, {id: demandId});\r\n                        RouterPath.redirect(href)\r\n                    }}\r\n                />\r\n            </div>\r\n        </>\r\n    )\r\n}\r\n\r\nTilesRow.propTypes = {\r\n    offerCollectionOrModification: PropTypes.bool.isRequired,\r\n    demandStatistics: PropTypes.object.isRequired,\r\n}\r\n\r\nTilesRow.defaultProps = {}\r\n\r\n\r\nexport default withRouter(TilesRow);","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\n\r\nconst getPoll = async (pollType) => {\r\n    return await RestRequestGET(Endpoints.POLL_GET(pollType));\r\n}\r\n\r\nconst savePollRating = async (rating) => {\r\n    return await RestRequestPOST(Endpoints.POLL_SAVE_RATING(), rating);\r\n}\r\n\r\nexport default {getPoll, savePollRating}","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {ToggleButton, ToggleButtonGroup} from \"@material-ui/lab\";\r\nimport SentimentVeryDissatisfiedIcon from '@material-ui/icons/SentimentVeryDissatisfied';\r\nimport SentimentDissatisfiedIcon from '@material-ui/icons/SentimentDissatisfied';\r\nimport SentimentSatisfiedIcon from '@material-ui/icons/SentimentSatisfied';\r\nimport SentimentSatisfiedAltIcon from '@material-ui/icons/SentimentSatisfiedAltOutlined';\r\nimport SentimentVerySatisfiedIcon from '@material-ui/icons/SentimentVerySatisfied';\r\n\r\n\r\nconst ratings = [\r\n    {\r\n        rating: 0,\r\n        icon: <SentimentVeryDissatisfiedIcon/>,\r\n        label: 'Very Dissatisfied',\r\n    },\r\n    {\r\n        rating: 1,\r\n        icon: <SentimentVeryDissatisfiedIcon/>,\r\n        label: 'Very Dissatisfied',\r\n    },\r\n    {\r\n        rating: 2,\r\n        icon: <SentimentVeryDissatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 3,\r\n        icon: <SentimentDissatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 4,\r\n        icon: <SentimentDissatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 5,\r\n        icon: <SentimentDissatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 6,\r\n        icon: <SentimentDissatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 7,\r\n        icon: <SentimentSatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 8,\r\n        icon: <SentimentSatisfiedIcon/>,\r\n    },\r\n    {\r\n        rating: 9,\r\n        icon: <SentimentSatisfiedAltIcon/>,\r\n    },\r\n    {\r\n        rating: 10,\r\n        icon: <SentimentVerySatisfiedIcon/>,\r\n    }];\r\n\r\nfunction PollNpsSwitch(\r\n    {\r\n        scoreChange,\r\n        score,\r\n        classes = {},\r\n    }) {\r\n\r\n    return (\r\n        <ToggleButtonGroup className={classes.root} size=\"large\" value={score} exclusive onChange={scoreChange}>\r\n            {\r\n                ratings.map((x) => <ToggleButton className={classes.button} key={x.rating} value={x.rating}>\r\n                    {\"\" + x.rating} {x.icon}\r\n                </ToggleButton>)\r\n            }\r\n        </ToggleButtonGroup>\r\n    )\r\n}\r\n\r\nPollNpsSwitch.propTypes = {\r\n    scoreChange: PropTypes.func.isRequired,\r\n    score: PropTypes.number,\r\n    classes: PropTypes.shape({\r\n        root: PropTypes.string,\r\n        button: PropTypes.string\r\n    })\r\n}\r\n\r\nexport default PollNpsSwitch;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PollService from \"services/PollService\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PollNpsSwitch from \"./PollNpsSwitch\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    button: {\r\n        padding: \"20px 25px\"\r\n    },\r\n    question: {\r\n        marginBottom: theme.spacing()\r\n    }\r\n}))\r\n\r\n\r\n\r\nfunction Poll(\r\n    {\r\n        demandId,\r\n        pollType,\r\n        onClose\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const [poll, setPoll] = useState({});\r\n\r\n    useEffect(() => {\r\n        PollService.getPoll(pollType).then((resp) => setPoll(resp));\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    const handleChange = (event, rate) => {\r\n\r\n        const rating = {\r\n            pollType: pollType,\r\n            objectType: \"demand\",\r\n            objectId: demandId,\r\n            score: rate\r\n        }\r\n        PollService.savePollRating(rating);\r\n        onClose();\r\n\r\n    };\r\n\r\n    return (\r\n        <Dialog\r\n            title={poll.title}\r\n            open={Boolean(poll && poll.enabled)}\r\n            titleCentered\r\n            maxWidth='md'\r\n            onClose={onClose}\r\n\r\n        >\r\n            <GridBlock justify='center'>\r\n                <BoldTypography className={classes.question}>{poll.question}</BoldTypography>\r\n\r\n                <PollNpsSwitch scoreChange={handleChange} classes={{button: classes.button}} />\r\n            </GridBlock>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nPoll.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    pollType: PropTypes.string.isRequired,\r\n    onClose: PropTypes.func.isRequired\r\n}\r\n\r\nexport default Poll;","import React, {useEffect, useMemo, useRef, useState} from 'react'\r\nimport ContractorSection from './sections/ContractorSection';\r\nimport OfferSection from './sections/OfferSection';\r\nimport StatisticSection from \"./sections/StatisticSection\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport OfferDecryptionSection from \"./sections/OfferDecryptionSection\";\r\nimport DocumentsSection from \"./sections/DocumentsSection\";\r\nimport NavigationBar from \"components/complex/floatingMenu/NavigationBar\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {modify} from \"services/ModificationService\";\r\nimport {isDemandModification, isDemandOfferCollection} from \"libs/getDemandStatus\";\r\nimport createButton from \"components/complex/floatingMenu/createButton\";\r\nimport Workspace from \"components/Workspace\";\r\nimport {connect} from \"react-redux\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport ResendOfferInvitationPopup from \"./components/ResendOfferInvitationPopup\";\r\nimport TilesRow from \"./components/TilesRow\";\r\nimport Loading from \"components/Loading\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport ListIcon from \"@material-ui/icons/List\";\r\nimport DemandRelatedObjectsPopup from \"components/popup/relatedObjects/DemandRelatedObjectsPopup\";\r\nimport PublishService from \"services/PublishService\";\r\nimport Poll from \"components/popup/poll/Poll\";\r\nimport SiwzService from \"services/SiwzService\";\r\nimport RepoService from \"services/RepoService\";\r\nimport RfxRoundService from \"services/RfxRoundService\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport DemandService from \"services/DemandService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    menuBar: {\r\n        direction: 'rtl',\r\n        marginBottom: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nconst rp = RouterPath.myProcedure;\r\n\r\nfunction Part2(\r\n    {\r\n        match,\r\n        demandStatistics,\r\n        currentRfxRound,\r\n        demandHeader,\r\n        siwzEditable = false,\r\n        repoEditable = false,\r\n        rfxPrivileges = {},\r\n        demandPrivileges = {}\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n    const classes = useStyle();\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [refreshStats, setRefreshStats] = useState(0);\r\n    const [resendInvitationPopupOpen, setResendInvitationPopup] = useState(false);\r\n    const [relatedObjectPopup, setRelatedObjectPopup] = useState(false);\r\n    const [firstPublication, setFirstPublication] = useState(()=> PublishService.isFirstPublication(demandId));\r\n    const intervalId = useRef(0);\r\n    const loadingInProgress = useRef(false);\r\n\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const offerCollection = useMemo(() => isDemandOfferCollection(), [demandHeader]);\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const modification = useMemo(() => isDemandModification(), [demandHeader]);\r\n\r\n    useEffect(() => {\r\n        if (!loadingInProgress.current && currentRfxRound?.id) {\r\n            loadingInProgress.current = true;\r\n            StatisticsService.getStats(demandId, currentRfxRound.id).finally(() => loadingInProgress.current = false);\r\n        }\r\n    }, [refreshStats, currentRfxRound, demandId])\r\n\r\n    useEffect(() => {\r\n        setRefreshStats(x => x + 1);\r\n    }, [currentRfxRound])\r\n\r\n    useEffect(() => {\r\n        StatisticsService.getCurrentRound(demandId).then((res)=> {\r\n            if(res)\r\n                RfxRoundService.getBuyerPrivileges(res.id)\r\n        });\r\n        intervalId.current = setInterval(() => {\r\n            setRefreshStats(x => x + 1)\r\n        }, 20000);\r\n        SiwzService.isSiwzEditable(demandId);\r\n        RepoService.isRepoEditable(demandId);\r\n        DemandService.getBuyerPrivileges(demandId);\r\n\r\n        return () => {\r\n            if (intervalId.current)\r\n                clearInterval(intervalId.current);\r\n            StatisticsService.clearStats();\r\n            StatisticsService.clearCurrentRound();\r\n            HeaderService.clear();\r\n            SiwzService.clearResources(SiwzService.SIWZ_EDITABLE_RESOURCE_ID);\r\n            RepoService.clearResources(RepoService.REPO_EDITABLE_RESOURCE_ID);\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.RFX_PRIVILEGE_STORE_KEY);\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n\r\n    const endTimeCallback = () => {\r\n        StatisticsService.getCurrentRound(demandId);\r\n        setRefreshStats(x => x + 1);\r\n    };\r\n\r\n    const handlePrevClick = () => {\r\n        const href = RouterPath.createPath(rp.steps.MP_1_ID, {id: demandId});\r\n        RouterPath.redirect(href)\r\n    };\r\n\r\n    const handleModifyClick = () => {\r\n        if (!working) {\r\n            setWorking(true);\r\n            modify(demandId)\r\n                .then((resp) => {\r\n                    if (resp) {\r\n                        handlePrevClick();\r\n                    } else {\r\n                        setWorking(false);\r\n                    }\r\n                }).catch(() => {\r\n                setWorking(false);\r\n            })\r\n        }\r\n    };\r\n\r\n\r\n    const getNavigationBarButtons = () => {\r\n        const buttons = [];\r\n        if (!demandHeader || !currentRfxRound) {\r\n            return buttons;\r\n        }\r\n        const offerCollection = isDemandOfferCollection();\r\n        if (demandHeader.hasPlanItems || demandHeader.hasPurchaseRequests) {\r\n            buttons.push(createButton('related_objects', () => setRelatedObjectPopup(true),\"outlined\", ListIcon, 'primary', false));\r\n        }\r\n        buttons.push(createButton(\"resend_offer_invitation\", () => setResendInvitationPopup(true), \"outlined\", undefined, \"primary\", !rfxPrivileges.RESEND_INVITATION || working || !(offerCollection || modification)));\r\n        buttons.push(createButton(\"modify\", handleModifyClick, undefined, undefined, \"primary\", !demandPrivileges.MODIFY || working || !offerCollection));\r\n        return buttons;\r\n    };\r\n\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const navigationBarButtons = useMemo(getNavigationBarButtons, [demandHeader, currentRfxRound, rfxPrivileges, demandPrivileges, working])\r\n\r\n    return (\r\n        <>\r\n            {(Boolean(currentRfxRound) && Boolean(demandHeader) && Boolean(demandStatistics)) ?\r\n                <>\r\n                    <NavigationBar buttons={navigationBarButtons} classesObj={classes}/>\r\n                    <Workspace\r\n                        render={<>\r\n                            {(offerCollection || modification) &&\r\n                                <StatisticSection currentRfxRound={currentRfxRound} endTimeCallback={endTimeCallback}/>\r\n                            }\r\n                            <TilesRow demandStatistics={demandStatistics}\r\n                                      offerCollectionOrModification={offerCollection || modification}/>\r\n                            <OfferDecryptionSection demandStatistics={demandStatistics}\r\n                                                    currentRfxRound={currentRfxRound}/>\r\n                            {(offerCollection || modification) &&\r\n                                <OfferSection/>\r\n                            }\r\n                            <ContractorSection demandHeader={demandHeader} demandStatistics={demandStatistics} currentRfxRound={currentRfxRound} rfxPrivileges={rfxPrivileges}/>\r\n                            {(offerCollection || modification) &&\r\n                                <DocumentsSection\r\n                                    siwzEditable={siwzEditable}\r\n                                    repoEditable={repoEditable}\r\n                                />\r\n                            }\r\n                        </>}\r\n                    />\r\n                </>\r\n                :\r\n                <Loading/>\r\n            }\r\n            {resendInvitationPopupOpen &&\r\n                <ResendOfferInvitationPopup demandId={demandId} roundId={currentRfxRound.id}\r\n                                            onClose={() => setResendInvitationPopup(false)}/>}\r\n            {\r\n                relatedObjectPopup &&\r\n                <DemandRelatedObjectsPopup demandId={demandId} onClose={() => setRelatedObjectPopup(false)}/>\r\n            }\r\n            {\r\n                firstPublication && <Poll onClose={()=> setFirstPublication(false)} pollType='demand_publication' demandId={demandId} />\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nconst mapStateToProps = state => ({\r\n        demandHeader: state.resources.demandHeader,\r\n        demandStatistics: state.resources[StatisticsService.DEMAND_STATISTICS_RESOURCE_ID],\r\n        currentRfxRound: state.resources[StatisticsService.CURRENT_RFX_RESOURCE_ID],\r\n        siwzEditable: state.resources[SiwzService.SIWZ_EDITABLE_RESOURCE_ID],\r\n        repoEditable: state.resources[RepoService.REPO_EDITABLE_RESOURCE_ID],\r\n        rfxPrivileges: state.privileges[PrivilegeService.RFX_PRIVILEGE_STORE_KEY],\r\n        demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY],\r\n    });\r\n\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(Part2);","import React, {useEffect, useState} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Loading from \"components/Loading\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport useId from \"hooks/useId\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport {connect} from \"react-redux\";\r\nimport DealingsService from \"services/DealingsService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport RealizationAmountForm from \"components/complex/realizationAmount/RealizationAmountForm\";\r\nimport Typography from \"../../../../../../../components/Typography\";\r\n\r\n\r\nconst RealizationValuePopup = (\r\n    {\r\n        demandId,\r\n        onCancel,\r\n        onSuccess,\r\n        editable,\r\n        formSubmit,\r\n    }) => {\r\n\r\n\r\n    const [realizationValues, setRealizationValues] = useState(null);\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(null);\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n\r\n    const onSubmit = ({dealings}) => {\r\n        setError(false);\r\n        setWorking(true);\r\n\r\n        const toCompare = realizationValues.dealings;\r\n\r\n        const touched = dealings.filter((el, i) => {\r\n            return el.realizationGrossValue !== toCompare[i].realizationGrossValue\r\n        });\r\n\r\n        DealingsService.saveRealizationValues(demandId, {dealings: touched}).then(onSuccess).catch(() => {\r\n            setError(Tr('unknown_error_message'));\r\n            setWorking(false);\r\n        });\r\n    }\r\n\r\n    useEffect(() => {\r\n        DealingsService.getRealizationValues(demandId).then(resp => {\r\n            if (isResponseValid(resp, setError))\r\n                setRealizationValues(resp)\r\n        }).finally(() => setWorking(false))\r\n    }, [demandId])\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined', working));\r\n        if (realizationValues && realizationValues.realizationValuePublished === true) {\r\n            buttons.push(createButton(Tr('unpublish'), () => changePublication(false), undefined, working || !editable));\r\n        } else if (realizationValues && realizationValues.realizationValuePublished === false) {\r\n            buttons.push(createButton(Tr('publish'), () => changePublication(true), undefined, working || !editable));\r\n        }\r\n\r\n        buttons.push(createButton(Tr('save'), handleSubmit, undefined, working || !editable));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    const changePublication = (publish) => {\r\n        setWorking(true);\r\n        const serviceMethod = publish ? DealingsService.publishRealizationAmountValue : DealingsService.unpublishRealizationAmountValue;\r\n        serviceMethod(demandId).then(() => {\r\n            return DealingsService.getRealizationValues(demandId)\r\n        }).then(resp => setRealizationValues(resp)).finally(() => setWorking(false));\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            title={Tr('realization_value')}\r\n            maxWidth='md'\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n                {working && <Loading/>}\r\n                {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n\r\n                {!!realizationValues && <>\r\n\r\n                    <Typography component='span' color=\"primary\">\r\n                        {Tr(realizationValues.realizationValuePublished ? 'realization_value_published' : 'realization_value_unpublished')}\r\n                    </Typography>\r\n\r\n\r\n                    <RealizationAmountForm\r\n                        onSubmit={onSubmit}\r\n                        required={false}\r\n                        formId={formId}\r\n                        realizationValues={realizationValues}\r\n                        editable={editable}\r\n                    />\r\n                </>}\r\n            </GridBlock>\r\n\r\n\r\n        </Dialog>)\r\n}\r\n\r\nRealizationValuePopup.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    editable: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(RealizationValuePopup)","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport panels from './part3.panels.components'\r\nimport {clearResource, setStepperState} from 'redux/actions'\r\nimport {connect} from 'react-redux'\r\nimport AccordionPart from \"pages/purchaser/MyProcedure/scenes/components/AccordionPart\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport createButton, {createSubmitFormButton} from \"components/complex/floatingMenu/createButton\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\nimport ForumIcon from '@material-ui/icons/Forum'\r\nimport reduxStore from \"redux/store\";\r\nimport DemandSectionsService from \"services/DemandSectionsService\";\r\nimport {DemandValidation, DemandValidationKeys} from \"constants/DemandValidation\";\r\nimport RealizationValuePopup from \"./panels/components/RealizationValuePopup\";\r\nimport ArrowIcon from \"@material-ui/icons/KeyboardArrowUp\";\r\nimport DemandRelatedObjectsPopup from \"components/popup/relatedObjects/DemandRelatedObjectsPopup\";\r\nimport ListIcon from \"@material-ui/icons/List\";\r\nimport DemandService from \"services/DemandService\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport SaveIcon from \"@material-ui/icons/Save\";\r\n\r\n\r\nfunction Part3(\r\n    {\r\n        stepperState,\r\n        setStepperState,\r\n        clearResource,\r\n        steps,\r\n        match,\r\n        location,\r\n        demandValidation,\r\n        demandHeader,\r\n        rfxPrivileges = {}\r\n    }) {\r\n    const id = match.params.id;\r\n    const [working, setWorking] = useState(true);\r\n    const [realizationValuesPopupOpened, setRealizationValuesPopupOpened] = useState(false);\r\n    const [relatedObjectPopup, setRelatedObjectPopup] = useState(false);\r\n\r\n    useEffect(() => {\r\n        const p2 = HeaderService.get(id);\r\n        const p1 = DemandSectionsService.getEvaluationSections(id);\r\n        const p3 = DemandService.getBuyerPrivileges(id);\r\n        const p4 = DemandService.getBuyerRfxPrivileges(id);\r\n        Promise.all([p1, p2, p3, p4]).then(() => setWorking(false));\r\n\r\n        return () => {\r\n            reduxStore.dispatch(setStepperState(null));\r\n            DemandSectionsService.clearDemandValidationResources();\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY)\r\n            HeaderService.clear();\r\n        };\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n    const navigationBarButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton('email_list', () => {\r\n            const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_EMAIL_LIST_ID, {id: id});\r\n            RouterPath.redirect(href)\r\n        }, undefined, MailIcon, 'primary', false, true));\r\n\r\n        if (!!rfxPrivileges.CORRESPONDENCE) {\r\n            buttons.push(createButton('correspondence', () => {\r\n                const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_CORRESPONDENCE_ID, {id: id});\r\n                RouterPath.redirect(href)\r\n            }, undefined, ForumIcon, 'primary', false, true));\r\n        }\r\n\r\n        if (demandHeader && (demandHeader.hasPlanItems || demandHeader.hasPurchaseRequests)) {\r\n            buttons.push(createButton('related_objects', () => setRelatedObjectPopup(true),\r\n                \"outlined\", ListIcon, 'primary', false, true));\r\n        }\r\n\r\n        if (demandValidation) {\r\n            const section = demandValidation.find(x => x.section === DemandValidation.PART_3_SECTION);\r\n            if (section && section.showUpdateRealizationValue) {\r\n                buttons.push(createButton('realization_demand_value', () => setRealizationValuesPopupOpened(true),\r\n                    'outlined', undefined, 'primary', false, false));\r\n            }\r\n        }\r\n\r\n        const isSaveButton = !!stepperState && stepperState === DemandValidationKeys.EVALUATION_ADDITIONAL_INFO;\r\n        buttons.push(createSubmitFormButton(isSaveButton ? \"save\" : \"close\",\r\n            undefined,\r\n            isSaveButton ? SaveIcon : ArrowIcon,\r\n            'primary',\r\n            stepperState === null,\r\n            isSaveButton)\r\n        );\r\n        return buttons;\r\n    }\r\n\r\n    return (<>\r\n            <AccordionPart working={working} steps={steps} panels={panels} navigationBarButtons={navigationBarButtons()}/>\r\n            {realizationValuesPopupOpened && <RealizationValuePopup\r\n                demandId={id}\r\n                onSuccess={() => setRealizationValuesPopupOpened(false)}\r\n                onCancel={() => setRealizationValuesPopupOpened(false)}\r\n                editable\r\n            />\r\n            }\r\n            {\r\n                relatedObjectPopup &&\r\n                <DemandRelatedObjectsPopup demandId={id} onClose={() => setRelatedObjectPopup(false)}/>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nPart3.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    stepperState: state.stepper.state,\r\n    steps: state.stepper.steps[2].steps,\r\n    demandValidation: state.resources.demandValidation,\r\n    rfxPrivileges: state.privileges[PrivilegeService.RFX_PRIVILEGE_STORE_KEY],\r\n    form: state.form,\r\n}), {\r\n    setStepperState,\r\n    clearResource\r\n})(Part3);","import React, {useEffect, useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport panels from './part4.panels.components'\r\nimport {clearResource, setStepperState} from 'redux/actions'\r\nimport {connect} from 'react-redux'\r\nimport reduxStore from 'redux/store'\r\nimport AccordionPart from \"pages/purchaser/MyProcedure/scenes/components/AccordionPart\";\r\nimport HeaderService from \"services/HeaderService\";\r\nimport createButton, {createSubmitFormButton} from \"components/complex/floatingMenu/createButton\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\nimport ForumIcon from '@material-ui/icons/Forum'\r\nimport DemandSectionsService from \"services/DemandSectionsService\";\r\nimport SaveIcon from \"@material-ui/icons/Save\";\r\nimport ArrowIcon from \"@material-ui/icons/KeyboardArrowUp\";\r\nimport ListIcon from \"@material-ui/icons/List\";\r\nimport DemandRelatedObjectsPopup from \"components/popup/relatedObjects/DemandRelatedObjectsPopup\";\r\nimport DemandService from \"services/DemandService\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport {DemandValidationKeys} from \"constants/DemandValidation\";\r\nimport {isNationalProcedure} from \"constants/ProcedureType\";\r\nimport Tr from \"translations/Translations\"\r\n\r\nfunction Part4(\r\n    {\r\n        stepperState,\r\n        setStepperState,\r\n        clearResource,\r\n        steps,\r\n        match,\r\n        demandValidation,\r\n        demandHeader\r\n    }) {\r\n    const id = match.params.id;\r\n    const [working, setWorking] = useState(true);\r\n    const [relatedObjectPopup, setRelatedObjectPopup] = useState(false);\r\n\r\n    useEffect(() => {\r\n        const p2 = HeaderService.get(id);\r\n        const p1 = DemandSectionsService.getFinishingSections(id);\r\n        const p3 = DemandService.getBuyerPrivileges(id);\r\n        Promise.all([p1, p2, p3]).then(() => setWorking(false));\r\n\r\n        return () => {\r\n            reduxStore.dispatch(setStepperState(null));\r\n            DemandSectionsService.clearDemandValidationResources();\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY);\r\n            HeaderService.clear();\r\n        };\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n    const navigationBarButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton('email_list', () => {\r\n            const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_EMAIL_LIST_ID, {id: id});\r\n            RouterPath.redirect(href)\r\n        }, undefined, MailIcon, 'primary', false, true));\r\n\r\n        if (!demandHeader || !demandHeader.exPost) {\r\n            buttons.push(createButton('correspondence', () => {\r\n                const href = RouterPath.createPath(RouterPath.myProcedure.steps.MP_CORRESPONDENCE_ID, {id: id});\r\n                RouterPath.redirect(href)\r\n            }, undefined, ForumIcon, 'primary', false, true));\r\n\r\n            if (demandHeader && (demandHeader.hasPlanItems || demandHeader.hasPurchaseRequests)) {\r\n                buttons.push(createButton('related_objects', () => setRelatedObjectPopup(true),\r\n                    \"outlined\", ListIcon, 'primary', false, true));\r\n            }\r\n        }\r\n\r\n\r\n        const isSaveButton = !!stepperState && (stepperState === \"mp_4_demand_plan_realization\" || stepperState === \"mp_4_finish_additional_info\");\r\n        buttons.push(createSubmitFormButton(isSaveButton ? \"save\" : \"close\",\r\n            undefined,\r\n            isSaveButton ? SaveIcon : ArrowIcon,\r\n            'primary',\r\n            stepperState === null,\r\n            isSaveButton)\r\n        );\r\n\r\n        return buttons;\r\n\r\n    };\r\n\r\n    const stepsMemo = useMemo(()=> {\r\n        return steps.map(x => x.key === DemandValidationKeys.RESULT_NOTICE && isNationalProcedure(demandHeader?.procedureType) ? {...x, label: Tr(\"mp_4_result_notice_national\")} : x )\r\n    },[demandHeader, steps])\r\n\r\n\r\n    return (<>\r\n            <AccordionPart working={working} steps={stepsMemo} panels={panels} navigationBarButtons={navigationBarButtons()}/>\r\n            {\r\n                relatedObjectPopup &&\r\n                <DemandRelatedObjectsPopup demandId={id} onClose={() => setRelatedObjectPopup(false)}/>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nPart4.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n    stepperState: state.stepper.state,\r\n    steps: state.stepper.steps[3].steps,\r\n    demandValidation: state.resources.demandValidation,\r\n    form: state.form,\r\n}), {\r\n    setStepperState,\r\n    clearResource\r\n})(Part4);","import React from 'react'\r\nimport {TextField} from '@material-ui/core';\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport PropTypes from 'prop-types';\r\nimport {Autocomplete} from \"@material-ui/lab\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nfunction OrganizationsSelect(\r\n    {\r\n        formikProps,\r\n        id,\r\n        label,\r\n        items,\r\n        noError,\r\n        className,\r\n        required,\r\n        disabled,\r\n        onChange = () => {\r\n        },\r\n        onChipClick,\r\n        chipTitle\r\n    }) {\r\n\r\n\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    //const touched = getObjectValue(id, formikProps.touched, false)\r\n    const value = getObjectValue(id, formikProps.values, [])\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n    const isError = !noError && !!errorValue;\r\n\r\n    let _label = label;\r\n    if (required) _label += '*';\r\n\r\n    const handleChange = (event, newValue) => {\r\n        formikProps.setFieldValue(id, newValue.map(x => x.value));\r\n        formikProps.setFieldTouched(id, true);\r\n        onChange(newValue);\r\n    };\r\n\r\n    return (\r\n        <Autocomplete\r\n            className={className}\r\n            noOptionsText={Tr('no_options')}\r\n            onChange={handleChange}\r\n            multiple\r\n            //id={id}\r\n            options={items}\r\n            getOptionLabel={option => option.label}\r\n            value={items.filter(x => value.includes(x.value))}\r\n            filterSelectedOptions\r\n            disableCloseOnSelect\r\n\r\n            disabled={disabled || !editable}\r\n            ChipProps={{\r\n                onClick: onChipClick,\r\n                title: chipTitle\r\n            }}\r\n            renderInput={params => {\r\n                return <TextField\r\n                    {...params}\r\n                    variant=\"standard\"\r\n                    label={_label}\r\n                    placeholder={Tr('recipients')}\r\n                    fullWidth\r\n                    helperText={noError ? undefined : isError ? errorValue : ' '}\r\n                    error={isError}\r\n                />\r\n            }}\r\n\r\n        />)\r\n\r\n}\r\n\r\nOrganizationsSelect.propTypes = {\r\n    className: PropTypes.string,\r\n    formikProps: PropTypes.object,\r\n    id: PropTypes.string.isRequired,\r\n    label: PropTypes.string,\r\n    items: PropTypes.arrayOf(\r\n        PropTypes.oneOfType([\r\n            PropTypes.shape({\r\n                value: PropTypes.any.isRequired,\r\n                label: PropTypes.string.isRequired,\r\n            }),\r\n            PropTypes.string.isRequired,\r\n        ])\r\n    ),\r\n    onChipClick: PropTypes.func,\r\n    chipTitle: PropTypes.string\r\n}\r\n\r\nOrganizationsSelect.defaultProps = {\r\n    items: []\r\n}\r\n\r\nexport default OrganizationsSelect\r\n","export default (x) => {\r\n    let label = x.name;\r\n    if (x.postCode || x.city) {\r\n        label += \" (\";\r\n        if (x.postCode) {\r\n            label += x.postCode;\r\n        }\r\n        if (x.city) {\r\n            label += \", \" + x.city;\r\n        }\r\n        label += \")\";\r\n    }\r\n    return label;\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport contractorNameBuilder from \"libs/contractorNameBuilder\";\r\nimport Typography from \"components/Typography\";\r\n\r\nfunction CorrespondenceEmailList(\r\n    {\r\n        wrapper,\r\n        className\r\n    }) {\r\n\r\n    return <div className={className}>\r\n        <BoldTypography>{contractorNameBuilder(wrapper.recipient)}</BoldTypography>\r\n        <ul>\r\n            {wrapper.emails.map((x, i) => <li key={i}><Typography>{`${i+1}. ${x}`}</Typography></li>)}\r\n        </ul>\r\n    </div>;\r\n\r\n}\r\n\r\nCorrespondenceEmailList.propTypes = {\r\n    wrapper: PropTypes.shape({\r\n        recipient: PropTypes.object.isRequired,\r\n        emails: PropTypes.arrayOf(PropTypes.string).isRequired\r\n    }).isRequired\r\n}\r\nexport default CorrespondenceEmailList;\r\n\r\n","import React, {useEffect, useMemo, useState} from 'react'\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Loading from \"components/Loading\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport OrganizationsSelect from \"components/OrganizationsSelect\";\r\nimport InputLimits from \"constants/InputLimits\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport contractorNameBuilder from \"libs/contractorNameBuilder\";\r\nimport ToggleButton from \"@material-ui/lab/ToggleButton\";\r\nimport ToggleButtonGroup from \"@material-ui/lab/ToggleButtonGroup\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport InfoIcon from '@material-ui/icons/Info';\r\nimport Button from \"components/Button\";\r\nimport CorrespondenceEmailList from \"./CorrespondenceEmailList\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport {connect} from \"react-redux\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    marginTop: {\r\n        marginTop: theme.spacing(4)\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    },\r\n    uploadFile: {\r\n        marginBottom: 20\r\n    },\r\n    toggle: {\r\n        width: \"100%\"\r\n    },\r\n    toggleButton: {\r\n        width: \"50%\"\r\n    },\r\n    dialogContent: {\r\n        position: \"relative\"\r\n    },\r\n    ctrEmailList: {\r\n        background: theme.palette.background.paper,\r\n        position: \"absolute\",\r\n        top: 0,\r\n        left: 0,\r\n        width: \"100%\",\r\n        height: \"100%\"\r\n    },\r\n    ctrEmailListTitle: {\r\n        position: \"fixed\",\r\n        background: theme.palette.background.paper,\r\n        maxWidth: 900,\r\n        marginTop: theme.spacing(-1)\r\n    }\r\n}));\r\n\r\nconst limits = InputLimits.procedure.correspondence;\r\n\r\nfunction AddThreadPopup(\r\n    {\r\n        rfxRoundId,\r\n        listResourceId,\r\n        onClose,\r\n        contractor,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [error, setError] = useState('');\r\n    const [sendType, setSendType] = useState('');\r\n    const [working, setWorking] = useState(!contractor);\r\n    const [withOfferSwitch, setWithOfferSwitch] = useState(false);\r\n    const [contractorList, setContractorList] = useState([]);\r\n    const [contractorEmailList, setContractorEmailList] = useState(null);\r\n    const {enqueueErrorSnackbar} = useSnackbar();\r\n    const formId = useId();\r\n\r\n    const contractorListForSelect = useMemo(() => {\r\n        const srcList = withOfferSwitch ? contractorList.filter(x => x.hasOffer) : contractorList;\r\n        return srcList.map(x => ({label: contractorNameBuilder(x), value: x.id}));\r\n    }, [contractorList, withOfferSwitch]);\r\n\r\n    const handleSubmit = (type) => {\r\n        setError('');\r\n        setSendType(type);\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (!contractor) {\r\n            const contractorInRoundList = CorrespondenceService.getBuyerContractorInRoundList(rfxRoundId).then(resp => setContractorList(resp));\r\n            Promise.all([contractorInRoundList]).finally(() => setWorking(false));\r\n        }\r\n\r\n    }, [rfxRoundId, contractor]);\r\n\r\n    const handleSaveResponse = (response) => {\r\n        if (isResponseValid(response, setError)) {\r\n            setWorking(false);\r\n            onClose();\r\n        } else {\r\n            setWorking(false);\r\n        }\r\n    };\r\n\r\n    const handleSendResponse = (saveResponse) => {\r\n        if (isResponseValid(saveResponse, setError)) {\r\n            const messages = saveResponse.messages;\r\n            if (!messages || messages.length === 0 || !messages[0].messageId || !saveResponse.threadId) {\r\n                setError(Tr('unknown_error_message'));\r\n            } else {\r\n                if (contractor) {\r\n                    CorrespondenceService.sendContractorMessage(rfxRoundId, saveResponse.threadId, messages[0].messageId, listResourceId).then(handleSaveResponse).catch(() => setWorking(false))\r\n                } else {\r\n                    CorrespondenceService.sendBuyerMessage(rfxRoundId, saveResponse.threadId, messages[0].messageId, listResourceId).then(handleSaveResponse).catch(() => setWorking(false))\r\n                }\r\n            }\r\n        } else {\r\n            setWorking(false);\r\n        }\r\n    };\r\n\r\n    const onSubmit = (thread) => {\r\n        setWorking(true);\r\n        const req = {\r\n            subject: thread.subject,\r\n            message: {\r\n                attachments: thread.attachments,\r\n                contents: thread.contents,\r\n                recipients: contractor ? [] : contractorList.filter(x => thread.supplierRecipientIds.indexOf(x.id) > -1)\r\n            }\r\n        };\r\n\r\n        if (sendType === 'save') {\r\n            if (contractor) {\r\n                CorrespondenceService.addContractorThread(rfxRoundId, req, listResourceId).then(handleSaveResponse).catch(() => setWorking(false));\r\n            } else {\r\n                CorrespondenceService.addBuyerThread(rfxRoundId, req, listResourceId).then(handleSaveResponse).catch(() => setWorking(false));\r\n            }\r\n        } else if (sendType === 'send') {\r\n            if (contractor) {\r\n                CorrespondenceService.addContractorThread(rfxRoundId, req, listResourceId).then(handleSendResponse).catch(() => setWorking(false));\r\n            } else {\r\n                CorrespondenceService.addBuyerThread(rfxRoundId, req, listResourceId).then(handleSendResponse).catch(() => setWorking(false));\r\n            }\r\n\r\n        }\r\n        setSendType('');\r\n\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working || !!contractorEmailList));\r\n        buttons.push(createButton(Tr('save'), () => handleSubmit('save'), 'outlined', working || !!contractorEmailList));\r\n        buttons.push(createButton(Tr('send'), () => handleSubmit('send'), undefined, working || !!contractorEmailList));\r\n        return buttons;\r\n    }\r\n\r\n    const onChangeWithOffer = (withOffer, formikProps) => {\r\n        if (withOffer !== null && withOffer !== withOfferSwitch) {\r\n            formikProps.setFieldValue('supplierRecipientIds', []);\r\n            setWithOfferSwitch(withOffer)\r\n        }\r\n    }\r\n\r\n    const chipClick = (e) => {\r\n        setContractorEmailList({});\r\n        const ctr = contractorList.find(x => contractorNameBuilder(x) === e.target.innerText);\r\n        CorrespondenceService.getBuyerContractorEmailList(rfxRoundId, ctr.contractorDepartmentId).then(setContractorEmailList).catch(() => {\r\n            setContractorEmailList(null)\r\n            enqueueErrorSnackbar(Tr(\"unknown_error_message\"));\r\n        })\r\n\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"new_message\")}\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n        >\r\n            <div className={classes.dialogContent}>\r\n                <Form\r\n                    initialValues={{\r\n                        subject: \"\",\r\n                        contents: \"\",\r\n                        supplierRecipientIds: [],\r\n                        attachments: []\r\n                    }}\r\n                    validationSchema={Yup.object().shape({\r\n                        subject: VS.stringMax(limits.SUBJECT),\r\n                        contents: VS.string(),\r\n                        supplierRecipientIds: contractor ? VS.any() : VS.arrayRequired()\r\n                    })}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock column>\r\n                            {working && <Loading className={classes.loading}/>}\r\n\r\n                            {error && <Typography color='error'>{error}</Typography>}\r\n\r\n                            {!contractor &&\r\n                                <ToggleButtonGroup className={classes.toggle} size=\"small\" value={withOfferSwitch} exclusive\r\n                                                   onChange={(e, v) => onChangeWithOffer(v, formikProps)}>\r\n                                    <ToggleButton classes={{root: classes.toggleButton}} value={false} disabled={working}>\r\n                                        {Tr(\"correspondence_all_suppliers\")}\r\n                                    </ToggleButton>\r\n                                    <ToggleButton classes={{root: classes.toggleButton}} value={true} disabled={working}>\r\n                                        {Tr(\"correspondence_suppliers_with_offer\")}\r\n                                    </ToggleButton>\r\n                                </ToggleButtonGroup>\r\n                            }\r\n                            {!contractor &&\r\n                                <OrganizationsSelect\r\n                                    id='supplierRecipientIds'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('choose_recipients')}\r\n                                    disabled={working}\r\n                                    items={contractorListForSelect}\r\n                                    className={classes.uploadFile}\r\n                                    required\r\n                                    onChipClick={chipClick}\r\n                                    chipTitle={Tr(\"correspondence_email_title\")}\r\n                                />\r\n                            }\r\n\r\n                            <TextInput\r\n                                id='subject'\r\n                                formikProps={formikProps}\r\n                                label={Tr('subject')}\r\n                                disabled={working}\r\n                                limit={limits.SUBJECT}\r\n                                required\r\n                            />\r\n\r\n                            <TextInput\r\n                                id='contents'\r\n                                formikProps={formikProps}\r\n                                label={Tr('contents')}\r\n                                disabled={working}\r\n                                multiline\r\n                                required\r\n                            />\r\n\r\n                            <Box component=\"div\" className={classes.uploadFile}>\r\n                                <UploadFile\r\n                                    id='attachments'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr(\"attachment\")}\r\n                                    disabled={working}\r\n                                />\r\n                            </Box>\r\n\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n                {!!contractorEmailList && <div className={classes.ctrEmailList}>\r\n                    <GridBlock alignItems=\"center\" className={classes.ctrEmailListTitle}>\r\n                        <TypographyWithIcon Icon={InfoIcon}>{Tr(\"correspondence_email_notification_list\")}</TypographyWithIcon>\r\n                        <Button onClick={()=> setContractorEmailList(null)} disabled={!contractorEmailList.recipient} className={classes.marginLeft}>{Tr(\"close\")}</Button>\r\n                    </GridBlock>\r\n                    {\r\n                        !contractorEmailList.recipient ? <Loading/> : <CorrespondenceEmailList className={classes.marginTop} wrapper={contractorEmailList}/>\r\n                    }\r\n\r\n                </div>\r\n                }\r\n            </div>\r\n        </Dialog>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddThreadPopup);","import React, {useState} from 'react'\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport TextInput from \"../../TextInput\";\r\nimport Loading from \"../../Loading\";\r\nimport InputLimits from \"../../../constants/InputLimits\";\r\nimport UploadFile from \"../../UploadFile\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport MultiButton, {createButton} from \"../../popup/components/MultiButton\";\r\nimport AddContactor from \"../../popup/addContactor/AddContactor\";\r\nimport getObjectValue from \"../../../libs/getObjectValue\";\r\nimport InviteContactor from \"../../popup/inviteContactor/InviteContactor\";\r\nimport Chip from \"../../Chip\";\r\nimport ContractorService from \"../../../services/ContractorService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    inlineBlock: {\r\n        display: 'inline-block',\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    },\r\n    uploadFile: {\r\n        marginBottom: 20\r\n    },\r\n    nameError: {\r\n        fontSize: '0.75rem'\r\n    }\r\n}));\r\n\r\nconst limits = InputLimits.procedure.correspondence;\r\n\r\nfunction AddThreadAsSupplierForm(\r\n    {\r\n        demandId,\r\n        working,\r\n        error,\r\n        formikProps,\r\n\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [addPopup, setAddPopup] = useState(false);\r\n    const [invitePopup, setInvitePopup] = useState(false);\r\n\r\n    const getFormButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('add_contractor'), () => setAddPopup(true), undefined, working));\r\n        buttons.push(createButton(Tr('suggest_contractor'), () => setInvitePopup(true), undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n    const getInviteDefaultValues = () => ({\r\n            name: getObjectValue('name', formikProps.values, ''),\r\n            email: getObjectValue('email', formikProps.values, ''),\r\n            vatin: {\r\n                number: getObjectValue('vatin.number', formikProps.values, ''),\r\n                prefix: getObjectValue('vatin.prefix', formikProps.values, 'PL'),\r\n            }\r\n        }\r\n    )\r\n\r\n\r\n    const handleClearContractor = () => {\r\n\r\n        const values = {\r\n            ...formikProps.values,\r\n            contractorDepartmentId: 0,\r\n            suggestContractor: false,\r\n            contractorName: null,\r\n            name: '',\r\n            email: '',\r\n            vatin: {\r\n                number: '',\r\n                prefix: \"PL\"\r\n            }\r\n        };\r\n        formikProps.setValues(values);\r\n    }\r\n\r\n    const handleChipClick = () => {\r\n        if (getObjectValue('suggestContractor', formikProps.values, false)) {\r\n            setInvitePopup(true);\r\n        } else {\r\n            setAddPopup(true);\r\n        }\r\n\r\n    }\r\n    const handleAddContractors = (data) => {\r\n\r\n        if (data && data.platformAdded.length > 0) {\r\n            ContractorService.getContractorDetails(demandId, data.platformAdded[0]).then((resp) => {\r\n                handleClearContractor();\r\n                formikProps.setFieldValue(\"contractorDepartmentId\", data.platformAdded[0]);\r\n                formikProps.setFieldValue(\"contractorName\", resp.name);\r\n            }).finally(() => setAddPopup(false));\r\n        } else {\r\n            setAddPopup(false);\r\n        }\r\n    }\r\n\r\n    const handleInvite = (data) => {\r\n        const values = {\r\n            ...formikProps.values,\r\n            suggestContractor: true,\r\n            contractorDepartmentId: 0,\r\n            contractorName:data.name,\r\n            ...data\r\n        };\r\n        formikProps.setValues(values);\r\n        setInvitePopup(false);\r\n    }\r\n\r\n    const contractorName = getObjectValue('contractorName', formikProps.values, false);\r\n    const contractorNameError = getObjectValue('contractorName', formikProps.errors, '');\r\n\r\n    return (<GridBlock column>\r\n        {working && <Loading className={classes.loading}/>}\r\n\r\n        <MultiButton className={classes.margin} buttons={getFormButtons()} justify='space-evenly'/>\r\n\r\n        <div>\r\n            <Typography color={contractorNameError ? 'error' : undefined} className={classes.inlineBlock}>{Tr('contractor')}*:</Typography>\r\n            {!!contractorName && <Chip value={contractorName} onDelete={handleClearContractor} onClick={handleChipClick}/>}\r\n            {!!contractorNameError && <Typography color='error' className={classes.nameError}>{contractorNameError}</Typography>}\r\n        </div>\r\n\r\n        {error && <Typography color='error'>{error}</Typography>}\r\n\r\n        <TextInput\r\n            id='subject'\r\n            formikProps={formikProps}\r\n            label={Tr('subject')}\r\n            disabled={working}\r\n            limit={limits.SUBJECT}\r\n            required\r\n        />\r\n\r\n        <TextInput\r\n            id='contents'\r\n            formikProps={formikProps}\r\n            label={Tr('contents')}\r\n            disabled={working}\r\n            multiline\r\n            required\r\n        />\r\n\r\n        <Box component=\"div\" className={classes.uploadFile}>\r\n            <UploadFile\r\n                id='attachments'\r\n                formikProps={formikProps}\r\n                label={Tr(\"attachment\")}\r\n                disabled={working}\r\n            />\r\n        </Box>\r\n\r\n        {addPopup && <AddContactor\r\n            demandId={demandId}\r\n            onClose={() => setAddPopup(false)}\r\n            addContractorsTab={handleAddContractors}\r\n        />}\r\n\r\n        {invitePopup && <InviteContactor\r\n            demandId={demandId}\r\n            open={true}\r\n            onClose={() => setInvitePopup(false)}\r\n            handleInvite={handleInvite}\r\n            defaultValues={getInviteDefaultValues()}\r\n        />}\r\n\r\n    </GridBlock>)\r\n}\r\n\r\nexport default AddThreadAsSupplierForm;","import React, {useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport VS from \"constants/ValidationShema\";\r\nimport InputLimits from \"constants/InputLimits\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport {withRouter} from \"react-router\";\r\nimport AddThreadAsSupplierForm from \"./AddThreadAsSupplierForm\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\n\r\n\r\nconst limits = InputLimits.procedure.correspondence;\r\n\r\nfunction AddThreadAsSupplierPopup(\r\n    {\r\n        match,\r\n        rfxRoundId,\r\n        listResourceId,\r\n        onClose = () => {\r\n        },\r\n        formSubmit,\r\n    }) {\r\n\r\n    let demandId = match.params.id;\r\n\r\n    const [error, setError] = useState('');\r\n    const [working, setWorking] = useState(false);\r\n    const formId = useId();\r\n\r\n    const handleSubmit = () => {\r\n        setError('');\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const handleSaveResponse = (response) => {\r\n        if (isResponseValid(response, setError)) {\r\n            setWorking(false);\r\n            onClose(response);\r\n        } else {\r\n            setWorking(false);\r\n        }\r\n    }\r\n\r\n    const onSubmit = (thread) => {\r\n        setWorking(true);\r\n\r\n        let sender;\r\n        if (thread.suggestContractor) {\r\n            sender = {\r\n                name: thread.name,\r\n                email: thread.email,\r\n                vatin: {...thread.vatin},\r\n            }\r\n        } else {\r\n            sender = {\r\n                contractorDepartmentId: thread.contractorDepartmentId\r\n            }\r\n        }\r\n\r\n        const req = {\r\n            subject: thread.subject,\r\n            message: {\r\n                attachments: thread.attachments,\r\n                contents: thread.contents,\r\n                sender\r\n            }\r\n        }\r\n\r\n        CorrespondenceService.saveBuyerThreadAsContractor(rfxRoundId, req, listResourceId).then(handleSaveResponse).catch(() => setWorking(false));\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('save'), handleSubmit, undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"new_message\")}\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={<MultiButton buttons={getButtons()} />}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    suggestContractor: false,\r\n                    contractorName: '',\r\n                    contractorDepartmentId: 0,\r\n                    name: '',\r\n                    email: '',\r\n                    vatin: {\r\n                        number: \"\",\r\n                        prefix: \"PL\",\r\n                    },\r\n                    subject: \"\",\r\n                    contents: \"\",\r\n                    attachments: []\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    contractorName: VS.string(),\r\n                    subject: VS.stringMax(limits.SUBJECT),\r\n                    contents: VS.string(),\r\n                })}\r\n                onSubmit={onSubmit}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <AddThreadAsSupplierForm formikProps={formikProps} error={error} demandId={demandId} working={working}/>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(withRouter(AddThreadAsSupplierPopup));","import React, {useEffect, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport CorrespondenceService from \"../../../services/CorrespondenceService\";\r\nimport Loading from \"../../Loading\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"../../../constants/DateFormats\";\r\nimport SimpleTable from \"../simpleTable/SimpleTable\";\r\nimport TooltipIcon from \"../../icon/TooltipIcon\";\r\nimport {Mail, MailOutline} from \"@material-ui/icons\";\r\n\r\n\r\nexport const createConfirmObject = (message, confirmFn, cancelFn) => {\r\n    return {\r\n        message,\r\n        confirm: confirmFn,\r\n        cancel: cancelFn\r\n    }\r\n}\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    bold: {\r\n        fontWeight: theme.typography.fontWeightBold\r\n    },\r\n    buttonRow: {\r\n        marginTop: theme.spacing(2),\r\n        textAlign: \"end\"\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    emailColumn: theme.components.table.emailColumn,\r\n    ipColumn: theme.components.table.ipColumn,\r\n    dateTimeColumn: {\r\n        ...theme.components.table.dateTimeColumn,\r\n        textAlign: 'center'\r\n    }\r\n}));\r\n\r\nfunction MessageEmailDeliveryPopup(\r\n    {\r\n        recipient,\r\n        messageId,\r\n        rfxRoundId,\r\n        onClose\r\n    }) {\r\n\r\n\r\n    const classes = useStyle();\r\n\r\n    const [working, setWorking] = useState(true);\r\n    const [deliveryList, setDeliveryList] = useState([]);\r\n\r\n    useEffect(() => {\r\n\r\n        let promise;\r\n        if (!!recipient.invitedSupplier) {\r\n            promise = CorrespondenceService.getBuyerMessageDelivery(rfxRoundId, messageId, 'invitedSupplier', recipient.invitedSupplier);\r\n        } else if (!!recipient.contractorDepartmentId) {\r\n            promise = CorrespondenceService.getBuyerMessageDelivery(rfxRoundId, messageId, 'contractorDepartment', recipient.contractorDepartmentId);\r\n        } else {\r\n            promise = CorrespondenceService.getBuyerMessageDelivery(rfxRoundId, messageId, 'external', messageId);\r\n        }\r\n        promise.then(x => setDeliveryList(x)).finally(() => setWorking(false));\r\n\r\n    }, [recipient, messageId, rfxRoundId]);\r\n\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(\"OK\", onClose, undefined, false));\r\n        return buttons;\r\n    }\r\n\r\n    const getStatusCellContent = (item) => {\r\n        return <span>\r\n            {Tr(`message_delivery_status_${item.status}`)}\r\n            {!!item.errorMessage && <>\r\n                <br/><span className={classes.bold}>{Tr('details')}: </span>\r\n                <span>${item.errorMessage}</span>\r\n            </>}\r\n\r\n        </span>\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"message_delivery_status_title\") + `: ${recipient.name}`}\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={<MultiButton buttons={getButtons()} />}\r\n        >\r\n            {working && <Loading/>}\r\n            {!working &&\r\n            <SimpleTable\r\n                columnClasses={[\r\n                    classes.lpColumn,\r\n                    classes.emailColumn,\r\n                    undefined,\r\n                    classes.dateTimeColumn,\r\n                ]}\r\n                headers={[\"\", Tr('email'), Tr('status'), Tr('status_date')]}\r\n                items={deliveryList.map((item, index) => [\r\n                    <TooltipIcon color={item.status === 'FAILED' || item.status === 'EMAIL_BLOCKED' ? 'error' : ( item.status === 'SUSPENDED' ? 'secondary' : undefined )} Icon={item.status === 'SENT' ? Mail : MailOutline} tooltip={Tr(`message_delivery_status_info_${item.status}`)} />,\r\n                    item.recipient,\r\n                    getStatusCellContent(item),\r\n                    item.deliveryDate ? moment(item.deliveryDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT) : '--'\r\n                ])}\r\n            />\r\n\r\n            }\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default MessageEmailDeliveryPopup;","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from \"../../GridBlock\";\r\nimport {Badge, makeStyles, Tooltip, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from 'clsx';\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport FilesList from \"components/FilesList\";\r\nimport {Mail, MailOutline, Visibility, VisibilityOff} from '@material-ui/icons';\r\nimport MessageEmailDeliveryPopup from \"./MessageEmailDeliveryPopup\";\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\nimport Chip from \"@material-ui/core/Chip\";\r\nimport TooltipIcon from \"../../icon/TooltipIcon\";\r\nimport CorrespondenceService from \"../../../services/CorrespondenceService\";\r\nimport GetAppIcon from \"@material-ui/icons/GetApp\";\r\nimport WorkableIconButton from \"../../button/WorkableIconButton\";\r\nimport useSalesNotification from \"../../../hooks/useSalesNotification\";\r\nimport SignatureIcon from \"../../icon/SignatureIcon\";\r\nimport salesNotificationKeys from \"components/popup/salesNotification/constants/salesNotification.keys\";\r\nimport contractorNameBuilder from \"libs/contractorNameBuilder\";\r\nimport Alert from \"components/popup/alert/Alert\";\r\nimport {connect} from \"react-redux\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '80%',\r\n        margin: 5,\r\n    },\r\n    rootMine: {\r\n        marginLeft: '20%'\r\n    },\r\n    recipientsRoot: {\r\n        display: 'flex',\r\n        justifyContent: 'left',\r\n        flexWrap: 'wrap',\r\n        '& > *': {\r\n            margin: theme.spacing(0.5),\r\n            paddingRight: theme.spacing(1),\r\n        },\r\n    },\r\n    contentWrapper: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper,\r\n        position: 'relative'\r\n    },\r\n    contentWrapperUnread: {\r\n        borderWidth: 3\r\n    },\r\n    contentWrapperMine: {\r\n        backgroundColor: theme.palette.background.default\r\n    },\r\n    content: {\r\n        padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`\r\n    },\r\n    sendDate: {\r\n        margin: `0 ${theme.spacing(1)}px`,\r\n        minWidth: 110\r\n    },\r\n    message: {\r\n        whiteSpace: 'pre-line',\r\n        margin: `${theme.spacing(2)}px 0`\r\n    },\r\n    newBadge: {\r\n        position: 'absolute',\r\n        right: 0,\r\n        top: 3\r\n    },\r\n}));\r\n\r\n\r\nfunction Message(\r\n    {\r\n        rfxRoundId,\r\n        listResourceId,\r\n        contractor,\r\n        message,\r\n        hasEdit,\r\n        downloadAttachmentRegistrationDate\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const [emailDeliveryRecipient, setEmailDeliveryRecipient] = useState(null);\r\n    const [downloadZipWorking, setDownloadZipWorking] = useState(false);\r\n    const [verificationWorking, setVerificationWorking] = useState(false);\r\n    const mine = !!(contractor ? (message.contractorUser || message.publicQuestion || message.buyerAsContractorUser) : message.buyerUser);\r\n    const unread = !mine && !message.read && !message.buyerAsContractorUser;\r\n    const [showVerifyLimitUsedAlert, setShowVerifyLimitUsedAlert] = useState(false);\r\n    const showAttachmentDownloadInfo = mine && !!downloadAttachmentRegistrationDate && moment(downloadAttachmentRegistrationDate) < moment.now()\r\n\r\n\r\n    const showEmailDelivery = (recipient) => {\r\n        setEmailDeliveryRecipient(recipient);\r\n    }\r\n\r\n\r\n    const getSender = () => (message.contractorUser ?  <Tooltip title={`${message.contractorUser.firstName} ${message.contractorUser.lastName}`}><Chip label={message.sender.name}/></Tooltip>  : <Chip label={message.sender.name} />)\r\n    const getRecipient = (recipient) => (\r\n\r\n        <Chip key={recipient.id} label={contractorNameBuilder(recipient)} onDelete={()=> {}} deleteIcon={\r\n            <>\r\n\r\n                {!contractor && <> {recipient.firstEmailDeliveryDate ?\r\n                    <TooltipIcon onClick={() => showEmailDelivery(recipient)} Icon={Mail} tooltip={`${Tr('message_delivered')}: ${moment(recipient.firstEmailDeliveryDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}`}/> :\r\n                    <TooltipIcon onClick={() => showEmailDelivery(recipient)} Icon={MailOutline} tooltip={Tr('message_not_delivered')} label={recipient.name}/>}\r\n                    </>\r\n                }\r\n\r\n                {!message.buyerAsContractorUser &&\r\n                <>\r\n                    {!!recipient.firstReadDate ?\r\n                        <TooltipIcon Icon={Visibility} tooltip={`${Tr('message_read')}: ${moment(recipient.firstReadDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT)}`}/>\r\n                        :\r\n                        <TooltipIcon Icon={VisibilityOff} tooltip={Tr('message_unread')}/>}\r\n                </>\r\n                }\r\n            </>\r\n        }/>\r\n    )\r\n\r\n    const getStatusCaption = () => {\r\n        if (message.buyerAsContractorUser) {\r\n            return \"send_buyer_as_contractor_date\";\r\n        } else if (message.published) {\r\n            return \"send_and_publish_date\";\r\n        } else {\r\n            return \"send_date\";\r\n        }\r\n    }\r\n    const onPrintVerification = () => {\r\n        setVerificationWorking(true);\r\n        CorrespondenceService.checkVerificationLimit(rfxRoundId, message.messageId).then(resp => {\r\n            if (resp.result)\r\n                CorrespondenceService.printBuyerMessageAttachmentsVerification(rfxRoundId, message.messageId, () => setVerificationWorking(false));\r\n            else {\r\n                setVerificationWorking(false);\r\n                setShowVerifyLimitUsedAlert(true);\r\n            }\r\n        });\r\n    }\r\n    const printVerificationSalesCheck = useSalesNotification(salesNotificationKeys.SIGNATURE_VERIFICATOR, onPrintVerification);\r\n\r\n    const onDownloadZip = () => {\r\n        const method = contractor ? CorrespondenceService.downloadContractorMessageAttachmentsZip : CorrespondenceService.downloadBuyerMessageAttachmentsZip;\r\n        setDownloadZipWorking(true);\r\n        method(rfxRoundId, message.messageId, () => setDownloadZipWorking(false));\r\n    }\r\n\r\n    const downloadAttachment = (attachment) => {\r\n        const method = contractor ? CorrespondenceService.downloadContractorMessageAttachment : CorrespondenceService.downloadBuyerMessageAttachment;\r\n        method(rfxRoundId, attachment.identity)\r\n    }\r\n\r\n    const getCustomAttachmentActions = (attachments) => (\r\n        <>\r\n            {!mine && attachments.some(a => !a.inaccessible) &&\r\n            <WorkableIconButton\r\n                tooltip={Tr('download_all_message_attachments')}\r\n                Icon={GetAppIcon}\r\n                onClick={onDownloadZip}\r\n                working={downloadZipWorking}/>\r\n            }\r\n            {(!contractor && !mine && hasEdit) &&\r\n            <WorkableIconButton\r\n                tooltip={Tr('print_message_attachments_verification')}\r\n                Icon={SignatureIcon}\r\n                onClick={printVerificationSalesCheck}\r\n                working={verificationWorking}/>\r\n            }\r\n        </>\r\n    )\r\n\r\n    return (\r\n        <div className={clsx(classes.root, {[classes.rootMine]: mine, 'new-message-scroll-to': unread})}>\r\n\r\n            <div className={clsx(classes.contentWrapper, {[classes.contentWrapperMine]: mine, [classes.contentWrapperUnread]: unread})}>\r\n                <div className={classes.content}>\r\n                    {unread && <Badge className={clsx(classes.newBadge)} badgeContent='NOWA' color=\"error\">\r\n                        <MailIcon color='primary'/>\r\n                    </Badge>}\r\n                    <GridBlock justify='flex-end'>\r\n                        <BoldTypography variant='caption'>{`${Tr(getStatusCaption())}: `}</BoldTypography>\r\n                        <Typography variant='caption' component='p' className={classes.sendDate}>\r\n                            {message.sendDate ? moment(message.sendDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT) : ''}\r\n                        </Typography>\r\n                    </GridBlock>\r\n\r\n                    <div className={classes.recipientsRoot}>\r\n                        <Typography><strong>{mine ? Tr('recipients') : Tr('sender')}: </strong></Typography>\r\n                        {mine ? message.recipients.map(x => getRecipient(x)) : getSender()}\r\n                    </div>\r\n\r\n                    <Typography variant='body1' className={classes.message}>{message.contents}</Typography>\r\n\r\n                    {!!message?.attachments?.length && <>\r\n                        <BoldTypography>{Tr('attachment')}</BoldTypography>\r\n                        <FilesList elements={message.attachments} onDownload={downloadAttachment} customAction={getCustomAttachmentActions(message.attachments)}\r\n                                   showDownloadDate={showAttachmentDownloadInfo} />\r\n                    </>}\r\n                </div>\r\n            </div>\r\n            {!!emailDeliveryRecipient && <MessageEmailDeliveryPopup recipient={emailDeliveryRecipient} messageId={message.messageId} rfxRoundId={rfxRoundId}\r\n                                                                    onClose={() => setEmailDeliveryRecipient(null)}/>}\r\n            {showVerifyLimitUsedAlert && <Alert\r\n                confirmText={Tr('client.limit.verification.used')}\r\n                open={showVerifyLimitUsedAlert}\r\n                onClose={() => setShowVerifyLimitUsedAlert(false)}\r\n                maxWidth='sm'\r\n            />}\r\n        </div>\r\n    )\r\n}\r\n\r\nMessage.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        downloadAttachmentRegistrationDate: state.resources[CorrespondenceService.CORRESPONDENCE_DOWNLOAD_ATTACHMENT_REGISTRATION_DATE_RESOURCE_ID],\r\n    }\r\n}\r\nconst mapDispatchToProps = {}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(Message);","import React, {useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport OrganizationsSelect from \"components/OrganizationsSelect\";\r\nimport Tr from \"translations/Translations\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport {connect} from \"react-redux\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport contractorNameBuilder from \"libs/contractorNameBuilder\";\r\nimport Dialog from \"components/Dialog\";\r\nimport Loading from \"components/Loading\";\r\nimport CorrespondenceEmailList from \"./CorrespondenceEmailList\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport downloadFile from \"../../../libs/downloadFile\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    buttons: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    linkToSection: {\r\n        cursor: 'pointer'\r\n    }\r\n}));\r\n\r\nfunction NewMessageForm(\r\n    {\r\n        rfxRoundId,\r\n        contractor,\r\n        formikProps,\r\n        message,\r\n        error,\r\n        working,\r\n        autoSave,\r\n        updateMessage,\r\n        deleteMessage,\r\n        currentActive,\r\n        threadsAfterEndDate\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [contractorListForSelect] = useState(contractor ? [] : message.availableRecipients.map(x => ({label: contractorNameBuilder(x), value: x.id})));\r\n    const [contractorEmailList, setContractorEmailList] = useState(null);\r\n    const {enqueueErrorSnackbar} = useSnackbar();\r\n\r\n    const doAutoSave = () => {\r\n        autoSave();\r\n    }\r\n\r\n    const handleSubmit = (type) => {\r\n        updateMessage(type, formikProps);\r\n    }\r\n\r\n    const handleDelete = () => {\r\n        deleteMessage(message.messageId);\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('delete'), handleDelete, 'outlined', working));\r\n        if (!contractor) {\r\n            buttons.push(createButton(Tr('send_and_publish'), () => handleSubmit('publish'), 'outlined', !currentActive || working));\r\n        }\r\n        buttons.push(createButton(Tr('save'), () => handleSubmit('save'), 'outlined', !currentActive || working));\r\n        buttons.push(createButton(Tr('send'), () => handleSubmit('send'), undefined, !currentActive || working));\r\n        return buttons;\r\n    }\r\n\r\n    const chipClick = (e) => {\r\n        const rec = message.availableRecipients.find(x => contractorNameBuilder(x) === e.target.innerText);\r\n        if (rec.id.startsWith(\"EXT_\")) {\r\n            setContractorEmailList({recipient: rec, emails: [rec.email]})\r\n        } else {\r\n            setContractorEmailList({})\r\n            CorrespondenceService.getBuyerContractorEmailList(rfxRoundId, rec.contractorDepartmentId).then(setContractorEmailList).catch(() => {\r\n                setContractorEmailList(null)\r\n                enqueueErrorSnackbar(Tr(\"unknown_error_message\"));\r\n            })\r\n        }\r\n\r\n    }\r\n\r\n    const downloadAttachment = (attachment) => {\r\n        const method = contractor ? CorrespondenceService.downloadContractorMessageAttachment : CorrespondenceService.downloadBuyerMessageAttachment;\r\n        !!attachment.identity ? method(rfxRoundId, attachment.identity) : downloadFile(attachment.file)\r\n    }\r\n\r\n    return (\r\n        <>\r\n            {error && <Typography color='error'>{error}</Typography>}\r\n\r\n            {!contractor &&\r\n                <OrganizationsSelect\r\n                    id='supplierRecipientIds'\r\n                    formikProps={formikProps}\r\n                    label={Tr('choose_recipients')}\r\n                    required\r\n                    //disabled={working}\r\n                    items={contractorListForSelect}\r\n                    className={classes.uploadFile}\r\n                    onChange={doAutoSave}\r\n                    onChipClick={chipClick}\r\n                    chipTitle={Tr(\"correspondence_email_title\")}\r\n                />\r\n            }\r\n\r\n            <TextInput\r\n                id='contents'\r\n                formikProps={formikProps}\r\n                label={Tr('contents')}\r\n                //disabled={working}\r\n                onChange={doAutoSave}\r\n                multiline\r\n                required\r\n            />\r\n\r\n            <Box component=\"div\" className={classes.uploadFile}>\r\n                <UploadFile\r\n                    id='attachments'\r\n                    formikProps={formikProps}\r\n                    label={Tr(\"attachment\")}\r\n                    onUploadPopupClosed={doAutoSave}\r\n                    onDelete={doAutoSave}\r\n                    onDownload={downloadAttachment}\r\n                />\r\n            </Box>\r\n\r\n            {\r\n                !currentActive && <Typography color=\"error\" className={classes.linkToSection}\r\n                                              onClick={() => scrollTo(`#section_${CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID}`)}>\r\n                    {Tr('correspondence_disabled_section', {name: threadsAfterEndDate.name})}</Typography>\r\n            }\r\n            <MultiButton className={classes.buttons} buttons={getButtons()}/>\r\n\r\n            {\r\n                !!contractorEmailList &&\r\n                <Dialog\r\n                    open\r\n                    maxWidth=\"md\"\r\n                    title={Tr(\"correspondence_email_notification_list\")}\r\n                    dialogActions={<SingleButton disabled={!contractorEmailList.recipient} label={Tr(\"close\")} onClick={() => setContractorEmailList(null)}/>}\r\n                    onClose={!contractorEmailList.recipient ? undefined : () => setContractorEmailList(null)}\r\n                >\r\n                    {\r\n                        !contractorEmailList.recipient ? <Loading/> : <CorrespondenceEmailList wrapper={contractorEmailList}/>\r\n                    }\r\n\r\n                </Dialog>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nNewMessageForm.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        threadsAfterEndDate: state.resources[CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID],\r\n    }\r\n};\r\n\r\nexport default connect(mapStateToProps, {})(NewMessageForm);","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport UploadFile from \"components/UploadFile\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport VS from \"constants/ValidationShema\";\r\n\r\n\r\nexport const createConfirmObject = (message, confirmFn, cancelFn) => {\r\n    return {\r\n        message,\r\n        confirm: confirmFn,\r\n        cancel: cancelFn\r\n    }\r\n}\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n        message: {\r\n            whiteSpace: 'pre-line',\r\n            margin: `${theme.spacing(2)}px 0`\r\n        },\r\n        actionWrap: {\r\n            display: 'block',\r\n            width: '100%',\r\n            textAlign: 'center',\r\n            borderTop: '2px solid',\r\n            marginTop: theme.spacing(3),\r\n            paddingTop: theme.spacing(1)\r\n        }\r\n    }\r\n));\r\n\r\nfunction PublishMessageConfirmationPopup(\r\n    {\r\n        publishMessageInfo\r\n    }) {\r\n\r\n\r\n    const classes = useStyle();\r\n\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), () => {\r\n            publishMessageInfo.cancel();\r\n        }, 'outlined', false));\r\n        buttons.push(createButton(Tr('publish'), () => {\r\n            publishMessageInfo.confirm();\r\n        }, undefined, false));\r\n        return buttons;\r\n    }\r\n\r\n    const getDialogActions = () => (<div className={classes.actionWrap}>\r\n        <BoldTypography>{Tr('publish_message_popup_text1')}</BoldTypography>\r\n        <BoldTypography>{Tr('publish_message_popup_text2')}</BoldTypography>\r\n        <MultiButton buttons={getButtons()} />\r\n    </div>)\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"publish_message_popup_header\")}\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={getDialogActions()}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    _editable: false,\r\n                    contents: publishMessageInfo.message.contents,\r\n                    attachments: publishMessageInfo.message.attachments\r\n                }}\r\n                validationSchema={VS.any()}\r\n                onSubmit={() => {\r\n                }}\r\n                id='0'\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n\r\n                        <BoldTypography>{Tr('contents')}</BoldTypography>\r\n                        <Typography className={classes.message}>{getObjectValue('contents', formikProps.values, '')}</Typography>\r\n\r\n                        {!!formikProps.values?.attachments.length && <Box component=\"div\" className={classes.uploadFile}>\r\n                            <UploadFile\r\n                                id='attachments'\r\n                                formikProps={formikProps}\r\n                                label={Tr(\"attachment\")}\r\n                                disabled\r\n                            />\r\n                        </Box>}\r\n\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default PublishMessageConfirmationPopup;","import React, {useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport clsx from 'clsx';\r\nimport * as Yup from \"yup\";\r\nimport _ from \"lodash\";\r\nimport {connect} from \"react-redux\";\r\nimport moment from \"libs/moment\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Tr from \"translations/Translations\";\r\nimport NewMessageForm from \"./NewMessageForm\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport PublishMessageConfirmationPopup, {createConfirmObject} from \"./PublishMessageConfirmationPopup\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        width: '80%',\r\n        margin: 5,\r\n        marginLeft: '20%',\r\n    },\r\n    contentWrapper: {\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper\r\n    },\r\n    content: {\r\n        padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`\r\n    },\r\n    sendDate: {\r\n        margin: `0 ${theme.spacing(1)}px`,\r\n        minWidth: 110\r\n    },\r\n    message: {\r\n        whiteSpace: 'pre-line',\r\n        margin: `${theme.spacing(2)}px 0`\r\n    }\r\n}));\r\n\r\n\r\nfunction NewMessage(\r\n    {\r\n        rfxRoundId,\r\n        listResourceId,\r\n        contractor,\r\n        message,\r\n        threadId,\r\n        formSubmit,\r\n        currentActive\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n    const formId = useId();\r\n    const [error, setError] = useState('');\r\n    const [working, setWorking] = useState(false);\r\n    const autoSaveSemaphore = useRef(false);\r\n    const [publishMessageInfo, setPublishMessageInfo] = useState(null);\r\n    const updateMessage = async (type, values) => {\r\n\r\n        const messageOut = {\r\n            attachments: values.attachments,\r\n            contents: values.contents,\r\n            recipients: contractor ? null : message.availableRecipients.filter(x => values.supplierRecipientIds.indexOf(x.id) > -1)\r\n        };\r\n        let holdSetWorking = false;\r\n        try {\r\n            let response;\r\n            if (contractor) {\r\n                response = await CorrespondenceService.updateContractorMessage(rfxRoundId, threadId, message.messageId, listResourceId, messageOut);\r\n            } else {\r\n                response = await CorrespondenceService.updateBuyerMessage(rfxRoundId, threadId, message.messageId, listResourceId, messageOut);\r\n            }\r\n\r\n            const isSaveRespValid = isResponseValid(response);\r\n            if (isSaveRespValid && (\"send\" === type)) {\r\n                let sendResp\r\n                if (contractor) {\r\n                    sendResp = await CorrespondenceService.sendContractorMessage(rfxRoundId, threadId, message.messageId, listResourceId);\r\n                } else {\r\n                    sendResp = await CorrespondenceService.sendBuyerMessage(rfxRoundId, threadId, message.messageId, listResourceId);\r\n                }\r\n                holdSetWorking |= isResponseValid(sendResp);\r\n            } else if (isSaveRespValid && \"publish\" === type) {\r\n                const publishResp = await CorrespondenceService.publishBuyerMessage(rfxRoundId, threadId, message.messageId, listResourceId);\r\n                holdSetWorking |= isResponseValid(publishResp);\r\n            }\r\n        } catch (e) {\r\n            console.error(e)\r\n        }\r\n        if (!holdSetWorking) {\r\n            setWorking(false);\r\n        }\r\n    }\r\n\r\n    const cancelPublish = (messageId) => {\r\n        setPublishMessageInfo(null);\r\n        setWorking(false);\r\n\r\n    }\r\n    const deleteMessage = async (messageId) => {\r\n        setWorking(true);\r\n        setError('');\r\n\r\n        let delResp = null;\r\n        if (contractor) {\r\n            delResp = await CorrespondenceService.deleteContractorMessage(rfxRoundId, threadId, messageId, listResourceId);\r\n        } else {\r\n            delResp = await CorrespondenceService.deleteBuyerMessage(rfxRoundId, threadId, messageId, listResourceId);\r\n        }\r\n        if (delResp.success !== true) {\r\n            isResponseValid(delResp, setError);\r\n        }\r\n    }\r\n\r\n    const handleSubmit = (type, formikProps, values) => {\r\n        autoSaveSemaphore.current = false;\r\n        if (formikProps) {\r\n            values = formikProps.values;\r\n        }\r\n        setWorking(true);\r\n        setError('');\r\n\r\n        if (\"send\" === type || \"publish\" === type) {\r\n\r\n            Yup.object().shape({\r\n                contents: VS.string(),\r\n                supplierRecipientIds: contractor ? VS.any() : VS.arrayRequired()\r\n            }).validate(values, {abortEarly: false}).then(x => {\r\n                if (\"send\" === type) {\r\n                    updateMessage(type, x);\r\n                } else if (\"publish\" === type) {\r\n                    setPublishMessageInfo(createConfirmObject(values, () => updateMessage(type, x), cancelPublish));\r\n                }\r\n            }).catch(x => {\r\n                const ob = {};\r\n                x.inner.reverse().forEach(x => ob[x.path] = x.message);\r\n                formikProps.setErrors(ob);\r\n                setWorking(false);\r\n            })\r\n        } else {\r\n            updateMessage(type, values);\r\n        }\r\n\r\n    }\r\n\r\n\r\n    const onSubmit = (values) => {\r\n        handleSubmit('autoSave', null, values);\r\n    };\r\n\r\n    const autoSaveDebounced = _.debounce(() => {\r\n        if (autoSaveSemaphore.current) {\r\n            formSubmit[formId]();\r\n        }\r\n    }, 8000);\r\n\r\n    const autoSave = () => {\r\n        autoSaveSemaphore.current = true;\r\n        autoSaveDebounced();\r\n    }\r\n\r\n\r\n    return (\r\n        <div className={clsx(classes.root)}>\r\n\r\n            <div className={clsx(classes.contentWrapper)}>\r\n                <div className={classes.content}>\r\n                    <GridBlock justify='flex-end'>\r\n                        <BoldTypography variant='caption'>{`${Tr('last_save_date')}: `}</BoldTypography>\r\n                        <Typography variant='caption' component='p' className={classes.sendDate}>\r\n                            {message.modifiedDate ? moment(message.modifiedDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT) : ''}\r\n                        </Typography>\r\n                    </GridBlock>\r\n                    <Form\r\n                        initialValues={{\r\n                            contents: message.contents,\r\n                            supplierRecipientIds: message.recipients.map(x => x.id),\r\n                            attachments: message.attachments\r\n                        }}\r\n                        initialTouched={{\r\n                            contents: true,\r\n                            supplierRecipientIds: true,\r\n                            attachments: true\r\n                        }}\r\n                        onSubmit={onSubmit}\r\n                        validationSchema={VS.any()}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <NewMessageForm formikProps={formikProps} message={message} rfxRoundId={rfxRoundId} autoSave={autoSave} updateMessage={handleSubmit}\r\n                                            deleteMessage={deleteMessage} error={error} working={working} contractor={contractor}\r\n                                            currentActive={currentActive}/>\r\n                        )}\r\n                    </Form>\r\n                </div>\r\n            </div>\r\n            {(!contractor && !!publishMessageInfo) && <PublishMessageConfirmationPopup publishMessageInfo={publishMessageInfo}/>}\r\n        </div>\r\n    )\r\n}\r\n\r\nNewMessage.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(NewMessage);","import React, {useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Loading from \"components/Loading\";\r\nimport Message from \"./Message\";\r\nimport Tr from \"translations/Translations\";\r\nimport Button from \"components/Button\";\r\nimport PostAddIcon from '@material-ui/icons/PostAdd';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport NewMessage from \"./NewMessage\";\r\nimport {connect} from \"react-redux\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    addButton: {\r\n        float: 'right'\r\n    }\r\n}));\r\n\r\nfunction MessagesList(\r\n    {\r\n        rfxRoundId,\r\n        listResourceId,\r\n        contractor,\r\n        thread,\r\n        currentActive,\r\n        correspondencePrivileges\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [addInProgress, setAddInProgress] = useState(false);\r\n    const hasEdit = useMemo(()=> !!correspondencePrivileges.EDIT, [correspondencePrivileges]);\r\n\r\n    if (!thread.messages) {\r\n        return <Loading/>\r\n    }\r\n\r\n    const addMessageClick = () => {\r\n        setAddInProgress(true);\r\n        if(contractor) {\r\n            CorrespondenceService.createContractorMessage(rfxRoundId, thread.threadId, listResourceId).finally(() => setAddInProgress(false));\r\n        } else {\r\n            CorrespondenceService.createBuyerMessage(rfxRoundId, thread.threadId, listResourceId).finally(() => setAddInProgress(false));\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <GridBlock column>\r\n                {thread.messages.map((msg) => (\r\n                    msg.status === 'saved' ?\r\n                        <NewMessage key={msg.messageId} rfxRoundId={rfxRoundId} listResourceId={listResourceId} message={msg} threadId={thread.threadId} contractor={contractor} currentActive={currentActive}/>\r\n                        :\r\n                        <Message key={msg.messageId} rfxRoundId={rfxRoundId} listResourceId={listResourceId} message={msg} contractor={contractor} hasEdit={hasEdit}/>)\r\n                )}\r\n\r\n                {hasEdit && currentActive &&\r\n                    <Button\r\n                        className={classes.addButton}\r\n                        onClick={addMessageClick}\r\n                        disabled={addInProgress}>\r\n                        <PostAddIcon/> {Tr('add_message_in_thread')}\r\n                    </Button>\r\n                }\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nMessagesList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        correspondencePrivileges: state.privileges[PrivilegeService.CORRESPONDENCE_PRIVILEGE_STORE_KEY],\r\n    }\r\n}\r\nconst mapDispatchToProps = {}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(MessagesList);","import React, {memo, useState} from 'react'\r\nimport Typography from '@material-ui/core/Typography'\r\nimport MailIcon from '@material-ui/icons/Mail';\r\nimport OutlinedFlagRoundedIcon from '@material-ui/icons/OutlinedFlagRounded';\r\nimport FlagRoundedIcon from '@material-ui/icons/FlagRounded';\r\nimport {Badge, Checkbox, makeStyles, Tooltip} from \"@material-ui/core\";\r\nimport ExpansionPanel from \"../../ExpansionPanel\";\r\nimport Tr from \"translations/Translations\";\r\nimport GridBlock from \"../../GridBlock\";\r\nimport clsx from 'clsx';\r\nimport CorrespondenceService from \"../../../services/CorrespondenceService\";\r\nimport MessagesList from \"./MessagesList\";\r\nimport scrollTo from \"../../../libs/scrollTo\";\r\nimport WorkableIconButton from \"../../button/WorkableIconButton\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2)\r\n\r\n    },\r\n    rootExpanded: {\r\n        marginBottom: `${theme.spacing(2)}px !important`\r\n    },\r\n    title: {\r\n        padding: 0,\r\n    },\r\n    summaryRoot: {\r\n        '&>*:nth-child(3)': {\r\n            flexGrow: 1,\r\n           //paddingLeft: theme.spacing(2),\r\n            width: 0,\r\n        }\r\n    },\r\n    summaryItem: {\r\n        padding: \"0 \" + theme.spacing(1) + \"px\"\r\n    },\r\n    subject: {\r\n        whiteSpace: 'nowrap',\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis'\r\n    },\r\n    subjectExpanded: {\r\n        wordBreak: 'break-all'\r\n    },\r\n    avatar: {\r\n        width: 30,\r\n        height: 30,\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    member: {\r\n        width: '200px',\r\n        overflow: 'hidden',\r\n        whiteSpace: 'nowrap',\r\n        textOverflow: 'ellipsis'\r\n    },\r\n    hasUnread: {\r\n        fontWeight: theme.typography.fontWeightBold\r\n    },\r\n    redFlag: {\r\n        color: theme.palette.error.main\r\n    }\r\n}));\r\n\r\n\r\nfunction Thread(\r\n    {\r\n        thread,\r\n        rfxRoundId,\r\n        contractor,\r\n        onThreadSelectChange = () => {\r\n        },\r\n        selectedThreads,\r\n        listResourceId,\r\n        currentActive\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const [expanded, setExpanded] = useState(!!thread.messages);\r\n    const [redFlagWorking, setRedFlagWorking] = useState(false);\r\n    const [loadingMessagesWorking, setLoadingMessagesWorking] = useState(false);\r\n    const threadSelected = selectedThreads.indexOf(thread.threadId) > -1;\r\n\r\n    const selectThreadChange = (e) => {\r\n        onThreadSelectChange(thread, e.target.checked);\r\n    }\r\n\r\n    const toggleThread = (callback) => {\r\n        if(loadingMessagesWorking) {\r\n            return;\r\n        }\r\n\r\n        setExpanded(!expanded);\r\n        if(expanded) {\r\n            CorrespondenceService.clearThreadMessages(thread.threadId, listResourceId);\r\n        } else {\r\n            setLoadingMessagesWorking(true);\r\n            if(contractor) {\r\n                CorrespondenceService.getContractorThreadMessageList(rfxRoundId, thread.threadId, listResourceId).then(()=> { if(typeof callback === 'function')setTimeout(callback, 500)}).catch(()=> setExpanded(false)).finally(()=> setLoadingMessagesWorking(false));\r\n            } else {\r\n                CorrespondenceService.getBuyerThreadMessageList(rfxRoundId, thread.threadId, listResourceId).then(()=> { if(typeof callback === 'function')setTimeout(callback, 500)}).catch(()=> setExpanded(false)).finally(()=> setLoadingMessagesWorking(false));\r\n            }\r\n\r\n        }\r\n    }\r\n\r\n    const scrollToMessage = () => {\r\n        if(loadingMessagesWorking) {\r\n            return;\r\n        }\r\n        if(expanded) {\r\n            doScrollToMessage();\r\n        } else {\r\n            toggleThread(doScrollToMessage)\r\n        }\r\n\r\n    }\r\n    const doScrollToMessage = () => {\r\n        scrollTo(`#messate-thread-${thread.threadId} .new-message-scroll-to`);\r\n    }\r\n\r\n    const flagClick = () => {\r\n        setRedFlagWorking(true);\r\n        let fn;\r\n        if (thread.hasRedFlag) {\r\n            fn = contractor ? CorrespondenceService.sendContractorUnflagThread : CorrespondenceService.sendBuyerUnflagThread;\r\n        } else {\r\n            fn = contractor ? CorrespondenceService.sendContractorFlagThread : CorrespondenceService.sendBuyerFlagThread;\r\n        }\r\n        fn(rfxRoundId, thread.threadId, listResourceId).finally(() => setRedFlagWorking(false));\r\n    }\r\n\r\n\r\n    const createTitle = ({threadId, hasRedFlag, subject, recipients, unreadMessagesCount = 0}) => {\r\n        return (\r\n            <GridBlock alignItems=\"center\" wrap='nowrap' justify='space-between' gridClasses={{root: classes.summaryRoot, item: classes.summaryItem}}>\r\n                <Tooltip title={threadSelected ? Tr('checkbox_uncheck') : Tr('checkbox_check')}>\r\n                    <Checkbox\r\n                        color='primary'\r\n                        checked={threadSelected}\r\n                        onChange={selectThreadChange}\r\n                        disabled={false}\r\n                    />\r\n                </Tooltip>\r\n                {!contractor ?\r\n                <Typography className={clsx(classes.member, {[classes.hasUnread]: !!unreadMessagesCount})} variant='h6' onClick={toggleThread}>\r\n                    {recipients.map(x => x.name).join(\", \")}\r\n                </Typography> : <Typography />}\r\n                <Typography className={clsx({\r\n                    [classes.subjectExpanded]: expanded,\r\n                    [classes.subject]: !expanded,\r\n                    [classes.hasUnread]: !!unreadMessagesCount\r\n                })\r\n                } variant='h6' onClick={toggleThread}>\r\n                    {subject}\r\n                </Typography>\r\n                {!!unreadMessagesCount && <div>\r\n                    <Badge badgeContent={unreadMessagesCount} max={9} color=\"error\">\r\n                        <MailIcon color='primary' onClick={scrollToMessage}/>\r\n                    </Badge>\r\n                </div>}\r\n                <WorkableIconButton className={classes.redFlag} Icon={hasRedFlag ? FlagRoundedIcon : OutlinedFlagRoundedIcon} tooltip={hasRedFlag ? Tr('unflag') : Tr(\"flag\")}\r\n                                    onClick={flagClick} working={redFlagWorking}/>\r\n                <WorkableIconExpandButton\r\n                    color='primary'\r\n                    onClick={toggleThread}\r\n                    expanded={expanded}\r\n                />\r\n            </GridBlock>\r\n        )\r\n    }\r\n\r\n    return (\r\n        <ExpansionPanel\r\n            titleAdornment={createTitle(thread)}\r\n            expanded={expanded}\r\n            onChange={(event, expanded) => {\r\n                if (event === null) setExpanded(expanded)\r\n            }}\r\n            classesObj={{root: classes.root, expanded: classes.rootExpanded, title: classes.title}}\r\n            square={true}\r\n            id={`messate-thread-${thread.threadId}`}>\r\n            <MessagesList listResourceId={listResourceId} rfxRoundId={rfxRoundId} thread={thread} contractor={contractor} currentActive={currentActive}/>\r\n        </ExpansionPanel>\r\n    )\r\n}\r\n\r\nexport default memo(Thread, (prevProps, nextProps) => {\r\n    //const t0 = performance.now()\r\n    const resp = ((prevProps, nextProps) => {\r\n        if (prevProps.rfxRoundId !== nextProps.rfxRoundId) return false;\r\n        if (prevProps.currentActive !== nextProps.currentActive) return false;\r\n\r\n        if(prevProps.selectedThreads !== nextProps.selectedThreads) {\r\n            if ((prevProps.selectedThreads.indexOf(prevProps.thread.threadId) > -1) !== (nextProps.selectedThreads.indexOf(nextProps.thread.threadId) > -1)) return false;\r\n        }\r\n\r\n        if(prevProps.thread !== nextProps.thread) {\r\n            return false;\r\n        }\r\n\r\n        return true;\r\n    })(prevProps, nextProps);\r\n    // const t1 = performance.now()\r\n    // console. log(\"Thread rerender\", !resp);\r\n    return resp;\r\n})","import React, {useRef, useState} from 'react'\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport clsx from \"clsx\";\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport TextInput from \"../../TextInput\";\r\nimport Loading from \"../../Loading\";\r\nimport UploadFile from \"../../UploadFile\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport MultiButton, {createButton} from \"../../popup/components/MultiButton\";\r\nimport Chip from \"../../Chip\";\r\nimport getObjectValue from \"../../../libs/getObjectValue\";\r\nimport CorrespondenceService from \"../../../services/CorrespondenceService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport PublishMessageConfirmationPopup, {createConfirmObject} from \"./PublishMessageConfirmationPopup\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport TypographyWithIcon from \"../../TypographyWithIcon\";\r\nimport InfoIcon from \"@material-ui/icons/Info\";\r\nimport Button from \"components/Button\";\r\nimport CorrespondenceEmailList from \"./CorrespondenceEmailList\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    margin: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    loading: {\r\n        width: '98%'\r\n    },\r\n    buttonRow: {\r\n        textAlign: \"end\"\r\n    },\r\n    uploadFile: {\r\n        marginBottom: 20\r\n    },\r\n    chip: {\r\n        width: '100%',\r\n        marginTop: theme.spacing(1),\r\n        \"&>.MuiChip-label\": {\r\n            width: '100%',\r\n            display: \"flex\"\r\n        }\r\n    },\r\n    chipLabel: {\r\n        display: \"flex\",\r\n        width: '100%'\r\n    },\r\n    chipSupplier: {\r\n        display: \"block\",\r\n        width: \"200px\",\r\n        paddingRight: theme.spacing(4),\r\n        paddingLeft: theme.spacing(2),\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis'\r\n    },\r\n    chipSubject: {\r\n        fontWeight: \"bold\",\r\n        flexGrow: 1,\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis'\r\n    },\r\n    hidden: {\r\n        opacity: 0,\r\n        transition: 'opacity 0.1s'\r\n    },\r\n    marginLeft: {\r\n        marginLeft: theme.spacing(2)\r\n    },\r\n    marginTop: {\r\n        marginTop: theme.spacing(4)\r\n    },\r\n    dialogContent: {\r\n        position: \"relative\"\r\n    },\r\n    ctrEmailList: {\r\n        background: theme.palette.background.paper,\r\n        position: \"absolute\",\r\n        top: 0,\r\n        left: 0,\r\n        width: \"100%\",\r\n        height: \"100%\"\r\n    },\r\n    ctrEmailListTitle: {\r\n        position: \"fixed\",\r\n        background: theme.palette.background.paper,\r\n        maxWidth: 900,\r\n        marginTop: theme.spacing(-1)\r\n    }\r\n}));\r\n\r\nfunction AddBulkMessagePopup(\r\n    {\r\n        rfxRoundId,\r\n        listResourceId,\r\n        threadsList,\r\n        selectedThreads,\r\n        onClose = () => {\r\n        },\r\n        formSubmit,\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n\r\n    const [error, setError] = useState('');\r\n    const [working, setWorking] = useState(false);\r\n    const [publishMessageInfo, setPublishMessageInfo] = useState(null);\r\n    const [contractorEmailList, setContractorEmailList] = useState(null);\r\n    const {enqueueErrorSnackbar} = useSnackbar();\r\n    const [open, setOpen] = useState(true);\r\n    const sendType = useRef('');\r\n    const formId = useId();\r\n\r\n    const handleSubmit = (type) => {\r\n        setError('');\r\n        sendType.current = type;\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    const cancelPublish = () => {\r\n        setOpen(true);\r\n        setPublishMessageInfo(null);\r\n        setWorking(false);\r\n    }\r\n    const processMessage = (type, message) => {\r\n\r\n        if (type === 'send') {\r\n            CorrespondenceService.sendBuyerBulkMessages(rfxRoundId, message, listResourceId)\r\n                .then(handleSaveResponse).catch(() => setWorking(false));\r\n        } else if (type === 'publish') {\r\n            setPublishMessageInfo(null);\r\n            setOpen(true);\r\n            CorrespondenceService.publishBuyerBulkMessages(rfxRoundId, message, listResourceId)\r\n                .then(handleSaveResponse).catch(() => setWorking(false));\r\n        }\r\n    }\r\n\r\n    const onSubmit = (message) => {\r\n        setWorking(true);\r\n        const reqMessage = {\r\n            threadIds: [...message.selectedThreadsIds],\r\n            message: {\r\n                attachments: message.attachments,\r\n                contents: message.contents\r\n            }\r\n        }\r\n\r\n        if (sendType.current === 'send') {\r\n            processMessage('send', reqMessage);\r\n        } else if ('publish') {\r\n            setPublishMessageInfo(createConfirmObject(message, () => processMessage('publish', reqMessage), cancelPublish));\r\n            setOpen(false);\r\n        }\r\n        sendType.current = '';\r\n\r\n    }\r\n\r\n    const handleSaveResponse = (response) => {\r\n        if (isResponseValid(response, setError)) {\r\n            setWorking(false);\r\n            onClose(response);\r\n        } else {\r\n            setWorking(false);\r\n        }\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working || !!contractorEmailList));\r\n        buttons.push(createButton(Tr('send_and_publish'), () => handleSubmit('publish'), 'outlined', working || !!contractorEmailList));\r\n        buttons.push(createButton(Tr('send'), () => handleSubmit('send'), undefined, working || !!contractorEmailList));\r\n        return buttons;\r\n    }\r\n\r\n    const doDelete = (formikProps, threadId) => {\r\n        const selectedThreadsIds = getObjectValue('selectedThreadsIds', formikProps.values, []);\r\n        formikProps.setFieldValue('selectedThreadsIds', selectedThreadsIds.filter(x => x !== threadId))\r\n    }\r\n\r\n    const chipClick = (threadId) => {\r\n        setContractorEmailList([]);\r\n        CorrespondenceService.getBuyerThreadEmailList(rfxRoundId, threadId).then(setContractorEmailList).catch(() => {\r\n            setContractorEmailList(null)\r\n            enqueueErrorSnackbar(Tr(\"unknown_error_message\"));\r\n        })\r\n\r\n    }\r\n\r\n    const getChips = (formikProps) => {\r\n\r\n        const selectedThreadsIds = getObjectValue('selectedThreadsIds', formikProps.values, []);\r\n\r\n        return threadsList.filter(x => selectedThreadsIds.indexOf(x.threadId) > -1).map(x => (<Chip\r\n            className={classes.chip}\r\n            labelClassName={classes.chipLabel}\r\n            value={<><span title={Tr(\"correspondence_email_title\")}><span className={classes.chipSupplier}>{x.recipients.map(r => r.name).join(\", \")}</span></span><span\r\n                className={classes.chipSubject}>{x.subject}</span></>}\r\n            onDelete={selectedThreadsIds.length > 1 ? () => {\r\n                doDelete(formikProps, x.threadId)\r\n            } : undefined}\r\n            key={x.threadId}\r\n            onClick={() => chipClick(x.threadId)}\r\n        />))\r\n    }\r\n\r\n    return (<>\r\n            <Dialog\r\n                title={Tr(\"correspondence_bulk_answer\")}\r\n                open={true}\r\n                maxWidth='md'\r\n                className={clsx({\r\n                    [classes.hidden]: !open,\r\n                })}\r\n                dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            >\r\n                <div className={classes.dialogContent}>\r\n                    <Form\r\n                        initialValues={{\r\n                            contents: \"\",\r\n                            selectedThreadsIds: [...selectedThreads],\r\n                            attachments: []\r\n                        }}\r\n                        validationSchema={Yup.object().shape({\r\n                            contents: VS.string(),\r\n                            selectedThreadsIds: VS.arrayRequired()\r\n                        })}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <GridBlock column>\r\n                                {working && <Loading className={classes.loading}/>}\r\n\r\n                                {error && <Typography color='error'>{error}</Typography>}\r\n\r\n                                <div>\r\n                                    <Typography className={classes.inlineBlock}>{Tr('correspondence_selected_threads')}:</Typography>\r\n                                    {getChips(formikProps)}\r\n                                </div>\r\n\r\n\r\n                                <TextInput\r\n                                    id='contents'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('contents')}\r\n                                    disabled={working}\r\n                                    required\r\n                                    multiline\r\n                                />\r\n\r\n                                <Box component=\"div\" className={classes.uploadFile}>\r\n                                    <UploadFile\r\n                                        id='attachments'\r\n                                        formikProps={formikProps}\r\n                                        label={Tr(\"attachment\")}\r\n                                        disabled={working}\r\n                                    />\r\n                                </Box>\r\n\r\n                            </GridBlock>\r\n                        )}\r\n                    </Form>\r\n                    {!!contractorEmailList && <div className={classes.ctrEmailList}>\r\n                        <GridBlock alignItems=\"center\" className={classes.ctrEmailListTitle}>\r\n                            <TypographyWithIcon Icon={InfoIcon}>{Tr(\"correspondence_email_notification_list\")}</TypographyWithIcon>\r\n                            <Button onClick={() => setContractorEmailList(null)} disabled={!contractorEmailList.length}\r\n                                    className={classes.marginLeft}>{Tr(\"close\")}</Button>\r\n                        </GridBlock>\r\n                        <div className={classes.marginTop}>\r\n                            {\r\n                                !contractorEmailList.length ? <Loading/> : contractorEmailList.map((x, i) =>\r\n                                    <CorrespondenceEmailList key={i} wrapper={x}/>)\r\n                            }\r\n                        </div>\r\n\r\n                    </div>\r\n                    }\r\n                </div>\r\n            </Dialog>\r\n            {!!publishMessageInfo && <PublishMessageConfirmationPopup publishMessageInfo={publishMessageInfo}/>}\r\n        </>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddBulkMessagePopup);","import React, {useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport ExpansionPanel from \"components/ExpansionPanel\";\r\nimport AddThreadPopup from \"./AddThreadPopup\";\r\nimport Tr from \"translations/Translations\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport AddThreadAsSupplierPopup from \"./AddThreadAsSupplierPopup\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport Thread from \"./Thread\";\r\nimport AddBulkMessagePopup from \"./AddBulkMessagePopup\";\r\nimport FlagRoundedIcon from \"@material-ui/icons/FlagRounded\";\r\nimport OutlinedFlagRoundedIcon from \"@material-ui/icons/OutlinedFlagRounded\";\r\nimport TooltipIcon from \"components/icon/TooltipIcon\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport {connect} from \"react-redux\";\r\nimport SplitButton, {createButton as createSplitButton} from \"components/popup/components/SplitButton\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport WorkableIconShareButton from \"components/button/WorkableIconShareButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport ShareSelectPopup, {sharePopupData} from \"components/popup/ShareSelectPopup\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        background: 'transparent'\r\n    },\r\n    summaryRoot: {\r\n        '&>*:nth-child(2)': {\r\n            flexGrow: 1,\r\n            textAlign: 'center'\r\n        }\r\n    },\r\n    details: {\r\n        padding: 0\r\n    },\r\n    buttons: {\r\n        padding: theme.spacing(4),\r\n        marginBottom: theme.spacing(2),\r\n        backgroundColor: theme.palette.background.paper\r\n    },\r\n    buttonPrint: {\r\n        width: 280,\r\n        whiteSpace: \"nowrap\",\r\n        overflow: \"hidden\"\r\n    },\r\n    redFlag: {\r\n        color: theme.palette.error.main\r\n    },\r\n    shareButton: {\r\n        marginBottom: -6,\r\n        marginTop: -6,\r\n    }\r\n}));\r\n\r\n\r\nfunction ThreadsPanel(\r\n    {\r\n        contractor,\r\n        title,\r\n        currentActive,\r\n        rfxRound,\r\n        listResourceId,\r\n        threadsList,\r\n        correspondencePrivileges,\r\n        showShare\r\n    }) {\r\n\r\n    const classes = useStyles();\r\n\r\n    const [addAsSupplierOpened, setAddAsSupplierOpened] = useState(false);\r\n    const [addPopupOpened, setAddPopupOpened] = useState(false);\r\n    const [bulkPopupOpened, setBulkPopupOpened] = useState(false);\r\n    const [expanded, setExpanded] = useState(currentActive);\r\n    const [selectedThreads, setSelectedThreads] = useState([]);\r\n    const [printWorking, setPrintWorking] = useState(false);\r\n    const [shareWorking, setShareWorking] = useState(false);\r\n    const [shareFilePopup, setShareFilePopup] = useState(null);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const hasEdit = useMemo(() => !!correspondencePrivileges.EDIT, [correspondencePrivileges]);\r\n\r\n    const onThreadSelectChange = (thread, added) => {\r\n        if (added) {\r\n            setSelectedThreads(x => [...x, thread.threadId]);\r\n        } else {\r\n            setSelectedThreads(x => x.filter(x => x !== thread.threadId));\r\n        }\r\n    }\r\n\r\n\r\n    const printCorrespondence = (type) => {\r\n        if (printWorking) {\r\n            return;\r\n        }\r\n        setPrintWorking(true);\r\n        let printPromise;\r\n        if (contractor) {\r\n            printPromise = CorrespondenceService.getContractorPrint(rfxRound.id, type, listResourceId === CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, selectedThreads);\r\n        } else {\r\n            printPromise = CorrespondenceService.getBuyerPrint(rfxRound.id, type, listResourceId === CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, selectedThreads);\r\n        }\r\n        printPromise.finally(() => setPrintWorking(false))\r\n\r\n    }\r\n\r\n    const buttons = useMemo(() => {\r\n        const buttons = [];\r\n        const hasSelected = selectedThreads.length > 0;\r\n        buttons.push(createButton(Tr(\"message_create_new\"), () => setAddPopupOpened(true), undefined, !hasEdit || !currentActive));\r\n        if (!contractor) {\r\n            buttons.push(createButton(Tr(\"message_bulk_answer\"), () => setBulkPopupOpened(true), 'outlined', !hasEdit || !currentActive || !hasSelected));\r\n            buttons.push(createButton(Tr(\"message_create_as_contractor\"), () => setAddAsSupplierOpened(true), 'outlined', !hasEdit || !currentActive));\r\n        }\r\n\r\n        return buttons;\r\n    }, [hasEdit, currentActive, selectedThreads, contractor]);\r\n\r\n    const hasRedFlag = useMemo(() => Boolean(threadsList.find(x => x.hasRedFlag)), [threadsList]);\r\n\r\n    const getTitle = () => (\r\n        <GridBlock alignItems=\"center\" wrap='nowrap' justify='space-between' gridClasses={{root: classes.summaryRoot}} id={`section_${listResourceId}`}>\r\n\r\n            <TooltipIcon className={classes.redFlag} Icon={hasRedFlag ? FlagRoundedIcon : OutlinedFlagRoundedIcon} fontSize='large'\r\n                         tooltip={hasRedFlag ? Tr('correspondence_contains_flagged_threads') : Tr(\"correspondence_no_flagged_threads\")}/>\r\n\r\n            <Typography className={classes.subject} variant='h4'>\r\n                {title}\r\n            </Typography>\r\n            <WorkableIconExpandButton\r\n                color='primary'\r\n                expanded={expanded}\r\n            />\r\n        </GridBlock>\r\n    )\r\n\r\n    const getPrintButton = useMemo(() => {\r\n        const buttons = [];\r\n        const hasSelected = selectedThreads.length > 0;\r\n        buttons.push(createSplitButton(Tr(hasSelected ? \"message_print_selected_pdf\" : \"message_print_pdf\"), () => printCorrespondence(\"pdf\"), !threadsList.length));\r\n        buttons.push(createSplitButton(Tr(hasSelected ? \"message_print_selected_rtf\" : \"message_print_rtf\"), () => printCorrespondence(\"rtf\"), !threadsList.length));\r\n        return (<SplitButton\r\n            label={Tr(hasSelected ? 'message_print_selected' : 'message_print')}\r\n            working={printWorking}\r\n            buttonClassName={classes.buttonPrint}\r\n            disabled={!threadsList.length}\r\n            buttons={buttons}\r\n            variant=\"outlined\"\r\n            hideEmpty={false}\r\n        />)\r\n        // eslint-disable-next-line\r\n    },[selectedThreads.length, threadsList.length, printWorking]);\r\n\r\n    const onShareFile = (name, selectedThreads) => setShareFilePopup(sharePopupData(name, selectedThreads));\r\n\r\n    const getShareButton = useMemo(()=> {\r\n        if(showShare) {\r\n            const hasSelected = selectedThreads.length > 0;\r\n\r\n            return <WorkableIconShareButton\r\n                    className={classes.shareButton}\r\n                    tooltip={Tr(hasSelected ? \"message_share_selected_pdf\" : \"message_share_pdf\")}\r\n                    onClick={()=> onShareFile(Tr(hasSelected ? \"message_share_selected_pdf\" : \"message_share_pdf\"), {selectedThreads, type: \"pdf\"})}\r\n                    working={shareWorking}\r\n                    disabled={shareWorking}\r\n                />\r\n        }\r\n        return undefined;\r\n        // eslint-disable-next-line\r\n    }, [selectedThreads.length, threadsList.length, showShare, shareWorking])\r\n\r\n\r\n    const doShare = ({selectedThreads, type}, system) => {\r\n        setShareFilePopup(null);\r\n        setShareWorking(true);\r\n        CorrespondenceService.shareCorrespondencePrint(rfxRound.id, type, listResourceId === CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID, selectedThreads, system).then((resp) => {\r\n            if (resp)\r\n                enqueueSuccessSnackbar(Tr(\"int_upload_success_x\", {x: system}, true))\r\n        }).finally(() => {\r\n            setShareWorking(false);\r\n        });\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <ExpansionPanel titleAdornment={getTitle()} expanded={expanded} onChange={(event, expanded) => {\r\n                setExpanded(expanded)\r\n            }} square classesObj={{root: classes.root, details: classes.details}}>\r\n                <GridBlock column>\r\n                    <MultiButton buttons={buttons} justify=\"space-evenly\" className={classes.buttons} after={getPrintButton} afterAfter={getShareButton}/>\r\n                    {threadsList.map((el) => (\r\n                        <Thread key={el.threadId} thread={el} rfxRoundId={rfxRound.id} onThreadSelectChange={onThreadSelectChange}\r\n                                selectedThreads={selectedThreads} listResourceId={listResourceId} contractor={contractor} currentActive={currentActive}/>\r\n                    ))}\r\n                </GridBlock>\r\n            </ExpansionPanel>\r\n\r\n            {(hasEdit && !contractor && addAsSupplierOpened) &&\r\n            <AddThreadAsSupplierPopup onClose={() => setAddAsSupplierOpened(false)} rfxRoundId={rfxRound.id} listResourceId={listResourceId}/>}\r\n            {hasEdit && addPopupOpened &&\r\n            <AddThreadPopup onClose={() => setAddPopupOpened(false)} rfxRoundId={rfxRound.id} listResourceId={listResourceId} contractor={contractor} />}\r\n            {(hasEdit && !contractor && bulkPopupOpened) &&\r\n            <AddBulkMessagePopup rfxRoundId={rfxRound.id} onClose={() => setBulkPopupOpened(false)} listResourceId={listResourceId}\r\n                                 selectedThreads={selectedThreads} threadsList={threadsList}/>}\r\n            {!!shareFilePopup && <ShareSelectPopup\r\n                data={shareFilePopup}\r\n                onCancel={() => setShareFilePopup(null)}\r\n                onChoose={doShare}\r\n            />}\r\n        </>\r\n    )\r\n}\r\n\r\nThreadsPanel.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        correspondencePrivileges: state.privileges[PrivilegeService.CORRESPONDENCE_PRIVILEGE_STORE_KEY],\r\n    }\r\n}\r\nconst mapDispatchToProps = {}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(ThreadsPanel);","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from \"../../GridBlock\";\r\nimport Tr from \"../../../translations/Translations\";\r\nimport SimpleSelect from \"../../SimpleSelect\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {Paper, TextField} from \"@material-ui/core\";\r\nimport querystring from \"querystring\";\r\nimport {setSearchObj} from \"../../../libs/RouterPath\";\r\nimport WorkableIconButton from \"../../button/WorkableIconButton\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport IconButton from \"../../button/IconButton\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport FlagRoundedIcon from \"@material-ui/icons/FlagRounded\";\r\nimport OutlinedFlagRoundedIcon from \"@material-ui/icons/OutlinedFlagRounded\";\r\nimport BoldTypography from \"../../BoldTypography\";\r\nimport {KeyboardDateTimePicker} from \"@material-ui/pickers\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport moment, {isMoment} from \"libs/moment\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(2),\r\n        }\r\n    },\r\n    search: {\r\n        width: 170,\r\n    },\r\n    date: {\r\n        width: 190,\r\n    },\r\n    chipsGrid: {\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    paper: {\r\n        padding: theme.spacing(3)\r\n    },\r\n    flag: {\r\n        color: theme.palette.error.main\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {subject: '', content: '', supplier: '', flag: '', dateFrom: null, dateTo: null}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nfunction CorrespondenceSearch(\r\n    {\r\n        searchInProgress,\r\n        doSearch,\r\n        contractor,\r\n        rfxRoundId\r\n    }) {\r\n\r\n\r\n    const getInitValue = () => {\r\n        const search = window.location.search.slice(1);\r\n        const parsed = querystring.parse(search);\r\n        const parsedFiltered = Object.keys(parsed)\r\n            .filter((k) => EMPTY_SEARCH_OBJECT.hasOwnProperty(k))\r\n            .reduce((a, k) => {\r\n                const n = {...a};\r\n                if(k === 'dateFrom' || k === 'dateTo') {\r\n                    let dat = moment(parsed[k], DateFormats.DATETIME_FORMAT);\r\n                    if(dat.isValid())\r\n                        n[k] = dat;\r\n                } else {\r\n                    n[k] = parsed[k].substring(0, MAX_SEARCH_LENGTH)\r\n                }\r\n                return n;\r\n            }, {})\r\n\r\n        return {...EMPTY_SEARCH_OBJECT, ...parsedFiltered};\r\n    }\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState(getInitValue());\r\n    const [contractorListForSelect, setContractorListForSelect] = useState([{label: Tr('any'), value: ''}]);\r\n    const [submitState, setSubmitState] = useState(0);\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => !!value[k])\r\n                .reduce((a, k) => ({...a, [k]: isMoment(value[k]) ? (value[k].isValid() ? value[k].format(DateFormats.DATETIME_FORMAT) : null) : value[k]}), {});\r\n\r\n            const valueFilteredForSearch = Object.keys(value)\r\n                .filter((k) => !!value[k])\r\n                .reduce((a, k) => ({...a, [k]: isMoment(value[k]) ? (value[k].isValid() ? value[k].format() : null) : value[k]}), {});\r\n\r\n\r\n            setSearchObj(valueFiltered);\r\n            doSearch(valueFilteredForSearch);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    const prepareContractorList = (respList) => {\r\n        setContractorListForSelect(x => [...x, ...respList.map(x => ({label: x.name, value: x.contractorDepartmentId.toString()}))]);\r\n    }\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleChangeDate = (id, date) => {\r\n        const dateValue = date ? date: null;\r\n        setValue({...value, [id]: dateValue})\r\n    };\r\n\r\n    const handleSubmit = () => {\r\n        setSubmitState(x => x + 1)\r\n    };\r\n\r\n\r\n    const handleKeyUp = (e) => {\r\n        if (e.key === 'Enter') {\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (!contractor) {\r\n            CorrespondenceService.getBuyerContractorInRoundList(rfxRoundId).then(prepareContractorList);\r\n        }\r\n\r\n    }, [rfxRoundId, contractor]);\r\n\r\n    return (\r\n        <Paper className={classes.paper}>\r\n            <BoldTypography>{Tr('search_box')}</BoldTypography>\r\n            <GridBlock className={classes.root}>\r\n\r\n                <IconButton className={classes.flag} Icon={value.flag === 'true' ? FlagRoundedIcon : OutlinedFlagRoundedIcon}\r\n                            tooltip={value.flag === 'true' ? Tr('unflag') : Tr('flag_threads')} onClick={() => {\r\n                    const newFlag = value.flag === 'true' ? '' : 'true';\r\n                    handleChange('flag', {target: {value: newFlag}});\r\n                    handleSubmit();\r\n                }}/>\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('search_subject')}\r\n                    onChange={e => handleChange('subject', e)}\r\n                    onKeyUp={handleKeyUp}\r\n                    fullWidth\r\n                    value={value.subject}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                    // InputProps={{\r\n                    //     endAdornment: <InputAdornment position=\"end\">\r\n                    //         <IconSearchButton disabled={searchInProgress}\r\n                    //             onClick={handleSubmit}\r\n                    //         />\r\n                    //     </InputAdornment>,\r\n                    // }}\r\n                />\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('search_content')}\r\n                    onChange={e => handleChange('content', e)}\r\n                    onKeyUp={handleKeyUp}\r\n                    fullWidth\r\n                    value={value.content}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                    // InputProps={{\r\n                    //     endAdornment: <InputAdornment position=\"end\">\r\n                    //         <IconSearchButton disabled={searchInProgress}\r\n                    //             onClick={handleSubmit}\r\n                    //         />\r\n                    //     </InputAdornment>,\r\n                    // }}\r\n                />\r\n                {!contractor &&\r\n                <SimpleSelect\r\n                    label={Tr('contractor')}\r\n                    className={classes.search}\r\n                    items={contractorListForSelect}\r\n                    value={value.supplier}\r\n                    onChange={(e) => {\r\n                        handleChange('supplier', e);\r\n                        handleSubmit();\r\n                    }}\r\n                />\r\n                }\r\n\r\n\r\n                <KeyboardDateTimePicker\r\n                    className={classes.date}\r\n                    label={Tr('date_from')}\r\n                    ampm={false}\r\n                    format={DateFormats.DATETIME_FORMAT}\r\n                    variant='dialog'\r\n                    cancelLabel={Tr('cancel')}\r\n                    value={value.dateFrom}\r\n                    invalidDateMessage={Tr(\"invalid_date_format\")}\r\n                    onChange={e => handleChangeDate('dateFrom', e)}\r\n                />\r\n\r\n                <KeyboardDateTimePicker\r\n                    className={classes.date}\r\n                    label={Tr('date_to')}\r\n                    ampm={false}\r\n                    format={DateFormats.DATETIME_FORMAT}\r\n                    variant='dialog'\r\n                    cancelLabel={Tr('cancel')}\r\n                    value={value.dateTo}\r\n                    invalidDateMessage={Tr(\"invalid_date_format\")}\r\n                    onChange={e => handleChangeDate('dateTo', e)}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={() => {\r\n                        setValue(EMPTY_SEARCH_OBJECT);\r\n                        handleSubmit()\r\n                    }}/>\r\n                </div>\r\n            </GridBlock>\r\n        </Paper>\r\n    )\r\n}\r\n\r\nCorrespondenceSearch.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\n\r\nexport default CorrespondenceSearch;","import React, {useEffect, useMemo, useRef, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from \"react-redux\";\r\nimport CorrespondenceService from \"services/CorrespondenceService\";\r\nimport ThreadsPanel from \"./ThreadsPanel\";\r\nimport Loading from \"components/Loading\";\r\nimport moment from \"libs/moment\";\r\nimport CorrespondenceSearch from \"./CorrespondenceSearch\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport {shareSystemsActive} from \"libs/shareSystems\";\r\n\r\n\r\nfunction Correspondence(\r\n    {\r\n        rfxRound,\r\n        threadsBeforeEndDate,\r\n        threadsAfterEndDate,\r\n        correspondenceSplitDate,\r\n        correspondenceCheckTime,\r\n        correspondencePrivileges,\r\n        contractor,\r\n        demandPrivileges = {},\r\n        demandHeader,\r\n    }) {\r\n\r\n    const loadingNewInProgress = useRef(false);\r\n    const searchSelected = useRef(false);\r\n    const intervalId = useRef(0);\r\n    const [searchInProgress, setSearchInProgress] = useState(false)\r\n    const [before, setBefore] = useState(!correspondenceCheckTime || !correspondenceSplitDate || moment(correspondenceCheckTime).isBefore(moment(correspondenceSplitDate)))\r\n\r\n    const showShare = useMemo(() => demandPrivileges.INTEGRATIONS_UPLOAD && shareSystemsActive(demandHeader).length > 0, [demandHeader, demandPrivileges])\r\n\r\n    const doSearch = (searchOb) => {\r\n        setSearchInProgress(true);\r\n        if (Object.keys(searchOb).length) {\r\n            searchSelected.current = true;\r\n        } else {\r\n            searchSelected.current = false;\r\n        }\r\n        let searchPromise;\r\n        if (contractor) {\r\n            searchPromise = CorrespondenceService.getContractorSearchResult(rfxRound.id, searchOb);\r\n        } else {\r\n            searchPromise = CorrespondenceService.getBuyerSearchResult(rfxRound.id, searchOb);\r\n        }\r\n        searchPromise.finally(() => setSearchInProgress(false))\r\n    };\r\n\r\n    const checkNewMessages = () => {\r\n        if (!loadingNewInProgress.current && !searchSelected.current) {\r\n            loadingNewInProgress.current = true;\r\n            if (contractor) {\r\n                CorrespondenceService.getContractorNewMessages(rfxRound.id).then(() => loadingNewInProgress.current = false);\r\n            } else {\r\n                CorrespondenceService.getBuyerNewMessages(rfxRound.id).then(() => loadingNewInProgress.current = false);\r\n            }\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (contractor) {\r\n            CorrespondenceService.getContractorThreadList(rfxRound.id);\r\n            CorrespondenceService.getContractorPrivileges(rfxRound.id);\r\n        } else {\r\n            CorrespondenceService.getBuyerThreadList(rfxRound.id);\r\n            CorrespondenceService.getBuyerPrivileges(rfxRound.id);\r\n        }\r\n        return () => {\r\n            CorrespondenceService.cleanupThreadList();\r\n            CorrespondenceService.cleanupPrivileges();\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    useEffect(() => {\r\n        intervalId.current = setInterval(checkNewMessages, 30000);\r\n        return () => {\r\n            if (intervalId.current) {\r\n                clearInterval(intervalId.current);\r\n            }\r\n        }\r\n        //eslint-disable-next-line\r\n    },[]);\r\n\r\n    const timeout = useRef();\r\n\r\n    useEffect(() => {\r\n        if (correspondenceSplitDate && correspondenceCheckTime) {\r\n            const isBefore = moment(correspondenceCheckTime).isBefore(moment(correspondenceSplitDate));\r\n            if (isBefore) {\r\n                if (timeout.current) {\r\n                    clearTimeout(timeout.current);\r\n                }\r\n                const diff = moment(correspondenceSplitDate).diff(correspondenceCheckTime) + 500;\r\n                timeout.current = setTimeout(checkNewMessages, diff)\r\n            } else {\r\n\r\n            }\r\n            setBefore(isBefore);\r\n        }\r\n\r\n        return () => {\r\n            if (timeout.current) {\r\n                clearTimeout(timeout.current);\r\n            }\r\n        }\r\n        //eslint-disable-next-line\r\n    }, [correspondenceSplitDate, correspondenceCheckTime]);\r\n    return (\r\n        <>\r\n            <CorrespondenceSearch searchInProgress={searchInProgress} doSearch={doSearch} rfxRoundId={rfxRound.id} contractor={contractor}/>\r\n\r\n            {\r\n                (!threadsAfterEndDate || !threadsBeforeEndDate || !correspondenceCheckTime || !correspondencePrivileges) ?\r\n                    <Loading/>\r\n                    :\r\n                    <>\r\n                        {!!threadsBeforeEndDate &&\r\n                        <ThreadsPanel\r\n                            contractor={contractor}\r\n                            title={threadsBeforeEndDate.name}\r\n                            currentActive={before}\r\n                            rfxRound={rfxRound}\r\n                            listResourceId={CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID}\r\n                            threadsList={threadsBeforeEndDate.threads}\r\n                            showShare={showShare}\r\n                        />\r\n                        }\r\n\r\n                        {!!threadsAfterEndDate &&\r\n                        <ThreadsPanel\r\n                            contractor={contractor}\r\n                            title={threadsAfterEndDate.name}\r\n                            currentActive={!before}\r\n                            rfxRound={rfxRound}\r\n                            listResourceId={CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID}\r\n                            threadsList={threadsAfterEndDate.threads}\r\n                            showShare={showShare}\r\n                        />}\r\n\r\n                        {/*{!!threadsNotSpliced &&*/}\r\n                        {/*<ThreadsPanel*/}\r\n                        {/*    contractor={contractor}*/}\r\n                        {/*    title={threadsNotSpliced.name}*/}\r\n                        {/*    currentActive='true'*/}\r\n                        {/*    rfxRound={rfxRound}*/}\r\n                        {/*    listResourceId={CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_NOT_SPLICED_RESOURCE_ID}*/}\r\n                        {/*    threadsList={threadsNotSpliced.threads}*/}\r\n                        {/*/>}*/}\r\n                    </>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\nCorrespondence.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        threadsBeforeEndDate: state.resources[CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_BEFORE_END_DATE_RESOURCE_ID],\r\n        threadsAfterEndDate: state.resources[CorrespondenceService.CORRESPONDENCE_THREAD_LISTS_AFTER_END_DATE_RESOURCE_ID],\r\n        correspondenceSplitDate: state.resources[CorrespondenceService.CORRESPONDENCE_SPLIT_DATE_RESOURCE_ID],\r\n        correspondenceCheckTime: state.resources[CorrespondenceService.CORRESPONDENCE_LAST_CHECK_TIME_RESOURCE_ID],\r\n        correspondencePrivileges: state.privileges[PrivilegeService.CORRESPONDENCE_PRIVILEGE_STORE_KEY],\r\n        demandPrivileges: state.privileges[PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY],\r\n        demandHeader: state.resources.demandHeader\r\n    }\r\n}\r\nconst mapDispatchToProps = {}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(Correspondence);","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport Correspondence from \"components/complex/correspondence/Correspondence\";\r\n\r\nfunction CorrespondenceSection(\r\n    {\r\n        currentRfxRound\r\n    }) {\r\n\r\n    return (\r\n        <div>\r\n            {(!currentRfxRound) ?\r\n                <Loading/>\r\n                :\r\n                <Correspondence rfxRound={currentRfxRound}/>\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nCorrespondenceSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        currentRfxRound: state.resources[StatisticsService.CURRENT_RFX_RESOURCE_ID]\r\n    }\r\n}\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(CorrespondenceSection);","import React, {useEffect} from 'react'\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport Workspace from \"components/Workspace\";\r\nimport CorrespondenceSection from \"./sections/CorrespondenceSection\";\r\nimport DemandService from \"services/DemandService\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\n\r\nfunction CorrespondencePanel(\r\n    {\r\n        match\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n\r\n    useEffect(() => {\r\n        StatisticsService.getCurrentRound(demandId)\r\n        DemandService.getBuyerPrivileges(demandId);\r\n        return () => {\r\n            StatisticsService.clearCurrentRound();\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n\r\n    return (\r\n        <>\r\n            <Workspace\r\n                render={<>\r\n                    <CorrespondenceSection />\r\n                </>}\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nexport default CorrespondencePanel;","import {clearResource, setResource} from 'redux/actions'\r\nimport reduxStore from 'redux/store'\r\nimport {RestRequestBLOB, RestRequestGET} from \"../libs/RestRequest\";\r\nimport Endpoints from \"../constants/Endpoints\";\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\n\r\nconst EMAIL_LIST_RESOURCE_ID = 'emailList';\r\nconst EMAIL_LIST_ACTIONS_RESOURCE_ID = 'emailListActions';\r\n\r\n\r\n\r\nconst getEmailList = async (id, pagination, searchData = {}) => {\r\n    try {\r\n        let params = {\r\n            ...pagination\r\n        }\r\n\r\n        params = applySearchParams(searchData, params);\r\n\r\n        const res = await RestRequestGET(Endpoints.EMAIL_LIST(id), {params});\r\n\r\n        reduxStore.dispatch(\r\n            setResource(EMAIL_LIST_RESOURCE_ID, res)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\n\r\nconst getEmailListActions = async (id) => {\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.EMAIL_LIST_ACTIONS(id));\r\n        reduxStore.dispatch(\r\n            setResource(EMAIL_LIST_ACTIONS_RESOURCE_ID, res.actions)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst getEmailDetails = async (demandId, emailId) => {\r\n    return await RestRequestGET(Endpoints.EMAIL_DETAILS(demandId, emailId));\r\n}\r\n\r\n\r\nconst doExportEmails = (url, finallyCallback = () => {\r\n}) => {\r\n    try {\r\n        RestRequestBLOB(url)\r\n            .finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst printEmailDetails = (demandId, emailId, finallyCallback = () => {}) => {\r\n    try {\r\n        RestRequestBLOB(Endpoints.EMAIL_PRINT(demandId, emailId)).finally(finallyCallback);\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst clearResources = (resource) => reduxStore.dispatch(clearResource(resource));\r\n\r\nexport default {\r\n    getEmailList,\r\n    getEmailListActions,\r\n    getEmailDetails,\r\n    clearResources,\r\n    doExportEmails,\r\n    printEmailDetails,\r\n    EMAIL_LIST_RESOURCE_ID,\r\n    EMAIL_LIST_ACTIONS_RESOURCE_ID\r\n}","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport {KeyboardDateTimePicker} from \"@material-ui/pickers\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport DateFormats from \"constants/DateFormats\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    search: {\r\n        width: 182,\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {subject: '', message: '', recipients: '', dateFrom: null, dateTo: null}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nfunction EmailListSearch(\r\n    {\r\n        searchInProgress,\r\n        doSearch\r\n    }) {\r\n\r\n\r\n    const getInitValue = () => {\r\n\r\n        return {...EMPTY_SEARCH_OBJECT};\r\n    }\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState(getInitValue());\r\n    const [submitState, setSubmitState] = useState(0);\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => value[k])\r\n                .reduce((a, k) => ({...a, [k]: value[k]}), {});\r\n            doSearch(valueFiltered);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        setSubmitState(x => x + 1)\r\n    };\r\n\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (e.key === 'Enter') {\r\n            e.preventDefault();\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    const handleChangeDate = (id, date) => {\r\n        const dateValue = date ? date: null;\r\n        setValue({...value, [id]: dateValue})\r\n    };\r\n\r\n    return (\r\n        <>\r\n            {/*<BoldTypography>{Tr('search_box')}</BoldTypography>*/}\r\n            <GridBlock className={classes.root}>\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('search_subject')}\r\n                    onChange={e => handleChange('subject', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.subject}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('search_content')}\r\n                    onChange={e => handleChange('message', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.message}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('recipients_content')}\r\n                    onChange={e => handleChange('recipients', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.recipients}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n                <KeyboardDateTimePicker\r\n                    className={classes.search}\r\n                    label={Tr('date_from')}\r\n                    ampm={false}\r\n                    format={DateFormats.DATETIME_FORMAT}\r\n                    variant='dialog'\r\n                    cancelLabel={Tr('cancel')}\r\n                    value={value.dateFrom}\r\n                    invalidDateMessage={Tr(\"invalid_date_format\")}\r\n                    onChange={e => handleChangeDate('dateFrom', e)}\r\n                />\r\n                <KeyboardDateTimePicker\r\n                    className={classes.search}\r\n                    label={Tr('date_to')}\r\n                    ampm={false}\r\n                    format={DateFormats.DATETIME_FORMAT}\r\n                    variant='dialog'\r\n                    cancelLabel={Tr('cancel')}\r\n                    value={value.dateTo}\r\n                    invalidDateMessage={Tr(\"invalid_date_format\")}\r\n                    onChange={e => handleChangeDate('dateTo', e)}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={() => {\r\n                        setValue(EMPTY_SEARCH_OBJECT);\r\n                        handleSubmit()\r\n                    }}/>\r\n                </div>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nEmailListSearch.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\n\r\nexport default EmailListSearch;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport TooltipIcon from \"components/icon/TooltipIcon\";\r\nimport {Mail, MailOutline} from \"@material-ui/icons\";\r\n\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    bold: {\r\n        fontWeight: theme.typography.fontWeightBold\r\n    },\r\n    buttonRow: {\r\n        marginTop: theme.spacing(2),\r\n        textAlign: \"end\"\r\n    },\r\n    lpColumn: theme.components.table.lpColumn,\r\n    emailColumn: theme.components.table.emailColumn,\r\n    ipColumn: theme.components.table.ipColumn,\r\n    dateTimeColumn: {\r\n        ...theme.components.table.dateTimeColumn,\r\n        textAlign: 'center'\r\n    }\r\n}));\r\n\r\nfunction EmailDeliveriesTable(\r\n    {\r\n        deliveryList\r\n    }) {\r\n\r\n\r\n    const classes = useStyle();\r\n\r\n    const getStatusCellContent = (item) => {\r\n        return <span>\r\n            {Tr(`message_delivery_status_${item.status}`)}\r\n            {!!item.errorMessage && <>\r\n                <br/><span className={classes.bold}>{Tr('details')}: </span>\r\n                <span>${item.errorMessage}</span>\r\n            </>}\r\n\r\n        </span>\r\n    }\r\n\r\n    return (\r\n\r\n        <SimpleTable\r\n            columnClasses={[\r\n                classes.lpColumn,\r\n                classes.emailColumn,\r\n                undefined,\r\n                classes.dateTimeColumn,\r\n            ]}\r\n            headers={[\"\", Tr('email'), Tr('status'), Tr('status_date')]}\r\n            items={deliveryList.map((item, index) => [\r\n                <TooltipIcon color={item.status === 'FAILED' || item.status === 'EMAIL_BLOCKED' ? 'error' : (item.status === 'SUSPENDED' ? 'secondary' : undefined)}\r\n                             Icon={item.status === 'SENT' ? Mail : MailOutline} tooltip={Tr(`message_delivery_status_info_${item.status}`)}/>,\r\n                item.recipient,\r\n                getStatusCellContent(item),\r\n                item.deliveryDate ? moment(item.deliveryDate).format(DateFormats.DATETIME_WITH_SECONDS_FORMAT) : '--'\r\n            ])}\r\n        />\r\n\r\n    )\r\n}\r\n\r\nexport default EmailDeliveriesTable;","import React, {useEffect, useState} from 'react';\r\nimport Dialog from \"components/Dialog\";\r\nimport {makeStyles, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport Loading from \"components/Loading\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport EmailListService from \"services/EmailListService\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport clsx from \"clsx\";\r\nimport EmailDeliveriesTable from \"./EmailDeliveriesTable\";\r\n\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n    secContent: {\r\n        paddingBottom: theme.spacing(2)\r\n    },\r\n    preLine: {\r\n        whiteSpace: \"pre-line\"\r\n    },\r\n    previewBox: {\r\n        width: '98%',\r\n        overflow: 'auto',\r\n        border: `solid 1px ${theme.palette.primary.main}`,\r\n    },\r\n    previewHtml: {\r\n        height: 300,\r\n    },\r\n    previewNoHtml: {\r\n        maxHeight: 300,\r\n        whiteSpace: \"pre-line\",\r\n        padding: theme.spacing(),\r\n        paddingRight: 0\r\n    }\r\n}));\r\n\r\nconst EmailDetailsPopup = (\r\n    {\r\n        demandId,\r\n        emailId,\r\n        detailed,\r\n        onClose = () => {\r\n        }\r\n    }) => {\r\n\r\n    const classes = useStyle({});\r\n\r\n    const [emailDetails, setEmailDetails] = useState(null);\r\n\r\n    useEffect(() => {\r\n        EmailListService.getEmailDetails(demandId, emailId).then((resp) => setEmailDetails(resp));\r\n    }, [demandId, emailId])\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('email_details')}\r\n            open\r\n            titleCentered\r\n            maxWidth={'md'}\r\n            fullWidth={true}\r\n            onClose={onClose}\r\n            dialogActions={<SingleButton\r\n                justify='flex-end'\r\n                label={Tr('close')}\r\n                onClick={onClose}\r\n            />}\r\n        >\r\n\r\n            {!emailDetails && <Loading/>}\r\n\r\n            {!!emailDetails && <>\r\n\r\n                {detailed && <>\r\n                    <BoldTypography>{Tr('sender')}:</BoldTypography>\r\n                    <Typography className={classes.secContent}>\r\n                        {emailDetails.from}\r\n                    </Typography>\r\n\r\n\r\n                    {!!emailDetails?.to.length && <>\r\n                        <BoldTypography>{Tr('email_to')}:</BoldTypography>\r\n                        <Typography className={clsx(classes.secContent, classes.preLine)}>\r\n                            {emailDetails.to.join('\\n')}\r\n                        </Typography></>\r\n                    }\r\n                    {!!emailDetails?.cc.length && <>\r\n                        <BoldTypography>{Tr('email_cc')}:</BoldTypography>\r\n                        <Typography className={clsx(classes.secContent, classes.preLine)}>\r\n                            {emailDetails.cc.join('\\n')}\r\n                        </Typography></>\r\n                    }\r\n                    {!!emailDetails?.bcc.length && <>\r\n                        <BoldTypography>{Tr('email_bcc')}:</BoldTypography>\r\n                        <Typography className={clsx(classes.secContent, classes.preLine)}>\r\n                            {emailDetails.bcc.join('\\n')}\r\n                        </Typography></>\r\n                    }\r\n                </>}\r\n                <BoldTypography>{Tr('subject')}:</BoldTypography>\r\n                <Typography className={classes.secContent}>\r\n                    {emailDetails.subject}\r\n                </Typography>\r\n\r\n                {detailed && <>\r\n                    <BoldTypography>{Tr('email_content')}:</BoldTypography>\r\n                    <Typography component='div' className={classes.secContent}>\r\n                        {\r\n                            emailDetails.html ? <iframe title={Tr('email_content')} className={clsx(classes.previewBox, classes.previewHtml)}\r\n                                                        srcDoc={emailDetails.message}/>\r\n                                : <Typography component='div' className={clsx(classes.previewBox, classes.previewNoHtml)}>{emailDetails.message}</Typography>\r\n                        }\r\n                    </Typography>\r\n\r\n                    <BoldTypography>{Tr('attachments')}:</BoldTypography>\r\n                    <Typography className={classes.secContent}>\r\n                        --\r\n                    </Typography>\r\n                </>}\r\n\r\n                {!!emailDetails?.deliveries && <>\r\n                    <BoldTypography>{Tr('send_status')}:</BoldTypography>\r\n                    <EmailDeliveriesTable deliveryList={emailDetails.deliveries}/>\r\n                </>\r\n                }\r\n\r\n\r\n            </>}\r\n        </Dialog>\r\n    );\r\n}\r\n\r\n\r\nEmailDetailsPopup.propTypes = {};\r\n\r\nexport default EmailDetailsPopup;","import React, {useEffect, useState} from \"react\";\r\nimport PropTypes from 'prop-types';\r\nimport Loading from \"components/Loading\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport Tr from \"translations/Translations\";\r\nimport moment from \"libs/moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport WorkableIconPrintButton from \"components/button/WorkableIconPrintButton\";\r\nimport {Link, makeStyles, Tooltip, Typography} from \"@material-ui/core\";\r\nimport Pagination from \"components/Pagination\";\r\nimport EmailListService from \"services/EmailListService\";\r\nimport {connect} from \"react-redux\";\r\nimport {setContrastColors} from \"redux/actions\";\r\nimport EmailListSearch from \"./EmailListSearch\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport EmailDetailsPopup from \"./EmailDetailsPopup\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport GridBlock from \"components/GridBlock\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    table: {\r\n        '& .MuiTableCell-head': {\r\n            fontWeight: 700\r\n        }\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    dateTimeColumn: theme.components.table.dateTimeColumn,\r\n    recColumn: {\r\n        width: 300\r\n    },\r\n    statusColumn: {\r\n        width: 60\r\n    },\r\n    tooltipContent: {\r\n        whiteSpace: 'pre-line'\r\n    },\r\n    recContent: {\r\n        textOverflow: 'ellipsis',\r\n        overflow: 'hidden'\r\n    },\r\n    more: {\r\n        whiteSpace: 'nowrap'\r\n    }\r\n}));\r\n\r\nfunction EmailListSection(\r\n    {\r\n        demandId,\r\n        emailList,\r\n        emailListActions\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [searchInProgress, setSearchInProgress] = useState(false);\r\n    const [exportWorking, setExportWorking] = useState(false);\r\n    const [printWorking, setPrintWorking] = useState(0);\r\n    const [emailDetails, setEmailDetails] = useState(null);\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig} = useSearch();\r\n\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (emailList?.totalCount !== undefined) {\r\n            setTotalCount(emailList.totalCount)\r\n        }\r\n    }, [emailList?.totalCount]);\r\n\r\n    useEffect(() => {\r\n        EmailListService.getEmailListActions(demandId);\r\n        return () => {\r\n            EmailListService.clearResources(EmailListService.EMAIL_LIST_RESOURCE_ID)\r\n            EmailListService.clearResources(EmailListService.EMAIL_LIST_ACTIONS_RESOURCE_ID)\r\n        }\r\n    }, [demandId]);\r\n\r\n    useEffect(() => {\r\n        setSearchInProgress(true);\r\n        const {pagination, search} = searchData;\r\n        EmailListService.getEmailList(demandId, pagination, search).finally(() => setSearchInProgress(false));\r\n        // eslint-disable-next-line\r\n    }, [searchData]);\r\n\r\n    const printEmailDetails = (emailId) => {\r\n        setPrintWorking(emailId);\r\n        EmailListService.printEmailDetails(demandId, emailId, () => setPrintWorking(0));\r\n    }\r\n\r\n    const getHeaders = (emailList) => {\r\n        const arr = [];\r\n\r\n        arr.push(Tr('subject'));\r\n        arr.push(Tr('recipients'));\r\n        arr.push(Tr('status'));\r\n        arr.push(Tr('send_date'));\r\n        arr.push('');\r\n        arr.push('');\r\n        return arr;\r\n    }\r\n\r\n    const getItems = ({items}) => {\r\n\r\n        const rows = [];\r\n\r\n        items.forEach(({identity, to, cc, bcc, subject, insertDate}, i, array) => {\r\n\r\n            const recipients = [...to, ...cc, ...bcc];\r\n            const arr = [];\r\n            arr.push({\r\n                value: subject\r\n            });\r\n\r\n            arr.push({\r\n                value: <Typography className={classes.recContent}>{recipients[0] + \" \"}\r\n                    {(recipients.length > 2) && <Tooltip title={<span className={classes.tooltipContent}>{recipients.join('\\n')}</span>}>\r\n                        <Typography className={classes.more} component='span'\r\n                                    color='secondary'>{' ' + Tr('and_x_more', {more: recipients.length - 1})}</Typography></Tooltip>}\r\n                </Typography>\r\n            });\r\n\r\n            arr.push({\r\n                value: <Link component=\"button\" variant=\"body2\" onClick={() => setEmailDetails({id: identity, detailed: false})}>{Tr('details')}</Link>\r\n            });\r\n\r\n            arr.push({\r\n                value: insertDate ? moment(insertDate).format(DateFormats.DATETIME_FORMAT) : null\r\n            });\r\n\r\n            arr.push({\r\n                value: <WorkableIconPrintButton onClick={() => {\r\n                    printEmailDetails(identity);\r\n                }} working={printWorking === identity} />\r\n            });\r\n\r\n            arr.push({\r\n                value: <WorkableIconPreviewButton onClick={() => {\r\n                    setEmailDetails({id: identity, detailed: true});\r\n                }}/>\r\n            });\r\n\r\n            rows.push(arr);\r\n        })\r\n        return rows;\r\n    };\r\n\r\n    const getColumnClasses = () => {\r\n        const arr = [];\r\n\r\n        arr.push(undefined);\r\n        arr.push(classes.recColumn);\r\n        arr.push(classes.statusColumn);\r\n        arr.push(classes.dateTimeColumn);\r\n        arr.push(classes.buttonColumn);\r\n        arr.push(classes.buttonColumn);\r\n        return arr;\r\n    };\r\n\r\n    const doExport = () => {\r\n        setExportWorking(true);\r\n        EmailListService.doExportEmails(emailListActions.exportEmailList.url, () => setExportWorking(false));\r\n    }\r\n\r\n    if (!emailList || !emailListActions) return <Loading/>\r\n    return (\r\n        <>\r\n            {!!emailListActions.exportEmailList && <GridBlock justify='flex-end'>\r\n                <WorkableButton working={exportWorking} onClick={doExport}>{Tr('export_email_list')}</WorkableButton>\r\n            </GridBlock>\r\n            }\r\n\r\n            <EmailListSearch doSearch={setSearchConfig} searchInProgress={searchInProgress}/>\r\n            <SimpleTable\r\n                headers={getHeaders(emailList)}\r\n                items={getItems(emailList)}\r\n                columnClasses={getColumnClasses()}\r\n                // cellClassName={classes.cell}\r\n                className={classes.table}\r\n            />\r\n            <Pagination totalCount={totalCount} disabled={searchInProgress} config={searchData.pagination} setConfig={setPaginationConfig}/>\r\n            {!!emailDetails &&\r\n            <EmailDetailsPopup detailed={emailDetails.detailed} demandId={demandId} emailId={emailDetails.id} onClose={() => setEmailDetails(null)}/>}\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nEmailListSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    emailList: state.resources[EmailListService.EMAIL_LIST_RESOURCE_ID],\r\n    emailListActions: state.resources[EmailListService.EMAIL_LIST_ACTIONS_RESOURCE_ID],\r\n}), {\r\n    setContrastColors\r\n})(EmailListSection);","import React from 'react'\r\nimport Workspace from \"components/Workspace\";\r\nimport EmailListSection from \"./components/EmailListSection\";\r\nimport Tr from \"translations/Translations\";\r\nimport Section from \"../part2/components/Section\";\r\n\r\nfunction EmailListPanel(\r\n    {\r\n        match\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n\r\n    return (<Section\r\n        title={Tr('email_list')}\r\n    ><Workspace render={<EmailListSection demandId={demandId}/>}/>\r\n    </Section>)\r\n}\r\n\r\n\r\nexport default EmailListPanel;","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport TextInput from \"components/TextInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\n\r\nfunction NoticeTextInput\r\n({\r\n     id,\r\n     label,\r\n     formikProps,\r\n     required,\r\n     multiline,\r\n     disabled\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(label ? label : id);\r\n\r\n\r\n    const input = <TextInput\r\n        id={id}\r\n        label={formTr(label ? label : id)}\r\n        formikProps={formikProps}\r\n        required={required}\r\n        multiline={multiline}\r\n        skipCheckTouched\r\n        disabled={disabled}\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeTextInput;","import React, {useContext, useState} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport EZamowieniaIcon from \"components/icon/EZamowieniaIcon\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport useEzamowieniaOauth from \"hooks/useEzamowieniaOauth\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\";\r\nimport {PP_REQUIRED_GROUPS} from \"constants/EzamowieniaRequiredGroups\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    inputWithButton: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(2)\r\n        }\r\n    },\r\n}))\r\n\r\n\r\nfunction BasicData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n    const classes = useStyle();\r\n    const [ezWorking, setEzWorking] = useState(false);\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const updateNotice = getObjectValue('_updateNotice', formikProps.values, true);\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict, getDynamicDict, loadDynamicDictionaries} = useContext(FormTranslationContext)\r\n    const {authorizeEzamowienia} = useEzamowieniaOauth();\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const loadPlanItems = () => {\r\n        setEzWorking(true);\r\n        authorizeEzamowienia(()=> {\r\n            loadDynamicDictionaries().then((resp)=> {\r\n                if(resp) {\r\n                    enqueueSuccessSnackbar(Tr(\"bzp_plan_items_loaded\"));\r\n                    if(resp[\"RKT-0510\"] && resp[\"RKT-0510\"].items && resp[\"RKT-0510\"].items.length > 0) {\r\n                        const bzpNumber = resp[\"RKT-0510\"].items[0].value;\r\n                        if(bzpNumber && gVal(\"tenderPlanNumber\") !== bzpNumber) {\r\n                            formikProps.setFieldValue(gId(\"tenderPlanNumber\"), bzpNumber);\r\n                            enqueueSuccessSnackbar(Tr(\"bzp_plan_number_loaded\"));\r\n                        }\r\n                    }\r\n\r\n\r\n                }\r\n            }).finally(()=>  setEzWorking(false));\r\n        },()=> {\r\n            setEzWorking(false)\r\n        }, PP_REQUIRED_GROUPS)\r\n    }\r\n\r\n    return (<>\r\n        <NoticeGlossaryInput\r\n            id={gId(\"refersTo\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MO.010\")}\r\n            required\r\n            disabled={updateNotice}\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"refersToSocialServices\")}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"name\")}\r\n            required\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"tenderPlanRelated\")}\r\n            required\r\n            disabled={updateNotice}\r\n        />\r\n        <Collapse in={gVal(\"tenderPlanRelated\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"tenderPlanNumber\")}\r\n                required\r\n                disabled={updateNotice}\r\n            />\r\n            <GridBlock wrap=\"nowrap\" className={classes.inputWithButton}>\r\n\r\n            <NoticeGlossaryInput\r\n                id={gId(\"tenderPlanItemIdentities\")}\r\n                items={getDynamicDict(\"RKT-05101\")}\r\n                formikProps={formikProps}\r\n                multiple\r\n                required\r\n                useObjectInsteadOfValues\r\n                disabled={updateNotice}\r\n            />\r\n                {\r\n                    !!loadDynamicDictionaries && !updateNotice && <WorkableButton disabled={!editable || ezWorking} working={ezWorking} Icon={EZamowieniaIcon} onClick={loadPlanItems}>Wczytaj</WorkableButton>\r\n                }\r\n            </GridBlock>\r\n        </Collapse>\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"onlyArt94Suppliers\")}\r\n            required\r\n        />\r\n        <Collapse in={gVal(\"onlyArt94Suppliers\") === true}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"art94Suppliers\")}\r\n                items={getDict(\"SL.MO.015\")}\r\n                formikProps={formikProps}\r\n                multiple\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={gVal(\"refersToSocialServices\") === true}>\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"onlyArt361Suppliers\")}\r\n                required={gVal(\"refersToSocialServices\")}\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"ueFunded\")}\r\n            required\r\n        />\r\n        <Collapse in={gVal(\"ueFunded\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"ueProgramName\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n    </>)\r\n}\r\n\r\nBasicData.propTypes = {};\r\n\r\nexport default BasicData;\r\n","import React, {useContext} from \"react\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport Typography from \"components/Typography\";\r\n\r\nfunction NoticeTypography\r\n({\r\n     children,\r\n     formTrKey\r\n }) {\r\n    const {formTr} = useContext(FormTranslationContext)\r\n\r\n    return <Typography variant=\"h6\">{formTrKey && formTr(formTrKey)}{children}</Typography>\r\n\r\n\r\n}\r\n\r\nexport default NoticeTypography;","import React, {memo, useContext} from 'react'\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport ExposureNeg1Icon from '@material-ui/icons/ExposureNeg1';\r\nimport Tr from 'translations/Translations'\r\nimport deepEq from 'fast-deep-equal'\r\nimport {Collapse} from \"@material-ui/core\";\r\n\r\nfunction PurchaserDataTogetherList(\r\n    {\r\n        id,\r\n        formikProps,\r\n        index,\r\n        removePurchaser\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    return (<>\r\n        <GridBlock justify=\"space-between\">\r\n            <NoticeTypography formTrKey={id}>: {index + 1}</NoticeTypography>\r\n            <Button disabled={!editable} variant=\"outlined\" Icon={ExposureNeg1Icon} onClick={() => removePurchaser(index)}>{Tr(\"remove_purchaser_x\", {x: index + 1})}</Button>\r\n        </GridBlock>\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"name\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"branch\")}\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"nationalIdNumber\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"street\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"city\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"postCode\")}\r\n            required\r\n        />\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"country\")}\r\n            items={getDict(\"SL.MT.005\")}\r\n            required\r\n            unmountOnExit\r\n        />\r\n        <Collapse in={gVal(\"country\") === \"PL\"}>\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"state\")}\r\n                items={getDict(\"SL.MT.007\")}\r\n                required\r\n                unmountOnExit\r\n            />\r\n        </Collapse>\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"nuts3\")}\r\n            items={getDict(\"SL.MT.004\")}\r\n            unmountOnExit\r\n            prefixLabelsWithKeys\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"phone\")}\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"fax\")}\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"email\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"www\")}\r\n            required\r\n        />\r\n    </>)\r\n}\r\n\r\nPurchaserDataTogetherList.propTypes = {};\r\n// export default PurchaserDataTogetherList;\r\nexport default memo(PurchaserDataTogetherList, (prevProps, nextProps) => {\r\n    const id = nextProps.id;\r\n    if (prevProps.formikProps && nextProps.formikProps) {\r\n        const pv = getObjectValue(id, prevProps.formikProps.values, null);\r\n        const nv = getObjectValue(id, nextProps.formikProps.values, null);\r\n        if (pv === nv) {\r\n            const pe = getObjectValue(id, prevProps.formikProps.errors, null);\r\n            const ne = getObjectValue(id, nextProps.formikProps.errors, null);\r\n            return pe === ne && deepEq(pe, ne);\r\n        }\r\n    }\r\n    return false;\r\n})\r\n\r\n","import React, {useEffect} from 'react'\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeIntegerInput from \"../../components/inputs/NoticeIntegerInput\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport Typography from \"components/Typography\";\r\nimport PlusOneIcon from '@material-ui/icons/PlusOne';\r\nimport Tr from 'translations/Translations';\r\nimport Button from \"components/Button\";\r\nimport PurchaserDataTogetherList from \"./PurchaserDataTogetherList\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {FieldArray} from \"formik\";\r\n\r\nfunction PurchaserDataTogether(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n\r\n    useEffect(() => {\r\n        if (getObjectValue(id, formikProps.values, null) == null) {\r\n            formikProps.setFieldValue(id, {\r\n                \"togetherDuties\": null,\r\n                \"togetherRegulations\": null,\r\n                \"list\": [],\r\n                \"togetherCount\": null\r\n            })\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n\r\n    const addPurchaser = (arrayHelpers) => {\r\n        const arr = gVal(\"list\", true, []);\r\n        arrayHelpers.push({\r\n            \"name\": null,\r\n            \"branch\": null,\r\n            \"nationalIdNumber\": null,\r\n            \"street\": null,\r\n            \"city\": null,\r\n            \"postCode\": null,\r\n            \"country\": \"PL\",\r\n            \"state\": null,\r\n            \"nuts3\": null,\r\n            \"phone\": null,\r\n            \"fax\": null,\r\n            \"email\": null,\r\n            \"www\": null\r\n        });\r\n        formikProps.setFieldValue(gId(\"togetherCount\"), arr.length + 1);\r\n    }\r\n\r\n    const removePurchaser = (arrayHelpers, index) => {\r\n        const arr = gVal(\"list\", true, []);\r\n        formikProps.setFieldValue(gId(\"togetherCount\"), arr.length - 1)\r\n        arrayHelpers.remove(index);\r\n    }\r\n\r\n\r\n    return (<>\r\n        <NoticeTypography formTrKey={id}/>\r\n\r\n        <Typography>To pole uzupełniane jest automaycznie poprzez dodawanie kolejnych wykonawców poniżej</Typography>\r\n        <NoticeIntegerInput\r\n            formikProps={formikProps}\r\n            id={gId(\"togetherCount\")}\r\n            disabled\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"togetherDuties\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"togetherRegulations\")}\r\n        />\r\n\r\n        <FieldArray\r\n            name={gId(\"list\")}\r\n            render={(arrayHelpers) => (<>\r\n                {!!gVal(\"form.purchaserData.together.list\", false) &&\r\n                    formikProps.values.form.purchaserData.together.list.map((item, index) => (\r\n                        <PurchaserDataTogetherList key={index} id={gId(\"list.\" + index)} formikProps={formikProps} index={index}\r\n                                                   removePurchaser={(index) => removePurchaser(arrayHelpers, index)}/>\r\n                    ))\r\n                }\r\n                <Button disabled={!editable} Icon={PlusOneIcon} onClick={() => addPurchaser(arrayHelpers)}>{Tr('add_purchaser')}</Button>\r\n            </>)}\r\n        />\r\n    </>)\r\n}\r\n\r\nPurchaserDataTogether.propTypes = {};\r\n\r\nexport default PurchaserDataTogether;\r\n","import React, {useContext, useEffect} from 'react'\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {Collapse} from \"@material-ui/core\";\r\n\r\nfunction PurchaserDataEntrusted(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    useEffect(() => {\r\n        if (getObjectValue(id, formikProps.values, null) == null) {\r\n            formikProps.setFieldValue(id, {})\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    return (<>\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"name\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"nationalIdNumber\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"street\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"city\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"postCode\")}\r\n            required\r\n        />\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"country\")}\r\n            items={getDict(\"SL.MT.005\")}\r\n            required\r\n            unmountOnExit\r\n        />\r\n        <Collapse in={gVal(\"country\") === \"PL\"}>\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"state\")}\r\n                items={getDict(\"SL.MT.007\")}\r\n                required\r\n                unmountOnExit\r\n            />\r\n        </Collapse>\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"nuts3\")}\r\n            items={getDict(\"SL.MT.004\")}\r\n            unmountOnExit\r\n            prefixLabelsWithKeys\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"phone\")}\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"fax\")}\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"email\")}\r\n            required\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"www\")}\r\n            required\r\n        />\r\n    </>)\r\n}\r\n\r\nPurchaserDataEntrusted.propTypes = {};\r\nexport default PurchaserDataEntrusted;\r\n\r\n\r\n","import React, {useContext} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport Typography from \"components/Typography\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport PurchaserDataTogether from \"./PurchaserDataTogether\";\r\nimport PurchaserDataEntrusted from \"./PurchaserDataEntrusted\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nfunction PurchaserData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    return (<>\r\n\r\n        <Typography>{Tr(\"bzp_notice_purchaser_data_info\")}</Typography>\r\n        <br/>\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"phoneNumber\")}\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"faxNumber\")}\r\n        />\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"email\")}\r\n            required\r\n        />\r\n        <NoticeGlossaryInput\r\n            id={gId(\"type\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MO.013\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"type\") === \"1.5\"}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"typeOther\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            id={gId(\"activitySubject\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MO.014\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"activitySubject\") === \"11\"}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"activitySubjectOther\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            id={gId(\"role\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"ENUM.001\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"role\") === 'wspolnie'} unmountOnExit>\r\n            <PurchaserDataTogether formikProps={formikProps} id={gId(\"together\")} />\r\n        </Collapse>\r\n\r\n        <Collapse in={gVal(\"role\") === 'powierzony'} unmountOnExit>\r\n            <PurchaserDataEntrusted formikProps={formikProps} id={gId(\"entrusted\")} />\r\n        </Collapse>\r\n\r\n\r\n\r\n    </>)\r\n}\r\n\r\nPurchaserData.propTypes = {};\r\n\r\nexport default PurchaserData;\r\n","import React, {useMemo, useRef} from 'react'\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport ArrowIconLeft from \"@material-ui/icons/KeyboardArrowLeft\";\r\nimport ArrowIconRight from \"@material-ui/icons/KeyboardArrowRight\";\r\nimport {Paper} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\"\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport moment from \"libs/moment\";\r\nimport scrollTo from \"libs/scrollTo\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        top: 109\r\n    },\r\n    paper: {\r\n        padding: theme.spacing(0.5),\r\n        border: `solid 2px ${theme.palette.border.dark}`,\r\n    },\r\n    select: {\r\n        minWidth: 550\r\n    },\r\n    margin: {\r\n        margin: `0 ${theme.spacing()}px`\r\n    }\r\n}))\r\n\r\nfunction FormNavigator(\r\n    {\r\n        formikProps,\r\n        id,\r\n        items,\r\n        formTr,\r\n        trPrefix,\r\n        onSubmit,\r\n        onSave,\r\n        onCreateNewVersion,\r\n        buttonWorks,\r\n        doAutoSave = false\r\n    }) {\r\n    const classes = useStyle();\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    // eslint-disable-next-line\r\n    const memoItems = useMemo(() => items.map((x, i, arr) => createSelectItem(x, `${formTr(trPrefix + x)} (${i + 1}/${arr.length})`)), [items, trPrefix])\r\n    const curStep = formikProps.values[id];\r\n    const curIndex = items.indexOf(curStep);\r\n    const lastSave = useRef(moment())\r\n\r\n\r\n    const autoSave = () => {\r\n        setTimeout(()=> scrollTo(\"#form-top-scroll-to\", -20), 100)\r\n        if(doAutoSave && onSave) {\r\n            const now = moment();\r\n            if(now.diff(lastSave.current, 'seconds') > 10) {\r\n                onSave();\r\n                lastSave.current = now;\r\n            }\r\n        }\r\n    }\r\n\r\n    const onChange = (step) => {\r\n        formikProps.setFieldValue(id, step);\r\n        autoSave();\r\n    }\r\n\r\n    return (<div className={classes.root}>\r\n        <Paper className={classes.paper}>\r\n            <GridBlock justify=\"space-between\" alignItems=\"center\" flexGrow>\r\n                <GridBlock justify=\"center\" alignItems=\"center\">\r\n                    <IconButton\r\n                        className={classes.margin}\r\n                        disabled={curIndex < 1}\r\n                        tooltip={curIndex > 0 ? formTr(trPrefix + items[curIndex - 1]) : undefined}\r\n                        variant=\"outlined\"\r\n                        onClick={() => onChange(items[curIndex - 1])}\r\n                        Icon={ArrowIconLeft}/>\r\n                    <Select onChange={autoSave} className={classes.select} items={memoItems} id={id} formikProps={formikProps} noError alwaysEditable/>\r\n                    <IconButton\r\n                        className={classes.margin}\r\n                        disabled={curIndex === items.length - 1}\r\n                        tooltip={curIndex < items.length - 1 ? formTr(trPrefix + items[curIndex + 1]) : undefined}\r\n                        variant=\"outlined\"\r\n                        onClick={() => onChange(items[curIndex + 1])}\r\n                        Icon={ArrowIconRight}/>\r\n                </GridBlock>\r\n                {\r\n\r\n                    (!!onCreateNewVersion || !!onSubmit || !!onSave) &&\r\n                    <GridBlock justify=\"flex-end\" alignItems=\"center\">\r\n                        {!!onCreateNewVersion && <WorkableButton working={buttonWorks.newVersion} onClick={onCreateNewVersion}>{Tr('bzp_notice_create_new_version')}</WorkableButton>}\r\n                        {!onCreateNewVersion && !!onSave && <WorkableButton working={buttonWorks.draft} disabled={!editable} variant=\"outlined\" onClick={onSave}>{Tr('save_draft_version')}</WorkableButton>}\r\n                        {!onCreateNewVersion && !!onSubmit && <WorkableButton working={buttonWorks.save} disabled={!editable} onClick={onSubmit} className={classes.margin}>{Tr('save')}</WorkableButton>}\r\n                    </GridBlock>\r\n                }\r\n            </GridBlock>\r\n        </Paper>\r\n    </div>)\r\n}\r\n\r\nFormNavigator.propTypes = {};\r\n\r\nexport default FormNavigator;\r\n","export default {\r\n    basicData: \"basicData\",\r\n    purchaserData: \"purchaserData\",\r\n    realizationType: \"realizationType\",\r\n    documentsAccess: \"documentsAccess\",\r\n    orderObject: \"orderObject\",\r\n    qualification: \"qualification\",\r\n    objectiveEvidence: \"objectiveEvidence\",\r\n    orderTerms: \"orderTerms\",\r\n    contractDraft: \"contractDraft\",\r\n    orderDetails: \"orderDetails\",\r\n    additionalInfo: \"additionalInfo\"\r\n}\r\n\r\nexport const contractNoticeStepsOrder = [\"basicData\", \"purchaserData\", \"realizationType\", \"documentsAccess\", \"orderObject\", \"qualification\",\r\n    \"objectiveEvidence\", \"orderTerms\", \"contractDraft\", \"orderDetails\", \"additionalInfo\"];","import VS from 'constants/ValidationShema';\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nexport default  () => VS.object({\r\n    step: VS.any().strip(),\r\n    orderDealing: VS.any().strip(),\r\n    primaryDealing: VS.any().strip(),\r\n    partnershipDealing: VS.any().strip(),\r\n    form: VS.lazy(form => {\r\n        const refersTo = getObjectValue(\"basicData.refersTo\", form, null);\r\n        const realizationType = refersTo === \"Order\" ? getObjectValue(\"realizationType.orderRealizationType\", form, null) : (refersTo === \"FrameworkAgreement\" ? getObjectValue(\"realizationType.frameworkRealizationType\", form, null) : null)\r\n        const partialOffers = getObjectValue(\"orderObject.partialOffers\", form, null);\r\n        const orderType = getObjectValue(\"orderObject.orderType\", form, null);\r\n\r\n        const realization_primary_1 = (refersTo === \"Order\" && realizationType === \"1.1.1\") || (refersTo === \"FrameworkAgreement\" && realizationType === \"11.1.1\");\r\n        const realization_primary_2 = (refersTo === \"Order\" && realizationType === \"1.1.2\") || (refersTo === \"FrameworkAgreement\" && realizationType === \"11.1.2\");\r\n        const realization_primary_3 = (refersTo === \"Order\" && realizationType === \"1.1.3\") || (refersTo === \"FrameworkAgreement\" && realizationType === \"11.1.3\");\r\n        const realization_partnership_2 = (refersTo === \"Order\" && realizationType === \"1.2\") || (refersTo === \"FrameworkAgreement\" && realizationType === \"11.2\");\r\n\r\n        const primaryRealizationType = realization_primary_1 || realization_primary_2 || realization_primary_3;\r\n\r\n        const criteriaValidator = (criteriaWeightStrategy) => VS.arrayOfShape({\r\n            type: VS.string(),\r\n            qualityCriterionType: VS.any().when(\"type\", {is: \"QUALITY\", then: VS.string(), otherwise: VS.any().strip()}),\r\n            criterionName: VS.stringMax(1000),\r\n            criterionPctgWeight: VS.any().when(\"type\", {is: (x) => criteriaWeightStrategy === \"1\", then: VS.amountMax100(), otherwise: VS.any().strip()}),\r\n            criterionPktWeight: VS.any().when(\"type\", {is: (x) => criteriaWeightStrategy === \"2\", then: VS.amountMax100(), otherwise: VS.any().strip()}),\r\n            criterionOrder: VS.any().when(\"type\", {is: (x) => criteriaWeightStrategy === \"3\", then: VS.amount(0, false), otherwise: VS.any().strip()})\r\n        })\r\n\r\n        const primaryLotValidator = VS.lazy(lot => {\r\n            const criteriaWeightStrategy = !!lot ? lot.criteriaWeightStrategy : null;\r\n\r\n            return VS.object({\r\n                negotiationsPossible: VS.any().when(\"criteriaWeightStrategy\", {\r\n                    is: (x) => realization_primary_2,\r\n                    then: VS.requiredBoolean(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                evaluationMethodDescription: VS.any().when(\"criteriaWeightStrategy\", {\r\n                    is: (x) => realization_primary_1 || realization_primary_2,\r\n                    then: VS.stringMaxNoRq(4000),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                criteriaWeightStrategy: VS.string(),\r\n                criteriaEvaluationStrategy: VS.string(),\r\n                evaluationSocialAspects3: VS.any().when(\"criteriaWeightStrategy\", {\r\n                    is: (x) => realization_primary_3,\r\n                    then: VS.requiredBoolean(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                evaluationSocialAspects3Info: VS.any().when(\"evaluationSocialAspects3\", {\r\n                    is: (x) => x === true,\r\n                    then: VS.arrayRequired(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                evaluationSocialAspects12: VS.any().when(\"criteriaWeightStrategy\", {\r\n                    is: (x) => realization_primary_1 || realization_primary_2,\r\n                    then: VS.requiredBoolean(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                evaluationSocialAspects12Info: VS.any().when(\"evaluationSocialAspects12\", {\r\n                    is: (x) => x === true && (realization_primary_1 || realization_primary_2),\r\n                    then: VS.arrayRequired()\r\n                }),\r\n                criteria: criteriaValidator(criteriaWeightStrategy)\r\n            })\r\n        })\r\n\r\n        const partnershipLotValidator = VS.lazy(lot => {\r\n            const criteriaWeightStrategy = !!lot ? lot.criteriaWeightStrategy : null;\r\n\r\n            return VS.object({\r\n                criteriaWeightStrategy: VS.string(),\r\n                criteriaEvaluationStrategy: VS.string(),\r\n                nonNegotiableRequirements: VS.string(4000),\r\n                criteria: criteriaValidator(criteriaWeightStrategy)\r\n            })\r\n        })\r\n\r\n\r\n        return VS.object({\r\n            basicData: VS.object({\r\n                refersTo: VS.string(),\r\n                refersToSocialServices: VS.requiredBoolean(),\r\n                name: VS.stringMax(200),\r\n                tenderPlanRelated: VS.requiredBoolean(),\r\n                tenderPlanNumber: VS.any().when(\"tenderPlanRelated\", {is: (x) => x === true, then: VS.stringMax(22), otherwise: VS.any().strip()}),\r\n                tenderPlanItemIdentities: VS.any().when(\"tenderPlanRelated\", {is: (x) => x === true, then: VS.arrayRequired(), otherwise: VS.any().strip()}),\r\n                onlyArt94Suppliers: VS.requiredBoolean(),\r\n                art94Suppliers: VS.any().when(\"onlyArt94Suppliers\", {is: (x) => x === true, then: VS.arrayRequired(), otherwise: VS.any().strip()}),\r\n                onlyArt361Suppliers: VS.any().when(\"refersToSocialServices\", {is: (x) => x === true, then: VS.requiredBoolean()}),\r\n                ueFunded: VS.requiredBoolean(),\r\n                ueProgramName: VS.any().when(\"ueFunded\", {is: (x) => x === true, then: VS.stringMax(400), otherwise: VS.any().strip()})\r\n            }),\r\n            purchaserData: VS.object({\r\n                phoneNumber: VS.stringMaxNoRq(100),\r\n                faxNumber: VS.stringMaxNoRq(100),\r\n                email: VS.emailMax(250),\r\n                type: VS.string(),\r\n                typeOther: VS.any().when(\"type\", {is: \"1.5\", then: VS.stringMax(200), otherwise: VS.any().strip()}),\r\n                activitySubject: VS.string(),\r\n                activitySubjectOther: VS.any().when(\"activitySubject\", {is: \"11\", then: VS.stringMax(200), otherwise: VS.any().strip()}),\r\n                role: VS.string(),\r\n                together: VS.any().when(\"role\", {\r\n                    is: \"wspolnie\", then: VS.object({\r\n                        togetherCount: VS.integerMinMax(1, 100),\r\n                        togetherDuties: VS.stringMax(1000),\r\n                        togetherRegulations: VS.stringMaxNoRq(1000),\r\n                        list: VS.arrayOfShape({\r\n                            name: VS.stringMax(300),\r\n                            branch: VS.stringMaxNoRq(300),\r\n                            nationalIdNumber: VS.stringMax(100),\r\n                            street: VS.stringMax(100),\r\n                            city: VS.stringMax(100),\r\n                            postCode: VS.stringMax(20),\r\n                            state: VS.any().when(\"country\", {is: \"PL\", then: VS.string(), otherwise: VS.any().strip()}),\r\n                            country: VS.string(),\r\n                            nuts3: VS.any().when(\"country\", {is: \"PL\", then: VS.string(), otherwise: VS.any()}),\r\n                            phone: VS.stringMaxNoRq(100),\r\n                            fax: VS.stringMaxNoRq(100),\r\n                            email: VS.emailMax(250),\r\n                            www: VS.urlMax(250)\r\n                        })\r\n\r\n                    }), otherwise: VS.any().strip()\r\n                }),\r\n                entrusted: VS.any().when(\"role\", {\r\n                    is: \"powierzony\", then: VS.object({\r\n                        name: VS.stringMax(300),\r\n                        nationalIdNumber: VS.stringMax(100),\r\n                        street: VS.stringMax(100),\r\n                        city: VS.stringMax(100),\r\n                        postCode: VS.stringMax(20),\r\n                        state: VS.any().when(\"country\", {is: \"PL\", then: VS.string(), otherwise: VS.any().strip()}),\r\n                        country: VS.string(),\r\n                        nuts3: VS.any().when(\"country\", {is: \"PL\", then: VS.string(), otherwise: VS.any()}),\r\n                        phone: VS.stringMaxNoRq(100),\r\n                        fax: VS.stringMaxNoRq(100),\r\n                        email: VS.emailMax(250),\r\n                        www: VS.urlMax(250)\r\n                    }), otherwise: VS.any().strip()\r\n                })\r\n            }),\r\n            realizationType: VS.object({\r\n                orderRealizationType: VS.any().when(\"frameworkRealizationType\", {\r\n                    is: (x) => refersTo === \"Order\",\r\n                    then: VS.string(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                frameworkRealizationType: VS.any().when(\"orderRealizationTypes\", {\r\n                    is: (x) => refersTo === \"FrameworkAgreement\",\r\n                    then: VS.string(),\r\n                    otherwise: VS.any().strip()\r\n                })\r\n            }),\r\n            documentsAccess: VS.object({\r\n                ezamowieniaDemand: VS.requiredBoolean(),\r\n                www: VS.urlMax(250),\r\n                restrictedAccess: VS.requiredBoolean(),\r\n                restrictedAccessInfo: VS.any().when(\"restrictedAccess\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                electronicOffersOnly: VS.requiredBoolean(),\r\n                electronicOffersInfo: VS.any().when(\"electronicOffersOnly\", {is: (x) => x === true, then: VS.stringMax(1000), otherwise: VS.any().strip()}),\r\n                electronicOffersRequirements: VS.any().when(\"electronicOffersOnly\", {is: (x) => x === true, then: VS.stringMax(4000)}),\r\n                toolsWww: VS.urlMaxOptional(250),\r\n                toolsNotWidelyAvailable: VS.requiredBoolean(),\r\n                notWidelyAvailableToolsInfo: VS.any().when(\"toolsNotWidelyAvailable\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                offerCatalog: VS.string(),\r\n                notElectronicOffersReason: VS.any().when(\"electronicOffersOnly\", {\r\n                    is: (x) => x === false,\r\n                    then: VS.arrayRequired(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                notElectronicOffersMethod: VS.any().when(\"electronicOffersOnly\", {is: (x) => x === false, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                offerLang: VS.arrayRequired(),\r\n                rodoInfo: VS.stringMaxNoRq(4000),\r\n                rodoLimitations: VS.stringMaxNoRq(4000),\r\n                offerCatalogUsage: VS.any().when(\"ezamowieniaDemand\", {\r\n                    is: (x) => refersTo === \"FrameworkAgreement\",\r\n                    then: VS.requiredBoolean(),\r\n                    otherwise: VS.any().strip()\r\n                })\r\n            }),\r\n            orderObject: VS.object({\r\n                marketConsultations: VS.requiredBoolean(),\r\n                number: VS.stringMaxNoRq(100),\r\n                orderType: VS.string(),\r\n                dividedIntoLots: VS.any().when(\"orderType\", {is: (x) => refersTo === \"Order\", then: VS.requiredBoolean(), otherwise: VS.any().strip()}),\r\n                lotsValueNet: VS.any().when(\"orderType\", {is: (x) => refersTo === \"Order\", then: VS.amountOptional(), otherwise: VS.any().strip()}),\r\n                lotsValueNetCurrency: VS.any().when(\"orderType\", {is: (x) => refersTo === \"Order\", then: VS.any(), otherwise: VS.any().strip()}),\r\n                orderValueNet: VS.any().when([\"orderType\", \"dividedIntoLots\"], {is: (orderType, dividedIntoLots) => refersTo === \"Order\" && dividedIntoLots === true, then: VS.amountOptional(), otherwise: VS.any().strip()}),\r\n                orderValueNetCurrency: VS.any().when([\"orderType\", \"dividedIntoLots\"], {is: (orderType, dividedIntoLots) => refersTo === \"Order\" && dividedIntoLots === true, then: VS.any(), otherwise: VS.any().strip()}),\r\n                frameworkAgreementValueNet: VS.any().when(\"orderType\", {\r\n                    is: (x) => refersTo === \"FrameworkAgreement\",\r\n                    then: VS.amountOptional(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                frameworkAgreementValueNetCurrency: VS.any().when(\"orderType\", {\r\n                    is: (x) => refersTo === \"FrameworkAgreement\",\r\n                    then: VS.any(), otherwise: VS.any().strip()\r\n                }),\r\n                partialOffers: VS.requiredBoolean(),\r\n                dealingCount: VS.any().when(\"partialOffers\", {is: (x) => x === true, then: VS.integerMinMax(2, 1000), otherwise: VS.any().strip()}),\r\n                offerType: VS.any().when(\"partialOffers\", {is: (x) => x === true, then: VS.string(), otherwise: VS.any().strip()}),\r\n                dealingLimited: VS.any().when(\"partialOffers\", {is: (x) => x === true, then: VS.requiredBoolean(), otherwise: VS.any().strip()}),\r\n                dealingLimitPerSupplier: VS.any().when(\"dealingLimited\", {\r\n                    is: (x) => x === true,\r\n                    then: VS.numberPositiveNoZero(),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                socialAspectsConsidered: VS.requiredBoolean(),\r\n                socialAspects: VS.any().when(\"socialAspectsConsidered\", {is: (x) => x === true, then: VS.arrayRequired(), otherwise: VS.any().strip()}),\r\n                notDivided: VS.any().when(\"partialOffers\", {\r\n                    is: (x) => x === false, then: VS.object({\r\n                        purchaserNeedsDescription: VS.any().when(\"mainCpv\", {is: (x) => realization_primary_3, then: VS.stringMax(10000), otherwise: VS.any().strip()}),\r\n                        innovationProductNeed: VS.any().when(\"mainCpv\", {is: (x) => realization_partnership_2, then: VS.string(10000), otherwise: VS.any().strip()}),\r\n                        orderSubjectDescription: VS.any().when(\"mainCpv\", {\r\n                            is: (x) => realization_primary_1 || realization_primary_2,\r\n                            then: VS.stringMax(10000),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        mainCpv: VS.requiredObject(),\r\n                        additionalCpv: VS.any(),\r\n                        includesOptions: VS.requiredBoolean(),\r\n                        includesOptionsInfo: VS.any().when(\"includesOptions\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                        realizationPeriod: VS.string(),\r\n                        realizationPeriodDateFrom: VS.any().when(\"realizationPeriod\", {is: \"DateFromTo\", then: VS.dateTimeValid(), otherwise: VS.any().strip()}),\r\n                        realizationPeriodDateTo: VS.any().when(\"realizationPeriod\", {\r\n                            is: (x) => x === \"DateFromTo\" || x === \"DateTo\",\r\n                            then: VS.dateTimeValid(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        realizationPeriodAmount: VS.any().when(\"realizationPeriod\", {\r\n                            is: (x) => x === \"NumberOfDays\" || x === \"NumberOfMonths\",\r\n                            then: VS.string(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        planRenewals: VS.requiredBoolean(),\r\n                        planRenewalsInfo: VS.any().when(\"planRenewals\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                        planOtherOrderForCurrentSupplier: VS.any().when(\"mainCpv\", {is: (x) => orderType === \"Works\" || orderType === \"Services\", then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n                        planOtherOrderForCurrentSupplierInfo: VS.any().when(\"planOtherOrderForCurrentSupplier\", {\r\n                            is: (x) => x === true,\r\n                            then: VS.stringMax(4000),\r\n                            otherwise: VS.any().strip()\r\n                        })\r\n                    }), otherwise: VS.any().strip()\r\n                }),\r\n                divided: VS.any().when(\"partialOffers\", {\r\n                    is: (x) => x === true, then: VS.arrayOfShape({\r\n                        dealingValue: VS.amountOptional(0, false),\r\n                        dealingValueCurrency: VS.any(),\r\n                        purchaserNeedsDescription: VS.any().when(\"mainCpv\", {is: (x) => realization_primary_3, then: VS.stringMax(10000), otherwise: VS.any().strip()}),\r\n                        innovationProductNeed: VS.any().when(\"mainCpv\", {is: (x) => realization_partnership_2, then: VS.string(10000), otherwise: VS.any().strip()}),\r\n                        orderSubjectDescription: VS.any().when(\"mainCpv\", {\r\n                            is: (x) => realization_primary_1 || realization_primary_2,\r\n                            then: VS.stringMax(10000),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        mainCpv: VS.requiredObject(),\r\n                        additionalCpv: VS.any(),\r\n                        includesOptions: VS.requiredBoolean(),\r\n                        includesOptionsInfo: VS.any().when(\"includesOptions\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                        realizationPeriod: VS.string(),\r\n                        realizationPeriodDateFrom: VS.any().when(\"realizationPeriod\", {is: \"DateFromTo\", then: VS.dateTimeValid(), otherwise: VS.any().strip()}),\r\n                        realizationPeriodDateTo: VS.any().when(\"realizationPeriod\", {\r\n                            is: (x) => x === \"DateFromTo\" || x === \"DateTo\",\r\n                            then: VS.dateTimeValid(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        realizationPeriodAmount: VS.any().when(\"realizationPeriod\", {\r\n                            is: (x) => x === \"NumberOfDays\" || x === \"NumberOfMonths\",\r\n                            then: VS.string(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        planRenewals: VS.requiredBoolean(),\r\n                        planRenewalsInfo: VS.any().when(\"planRenewals\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                        planOtherOrderForCurrentSupplier: VS.any().when(\"mainCpv\", {is: (x) => orderType === \"Works\" || orderType === \"Services\", then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n                        planOtherOrderForCurrentSupplierInfo: VS.any().when(\"planOtherOrderForCurrentSupplier\", {\r\n                            is: (x) => x === true,\r\n                            then: VS.stringMax(4000),\r\n                            otherwise: VS.any().strip()\r\n                        })\r\n                    }), otherwise: VS.any().strip()\r\n                }),\r\n            }),\r\n            qualification: VS.object({\r\n                predictedExclusion: VS.requiredBoolean(),\r\n                predictedExclusionInfo: VS.any().when(\"predictedExclusion\", {is: (x) => x === true, then: VS.arrayRequired(), otherwise: VS.any().strip()}),\r\n                participationConditions: VS.requiredBoolean(),\r\n                participationConditionsInfo: VS.any().when(\"participationConditions\", {is: (x) => x === true, then: VS.stringMax(10000), otherwise: VS.any().strip()}),\r\n                art125Statement: VS.requiredBoolean(),\r\n                inclusionSubjectiveEvidence: VS.stringMaxNoRq(4000),\r\n                exclusionSubjectiveEvidence: VS.stringMaxNoRq(4000)\r\n            }),\r\n            objectiveEvidence: VS.object({\r\n                objectiveEvidenceInfo: VS.stringMaxNoRq(4000),\r\n                plansEvidence: VS.any(),\r\n                plansEvidenceInfo: VS.any().when(\"plansEvidence\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                otherDocumentsList: VS.stringMaxNoRq(4000)\r\n            }),\r\n            orderTerms: VS.object({\r\n                variantsAllowed: VS.requiredBoolean(),\r\n                variantsAllowedInfo: VS.any().when(\"variantsAllowed\", {is: (x) => x === true, then: VS.string(), otherwise: VS.any().strip()}),\r\n                auctionPlanned: VS.requiredBoolean(),\r\n                auctionUrl: VS.any().when(\"auctionPlanned\", {is: (x) => x === true, then: VS.stringMax(250), otherwise: VS.any().strip()}),\r\n                auctionPlannedInfo: VS.any().when(\"auctionPlanned\", {is: (x) => x === true, then: VS.stringMax(10000), otherwise: VS.any().strip()}),\r\n                guaranteeRequired: VS.requiredBoolean(),\r\n                guaranteeRequiredInfo: VS.any().when(\"guaranteeRequired\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                properExecutionGuarantee: VS.requiredBoolean(),\r\n                togetherRequirements: VS.stringMaxNoRq(4000),\r\n                possibleDemandInvalidation: VS.requiredBoolean()\r\n            }),\r\n            contractDraft: VS.object({\r\n                advancePayment: VS.requiredBoolean(),\r\n                advancePaymentInfo: VS.any().when(\"advancePayment\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                contractChanges: VS.requiredBoolean(),\r\n                contractChangesInfo: VS.any().when(\"contractChanges\", {is: (x) => x === true, then: VS.stringMax(4000), otherwise: VS.any().strip()}),\r\n                socialAspects: VS.requiredBoolean(),\r\n                socialAspectsInfo: VS.any().when(\"socialAspects\", {is: (x) => x === true, then: VS.arrayRequired(), otherwise: VS.any().strip()})\r\n            }),\r\n            orderDetails: VS.object({\r\n                x: VS.any().strip(),\r\n                frameworkAgreement: VS.any().when(\"x\", {\r\n                    is: (x) => refersTo === \"FrameworkAgreement\",\r\n                    then: VS.object({\r\n                        suppliersNumber: VS.string(),\r\n                        suppliersNumberLimited: VS.requiredBoolean(),\r\n                        suppliersNumberLimit: VS.any().when(\"suppliersNumberLimited\", {is: (x) => x === true, then: VS.number(), otherwise: VS.any().strip()}),\r\n                        art314Order: VS.any().when(\"suppliersNumber\", {\r\n                            is: \"FrameworkAgreementSeveralContractors\",\r\n                            then: VS.string(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        periodExceedInfo: VS.any()\r\n                    }).nullable(), otherwise: VS.any().strip()\r\n                }),\r\n                primary: VS.any().when(\"x\", {\r\n                    is: (x) => primaryRealizationType,\r\n                    then: VS.object({\r\n                        offerEndDate: VS.dateTimeValid(),\r\n                        offerSubmitPlace: VS.string(),\r\n                        offerOpenDate: VS.dateTimeValid(),\r\n                        bindWithOffer: VS.any().when(\"offerSubmitPlace\", {\r\n                            is: (x) => realization_primary_1 || realization_primary_2,\r\n                            then: VS.string(), otherwise: VS.any().strip()\r\n                        }),\r\n                        bindWithOfferDays: VS.any().when(\"bindWithOffer\", {\r\n                            is: (x) => x === \"DAYCOUNT\" && (realization_primary_1 || realization_primary_2),\r\n                            then: VS.numberPositiveNoZero(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        bindWithOfferDate: VS.any().when(\"bindWithOffer\", {\r\n                            is: (x) => x === \"DATE\" && (realization_primary_1 || realization_primary_2),\r\n                            then: VS.dateTimeValid(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        maxSupplierNumber: VS.any().when(\"offerSubmitPlace\", {\r\n                            is: (x) => realization_primary_2 || realization_primary_3,\r\n                            then: VS.numberPositiveOptional(), otherwise: VS.any().strip()\r\n                        }),\r\n                        limitSuppliersNumberInfo: VS.any().when(\"offerSubmitPlace\", {\r\n                            is: (x) => realization_primary_2 || realization_primary_3,\r\n                            then: VS.stringMaxNoRq(4000), otherwise: VS.any().strip()\r\n                        }),\r\n                        noNegotiationsTermsDescription: VS.any().when(\"offerSubmitPlace\", {\r\n                            is: (x) => realization_primary_3,\r\n                            then: VS.string(4000)\r\n                        }),\r\n                    }), otherwise: VS.any().strip()\r\n                }),\r\n                primaryLots: VS.any().when(\"x\", {\r\n                    is: (x) => partialOffers === true && primaryRealizationType,\r\n                    then: VS.arrayOf(primaryLotValidator), otherwise: VS.any().strip()\r\n                }),\r\n                primaryNoLots: VS.any().when(\"x\", {\r\n                    is: (x) => partialOffers === false && primaryRealizationType,\r\n                    then: primaryLotValidator, otherwise: VS.any().strip()\r\n                }),\r\n                partnership: VS.any().when(\"x\", {\r\n                    is: (x) => realization_partnership_2,\r\n                    then: VS.object({\r\n                        offerEndDate: VS.dateTimeValid(),\r\n                        offerSubmitPlace: VS.string(),\r\n                        offerOpenDate: VS.dateTimeValid(),\r\n                        phasedNegotiations: VS.requiredBoolean(),\r\n                        suppliersLimited: VS.requiredBoolean(),\r\n                        suppliersLimitedInfo: VS.any().when(\"suppliersLimited\", {is: (x) => x === true, then: VS.string(4000), otherwise: VS.any().strip()}),\r\n                        criteriaComplianceDeclaration: VS.any().when(\"suppliersLimited\", {\r\n                            is: (x) => x === true,\r\n                            then: VS.requiredBoolean(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        criteriaComplianceList: VS.any().when(\"suppliersLimited\", {is: (x) => x === true, then: VS.string(4000), otherwise: VS.any().strip()}),\r\n                        minSuppliersCount: VS.any().when(\"suppliersLimited\", {\r\n                            is: (x) => x === true,\r\n                            then: VS.numberPositiveNoZero(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                        maxSuppliersCount: VS.any().when(\"suppliersLimited\", {\r\n                            is: (x) => x === true,\r\n                            then: VS.numberPositiveNoZero(),\r\n                            otherwise: VS.any().strip()\r\n                        }),\r\n                    }), otherwise: VS.any().strip()\r\n                }),\r\n                partnershipLots: VS.any().when(\"x\", {\r\n                    is: (x) => partialOffers === true && realization_partnership_2,\r\n                    then: VS.arrayOf(partnershipLotValidator),\r\n                    otherwise: VS.any().strip()\r\n                }),\r\n                partnershipNoLots: VS.any().when(\"x\", {\r\n                    is: (x) => partialOffers === false && realization_partnership_2,\r\n                    then: partnershipLotValidator,\r\n                    otherwise: VS.any().strip()\r\n                })\r\n            }),\r\n            additionalInfo: VS.object({\r\n                info: VS.stringMaxNoRq(4000)\r\n            })\r\n        })\r\n    })\r\n});","import React, {useContext} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction RealizationTypeData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const updateNotice = getObjectValue('_updateNotice', formikProps.values, true);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    const refersTo = gVal(\"form.basicData.refersTo\", false)\r\n    return (<>\r\n        <Collapse in={refersTo === \"Order\"}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"orderRealizationType\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.018A\")}\r\n                required\r\n                disabled={updateNotice}\r\n            />\r\n        </Collapse>\r\n        <Collapse in={refersTo === \"FrameworkAgreement\"}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"frameworkRealizationType\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.019A\")}\r\n                required\r\n                disabled={updateNotice}\r\n            />\r\n        </Collapse>\r\n    </>)\r\n}\r\n\r\nRealizationTypeData.propTypes = {};\r\n\r\nexport default RealizationTypeData;\r\n","import React, {useContext} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction DocumentsAccessData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    return (<>\r\n        <NoticeYesNoInput\r\n            id={gId(\"ezamowieniaDemand\")}\r\n            formikProps={formikProps}\r\n            required\r\n            disabled\r\n        />\r\n\r\n        <NoticeTextInput\r\n            id={gId(\"www\")}\r\n            formikProps={formikProps}\r\n            required\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            id={gId(\"restrictedAccess\")}\r\n            formikProps={formikProps}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"restrictedAccess\") === true}>\r\n            <NoticeTextInput\r\n                id={gId(\"restrictedAccessInfo\")}\r\n                formikProps={formikProps}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n\r\n        <NoticeYesNoInput\r\n            id={gId(\"electronicOffersOnly\")}\r\n            formikProps={formikProps}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            id={gId(\"electronicOffersInfo\")}\r\n            formikProps={formikProps}\r\n            required={!!gVal(\"electronicOffersOnly\")}\r\n            multiline\r\n        />\r\n\r\n        <NoticeTextInput\r\n            id={gId(\"electronicOffersRequirements\")}\r\n            formikProps={formikProps}\r\n            required={!!gVal(\"electronicOffersOnly\")}\r\n            multiline\r\n        />\r\n\r\n        <NoticeTextInput\r\n            id={gId(\"toolsWww\")}\r\n            formikProps={formikProps}\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            id={gId(\"toolsNotWidelyAvailable\")}\r\n            formikProps={formikProps}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"toolsNotWidelyAvailable\") === true}>\r\n            <NoticeTextInput\r\n                id={gId(\"notWidelyAvailableToolsInfo\")}\r\n                formikProps={formikProps}\r\n                required\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            id={gId(\"offerCatalog\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"ENUM.005\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"electronicOffersOnly\") === false}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"notElectronicOffersReason\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.006\")}\r\n                multiple\r\n                required\r\n            />\r\n            <NoticeTextInput\r\n                id={gId(\"notElectronicOffersMethod\")}\r\n                formikProps={formikProps}\r\n                required\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            id={gId(\"offerLang\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MO.026\")}\r\n            multiple\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            id={gId(\"rodoInfo\")}\r\n            formikProps={formikProps}\r\n            multiline\r\n        />\r\n\r\n        <NoticeTextInput\r\n            id={gId(\"rodoLimitations\")}\r\n            formikProps={formikProps}\r\n            multiline\r\n        />\r\n        <Collapse in={gVal(\"form.basicData.refersTo\", false) === \"FrameworkAgreement\"}>\r\n            <NoticeYesNoInput\r\n                id={gId(\"offerCatalogUsage\")}\r\n                formikProps={formikProps}\r\n                required\r\n            />\r\n        </Collapse>\r\n    </>)\r\n}\r\n\r\nDocumentsAccessData.propTypes = {};\r\n\r\nexport default DocumentsAccessData;\r\n","import React, {useState} from 'react'\r\nimport {FormHelperText, FormLabel, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport SelectCPV from 'components/popup/selectCpv/SelectCPV';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport Chip from './Chip';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginTop: theme.spacing()\r\n    },\r\n    chipLabel: {\r\n        maxWidth: 250,\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis',\r\n    },\r\n    buttonSelect: {\r\n        marginRight: theme.spacing(2)\r\n    }\r\n})\r\n\r\nfunction CPVSingleInput({\r\n                      classes,\r\n                      formikProps,\r\n                      id,\r\n                      required,\r\n                      disabled,\r\n                      label = Tr('cpv_code'),\r\n                      skipCheckTouched\r\n                  }) {\r\n\r\n    const [openSelectCPV, setOpenSelectCPV] = useState(false)\r\n\r\n    const handleClick = () => {\r\n        setOpenSelectCPV(true)\r\n        formikProps.setFieldTouched(id, true)\r\n    }\r\n\r\n    const handleClosePoup = () => {\r\n        setOpenSelectCPV(false)\r\n        formikProps.setFieldTouched(id, true)\r\n    }\r\n\r\n    const handleConfirm = (values) => {\r\n        const elements = Object.keys(values).reduce((prevValue, currValue) => {\r\n            if (!values[currValue]) return prevValue;\r\n            return [\r\n                ...prevValue,\r\n                JSON.parse(currValue)\r\n            ]\r\n        }, [])\r\n        handleClosePoup();\r\n        formikProps.setFieldValue(id, elements[0])\r\n    }\r\n\r\n    const element = getObjectValue(id, formikProps.values, null)\r\n    const errorValue = getObjectValue(id, formikProps.errors, '')\r\n    const touched = getObjectValue(id, formikProps.touched, !!skipCheckTouched)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const errorLabel = touched && errorValue ? errorValue : ' '\r\n\r\n\r\n    const handleDelete = () => {\r\n        formikProps.setFieldValue(id, null);\r\n    }\r\n\r\n    return (\r\n        <div data-id={id}>\r\n            <FormLabel>\r\n                {label} {required && '*'}\r\n            </FormLabel>\r\n            <GridBlock\r\n                className={classes.root}\r\n                alignItems='center'\r\n                wrap='nowrap'\r\n                data-id={id}\r\n            >\r\n                {editable && !disabled && <Button\r\n                    onClick={handleClick}\r\n                    className={classes.buttonSelect}\r\n                    disabled={!editable || disabled}\r\n                >\r\n                    {Tr('select')}\r\n                </Button>}\r\n\r\n                <GridBlock spacing={1}>\r\n                    {!!element && <Chip\r\n                        labelClassName={classes.chipLabel}\r\n                        value={`${element.publicCode} ${element.name}`}\r\n                        onDelete={editable && !disabled ? () => handleDelete() : undefined}\r\n                    />\r\n                    }\r\n                </GridBlock>\r\n\r\n            </GridBlock>\r\n            <SelectCPV\r\n                initValues={[]}\r\n                open={openSelectCPV}\r\n                onCancel={handleClosePoup}\r\n                onConfirm={handleConfirm}\r\n                label={label}\r\n                multiple={false}\r\n            />\r\n            <FormHelperText error={touched && !!errorValue}>{errorLabel}</FormHelperText>\r\n        </div>\r\n    )\r\n}\r\n\r\nCPVSingleInput.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(CPVSingleInput);","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport CPVInput from \"components/CPVInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport CPVSingleInput from \"components/CPVSingleInput\";\r\n\r\nfunction NoticeCpvInput\r\n({\r\n     id,\r\n     label,\r\n     formikProps,\r\n     disabled,\r\n     required,\r\n     multiple\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(label ? label : id);\r\n\r\n\r\n    const input = multiple ? <CPVInput\r\n        formikProps={formikProps}\r\n        id={id}\r\n        required={required}\r\n        label={formTr(label ? label : id)}\r\n        skipCheckTouched\r\n        disabled={disabled}\r\n    /> : <CPVSingleInput\r\n        formikProps={formikProps}\r\n        id={id}\r\n        required={required}\r\n        label={formTr(label ? label : id)}\r\n        skipCheckTouched\r\n        disabled={disabled}\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeCpvInput;","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport DatePicker from \"components/DatePicker\";\r\n\r\nfunction NoticeDateInput\r\n({\r\n     id,\r\n     formikProps,\r\n     required\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(id);\r\n\r\n\r\n    const input = <DatePicker\r\n        formikProps={formikProps}\r\n        id={id}\r\n        label={formTr(id)}\r\n        required={required}\r\n        skipCheckTouched\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeDateInput;","import React, {useContext} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeCpvInput from \"../../components/inputs/NoticeCpvInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeDateInput from \"../../components/inputs/NoticeDateInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction OrderObjectNotDivided(\r\n    {\r\n        id,\r\n        formikProps,\r\n        realizationType\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const realizationPeriod = gVal(\"realizationPeriod\");\r\n    const orderType = gVal(\"form.orderObject.orderType\", false, null)\r\n\r\n    return (<>\r\n\r\n        <Collapse in={\"1.1.3\" === realizationType || \"11.1.3\" === realizationType}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"purchaserNeedsDescription\")}\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={\"1.2\" === realizationType || \"11.2\" === realizationType}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"innovationProductNeed\")}\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={\"1.1.1\" === realizationType || \"1.1.2\" === realizationType || \"11.1.1\" === realizationType || \"11.1.2\" === realizationType}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"orderSubjectDescription\")}\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeCpvInput\r\n            formikProps={formikProps}\r\n            id={gId(\"mainCpv\")}\r\n            required\r\n        />\r\n\r\n        <NoticeCpvInput\r\n            formikProps={formikProps}\r\n            id={gId(\"additionalCpv\")}\r\n            multiple\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"includesOptions\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"includesOptions\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"includesOptionsInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"realizationPeriod\")}\r\n            items={getDict(\"ENUM.025\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={realizationPeriod === \"DateFromTo\"}>\r\n            <NoticeDateInput\r\n                formikProps={formikProps}\r\n                id={gId(\"realizationPeriodDateFrom\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse\r\n            in={realizationPeriod === \"DateFromTo\" || realizationPeriod === \"DateTo\"}>\r\n            <NoticeDateInput\r\n                formikProps={formikProps}\r\n                id={gId(\"realizationPeriodDateTo\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse\r\n            in={realizationPeriod === \"NumberOfDays\" || realizationPeriod === \"NumberOfMonths\"}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"realizationPeriodAmount\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"planRenewals\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"planRenewals\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"planRenewalsInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"planOtherOrderForCurrentSupplier\")}\r\n            required={orderType === 'Works' || orderType === 'Services'}\r\n        />\r\n\r\n        <Collapse in={gVal(\"planOtherOrderForCurrentSupplier\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"planOtherOrderForCurrentSupplierInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n    </>)\r\n}\r\n\r\nOrderObjectNotDivided.propTypes = {};\r\n\r\nexport default OrderObjectNotDivided;\r\n","import React, {useMemo} from 'react'\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport ArrowIconLeft from \"@material-ui/icons/KeyboardArrowLeft\";\r\nimport ArrowIconRight from \"@material-ui/icons/KeyboardArrowRight\";\r\nimport {Paper} from \"@material-ui/core\";\r\nimport Button from \"../../../Button\";\r\nimport PlusOneIcon from \"@material-ui/icons/PlusOne\";\r\nimport getObjectValue from \"../../../../libs/getObjectValue\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        top: 162,\r\n        marginBottom: theme.spacing(2),\r\n        marginLeft: theme.spacing(),\r\n        marginRight: theme.spacing(),\r\n    },\r\n    paper: {\r\n        border: `solid 2px ${theme.palette.border.dark}`,\r\n        padding: theme.spacing(0.25)\r\n    },\r\n    select: {\r\n        minWidth: 250\r\n    },\r\n    margin: {\r\n        margin: `0 ${theme.spacing()}px`\r\n    }\r\n}))\r\n\r\nfunction DealingsNavigator(\r\n    {\r\n        formikProps,\r\n        id,\r\n        items,\r\n        addPart\r\n    }) {\r\n    const classes = useStyle();\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const passive = getObjectValue('_passive', formikProps.values, false);\r\n    const onlyNotice = getObjectValue('_onlyNotice', formikProps.values, false);\r\n    const updateNotice = getObjectValue('_updateNotice', formikProps.values, true);\r\n    // eslint-disable-next-line\r\n    const memoItems = useMemo(() => {\r\n        const arr = items.map((x, i, arr) => createSelectItem(i, Tr(\"part_x\", {x: i + 1})));\r\n        arr.unshift(createSelectItem(-1, Tr('choose_position')));\r\n        return arr;\r\n    }, [items])\r\n\r\n    const curIndex = formikProps.values[id];\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <Paper className={classes.paper}>\r\n                <GridBlock justify=\"space-evenly\" alignItems=\"center\">\r\n                    <GridBlock justify=\"center\" alignItems=\"center\">\r\n                        <IconButton\r\n                            className={classes.margin}\r\n                            disabled={curIndex < 0}\r\n                            tooltip={curIndex > -1 ? Tr(\"part_x\", {x: curIndex}) : Tr('select')}\r\n                            variant=\"outlined\"\r\n                            onClick={() => formikProps.setFieldValue(id, curIndex - 1)}\r\n                            Icon={ArrowIconLeft}/>\r\n                        <Select className={classes.select} formikProps={formikProps} id={id} items={memoItems} noError alwaysEditable/>\r\n                        <IconButton\r\n                            className={classes.margin}\r\n                            disabled={curIndex === items.length - 1}\r\n                            tooltip={curIndex < items.length - 1 ? Tr(\"part_x\", {x: curIndex + 2}) : undefined}\r\n                            variant=\"outlined\"\r\n                            onClick={() => formikProps.setFieldValue(id, curIndex + 1)}\r\n                            Icon={ArrowIconRight}/>\r\n                    </GridBlock>\r\n                    {(onlyNotice || passive) && !!addPart && <Button Icon={PlusOneIcon} onClick={addPart} disabled={updateNotice || !editable}>{Tr('add_part')}</Button>}\r\n                </GridBlock>\r\n            </Paper>\r\n        </div>)\r\n}\r\n\r\nDealingsNavigator.propTypes = {};\r\n\r\nexport default DealingsNavigator;\r\n","import React, {useContext} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeCpvInput from \"../../components/inputs/NoticeCpvInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeDateInput from \"../../components/inputs/NoticeDateInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport ExposureNeg1Icon from \"@material-ui/icons/ExposureNeg1\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nfunction OrderObjectDivided(\r\n    {\r\n        id,\r\n        formikProps,\r\n        realizationType,\r\n        index,\r\n        removePart\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const passive = getObjectValue('_passive', formikProps.values, false);\r\n    const onlyNotice = getObjectValue('_onlyNotice', formikProps.values, false);\r\n    const updateNotice = getObjectValue('_updateNotice', formikProps.values, true);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const includesOptions = gVal(\"includesOptions\");\r\n    const realizationPeriod = gVal(\"realizationPeriod\");\r\n    const orderType = gVal(\"form.orderObject.orderType\", false, null)\r\n\r\n    return (<>\r\n        <GridBlock justify=\"space-evenly\">\r\n            <NoticeTypography formTrKey={id}>: {index + 1}</NoticeTypography>\r\n            {(onlyNotice || passive) && <Button disabled={updateNotice || !editable} variant=\"outlined\" Icon={ExposureNeg1Icon} onClick={() => removePart(index)}>{Tr(\"remove_part_x\", {x: index + 1})}</Button>}\r\n        </GridBlock>\r\n\r\n        <NoticeNumericInput\r\n            formikProps={formikProps}\r\n            id={gId(\"dealingValue\")}\r\n        />\r\n        <NoticeGlossaryInput\r\n            id={gId(\"dealingValueCurrency\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MO.043\")}\r\n        />\r\n\r\n        <Collapse in={\"1.1.3\" === realizationType || \"11.1.3\" === realizationType}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"purchaserNeedsDescription\")}\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={\"1.2\" === realizationType || \"11.2\" === realizationType}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"innovationProductNeed\")}\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={\"1.1.1\" === realizationType || \"1.1.2\" === realizationType || \"11.1.1\" === realizationType || \"11.1.2\" === realizationType}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"orderSubjectDescription\")}\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeCpvInput\r\n            formikProps={formikProps}\r\n            id={gId(\"mainCpv\")}\r\n            required\r\n        />\r\n\r\n        <NoticeCpvInput\r\n            formikProps={formikProps}\r\n            id={gId(\"additionalCpv\")}\r\n            multiple\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"includesOptions\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={includesOptions === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"includesOptionsInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"realizationPeriod\")}\r\n            items={getDict(\"ENUM.025\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={realizationPeriod === \"DateFromTo\"}>\r\n            <NoticeDateInput\r\n                formikProps={formikProps}\r\n                id={gId(\"realizationPeriodDateFrom\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse\r\n            in={realizationPeriod === \"DateFromTo\" || realizationPeriod === \"DateTo\"}>\r\n            <NoticeDateInput\r\n                formikProps={formikProps}\r\n                id={gId(\"realizationPeriodDateTo\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse\r\n            in={realizationPeriod === \"NumberOfDays\" || realizationPeriod === \"NumberOfMonths\"}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"realizationPeriodAmount\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"planRenewals\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"planRenewals\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"planRenewalsInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"planOtherOrderForCurrentSupplier\")}\r\n            required={orderType === 'Works' || orderType === 'Services'}\r\n        />\r\n\r\n        <Collapse in={gVal(\"planOtherOrderForCurrentSupplier\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"planOtherOrderForCurrentSupplierInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n    </>)\r\n}\r\n\r\nOrderObjectDivided.propTypes = {};\r\n\r\nexport default OrderObjectDivided;\r\n","import React from 'react'\r\nimport DealingsNavigator from \"../../components/DealingsNavigator\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {FieldArray} from \"formik\";\r\nimport OrderObjectDividedList from \"./OrderObjectDividedList\";\r\n\r\n\r\nfunction OrderObjectDivided(\r\n    {\r\n        id,\r\n        formikProps,\r\n        realizationType\r\n    }) {\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const curIndex = gVal(\"orderDealing\", false, -1);\r\n\r\n    const addPart = (arrayHelpers) => {\r\n        const arr = gVal(\"divided\", true, []);\r\n        arrayHelpers.push({\r\n            \"dealingValue\": null,\r\n            \"dealingValueCurrency\": null,\r\n            \"purchaserNeedsDescription\": null,\r\n            \"innovationProductNeed\": null,\r\n            \"orderSubjectDescription\": null,\r\n            \"mainCpv\": null,\r\n            \"additionalCpv\": null,\r\n            \"includesOptions\": null,\r\n            \"includesOptionsInfo\": null,\r\n            \"realizationPeriod\": null,\r\n            \"realizationPeriodDateFrom\": null,\r\n            \"realizationPeriodDateTo\": null,\r\n            \"realizationPeriodAmount\": null,\r\n            \"planRenewals\": null,\r\n            \"planRenewalsInfo\": null,\r\n            \"planOtherOrderForCurrentSupplier\": null,\r\n            \"planOtherOrderForCurrentSupplierInfo\": null\r\n        });\r\n        formikProps.setFieldValue(gId(\"dealingCount\"), arr.length + 1);\r\n    }\r\n\r\n    const removePart = (arrayHelpers, index) => {\r\n        const arr = gVal(\"divided\", true, []);\r\n        formikProps.setFieldValue(gId(\"dealingCount\"), arr.length - 1)\r\n        formikProps.setFieldValue(\"orderDealing\", -1)\r\n        arrayHelpers.remove(index);\r\n    }\r\n\r\n    return (<FieldArray\r\n        name={gId(\"divided\")}\r\n        render={(arrayHelpers) => (<>\r\n            <DealingsNavigator\r\n                formikProps={formikProps}\r\n                id=\"orderDealing\"\r\n                items={gVal(\"divided\", true, [])}\r\n                addPart={() => addPart(arrayHelpers)}\r\n            />\r\n            {curIndex > -1 &&\r\n                <OrderObjectDividedList\r\n                    formikProps={formikProps}\r\n                    id={gId(\"divided.\" + curIndex)}\r\n                    realizationType={realizationType}\r\n                    index={curIndex}\r\n                    removePart={(index) => removePart(arrayHelpers, index)}\r\n                />\r\n            }\r\n\r\n        </>)}\r\n    />)\r\n}\r\n\r\nOrderObjectDivided.propTypes = {};\r\n\r\nexport default OrderObjectDivided;\r\n","import React, {useContext} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport NoticeIntegerInput from \"../../components/inputs/NoticeIntegerInput\";\r\nimport OrderObjectNotDivided from \"./OrderObjectNotDivided\";\r\nimport OrderObjectDivided from \"./OrderObjectDivided\";\r\nimport Typography from \"components/Typography\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nfunction OrderObjectData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const updateNotice = getObjectValue('_updateNotice', formikProps.values, true);\r\n    const basicDataRefersTo = gVal(\"form.basicData.refersTo\", false);\r\n    const realizationType = basicDataRefersTo === \"Order\" ? gVal(\"form.realizationType.orderRealizationType\", false) : (basicDataRefersTo === \"FrameworkAgreement\" ? gVal(\"form.realizationType.frameworkRealizationType\", false) : null)\r\n\r\n    return (<>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"marketConsultations\")}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"number\")}\r\n        />\r\n\r\n        <NoticeGlossaryInput\r\n            id={gId(\"orderType\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"ENUM.002\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={basicDataRefersTo === \"Order\"}>\r\n\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"dividedIntoLots\")}\r\n            />\r\n\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"lotsValueNet\")}\r\n            />\r\n\r\n            <NoticeGlossaryInput\r\n                id={gId(\"lotsValueNetCurrency\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"SL.MO.043\")}\r\n            />\r\n\r\n            <Collapse in={gVal(\"dividedIntoLots\") === true}>\r\n                <NoticeNumericInput\r\n                    formikProps={formikProps}\r\n                    id={gId(\"orderValueNet\")}\r\n                />\r\n\r\n                <NoticeGlossaryInput\r\n                    id={gId(\"orderValueNetCurrency\")}\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"SL.MO.043\")}\r\n                />\r\n            </Collapse>\r\n        </Collapse>\r\n\r\n        <Collapse in={basicDataRefersTo === \"FrameworkAgreement\"}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"frameworkAgreementValueNet\")}\r\n            />\r\n\r\n            <NoticeGlossaryInput\r\n                id={gId(\"frameworkAgreementValueNetCurrency\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"SL.MO.043\")}\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"partialOffers\")}\r\n            required\r\n            disabled={updateNotice}\r\n        />\r\n\r\n        <Collapse in={gVal(\"partialOffers\") === true}>\r\n            <Typography>To pole uzupełniane jest automatycznie poprzez dodawanie kolejnych części poniżej</Typography>\r\n            <NoticeIntegerInput\r\n                formikProps={formikProps}\r\n                id={gId(\"dealingCount\")}\r\n                disabled\r\n                required\r\n            />\r\n\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"offerType\")}\r\n                required\r\n                items={getDict(\"ENUM.008\")}\r\n            />\r\n\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"dealingLimited\")}\r\n                required\r\n            />\r\n            <Collapse in={gVal(\"dealingLimited\") === true}>\r\n                <NoticeIntegerInput\r\n                    formikProps={formikProps}\r\n                    id={gId(\"dealingLimitPerSupplier\")}\r\n                    required\r\n                />\r\n            </Collapse>\r\n\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"socialAspectsConsidered\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"socialAspectsConsidered\") === true}>\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"socialAspects\")}\r\n                required\r\n                items={getDict(\"SL.MO.027\")}\r\n                multiple\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={gVal(\"partialOffers\") === false} unmountOnExit>\r\n            <OrderObjectNotDivided id={gId(\"notDivided\")} formikProps={formikProps} realizationType={realizationType}/>\r\n        </Collapse>\r\n\r\n        <Collapse in={gVal(\"partialOffers\") === true} unmountOnExit>\r\n            <OrderObjectDivided id={id} formikProps={formikProps} realizationType={realizationType}/>\r\n        </Collapse>\r\n\r\n    </>)\r\n}\r\n\r\nOrderObjectData.propTypes = {};\r\n\r\nexport default OrderObjectData;\r\n","import React, {useContext} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction QualificationData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n\r\n    return (<>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"predictedExclusion\")}\r\n            required\r\n        />\r\n        <Collapse in={gVal(\"predictedExclusion\") === true}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"predictedExclusionInfo\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"SL.MO.028\")}\r\n                multiple\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"participationConditions\")}\r\n            required\r\n        />\r\n        <Collapse in={gVal(\"participationConditions\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"participationConditionsInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"art125Statement\")}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"inclusionSubjectiveEvidence\")}\r\n            multiline\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"exclusionSubjectiveEvidence\")}\r\n            multiline\r\n        />\r\n\r\n    </>)\r\n}\r\n\r\nQualificationData.propTypes = {};\r\n\r\nexport default QualificationData;\r\n","import React from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction ObjectiveEvidenceData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    return (<>\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"objectiveEvidenceInfo\")}\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"plansEvidence\")}\r\n        />\r\n\r\n        <Collapse in={gVal(\"plansEvidence\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"plansEvidenceInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"otherDocumentsList\")}\r\n            multiline\r\n        />\r\n\r\n    </>)\r\n}\r\n\r\nObjectiveEvidenceData.propTypes = {};\r\n\r\nexport default ObjectiveEvidenceData;\r\n","import React, {useContext} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction OrderTermsData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n\r\n    return (<>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"variantsAllowed\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"variantsAllowed\") === true}>\r\n\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"variantsAllowedInfo\")}\r\n                items={getDict(\"SL.MO.019\")}\r\n                required\r\n            />\r\n\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"auctionPlanned\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"auctionPlanned\") === true}>\r\n\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"auctionUrl\")}\r\n                required\r\n            />\r\n\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"auctionPlannedInfo\")}\r\n                required\r\n                multiline\r\n            />\r\n\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"guaranteeRequired\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"guaranteeRequired\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"guaranteeRequiredInfo\")}\r\n                multiline\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"properExecutionGuarantee\")}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"togetherRequirements\")}\r\n            multiline\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"possibleDemandInvalidation\")}\r\n            required\r\n        />\r\n\r\n    </>)\r\n}\r\n\r\nOrderTermsData.propTypes = {};\r\n\r\nexport default OrderTermsData;\r\n","import React, {useContext} from 'react'\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\n\r\nfunction ContractDraftData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    return (<>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"advancePayment\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"advancePayment\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"advancePaymentInfo\")}\r\n                required\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"contractChanges\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"contractChanges\") === true}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"contractChangesInfo\")}\r\n                required\r\n                multiline\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"socialAspects\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"socialAspects\") === true}>\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"socialAspectsInfo\")}\r\n                items={getDict(\"SL.MO.022\")}\r\n                required\r\n                multiple\r\n            />\r\n        </Collapse>\r\n\r\n    </>)\r\n}\r\n\r\nContractDraftData.propTypes = {};\r\n\r\nexport default ContractDraftData;\r\n","import React, {useContext, useEffect} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nfunction OrderDetailsFrameworkAgreement(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    useEffect(() => {\r\n        if (getObjectValue(id, formikProps.values, null) == null) {\r\n            formikProps.setFieldValue(id, {})\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n    return (<>\r\n\r\n\r\n        <NoticeGlossaryInput\r\n            id={gId(\"suppliersNumber\")}\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MO.031\")}\r\n            required\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"suppliersNumberLimited\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"suppliersNumberLimited\") === true}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"suppliersNumberLimit\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={gVal(\"suppliersNumber\") === \"FrameworkAgreementSeveralContractors\"}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"art314Order\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"SL.MO.032\")}\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"periodExceedInfo\")}\r\n            multiline\r\n        />\r\n\r\n    </>)\r\n}\r\n\r\nOrderDetailsFrameworkAgreement.propTypes = {};\r\n\r\nexport default OrderDetailsFrameworkAgreement;\r\n","import React, {useContext} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport ExposureNeg1Icon from \"@material-ui/icons/ExposureNeg1\";\r\nimport Tr from \"translations/Translations\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nfunction OrderDetailsLotCriterion(\r\n    {\r\n        id,\r\n        formikProps,\r\n        index,\r\n        criterion,\r\n        criteriaEvaluationStrategy,//RKT-2275\r\n        criteriaWeightStrategy,//@CriteriaWeightStrategy\r\n        removeCriterion\r\n    }) {\r\n    const gId = (name) => id + \".\" + name;\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const passive = getObjectValue('_passive', formikProps.values, false);\r\n    const onlyNotice = getObjectValue('_onlyNotice', formikProps.values, false);\r\n\r\n    const deleteAvailable = editable && criterion.type === \"QUALITY\" && (\r\n        (criteriaEvaluationStrategy === \"7\" && index > 0) ||\r\n        ((criteriaEvaluationStrategy === \"4\" || criteriaEvaluationStrategy === \"5\") && index > 1) ||\r\n        (criteriaEvaluationStrategy === \"6\" && index > 2)\r\n    )\r\n\r\n    return (<>\r\n        <GridBlock justify=\"space-evenly\">\r\n            <NoticeTypography formTrKey={id}>: {index + 1}</NoticeTypography>\r\n            {(onlyNotice || passive) && <Button variant=\"outlined\" Icon={ExposureNeg1Icon} onClick={removeCriterion}\r\n                    disabled={!deleteAvailable}>{Tr(\"remove_criterion_x\", {x: index + 1})}</Button>}\r\n        </GridBlock>\r\n\r\n        <Collapse in={criterion.type === \"QUALITY\"}>\r\n            <NoticeGlossaryInput\r\n                formikProps={formikProps}\r\n                id={gId(\"qualityCriterionType\")}\r\n                items={getDict(\"ENUM.024\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"criterionName\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={criteriaWeightStrategy === \"1\"}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"criterionPctgWeight\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n        <Collapse in={criteriaWeightStrategy === \"2\"}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"criterionPktWeight\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n        <Collapse in={criteriaWeightStrategy === \"3\"}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"criterionOrder\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n    </>)\r\n}\r\n\r\nOrderDetailsLotCriterion.propTypes = {};\r\n\r\nexport default OrderDetailsLotCriterion;\r\n","import React, {useContext} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport {FieldArray} from \"formik\";\r\nimport OrderDetailsLotCriterion from \"./OrderDetailsLotCriterion\";\r\nimport Button from \"components/Button\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PlusOneIcon from \"@material-ui/icons/PlusOne\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nexport const CRITERION_TYPE = {\r\n    PRICE: {type: \"PRICE\", criterionName: \"Cena\", criterionPctgWeight: null, criterionPktWeight: null, criterionOrder: null},\r\n    COST: {type: \"COST\", criterionName: \"Koszt\", criterionPctgWeight: null, criterionPktWeight: null, criterionOrder: null},\r\n    QUALITY: {type: \"QUALITY\", criterionName: \"\", criterionPctgWeight: null, criterionPktWeight: null, criterionOrder: null}\r\n}\r\n\r\nexport const getDefaultCriteria = (strategy) => {\r\n    let newCriterions;\r\n    switch (strategy) {\r\n        case \"1\":\r\n            newCriterions = [CRITERION_TYPE.PRICE]\r\n            break;\r\n        case \"2\":\r\n            newCriterions = [CRITERION_TYPE.COST]\r\n            break;\r\n        case \"3\":\r\n            newCriterions = [CRITERION_TYPE.PRICE, CRITERION_TYPE.COST]\r\n            break;\r\n        case \"4\":\r\n            newCriterions = [CRITERION_TYPE.PRICE, CRITERION_TYPE.QUALITY]\r\n            break;\r\n        case \"5\":\r\n            newCriterions = [CRITERION_TYPE.COST, CRITERION_TYPE.QUALITY]\r\n            break;\r\n        case \"6\":\r\n            newCriterions = [CRITERION_TYPE.PRICE, CRITERION_TYPE.COST, CRITERION_TYPE.QUALITY]\r\n            break;\r\n        case \"7\":\r\n            newCriterions = [CRITERION_TYPE.QUALITY]\r\n            break;\r\n        default:\r\n            newCriterions = [];\r\n    }\r\n    return newCriterions;\r\n}\r\n\r\nfunction OrderDetailsPrimaryLot(\r\n    {\r\n        id,\r\n        formikProps,\r\n        lotNumber,\r\n        realizationTypeX11,\r\n        realizationTypeX12,\r\n        realizationTypeX13\r\n    }) {\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const passive = getObjectValue('_passive', formikProps.values, false);\r\n    const onlyNotice = getObjectValue('_onlyNotice', formikProps.values, false);\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    const changeCriteriaEvaluationStrategy = (strategy) => {\r\n        const newCriterions = getDefaultCriteria(strategy);\r\n        formikProps.setFieldValue(gId(\"criteria\"), newCriterions);\r\n    }\r\n\r\n    const removeCriterion = (arrayHelpers, index) => {\r\n        arrayHelpers.remove(index);\r\n    }\r\n\r\n    const addCriterion = (arrayHelpers) => {\r\n        arrayHelpers.push(CRITERION_TYPE.QUALITY);\r\n    }\r\n    const addAvailable = (onlyNotice || passive) && [\"4\", \"5\", \"6\", \"7\"].includes(gVal(\"criteriaEvaluationStrategy\"));\r\n    return (<>\r\n        {!!lotNumber && <NoticeTypography formTrKey={id}>: {lotNumber}</NoticeTypography>}\r\n\r\n        <Collapse in={realizationTypeX11 || realizationTypeX12}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"evaluationMethodDescription\")}\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={realizationTypeX12}>\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"negotiationsPossible\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"criteriaWeightStrategy\")}\r\n            items={getDict(\"ENUM.015\")}\r\n            required\r\n        />\r\n\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"criteriaEvaluationStrategy\")}\r\n            items={getDict(\"ENUM.014\")}\r\n            onChange={changeCriteriaEvaluationStrategy}\r\n            required\r\n        />\r\n\r\n        <Collapse in={realizationTypeX11 || realizationTypeX12}>\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"evaluationSocialAspects12\")}\r\n                required\r\n            />\r\n            <Collapse in={gVal(\"evaluationSocialAspects12\") === true}>\r\n                <NoticeGlossaryInput\r\n                    formikProps={formikProps}\r\n                    id={gId(\"evaluationSocialAspects12Info\")}\r\n                    items={getDict(\"SL.MO.030\")}\r\n                    multiple\r\n                    required\r\n                />\r\n            </Collapse>\r\n        </Collapse>\r\n\r\n        <Collapse in={realizationTypeX13}>\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"evaluationSocialAspects3\")}\r\n                required\r\n            />\r\n            <Collapse in={gVal(\"evaluationSocialAspects3\") === true}>\r\n                <NoticeGlossaryInput\r\n                    formikProps={formikProps}\r\n                    id={gId(\"evaluationSocialAspects3Info\")}\r\n                    items={getDict(\"SL.MO.030\")}\r\n                    multiple\r\n                    required\r\n                />\r\n            </Collapse>\r\n        </Collapse>\r\n\r\n        <FieldArray\r\n            name={gId(\"criteria\")}\r\n            render={(arrayHelpers) => (<>\r\n                {\r\n                    gVal(\"criteria\", true, [])\r\n                        .map((x, i) => (<OrderDetailsLotCriterion\r\n                            key={i}\r\n                            formikProps={formikProps}\r\n                            id={gId(\"criteria.\" + i)}\r\n                            index={i}\r\n                            criterion={x}\r\n                            criteriaEvaluationStrategy={gVal(\"criteriaEvaluationStrategy\")}\r\n                            criteriaWeightStrategy={gVal(\"criteriaWeightStrategy\")}\r\n                            removeCriterion={() => removeCriterion(arrayHelpers, i)}\r\n                        />))\r\n                }\r\n                {addAvailable &&\r\n                    <GridBlock justify=\"center\">\r\n                        <Button disabled={!editable} Icon={PlusOneIcon} onClick={() => addCriterion(arrayHelpers)}>{Tr('add_criteria')}</Button>\r\n                    </GridBlock>\r\n                }\r\n\r\n            </>)}\r\n        />\r\n\r\n    </>)\r\n}\r\n\r\nOrderDetailsPrimaryLot.propTypes = {};\r\n\r\nexport default OrderDetailsPrimaryLot;\r\n","import React, {useContext} from \"react\";\r\nimport HelpComponent from \"components/HelpComponent\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport DateTimePicker from \"components/DateTimePicker\";\r\n\r\nfunction NoticeDateTimeInput\r\n({\r\n     id,\r\n     formikProps,\r\n     className,\r\n     required\r\n }) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext)\r\n    const tip = formTip(id);\r\n\r\n\r\n    const input = <DateTimePicker\r\n        className={className}\r\n        formikProps={formikProps}\r\n        id={id}\r\n        label={formTr(id)}\r\n        required={required}\r\n        skipCheckTouched\r\n    />\r\n\r\n    if (tip)\r\n        return <HelpComponent text={tip}>\r\n            {input}\r\n        </HelpComponent>\r\n    return input;\r\n\r\n\r\n}\r\n\r\nexport default NoticeDateTimeInput;","import React, {useContext} from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport NoticeDateTimeInput from \"../../components/inputs/NoticeDateTimeInput\";\r\nimport NoticeDateInput from \"../../components/inputs/NoticeDateInput\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\n\r\nfunction OrderDetailsPrimary(\r\n    {\r\n        id,\r\n        formikProps,\r\n        realizationTypeX11,\r\n        realizationTypeX12,\r\n        realizationTypeX13\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n  return (<>\r\n        <NoticeTypography formTrKey={id}/>\r\n        <NoticeDateTimeInput\r\n            formikProps={formikProps}\r\n            id={gId(\"offerEndDate\")}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"offerSubmitPlace\")}\r\n            required\r\n        />\r\n\r\n        <NoticeDateTimeInput\r\n            formikProps={formikProps}\r\n            id={gId(\"offerOpenDate\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={realizationTypeX11 || realizationTypeX12}>\r\n            <NoticeGlossaryInput\r\n                id={gId(\"bindWithOffer\")}\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.026\")}\r\n                required\r\n            />\r\n\r\n            <Collapse in={gVal(\"bindWithOffer\") === \"DAYCOUNT\"}>\r\n                <NoticeNumericInput\r\n                    formikProps={formikProps}\r\n                    id={gId(\"bindWithOfferDays\")}\r\n                    required\r\n                />\r\n            </Collapse>\r\n            <Collapse in={gVal(\"bindWithOffer\") === \"DATE\"}>\r\n                <NoticeDateInput\r\n                    formikProps={formikProps}\r\n                    id={gId(\"bindWithOfferDate\")}\r\n                    required\r\n                />\r\n            </Collapse>\r\n        </Collapse>\r\n\r\n        <Collapse in={realizationTypeX12 || realizationTypeX13}>\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"maxSupplierNumber\")}\r\n            />\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"limitSuppliersNumberInfo\")}\r\n            />\r\n        </Collapse>\r\n\r\n        <Collapse in={realizationTypeX13}>\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"noNegotiationsTermsDescription\")}\r\n                required\r\n            />\r\n        </Collapse>\r\n\r\n    </>)\r\n}\r\n\r\nOrderDetailsPrimary.propTypes = {};\r\n\r\nexport default OrderDetailsPrimary;\r\n","import React from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeNumericInput from \"../../components/inputs/NoticeNumericInput\";\r\nimport NoticeDateTimeInput from \"../../components/inputs/NoticeDateTimeInput\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport NoticeYesNoInput from \"../../components/inputs/NoticeYesNoInput\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n    },\r\n    dateTimeInput: {\r\n        \"width\": 600\r\n    }\r\n}))\r\n\r\nfunction OrderDetailsPartnership(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n    const classes = useStyle();\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n\r\n    return (<>\r\n        <NoticeTypography formTrKey={id}/>\r\n\r\n        <NoticeDateTimeInput\r\n            formikProps={formikProps}\r\n            id={gId(\"offerEndDate\")}\r\n            className={classes.dateTimeInput}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"offerSubmitPlace\")}\r\n            required\r\n        />\r\n\r\n        <NoticeDateTimeInput\r\n            formikProps={formikProps}\r\n            id={gId(\"offerOpenDate\")}\r\n            className={classes.dateTimeInput}\r\n            required\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"phasedNegotiations\")}\r\n            required\r\n        />\r\n\r\n        <NoticeYesNoInput\r\n            formikProps={formikProps}\r\n            id={gId(\"suppliersLimited\")}\r\n            required\r\n        />\r\n\r\n        <Collapse in={gVal(\"suppliersLimited\") === true}>\r\n\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"suppliersLimitedInfo\")}\r\n                required\r\n            />\r\n\r\n            <NoticeYesNoInput\r\n                formikProps={formikProps}\r\n                id={gId(\"criteriaComplianceDeclaration\")}\r\n                required\r\n            />\r\n\r\n            <NoticeTextInput\r\n                formikProps={formikProps}\r\n                id={gId(\"criteriaComplianceList\")}\r\n                required\r\n            />\r\n\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"minSuppliersCount\")}\r\n                required\r\n            />\r\n            <NoticeNumericInput\r\n                formikProps={formikProps}\r\n                id={gId(\"maxSuppliersCount\")}\r\n                required\r\n            />\r\n\r\n        </Collapse>\r\n\r\n    </>)\r\n}\r\n\r\nOrderDetailsPartnership.propTypes = {};\r\n\r\nexport default OrderDetailsPartnership;\r\n","import React, {useContext} from 'react'\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport NoticeTypography from \"../../components/inputs/NoticeTypography\";\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"../../components/inputs/NoticeGlossaryInput\";\r\nimport {FieldArray} from \"formik\";\r\nimport OrderDetailsLotCriterion from \"./OrderDetailsLotCriterion\";\r\nimport Button from \"components/Button\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport PlusOneIcon from \"@material-ui/icons/PlusOne\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nexport const CRITERION_TYPE = {\r\n    PRICE: {type: \"PRICE\", criterionName: \"Cena\", criterionPctgWeight: null, criterionPktWeight: null, criterionOrder: null},\r\n    COST: {type: \"COST\", criterionName: \"Koszt\", criterionPctgWeight: null, criterionPktWeight: null, criterionOrder: null},\r\n    QUALITY: {type: \"QUALITY\", criterionName: \"\", criterionPctgWeight: null, criterionPktWeight: null, criterionOrder: null}\r\n}\r\n\r\nexport const getDefaultCriteria = (strategy) => {\r\n    let newCriterions;\r\n    switch (strategy) {\r\n        case \"1\":\r\n            newCriterions = [CRITERION_TYPE.PRICE]\r\n            break;\r\n        case \"2\":\r\n            newCriterions = [CRITERION_TYPE.COST]\r\n            break;\r\n        case \"3\":\r\n            newCriterions = [CRITERION_TYPE.PRICE, CRITERION_TYPE.COST]\r\n            break;\r\n        case \"4\":\r\n            newCriterions = [CRITERION_TYPE.PRICE, CRITERION_TYPE.QUALITY]\r\n            break;\r\n        case \"5\":\r\n            newCriterions = [CRITERION_TYPE.COST, CRITERION_TYPE.QUALITY]\r\n            break;\r\n        case \"6\":\r\n            newCriterions = [CRITERION_TYPE.PRICE, CRITERION_TYPE.COST, CRITERION_TYPE.QUALITY]\r\n            break;\r\n        case \"7\":\r\n            newCriterions = [CRITERION_TYPE.QUALITY]\r\n            break;\r\n        default:\r\n            newCriterions = [];\r\n    }\r\n    return newCriterions;\r\n}\r\n\r\nfunction OrderDetailsPartnershipLot(\r\n    {\r\n        id,\r\n        formikProps,\r\n        lotNumber\r\n    }) {\r\n\r\n    const editable = getObjectValue('_editable', formikProps.values, true);\r\n    const passive = getObjectValue('_passive', formikProps.values, false);\r\n    const onlyNotice = getObjectValue('_onlyNotice', formikProps.values, false);\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n    const {getDict} = useContext(FormTranslationContext)\r\n\r\n    const changeCriteriaEvaluationStrategy = (strategy) => {\r\n        const newCriterions = getDefaultCriteria(strategy);\r\n        formikProps.setFieldValue(gId(\"criteria\"), newCriterions);\r\n    }\r\n\r\n    const removeCriterion = (arrayHelpers, index) => {\r\n        arrayHelpers.remove(index);\r\n    }\r\n\r\n    const addCriterion = (arrayHelpers) => {\r\n        arrayHelpers.push(CRITERION_TYPE.QUALITY);\r\n    }\r\n    const addAvailable = (onlyNotice || passive) && [\"4\", \"5\", \"6\", \"7\"].includes(gVal(\"criteriaEvaluationStrategy\"));\r\n    return (<>\r\n        {!!lotNumber && <NoticeTypography formTrKey={id}>: {lotNumber}</NoticeTypography>}\r\n\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"criteriaWeightStrategy\")}\r\n            items={getDict(\"ENUM.015\")}\r\n            required\r\n        />\r\n\r\n        <NoticeGlossaryInput\r\n            formikProps={formikProps}\r\n            id={gId(\"criteriaEvaluationStrategy\")}\r\n            items={getDict(\"ENUM.014\")}\r\n            onChange={changeCriteriaEvaluationStrategy}\r\n            required\r\n        />\r\n\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"nonNegotiableRequirements\")}\r\n            required\r\n        />\r\n\r\n        <FieldArray\r\n            name={gId(\"criteria\")}\r\n            render={(arrayHelpers) => (<>\r\n                {\r\n                    gVal(\"criteria\", true, [])\r\n                        .map((x, i) => (<OrderDetailsLotCriterion\r\n                            key={i}\r\n                            formikProps={formikProps}\r\n                            id={gId(\"criteria.\" + i)}\r\n                            index={i}\r\n                            criterion={x}\r\n                            criteriaEvaluationStrategy={gVal(\"criteriaEvaluationStrategy\")}\r\n                            criteriaWeightStrategy={gVal(\"criteriaWeightStrategy\")}\r\n                            removeCriterion={() => removeCriterion(arrayHelpers, i)}\r\n                        />))\r\n                }\r\n                {addAvailable &&\r\n                    <GridBlock justify=\"center\">\r\n                        <Button disabled={!editable} Icon={PlusOneIcon} onClick={() => addCriterion(arrayHelpers)}>{Tr('add_criteria')}</Button>\r\n                    </GridBlock>\r\n                }\r\n\r\n            </>)}\r\n        />\r\n\r\n    </>)\r\n}\r\n\r\nOrderDetailsPartnershipLot.propTypes = {};\r\n\r\nexport default OrderDetailsPartnershipLot;\r\n","import React from 'react'\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport OrderDetailsFrameworkAgreement from \"./OrderDetailsFrameworkAgreement\";\r\nimport {FieldArray} from \"formik\";\r\nimport DealingsNavigator from \"../../components/DealingsNavigator\";\r\nimport OrderDetailsPrimaryLot from \"./OrderDetailsPrimaryLot\";\r\nimport OrderDetailsPrimary from \"./OrderDetailsPrimary\";\r\nimport OrderDetailsPartnership from \"./OrderDetailsPartnership\";\r\nimport OrderDetailsPartnershipLot from \"./OrderDetailsPartnershipLot\";\r\n\r\n\r\nfunction OrderDetailsData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n    const gVal = (name, prefix = true, defaultVal = null) => getObjectValue(prefix ? gId(name) : name, formikProps.values, defaultVal);\r\n\r\n    const basicDataRefersTo = gVal(\"form.basicData.refersTo\", false);\r\n    const partialOffers = gVal(\"form.orderObject.partialOffers\", false);\r\n    const realizationType = basicDataRefersTo === \"Order\" ? gVal(\"form.realizationType.orderRealizationType\", false) : (basicDataRefersTo === \"FrameworkAgreement\" ? gVal(\"form.realizationType.frameworkRealizationType\", false) : null)\r\n\r\n    const realization_x_1_1 = (basicDataRefersTo === \"Order\" && realizationType === \"1.1.1\") || (basicDataRefersTo === \"FrameworkAgreement\" && realizationType === \"11.1.1\");\r\n    const realization_x_1_2 = (basicDataRefersTo === \"Order\" && realizationType === \"1.1.2\") || (basicDataRefersTo === \"FrameworkAgreement\" && realizationType === \"11.1.2\");\r\n    const realization_x_1_3 = (basicDataRefersTo === \"Order\" && realizationType === \"1.1.3\") || (basicDataRefersTo === \"FrameworkAgreement\" && realizationType === \"11.1.3\");\r\n    const realization_1_2 = (basicDataRefersTo === \"Order\" && realizationType === \"1.2\") || (basicDataRefersTo === \"FrameworkAgreement\" && realizationType === \"11.2\");\r\n\r\n    const curPrimaryDealingIndex = gVal(\"primaryDealing\", false, -1);\r\n    const curPartnershipDealingIndex = gVal(\"partnershipDealing\", false, -1);\r\n\r\n    return (<>\r\n\r\n        <Collapse in={basicDataRefersTo === \"FrameworkAgreement\"} unmountOnExit>\r\n            <OrderDetailsFrameworkAgreement formikProps={formikProps} id={gId(\"frameworkAgreement\")}/>\r\n        </Collapse>\r\n\r\n        <Collapse in={realization_x_1_1 || realization_x_1_2 || realization_x_1_3} unmountOnExit>\r\n\r\n            <OrderDetailsPrimary\r\n                formikProps={formikProps}\r\n                id={gId(\"primary\")}\r\n                realizationTypeX11={realization_x_1_1}\r\n                realizationTypeX12={realization_x_1_2}\r\n                realizationTypeX13={realization_x_1_3}\r\n\r\n            />\r\n\r\n            <Collapse in={partialOffers === true} unmountOnExit>\r\n                <FieldArray\r\n                    name={gId(\"primaryLots\")}\r\n                    render={(arrayHelpers) => (<>\r\n                        <DealingsNavigator\r\n                            formikProps={formikProps}\r\n                            id=\"primaryDealing\"\r\n                            items={gVal(\"form.orderObject.divided\", false, [])}\r\n                        />\r\n                        {curPrimaryDealingIndex > -1 &&\r\n                            <OrderDetailsPrimaryLot\r\n                                formikProps={formikProps}\r\n                                id={gId(\"primaryLots.\" + curPrimaryDealingIndex)}\r\n                                index={curPrimaryDealingIndex}\r\n                                realizationTypeX11={realization_x_1_1}\r\n                                realizationTypeX12={realization_x_1_2}\r\n                                realizationTypeX13={realization_x_1_3}\r\n                            />\r\n                        }\r\n                    </>)}\r\n                />\r\n            </Collapse>\r\n\r\n            <Collapse in={partialOffers === false} unmountOnExit>\r\n                <OrderDetailsPrimaryLot\r\n                    formikProps={formikProps}\r\n                    id={gId(\"primaryNoLots\")}\r\n                    realizationTypeX11={realization_x_1_1}\r\n                    realizationTypeX12={realization_x_1_2}\r\n                    realizationTypeX13={realization_x_1_3}\r\n                />\r\n            </Collapse>\r\n        </Collapse>\r\n\r\n        <Collapse in={realization_1_2} unmountOnExit>\r\n            <OrderDetailsPartnership\r\n                formikProps={formikProps}\r\n                id={gId(\"partnership\")}\r\n            />\r\n\r\n            <Collapse in={partialOffers === true} unmountOnExit>\r\n                <FieldArray\r\n                    name={gId(\"partnershipLots\")}\r\n                    render={(arrayHelpers) => (<>\r\n                        <DealingsNavigator\r\n                            formikProps={formikProps}\r\n                            id=\"partnershipDealing\"\r\n                            items={gVal(\"form.orderObject.divided\", false, [])}\r\n                        />\r\n                        {curPartnershipDealingIndex > -1 &&\r\n                            <OrderDetailsPartnershipLot\r\n                                formikProps={formikProps}\r\n                                id={gId(\"partnershipLots.\" + curPartnershipDealingIndex)}\r\n                                index={curPartnershipDealingIndex}\r\n                            />\r\n                        }\r\n                    </>)}\r\n                />\r\n            </Collapse>\r\n            <Collapse in={partialOffers === false} unmountOnExit>\r\n                <OrderDetailsPartnershipLot\r\n                    formikProps={formikProps}\r\n                    id={gId(\"partnershipNoLots\")}\r\n                />\r\n            </Collapse>\r\n\r\n\r\n        </Collapse>\r\n    </>)\r\n}\r\n\r\nOrderDetailsData.propTypes = {};\r\n\r\nexport default OrderDetailsData;\r\n","import React from 'react'\r\nimport NoticeTextInput from \"../../components/inputs/NoticeTextInput\";\r\n\r\n\r\nfunction AdditionalInfoData(\r\n    {\r\n        id,\r\n        formikProps\r\n    }) {\r\n\r\n    const gId = (name) => id + \".\" + name;\r\n\r\n    return (<>\r\n        <NoticeTextInput\r\n            formikProps={formikProps}\r\n            id={gId(\"info\")}\r\n        />\r\n    </>)\r\n}\r\n\r\nAdditionalInfoData.propTypes = {};\r\n\r\nexport default AdditionalInfoData;\r\n","import React, {useEffect, useMemo, useReducer, useState} from 'react'\r\nimport {connect} from 'react-redux'\r\nimport PropTypes from \"prop-types\";\r\nimport Form from \"components/Form\";\r\nimport Loading from \"components/Loading\";\r\nimport BasicData from \"./components/BasicData\";\r\nimport PurchaserData from \"./components/PurchaserData\";\r\nimport FormNavigator from \"../components/FormNavigator\";\r\nimport {contractNoticeStepsOrder} from \"./contractNoticeSteps\";\r\nimport contractNoticeValidation from \"./contractNoticeValidation\";\r\nimport {Collapse, Typography} from \"@material-ui/core\";\r\nimport RealizationTypeData from \"./components/RealizationTypeData\";\r\nimport DocumentsAccessData from \"./components/DocumentsAccessData\";\r\nimport OrderObjectData from \"./components/OrderObjectData\";\r\nimport QualificationData from \"./components/QualificationData\";\r\nimport ObjectiveEvidenceData from \"./components/ObjectiveEvidenceData\";\r\nimport OrderTermsData from \"./components/OrderTermsData\";\r\nimport ContractDraftData from \"./components/ContractDraftData\";\r\nimport OrderDetailsData from \"./components/OrderDetailsData\";\r\nimport AdditionalInfoData from \"./components/AdditionalInfoData\";\r\nimport NationalNoticeService from \"services/NationalNoticeService\";\r\nimport Tr from \"translations/Translations\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport NationalNoticeStatus from \"../constants/NationalNoticeStatus\";\r\nimport {isDemandModification} from \"libs/getDemandStatus\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport RouterPath, {createPath} from \"libs/RouterPath\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Section from \"pages/purchaser/MyProcedure/scenes/part2/components/Section\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport _ from \"lodash\";\r\n\r\nfunction getKey(id) {\r\n    const split = id.split(\".\").filter(x => !/^\\d+$/.test(x));\r\n    split[0] = 'contractNotice';\r\n    return split.join(\".\");\r\n}\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    collapse: {\r\n        marginTop: theme.spacing(3)\r\n    },\r\n    info: {\r\n        textAlign: \"center\",\r\n        fontWeight: \"bold\",\r\n        marginTop: theme.spacing(2),\r\n        cursor: \"pointer\"\r\n    }\r\n}))\r\n\r\nfunction ContractNoticeForm(\r\n    {\r\n        demandId,\r\n        demandHeader\r\n    }) {\r\n    const classes = useStyle();\r\n    const FORM_ID = \"ContractNotice\";\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n    const [confirmRemove, setConfirmRemove] = useState(false);\r\n    const [loaded, setLoaded] = useState(false);\r\n    const [initData, setInitData] = useState(null);\r\n    const [dictionaries, setDictionaries] = useState(null);\r\n    const [translations, setTranslations] = useState(null);\r\n\r\n    // eslint-disable-next-line\r\n    const modification = useMemo(() => isDemandModification(), [demandHeader]);\r\n    const [buttonWorks, dispatchButtonWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        save: false,\r\n        draft: false\r\n    });\r\n\r\n    const formTr = (id) => {\r\n        const key = getKey(id);\r\n        return translations.labels[key] || key;\r\n    }\r\n    const formTip = (id) => {\r\n        const key = getKey(id);\r\n        return translations.tips[key];\r\n    }\r\n\r\n    const getDict = (id) => {\r\n        return dictionaries[id].items;\r\n    }\r\n\r\n    const getDynamicDict = (id) => {\r\n        return initData.dictionaries?.[id]?.items || [];\r\n    }\r\n\r\n    const loadDynamicDictionaries = async () => {\r\n        try {\r\n            const resp = await NationalNoticeService.getContractNoticeDynamicDictionaries(demandId);\r\n            if(resp) {\r\n                setInitData(x => ({...x, dictionaries: {...x.dictionaries, ...resp}}))\r\n                return resp;\r\n            }\r\n        } catch (e) {\r\n            enqueueErrorSnackbar(Tr(\"unknown_error_message\"));\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        Promise.all([\r\n            NationalNoticeService.getContractNotice(demandId),\r\n            NationalNoticeService.getContractNoticeDictionaries(demandId),\r\n            NationalNoticeService.getContractNoticeTranslations(demandId)])\r\n            .then(values => {\r\n                setInitData(values[0]);\r\n                setDictionaries(values[1]);\r\n                setTranslations(values[2]);\r\n            }).then(() => setLoaded(true))\r\n\r\n\r\n    }, [demandId])\r\n\r\n    const handleSave = (formikProps) => {\r\n        formikProps.setFieldValue(\"_editable\", false);\r\n        dispatchButtonWorks({type: 'draft', works: true});\r\n        NationalNoticeService.saveContractNoticeDraft(demandId, formikProps.values)\r\n            .then((resp) => {\r\n                if (!!resp) {\r\n                    enqueueSuccessSnackbar(Tr(\"saved_draft\"));\r\n                    setInitData(x => ({...x, ...resp}))\r\n                } else {\r\n                    throw new Error();\r\n                }\r\n            })\r\n            .catch(() => enqueueErrorSnackbar(Tr(\"unknown_error_message\")))\r\n            .finally(() => {\r\n                formikProps.setFieldValue(\"_editable\", true);\r\n                dispatchButtonWorks({type: 'draft', works: false});\r\n            })\r\n    }\r\n\r\n    const handleSubmit = (formikProps) => {\r\n        (async () => {\r\n            try {\r\n                const casted = await contractNoticeValidation().validate(formikProps.values, {abortEarly: false})\r\n                //const casted = contractNoticeValidation().cast(formikProps.values);\r\n                formikProps.setFieldValue(\"_editable\", false)\r\n                dispatchButtonWorks({type: 'save', works: true});\r\n                NationalNoticeService.saveContractNotice(demandId, casted)\r\n                    .then((resp) => {\r\n                        if (resp.success) {\r\n                            enqueueSuccessSnackbar(Tr(\"saved\"))\r\n                            setInitData(x => ({...x, ...resp.result}))\r\n                        } else {\r\n                            const keys = Object.keys(resp.errors);\r\n                            let message;\r\n                            if(Array.isArray()){\r\n                                message = resp.errors[keys[0]][0];\r\n                            } else if(_.isString(resp.errors[keys[0]])) {\r\n                                message = resp.errors[keys[0]];\r\n                            } else {\r\n                                message = Tr(\"unknown_error_message\")\r\n                            }\r\n\r\n                            navigateToError(keys[0], message, formikProps, true)\r\n                        }\r\n                    })\r\n                    .catch(() => enqueueErrorSnackbar(Tr(\"unknown_error_message\")))\r\n                    .finally(() => {\r\n                        formikProps.setFieldValue(\"_editable\", true);\r\n                        dispatchButtonWorks({type: 'save', works: false});\r\n                    })\r\n            } catch (e) {\r\n                navigateToError(e.inner[0].path, e.inner[0].message, formikProps);\r\n            }\r\n        })()\r\n    }\r\n\r\n    const navigateToError = (errorpath, message, formikProps, setError) => {\r\n\r\n        const formikPath = errorpath.replaceAll(\"[\", \".\").replaceAll(\"]\", \"\");\r\n        if (setError) {\r\n            formikProps.setFieldTouched(formikPath, true);\r\n            formikProps.setFieldError(formikPath, message);\r\n        }\r\n\r\n        const path = errorpath.split(\".\");\r\n        enqueueErrorSnackbar(<span><strong>{message}</strong>{\": \" + formTr(path.map(x => x.replace(/\\[(.*)\\]/g, '')).join(\".\"))}</span>)\r\n        formikProps.setFieldValue(\"step\", path[1]);\r\n        if (path.length > 2) {\r\n            if (path[1] === \"orderObject\" && path[2].startsWith(\"divided[\")) {\r\n                formikProps.setFieldValue(\"orderDealing\", parseInt(path[2].replace(/\\D/g, '')));\r\n            } else if (path[1] === \"orderDetails\" && path[2].startsWith(\"primaryLots[\")) {\r\n                formikProps.setFieldValue(\"primaryDealing\", parseInt(path[2].replace(/\\D/g, '')));\r\n            } else if (path[1] === \"orderDetails\" && path[2].startsWith(\"partnershipLots[\")) {\r\n                formikProps.setFieldValue(\"partnershipDealing\", parseInt(path[2].replace(/\\D/g, '')));\r\n            }\r\n        }\r\n        setTimeout((p) => scrollTo('[data-id=\"' + p + '\"]', 100), 100, formikPath)\r\n    }\r\n\r\n    const createNewVersion = () => {\r\n        setLoaded(false);\r\n        setInitData(null);\r\n        NationalNoticeService.createNewContractNoticeVersion(demandId).then((resp) => setInitData(resp)).then(() => setLoaded(true));\r\n    }\r\n\r\n    const deleteLastVersion = () => {\r\n        setConfirmRemove(false)\r\n        setLoaded(false);\r\n        setInitData(null);\r\n\r\n        (async () => {\r\n            try {\r\n                await NationalNoticeService.deleteLastContractNoticeVersion(demandId);\r\n                const resp = await NationalNoticeService.getContractNotice(demandId);\r\n                setInitData(resp);\r\n            } catch (e) {\r\n            }\r\n            setLoaded(true);\r\n        })();\r\n    }\r\n\r\n\r\n    if (!loaded) return <Loading/>\r\n\r\n    return (\r\n            <Section  title={Tr(!initData.updateNotice ? \"bzp_notice\" : \"bzp_notice_update\")}>\r\n                <FormTranslationContext.Provider value={{\r\n                    formTr, formTip, getDict, getDynamicDict, loadDynamicDictionaries: initData.canLoadDynamicDictionaries ? loadDynamicDictionaries : undefined\r\n                }}>\r\n                    <Form\r\n                        initialValues={{\r\n                            _editable: initData.editable && (initData.status === NationalNoticeStatus.DRAFT || initData.status === NationalNoticeStatus.COMPLETED),\r\n                            _passive: initData.passive,\r\n                            _onlyNotice: initData.onlyNotice,\r\n                            _updateNotice: initData.updateNotice,\r\n                            form: {\r\n                                basicData: initData.form.basicData || {},\r\n                                purchaserData: initData.form.purchaserData || {},\r\n                                realizationType: initData.form.realizationType || {},\r\n                                documentsAccess: initData.form.documentsAccess || {},\r\n                                orderObject: initData.form.orderObject || {},\r\n                                qualification: initData.form.qualification || {},\r\n                                objectiveEvidence: initData.form.objectiveEvidence || {},\r\n                                orderTerms: initData.form.orderTerms || {},\r\n                                contractDraft: initData.form.contractDraft || {},\r\n                                orderDetails: initData.form.orderDetails || {},\r\n                                additionalInfo: initData.form.additionalInfo || {},\r\n                            },\r\n                            step: 'basicData',\r\n                            orderDealing: -1,\r\n                            primaryDealing: -1,\r\n                            partnershipDealing: -1\r\n                        }}\r\n                        validationSchema={contractNoticeValidation()}\r\n                        onSubmit={() => {\r\n                        }}\r\n                        id={FORM_ID}\r\n                        validateOnMount\r\n                    >\r\n                        {\r\n                            (formikProps) => {\r\n                                const step = formikProps.values.step\r\n                                return (<>\r\n                                    {!!initData.ezamowieniaErrors && <>\r\n                                        <BoldTypography>{Tr('bzp_last_ezamowienia_errors')}</BoldTypography>\r\n                                        <ul>\r\n                                            {\r\n                                                Object.keys(initData.ezamowieniaErrors).map(x => (<ul key={x}>\r\n                                                    <li>{x}\r\n                                                        <ul>\r\n                                                            {initData.ezamowieniaErrors[x].map(e => (<li key={e}>{e}</li>))}\r\n                                                        </ul>\r\n                                                    </li>\r\n                                                </ul>))\r\n                                            }\r\n                                        </ul>\r\n                                    </>}\r\n\r\n                                    <Typography id=\"form-top-scroll-to\" variant=\"body2\"\r\n                                                align='right'><strong>{Tr('current_state')}:</strong> {Tr(\"ezamowienia_state_\" + initData.status.toLowerCase())}\r\n                                    </Typography>\r\n                                    <FormNavigator\r\n                                        formikProps={formikProps}\r\n                                        id=\"step\"\r\n                                        items={contractNoticeStepsOrder}\r\n                                        formTr={formTr}\r\n                                        trPrefix=\"contractNotice.\"\r\n                                        onSubmit={() => handleSubmit(formikProps)}\r\n                                        onSave={() => handleSave(formikProps)}\r\n                                        onCreateNewVersion={modification && initData.editable && initData.status === NationalNoticeStatus.PUBLISHED && isDemandModification() ? createNewVersion : undefined}\r\n                                        buttonWorks={buttonWorks}\r\n                                        doAutoSave={initData.editable && initData.status === NationalNoticeStatus.DRAFT}\r\n                                    />\r\n\r\n                                    <Collapse className={classes.collapse} in={step === \"basicData\"} unmountOnExit>\r\n                                        <BasicData formikProps={formikProps} id=\"form.basicData\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"purchaserData\"} unmountOnExit>\r\n                                        <PurchaserData formikProps={formikProps} id=\"form.purchaserData\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"realizationType\"} unmountOnExit>\r\n                                        <RealizationTypeData formikProps={formikProps} id=\"form.realizationType\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"documentsAccess\"} unmountOnExit>\r\n                                        <DocumentsAccessData formikProps={formikProps} id=\"form.documentsAccess\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"orderObject\"} unmountOnExit>\r\n                                        <OrderObjectData formikProps={formikProps} id=\"form.orderObject\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"qualification\"} unmountOnExit>\r\n                                        <QualificationData formikProps={formikProps} id=\"form.qualification\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"objectiveEvidence\"} unmountOnExit>\r\n                                        <ObjectiveEvidenceData formikProps={formikProps} id=\"form.objectiveEvidence\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"orderTerms\"} unmountOnExit>\r\n                                        <OrderTermsData formikProps={formikProps} id=\"form.orderTerms\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"contractDraft\"} unmountOnExit>\r\n                                        <ContractDraftData formikProps={formikProps} id=\"form.contractDraft\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"orderDetails\"} unmountOnExit>\r\n                                        <OrderDetailsData formikProps={formikProps} id=\"form.orderDetails\"/>\r\n                                    </Collapse>\r\n                                    <Collapse className={classes.collapse} in={step === \"additionalInfo\"} unmountOnExit>\r\n                                        <AdditionalInfoData formikProps={formikProps} id=\"form.additionalInfo\"/>\r\n                                    </Collapse>\r\n\r\n                                    <GridBlock justify=\"flex-end\">\r\n                                        {initData.editable && initData.modifiedDate != null && (initData.status === NationalNoticeStatus.DRAFT || initData.status === NationalNoticeStatus.COMPLETED) &&\r\n                                            <Button variant=\"outlined\" onClick={() => setConfirmRemove(true)}>{Tr(\"bzp_remove_last_version\")}</Button>\r\n                                        }\r\n                                    </GridBlock>\r\n                                    {initData.status === NationalNoticeStatus.COMPLETED &&\r\n                                        <Typography\r\n                                            className={classes.info}>{Tr(\"bzp_go_to_publish_info\")}\r\n                                            <Button variant=\"text\"\r\n                                                    onClick={() => RouterPath.redirect(createPath(RouterPath.myProcedure.steps.MP_1_ID, {id: demandId}))}>\r\n                                                {Tr(\"mp_1\")}\r\n                                            </Button> </Typography>}\r\n\r\n\r\n                                    <Confirm\r\n                                        confirmText='bzp_remove_last_version_confirm'\r\n                                        onCancel={() => setConfirmRemove(false)}\r\n                                        onConfirm={deleteLastVersion}\r\n                                        open={confirmRemove}\r\n                                    />\r\n                                </>)\r\n                            }\r\n                        }\r\n                    </Form>\r\n                </FormTranslationContext.Provider>\r\n            </Section>\r\n    )\r\n}\r\n\r\nContractNoticeForm.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired\r\n};\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(ContractNoticeForm);\r\n","import React from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport Workspace from \"components/Workspace\";\r\nimport PapersGeneratorXmpUzpPresidentPaperContent from \"components/complex/papersGenerator/customPopups/xmpUzpPresidentPaper/PapersGeneratorXmpUzpPresidentPaperContent\";\r\n\r\nfunction XmlUzpPresidentPaper(\r\n    {\r\n        demandId\r\n    }) {\r\n    return (\r\n        <Workspace>\r\n            <PapersGeneratorXmpUzpPresidentPaperContent demandId={demandId}/>\r\n        </Workspace>\r\n    )\r\n}\r\n\r\nXmlUzpPresidentPaper.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired\r\n};\r\n\r\nexport default XmlUzpPresidentPaper;\r\n","import React from 'react'\r\nimport PropTypes from \"prop-types\";\r\nimport ContractNoticeForm from \"./contractNotice/ContractNoticeForm\";\r\nimport XmlUzpPresidentPaper from \"./xmlUzpPresidentPaper/XmlUzpPresidentPaper\";\r\n\r\n\r\nfunction NationalNoticePage(\r\n    {\r\n        demandId,\r\n        formType\r\n    }) {\r\n\r\n    switch (formType) {\r\n        case \"xmlUzpPresidentPaper\":\r\n            return <XmlUzpPresidentPaper demandId={demandId} />\r\n        default:\r\n            return <ContractNoticeForm demandId={demandId}/>\r\n    }\r\n}\r\n\r\nNationalNoticePage.propTypes = {\r\n    demandId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n    formType: PropTypes.string.isRequired\r\n};\r\n\r\nexport default NationalNoticePage;\r\n","import React from 'react'\r\nimport Workspace from \"components/Workspace\";\r\nimport NationalNoticePage from \"components/complex/nationalNotice/NationalNoticePage\";\r\n\r\nfunction NationalNoticePanel(\r\n    {\r\n        match\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n    const formType = match.params.formType;\r\n\r\n    return (\r\n        <>\r\n            <Workspace\r\n                render={<>\r\n                    <NationalNoticePage demandId={demandId} formType={formType} />\r\n                </>}\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nexport default NationalNoticePanel;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport { Switch, Route } from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport Part1 from './part1/Part1'\r\nimport Part2 from './part2/Part2'\r\nimport Part3 from \"./part3/Part3\";\r\nimport Part4 from \"./part4/Part4\";\r\nimport CorrespondencePanel from \"./correspondence/CorrespondencePanel\";\r\nimport EmailListPanel from \"./emailList/EmailListPanel\";\r\nimport NationalNoticePanel from \"./nationalNotice/NationalNoticePanel\";\r\n\r\nconst rp = RouterPath.myProcedure.steps;\r\n\r\nfunction PartsRouter() {\r\n\treturn (\r\n\t\t<Switch>\r\n\t\t\t<Route path={rp.MP_1_ID} component={Part1} />\r\n\t\t\t<Route path={rp.MP_2_ID} component={Part2} />\r\n\t\t\t<Route path={rp.MP_3_ID} component={Part3} />\r\n\t\t\t<Route path={rp.MP_4_ID} component={Part4} />\r\n\t\t\t<Route path={rp.MP_CORRESPONDENCE_ID} component={CorrespondencePanel} />\r\n\t\t\t<Route path={rp.MP_EMAIL_LIST_ID} component={EmailListPanel} />\r\n\t\t\t<Route path={rp.MP_NATIONAL_NOTICE_FORM_TYPE_ID} component={NationalNoticePanel} />\r\n\t\t</Switch>\r\n\t)\r\n}\r\n\r\nPartsRouter.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nPartsRouter.defaultProps = {\r\n}\r\n\r\nexport default PartsRouter;","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport clsx from 'clsx';\r\nimport {connect} from 'react-redux'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tminHeight: `calc(100vh - ${theme.mixins.toolbar.minHeight}px)`,\r\n\t\tmarginLeft: theme.components.navigation.margin.left,\r\n\t\ttransition: theme.transitions.default.close('margin-left'),\r\n\t\tdisplay: 'flex',\r\n\t\tflexDirection: 'column',\r\n\r\n\t},\r\n\tmenuMargin: {\r\n\t\tmarginLeft: theme.components.navigation.width,\r\n\t\ttransition: theme.transitions.default.open('margin-left'),\r\n\t},\r\n\tcontainer: {\r\n\t\t// padding: theme.spacing(2),\r\n\t\tflexGrow: 1,\r\n\t}\r\n})\r\n\r\nfunction Page({\r\n\tchildren,\r\n\tclassName,\r\n\tclasses,\r\n\tisMenuOpen,\r\n\tfloatingWorkspace\r\n}) {\r\n\treturn (\r\n\t\t<div className={clsx(className, classes.root, {\r\n\t\t\t[classes.menuMargin]: floatingWorkspace && isMenuOpen,\r\n\t\t})}>\r\n\t\t\t<div className={classes.container} >\r\n\t\t\t\t{children}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nPage.propTypes = {\r\n\tinfoBarData: PropTypes.shape({\r\n\t\ttitle: PropTypes.string.isRequired,\r\n\t}),\r\n\tfloatingWorkspace: PropTypes.bool,\r\n}\r\n\r\nPage.propDefault = {\r\n\tfloatingWorkspace: false,\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tisMenuOpen: state.store.isMenuOpen\r\n}), {\r\n\r\n})(withStyles(style)(Page));","import React from 'react'\r\nimport { withStyles, Grid, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tlabel: {\r\n\t\tfontWeight: theme.typography.fontWeightBold\r\n\t}\r\n})\r\n\r\nfunction InfoDataElement({\r\n\tclasses,\r\n\ttrKey,\r\n\tvalue,\r\n}) {\r\n\treturn (\r\n\t\t<Grid item>\r\n\t\t\t<Typography component='span' variant='body1' className={classes.label}>\r\n\t\t\t\t{Tr(trKey)}:{' '}\r\n\t\t\t</Typography>\r\n\t\t\t<Typography component='span' variant='body1'>\r\n\t\t\t\t{value}\r\n\t\t\t</Typography>\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nInfoDataElement.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(InfoDataElement);","import React from 'react'\r\nimport {Grid} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport InfoDataElement from './InfoDataElement';\r\nimport {LABELS as ProcedureStatusLabels} from 'constants/ProcedureStatus';\r\nimport moment from 'moment';\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {PrimaryTenderVariantTr} from \"constants/PrimaryTenderVariant\";\r\n\r\nfunction InfoData(\r\n\t{\r\n\t\tcontractor,\r\n\t\theaderData\r\n\t}) {\r\n\tif (!headerData.authorUser) return '';\r\n\r\n\treturn (\r\n\t\t<Grid\r\n\t\t\tcontainer\r\n\t\t\tdirection='column'\r\n\t\t>\r\n\t\t\t<InfoDataElement trKey={'registering_person'} value={`${headerData.authorUser.firstName} ${headerData.authorUser.lastName}`} />\r\n\t\t\t<InfoDataElement trKey={'organizational_unit'} value={headerData.organization.name} />\r\n\t\t\t<InfoDataElement trKey={'demand_type'} value={headerData.procedureTypeTr} />\r\n\t\t\t<InfoDataElement trKey={'demand_realization_type'} value={headerData.demandRealizationTypeTr} />\r\n\t\t\t{!!headerData.primaryTenderVariant && <InfoDataElement trKey={'primary_tender_variant'} value={PrimaryTenderVariantTr[headerData.primaryTenderVariant]} />}\r\n\t\t\t<InfoDataElement trKey={'demand_status'} value={ProcedureStatusLabels[headerData.status]} />\r\n\t\t\t{headerData.procedureStartDate && <InfoDataElement trKey={'procedure_start_date'} value={moment(headerData.procedureStartDate).format(DateFormats.DATETIME_FORMAT)} />}\r\n\t\t</Grid>\r\n\t)\r\n}\r\n\r\nInfoData.propTypes = {\r\n\ttype: PropTypes.string,\r\n\tprocedure: PropTypes.string,\r\n\tstatus: PropTypes.string,\r\n\tnumber: PropTypes.string,\r\n\tcontractor: PropTypes.bool.isRequired\r\n}\r\n\r\nInfoData.defaultProps = {\r\n}\r\n\r\nexport default InfoData;\r\n","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowDown'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\tlinkRow: {\r\n\t\tcursor: 'pointer',\r\n\t\tdisplay: 'flex',\r\n\t\talignItems: 'center',\r\n\t},\r\n\trotate: {\r\n\t\ttransform: 'rotate(180deg)'\r\n\t}\r\n})\r\n\r\nfunction OpenBarText({\r\n\tclasses,\r\n\ttext,\r\n\tonClick,\r\n\trotate=false,\r\n}) {\r\n\treturn (\r\n\t\t<div\r\n\t\t\tonClick={onClick}\r\n\t\t\tclassName={classes.linkRow}\r\n\t\t>\r\n\t\t\t<Typography\r\n\t\t\t\tvariant='caption'\r\n\t\t\t>\r\n\t\t\t\t{text}\r\n\t\t\t</Typography>\r\n\t\t\t<ArrowIcon\r\n\t\t\t\tclassName={clsx({\r\n\t\t\t\t\t[classes.rotate]: rotate\r\n\t\t\t\t})}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t)\r\n}\r\n\r\nOpenBarText.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default withStyles(style)(OpenBarText);","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport Button from 'components/Button';\r\n\r\nconst style = theme => ({\r\n\tbutton: {\r\n\t\tcolor: theme.palette.primary.contrastText,\r\n\t\tmarginLeft: theme.spacing(1),\r\n\t},\r\n})\r\n\r\nfunction InfoBarTitleButton({\r\n\tclasses,\r\n\tonClick,\r\n\tdisabled = false,\r\n\tIcon,\r\n\tIconAfter,\r\n\tlabel,\r\n}) {\r\n\treturn <Button\r\n\t\tvariant='text'\r\n\t\tsize='small'\r\n\t\tcolor='primary'\r\n\t\tclassName={classes.button}\r\n\t\tonClick={onClick}\r\n\t\tdisabled={disabled}\r\n\t>\r\n\t\t{Icon && <Icon />}\r\n\t\t{label}\r\n\t\t{IconAfter && <IconAfter />}\r\n\t</Button>\r\n}\r\n\r\n\r\nexport default withStyles(style)(InfoBarTitleButton);","import React, {useMemo, useState} from 'react'\r\nimport {makeStyles, Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport GridBlock from 'components/GridBlock';\r\nimport DeleteIcon from '@material-ui/icons/Delete'\r\nimport Tr from 'translations/Translations';\r\nimport {withRouter} from \"react-router\";\r\nimport DemandService from 'services/DemandService';\r\nimport {connect} from 'react-redux'\r\nimport RouterPath from 'libs/RouterPath';\r\nimport CancelOutlinedIcon from '@material-ui/icons/CancelOutlined';\r\nimport InfoBarTitleButton from './InfoBarTitleButton';\r\nimport extendFindSectionEditable from 'libs/extendFindSectionEditable';\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport {isDemandModification, isDemandOfferCollection, isDemandPreparing, wasEverPublished} from \"libs/getDemandStatus\";\r\nimport InvalidateDemandPopup from \"components/popup/invalidate/InvalidateDemandPopup\";\r\nimport RfxRoundService from \"services/RfxRoundService\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport LoadingScreen from \"components/complex/loadingScreen/LoadingScreen\";\r\nimport clsx from 'clsx';\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\nimport supportedNoApiScreens from \"libs/supportedNoApiScreens\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    item: {\r\n        '&:first-child': {\r\n            width: 'calc(100% - 300px)'\r\n        },\r\n        '&:nth-child(2)': {\r\n            width: 'calc(100% - 300px)'\r\n        }\r\n    },\r\n    title: {\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis'\r\n    },\r\n    titleWrapped: {\r\n        whiteSpace: 'nowrap'\r\n    },\r\n    label: {\r\n        fontWeight: theme.typography.fontWeightBold\r\n    }\r\n}));\r\n\r\nfunction InfoBarTitle(\r\n    {\r\n        contractor,\r\n        title,\r\n        number,\r\n        attach,\r\n        demandValidation = [],\r\n        match,\r\n        stepperState,\r\n        steps,\r\n        ojsPublicationStatus = {},\r\n        demandHeader,\r\n        isDemandChanged = {},\r\n        rfxPrivileges = {}\r\n    }) {\r\n    const classes = useStyle();\r\n    const [openDelete, setOpenDelete] = useState(false)\r\n    const [openInvalidate, setOpenInvalidate] = useState(false)\r\n    const [working, setWorking] = useState(false)\r\n    const id = match.params.id;\r\n\r\n    const editable = extendFindSectionEditable(demandValidation, steps, stepperState)\r\n\r\n    const handleDelete = () => {\r\n        setOpenDelete(false);\r\n        setWorking(true);\r\n        DemandService.deleteDemand(id).then(() => {\r\n                RouterPath.redirect(RouterPath.MY_PROCEDURE);\r\n            }\r\n        ).catch(()=> setWorking(false))\r\n    }\r\n\r\n    const isModification = isDemandModification() === true;\r\n    const isPreparing = isDemandPreparing() === true;\r\n    const isOfferCollection = isDemandOfferCollection() === true;\r\n\r\n    const rp = RouterPath.myProcedure;\r\n\r\n    const handleCancel = () => {\r\n        setOpenInvalidate(true);\r\n    }\r\n\r\n    const isPublished = wasEverPublished();\r\n\r\n    // eslint-disable-next-line\r\n    const isDeleteActive = useMemo(() => !isPublished && isPreparing, [demandValidation, demandHeader]);\r\n    // eslint-disable-next-line\r\n    const isInvalidationActive = useMemo(() => isPreparing || isModification || isOfferCollection, [demandValidation, demandHeader])\r\n\r\n    const onInvalidate = (({comment}) => {\r\n        setOpenInvalidate(false);\r\n        setWorking(true);\r\n        StatisticsService.getCurrentRound(id).then((resp) => {\r\n            RfxRoundService.cancelRound(resp.id, comment)\r\n                .then(() => {\r\n                    RouterPath.redirect(RouterPath.createPath(rp.steps.MP_4_ID, {id}))\r\n                }).catch(() => setWorking(false))\r\n        })\r\n    })\r\n\r\n    return (\r\n        <>\r\n            <GridBlock alignItems='center' justify='space-between' gridClasses={{root: classes.root, item: classes.item}}>\r\n                <Typography variant='h6' className={clsx(classes.title, {[classes.titleWrapped]: !attach})}>\r\n                    <b>{Tr('name')}:{' '}</b>{title}\r\n                </Typography>\r\n                <Typography variant='body1' className={clsx(classes.title, {[classes.titleWrapped]: !attach})}>\r\n                    <b>{Tr('number_of_processing')}:{' '}</b>{number}\r\n                </Typography>\r\n                {(!contractor && !supportedNoApiScreens()) && <GridBlock>\r\n                    {(editable && isDeleteActive) && <InfoBarTitleButton\r\n                        Icon={DeleteIcon}\r\n                        label={Tr('delete')}\r\n                        onClick={() => setOpenDelete(true)}\r\n                    />}\r\n\r\n                    {editable && isPublished && isInvalidationActive &&\r\n                        <InfoBarTitleButton\r\n                            Icon={CancelOutlinedIcon}\r\n                            label={Tr('invalidate')}\r\n                            onClick={handleCancel}\r\n                            disabled={!rfxPrivileges.CANCEL || isModification}\r\n                        />\r\n                    }\r\n                </GridBlock>}\r\n            </GridBlock>\r\n            <Confirm\r\n                open={openDelete}\r\n                onConfirm={handleDelete}\r\n                onCancel={() => setOpenDelete(false)}\r\n                confirmText=\"delete_popup_text1\"\r\n                confirmText2=\"delete_popup_text2\"\r\n            />\r\n            <InvalidateDemandPopup onClose={() => setOpenInvalidate(false)} open={openInvalidate} onInvalidate={onInvalidate}/>\r\n            {working ? <LoadingScreen/> : ''}\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nInfoBarTitle.propTypes = {\r\n    classes: PropTypes.any,\r\n    contractor: PropTypes.bool.isRequired\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandValidation: state.resources.demandValidation,\r\n    isDemandChanged: state.resources.isDemandChanged,\r\n    ojsPublicationStatus: state.resources.ojsPublicationStatus,\r\n    stepperState: state.stepper.state,\r\n    steps: state.stepper.steps[0].steps,\r\n    demandHeader: state.resources.demandHeader,\r\n    rfxPrivileges: state.privileges[PrivilegeService.RFX_PRIVILEGE_STORE_KEY],\r\n}), {})(withRouter(InfoBarTitle));\r\n","export default (tab,steps,stepperState)=>{\r\n\tlet editable = true \r\n\tif (steps !== undefined && tab !== undefined) {\r\n\t\tconst stepsId = steps.findIndex(x => x.key === stepperState)\r\n\t\tif (stepsId > -1) {\r\n\t\t\teditable = tab.find((x) => x.section === steps[stepsId].apiId).editable\r\n\t\t}\r\n\t}\r\n\r\n\tif (editable === undefined) editable = true\r\n\r\n\treturn editable\r\n}","import React, {useEffect, useState} from 'react'\r\nimport {AppBar, Grid, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types'\r\nimport InfoData from './InfoData';\r\nimport clsx from 'clsx';\r\nimport Tr from 'translations/Translations';\r\nimport OpenBarText from './OpenBarText';\r\nimport InfoBarTitle from './InfoBarTitle';\r\nimport HeaderService from 'services/HeaderService';\r\nimport {withRouter} from \"react-router\";\r\nimport {connect} from 'react-redux'\r\nimport querystring from \"querystring\";\r\nimport {ProcedureTypeTr} from \"constants/ProcedureType\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tborderBottom: `solid 1px ${theme.palette.primary.main}`,\r\n\t\twidth: 'unset',\r\n\t\tpadding: theme.spacing(1),\r\n\t\tpaddingLeft: theme.spacing(4),\r\n\t\tminHeight: theme.mixins.toolbar.minHeight + theme.spacing(4),\r\n\t\tbackgroundColor: theme.palette.background.greyBackground,\r\n\t},\r\n\topen: {\r\n\t\tmaxHeight: 500,\r\n\t\ttransition: theme.transitions.default.open('max-height'),\r\n\t\t'& $content': {\r\n\t\t\tmargin: `${theme.spacing(1)}px 0`,\r\n\t\t\tpadding: `${theme.spacing(1)}px 0`\r\n\t\t}\r\n\t},\r\n\tclose: {\r\n\t\tmaxHeight: 0,\r\n\t\toverflow: 'hidden',\r\n\t\ttransition: theme.transitions.default.close('max-height'),\r\n\t\t'& $content': {\r\n\t\t\theight: 0,\r\n\t\t\topacity: 0,\r\n\t\t\tzIndex: -1,\r\n\t\t\tmarginTop: theme.spacing(-1)\r\n\t\t},\r\n\t},\r\n\tcontent: {\r\n\t\tborderColor: theme.palette.primary.contrastText,\r\n\t\tborderStyle: 'solid',\r\n\t\tborderWidth: '1px 0',\r\n\t},\r\n\ttitle: {\r\n\t\twidth: \"100%\"\r\n\t},\r\n\tinfoContainer: {\r\n\t\t'&>*': {\r\n\t\t\tflexGrow: 1,\r\n\t\t\tflexShrink: 0,\r\n\t\t\tflexBasis: 0,\r\n\t\t}\r\n\t},\r\n})\r\n\r\nfunction InfoBar({\r\n\tcontractor = false,\r\n\tclasses,\r\n\tmatch,\r\n\tlocation,\r\n\theaderData = {}\r\n}) {\r\n\tconst [attach, setAttach] = useState(false)\r\n\tlet id = match.params.id ? match.params.id : -1;\r\n\tif(!headerData.name) {\r\n\t\tconst urlParams = querystring.parse(location.search.slice(1));\r\n\t\tif(urlParams.procedureType) {\r\n\t\t\theaderData = { name:  `${Tr('new_procedure')}: ${ProcedureTypeTr[urlParams.procedureType]}`}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tuseEffect(() => {\r\n\t\tHeaderService.get(id)\r\n\t}, [id]);\r\n\r\n\tconst handleAttachClick = () => {\r\n\t\tsetAttach(!attach)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<AppBar\r\n\t\t\t\tid='appBar'\r\n\t\t\t\tclassName={clsx(\r\n\t\t\t\t\tclasses.root, {\r\n\t\t\t\t\t\t[classes.open]: attach,\r\n\t\t\t\t\t\t[classes.close]: !attach,\r\n\t\t\t\t\t}\r\n\t\t\t\t)}\r\n\t\t\t\tcomponent='div'\r\n\t\t\t\televation={0}\r\n\t\t\t\tposition='relative'\r\n\t\t\t>\r\n\t\t\t\t<Grid\r\n\t\t\t\t\tcontainer\r\n\t\t\t\t\tdirection='column'\r\n\t\t\t\t>\r\n\t\t\t\t\t<Grid item className={classes.title}>\r\n\t\t\t\t\t\t<InfoBarTitle title={headerData.name} number={headerData.number} attach={attach} contractor={contractor}/>\r\n\t\t\t\t\t</Grid>\r\n\t\t\t\t\t{headerData &&\r\n\t\t\t\t\t<Grid item className={classes.content}>\r\n\t\t\t\t\t\t<Grid\r\n\t\t\t\t\t\t\tcontainer\r\n\t\t\t\t\t\t\tclassName={classes.infoContainer}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Grid item>\r\n\t\t\t\t\t\t\t\t<InfoData headerData={headerData} contractor={contractor}/>\r\n\t\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t</Grid>\r\n\t\t\t\t\t}\r\n\t\t\t\t\t{id > 0 &&\r\n\t\t\t\t\t\t<Grid item>\r\n\t\t\t\t\t\t\t<OpenBarText\r\n\t\t\t\t\t\t\t\tonClick={handleAttachClick}\r\n\t\t\t\t\t\t\t\ttext={attach ? Tr('hide_info_bar') : Tr('show_info_bar')}\r\n\t\t\t\t\t\t\t\trotate={attach}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t}\r\n\t\t\t\t</Grid>\r\n\t\t\t</AppBar>\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nInfoBar.propTypes = {\r\n\ttitle: PropTypes.string,\r\n}\r\n\r\nInfoBar.defaultProps = {\r\n}\r\n\r\nexport default connect((state) => ({\r\n\theaderData: state.resources.demandHeader\r\n}), {\r\n\r\n})(withRouter(withStyles(style)(InfoBar)));","import React, {useMemo} from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport clsx from 'clsx';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        textAlign: 'center',\r\n    },\r\n    text: {\r\n        paddingTop: props => theme.spacing(1),\r\n        paddingBottom: props => theme.spacing(1) + 3,\r\n        borderStyle: 'solid',\r\n        borderColor: props => theme.palette.primary.main,\r\n        borderWidth: '0 0 1px 1px'\r\n\r\n    },\r\n    currentText: {\r\n        //fontWeight: theme.typography.fontWeightBold,\r\n        borderBottomWidth: 4,\r\n        paddingBottom: props => theme.spacing(1)\r\n    },\r\n    linkText: {\r\n        cursor: \"pointer\"\r\n    }\r\n}))\r\n\r\nfunction StageElement(\r\n    {\r\n        current,\r\n        onClick,\r\n        thin,\r\n        children\r\n    }) {\r\n    const classes = useStyle({thin});\r\n    const color = useMemo(() => Boolean(onClick) ? 'textPrimary' : 'textSecondary', [onClick])\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <Typography\r\n                variant='body1'\r\n                className={clsx(classes.text, {\r\n                    [classes.currentText]: current,\r\n                    [classes.linkText]: !current && Boolean(onClick)\r\n                })}\r\n                onClick={() => {\r\n                    if (Boolean(onClick)) {\r\n                        onClick();\r\n                    }\r\n                }}\r\n                color={color}\r\n            >\r\n                {children}\r\n            </Typography>\r\n        </div>\r\n    )\r\n}\r\n\r\nStageElement.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default StageElement;","import React, {useMemo} from 'react'\r\nimport {AppBar, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport StageElement from './components/StageElement';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {useParams, withRouter} from \"react-router\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Tr from \"translations/Translations\";\r\nimport {isDemandModification, isDemandOfferCollection, isDemandOfferEvaluation, isDemandPreparing, isDemandOfferDecryption} from \"libs/getDemandStatus\";\r\nimport {connect} from \"react-redux\";\r\nimport supportedNoApiScreens from \"libs/supportedNoApiScreens\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        backgroundColor: theme.palette.background.paper,\r\n        top: 64,\r\n        zIndex: 1099\r\n    },\r\n    gridItem: {\r\n        flexGrow: 1\r\n    },\r\n    modification: {\r\n        fontWeight: 400\r\n    }\r\n})\r\n\r\nfunction StageBar(\r\n    {\r\n        classes,\r\n        location,\r\n        demandHeader//ma się odświeżać na zmianę\r\n    }) {\r\n\r\n    const pathname = location.pathname;\r\n    const demandId = useParams().id;\r\n\r\n    const goSoStatus = useMemo(() => !!(demandHeader?.oldPlatformRoundStatusUrl) && supportedNoApiScreens(), [demandHeader]);\r\n\r\n\r\n    const createElement = (label, label2, onClick, current) => ({label, label2, onClick, current})\r\n    const rp = RouterPath.myProcedure;\r\n\r\n    const stageClick = (path) => {\r\n        if (goSoStatus) {\r\n            window.location.href = demandHeader.oldPlatformRoundStatusUrl;\r\n        } else {\r\n            RouterPath.redirect(path);\r\n        }\r\n    }\r\n\r\n\r\n    const elements = useMemo(() => {\r\n\r\n        const preparing = !demandId || demandId <= 0 || isDemandPreparing();\r\n        const modification = isDemandModification();\r\n        const offerCollection = isDemandOfferCollection();\r\n        const offerDecryption = isDemandOfferDecryption();\r\n        const evaluation = isDemandOfferEvaluation();\r\n        const exPost = demandHeader ? demandHeader.exPost : false;\r\n\r\n        const elements = [\r\n            createElement(\r\n                Tr('mp_1'),\r\n                modification ? Tr('modification') : undefined,\r\n                () => {\r\n                    stageClick(RouterPath.createPath(rp.steps.MP_1_ID, {id: demandId}))\r\n                },\r\n                pathname.startsWith(rp.steps.MP_1)),\r\n            createElement(\r\n                Tr('mp_2'),\r\n                undefined,\r\n                preparing || exPost ? undefined : () => {\r\n                    stageClick(RouterPath.createPath(rp.steps.MP_2_ID, {id: demandId}))\r\n                },\r\n                pathname.startsWith(rp.steps.MP_2)),\r\n            createElement(\r\n                Tr('mp_3'),\r\n                undefined,\r\n                preparing || modification || offerCollection || offerDecryption || exPost ? undefined : () => {\r\n                    stageClick(RouterPath.createPath(rp.steps.MP_3_ID, {id: demandId}))\r\n                },\r\n                pathname.startsWith(rp.steps.MP_3)),\r\n            createElement(\r\n                Tr('mp_4'),\r\n                undefined,\r\n                preparing || modification || offerCollection || offerDecryption || evaluation  ? undefined : () => {\r\n                    stageClick(RouterPath.createPath(rp.steps.MP_4_ID, {id: demandId}))\r\n                },\r\n                pathname.startsWith(rp.steps.MP_4))\r\n        ]\r\n        return elements;\r\n        // eslint-disable-next-line\r\n    }, [demandHeader, demandId, pathname]);\r\n\r\n\r\n    return (\r\n        <AppBar\r\n            id='stageBar'\r\n            component='div'\r\n            elevation={0}\r\n            position='sticky'\r\n            className={classes.root}\r\n        >\r\n            <GridBlock\r\n                itemClassName={classes.gridItem}\r\n            >\r\n                {elements.map(({label, label2, onClick, current}, i) => {\r\n                    return (\r\n                        <StageElement\r\n                            key={i}\r\n                            current={current}\r\n                            onClick={onClick}\r\n                        >\r\n                            {label} {!!label2 && <span className={classes.modification}>({label2})</span>}\r\n                        </StageElement>\r\n                    )\r\n                })}\r\n            </GridBlock>\r\n        </AppBar>\r\n    )\r\n}\r\n\r\nStageBar.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(withRouter(withStyles(style)(StageBar)));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport PartsRouter from './PartsRouter';\r\nimport Page from 'components/Page';\r\nimport InfoBar from \"components/complex/infobar/InfoBar\";\r\nimport StageBar from \"components/complex/stagebar/StageBar\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n\tcontent: {\r\n\t\tpadding: theme.spacing(2)\r\n\t}\r\n}));\r\n\r\nfunction StepperPages(\r\n\t{\r\n\t\tmatch\r\n\t}) {\r\n\tconst classes = useStyles();\r\n\r\n\treturn (\r\n\r\n\t\t<Page>\r\n\t\t\t<InfoBar />\r\n\t\t\t<StageBar />\r\n\t\t\t<div className={classes.content}>\r\n\t\t\t\t<PartsRouter/>\r\n\t\t\t</div>\r\n\t\t</Page>\r\n\t)\r\n}\r\n\r\nStepperPages.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default StepperPages;\r\n\t\r\n","import React, {useState} from 'react'\r\nimport {InputAdornment, TextField} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport {setSearchObj} from 'libs/RouterPath';\r\nimport querystring from 'querystring';\r\nimport WorkableIconSearchButton from \"./button/WorkableIconSearchButton\";\r\n\r\nfunction SearchInput({\r\n\tclassName,\r\n\tlabel,\r\n\tid,\r\n\thandleSubmit\r\n}) {\r\n\tconst getInitValue = () => {\r\n\t\tconst search = window.location.search;\r\n\t\tconst value = querystring.parse(search.slice(1))[id];\r\n\t\treturn value ? value : '';\r\n\t}\r\n\r\n\tconst [value, setValue] = useState(getInitValue())\r\n\r\n\tconst handleChange = (e) => {\r\n\t\tsetValue(e.target.value)\r\n\t}\r\n\r\n\tconst hadleClick = (e) => {\r\n\t\tif(handleSubmit) {\r\n\t\t\thandleSubmit({ [id]: value });\r\n\t\t} else {\r\n\t\t\tsetSearchObj({ [id]: value })\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleKeyUp = (e) => {\r\n\t\tif (e.key === 'Enter') {\r\n\t\t\thadleClick()\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<TextField\r\n\t\t\tclassName={className}\r\n\t\t\tlabel={label}\r\n\t\t\tonChange={handleChange}\r\n\t\t\tonKeyUp={handleKeyUp}\r\n\t\t\tfullWidth\r\n\t\t\tvalue={value}\r\n\t\t\tInputProps={{\r\n\t\t\t\tendAdornment: <InputAdornment position=\"end\">\r\n\t\t\t\t\t<WorkableIconSearchButton\r\n\t\t\t\t\t\tonClick={hadleClick}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</InputAdornment>,\r\n\t\t\t}}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nSearchInput.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tclassName: PropTypes.string,\r\n\tlabel: PropTypes.string,\r\n\tid: PropTypes.string,\r\n}\r\n\r\nSearchInput.defaultProps = {\r\n}\r\n\r\nexport default SearchInput;","import React from 'react'\r\nimport {withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport SearchInput from 'components/SearchInput'\r\nimport Tr from 'translations/Translations';\r\nimport GridBlock from 'components/GridBlock';\r\nimport SimpleSelect from 'components/SimpleSelect';\r\nimport ProcedureStatus from 'constants/ProcedureStatus';\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n        marginLeft: theme.spacing(1),\r\n\r\n        '&>*:not(:first-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    search: {\r\n        ...theme.components.input.search\r\n    },\r\n    chipsGrid: {\r\n        marginTop: theme.spacing(1)\r\n    },\r\n    select: {\r\n        width: 250,\r\n    }\r\n})\r\n\r\nfunction SearchBar(\r\n    {\r\n        classes,\r\n        setFilters,\r\n        filters,\r\n    }) {\r\n\r\n    return (\r\n        <>\r\n            <GridBlock\r\n                alignItems='flex-end'\r\n                className={classes.root}\r\n            >\r\n                <SearchInput\r\n                    id='search'\r\n                    label={Tr('search')}\r\n                    className={classes.search}\r\n                />\r\n                <SimpleSelect\r\n                    label={Tr('status')}\r\n                    className={classes.select}\r\n                    items={ProcedureStatus}\r\n                    onChange={(e) => setFilters({state: e.target.value})}\r\n                    value={filters.state}\r\n                />\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nSearchBar.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nSearchBar.defaultProps = {}\r\n\r\nexport default withStyles(style)(SearchBar);","import reduxStore from 'redux/store'\r\nimport {clearResource, setResource} from 'redux/actions'\r\nimport Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET} from 'libs/RestRequest';\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\n\r\n\r\nconst get = async (page = 1, pageSize = 10, filters = {}, sort = {}) => {\r\n\r\n    const {\r\n        column,\r\n        direction\r\n    } = sort\r\n\r\n    let params = {\r\n        'page': page,\r\n        'pageSize': pageSize\r\n    }\r\n    params = applySearchParams(filters, params);\r\n\r\n    if (column) {\r\n        params['sort[0].column'] = column\r\n        params['sort[0].direction'] = direction.toUpperCase()\r\n    }\r\n\r\n    try {\r\n        const res = await RestRequestGET(Endpoints.DEMANDS, {\r\n            params\r\n        });\r\n        reduxStore.dispatch(\r\n            setResource('demands', res)\r\n        )\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst clear = () => {\r\n    reduxStore.dispatch(\r\n        clearResource('demands')\r\n    )\r\n}\r\n\r\nexport default {\r\n    get,\r\n    clear,\r\n}\r\n\r\n","import {useMemo} from 'react';\r\nimport querystring from 'querystring'\r\n\r\nconst getObj = (location) => {\r\n    const search = location.search;\r\n    return querystring.parse(search.substr(1));\r\n}\r\nexport default (location = window.location) => {\r\n    // eslint-disable-next-line\r\n    const params = useMemo(() => getObj(location), [location.search])\r\n    return params;\r\n}","import React from 'react'\r\nimport DuplicateIcon from '@material-ui/icons/FilterNone';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconDuplicateButton(\r\n    {\r\n        tooltip = Tr('duplicate'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={DuplicateIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconDuplicateButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconDuplicateButton;","import React, {useEffect, useMemo, useState} from 'react'\r\nimport {makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport SearchBar from './components/SearchBar'\r\nimport Tr from 'translations/Translations';\r\nimport DemandsService from 'services/DemandsService';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport moment from 'moment';\r\nimport SimpleTable from 'components/complex/simpleTable/SimpleTable';\r\nimport usePathParams from 'hooks/usePathParams'\r\nimport Loading from 'components/Loading';\r\nimport {LABELS as ProcedureStatusLabels} from 'constants/ProcedureStatus';\r\nimport Pagination from 'components/Pagination';\r\nimport DemandService from 'services/DemandService';\r\nimport {ProcedureTypeTr} from 'constants/ProcedureType';\r\nimport WorkableIconDeleteButton from 'components/button/WorkableIconDeleteButton';\r\nimport Confirm from \"components/popup/confirm/Confirm\";\r\nimport WorkableIconForwardButton from \"components/button/WorkableIconForwardButton\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconDuplicateButton from \"components/button/WorkableIconDuplicateButton\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        margin: -theme.spacing(2),\r\n        marginTop: 0,\r\n    },\r\n    numberColumn: {\r\n        width: 100,\r\n        wordBreak: 'break-all'\r\n    },\r\n    typeColumn: {\r\n        width: 140\r\n    },\r\n    dateColumn: {\r\n        width: 150,\r\n        textAlign: \"center\"\r\n    },\r\n    statusColumn: {\r\n        width: 100,\r\n    },\r\n    button: {\r\n        width: 50,\r\n        padding: '0 !important',\r\n    },\r\n    oneLine: {\r\n        ...theme.typography.cutLines(1),\r\n    },\r\n    cell: {\r\n        padding: theme.spacing(1),\r\n    }\r\n}));\r\n\r\nconst rp = RouterPath.myProcedure\r\n\r\nfunction Started(\r\n    {\r\n        resources = {},\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const {\r\n        // paginator,\r\n        //totalCount,\r\n        items,\r\n    } = resources;\r\n\r\n\r\n    const [loading, setLoading] = useState(false);\r\n    const [openDeleteId, setOpenDeleteId] = useState(0);\r\n    const [openCloneId, setOpenCloneId] = useState(0);\r\n\r\n    let params = usePathParams()\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig, setSortConfig,}\r\n        = useSearch({\r\n        search: {\r\n            params,\r\n            filters: {\r\n                state: ''\r\n            }\r\n        },\r\n        sort: {\r\n            column: 'dateInserted',\r\n            direction: 'desc',\r\n        }\r\n    });\r\n\r\n    const setFilters = (filters) => {\r\n        setSearchConfig({...searchData.search, filters});\r\n    }\r\n\r\n    useDidUpdateEffect(() => {\r\n        setSearchConfig({...searchData.search, params});\r\n    }, [params]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (resources?.totalCount !== undefined) {\r\n            setTotalCount(resources.totalCount);\r\n        }\r\n    }, [resources?.totalCount]);\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            DemandsService.clear();\r\n        }\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n        fetchData()\r\n        // eslint-disable-next-line\r\n    }, [searchData])\r\n\r\n    const handleSortChange = (id) => {\r\n        let direction = 'desc';\r\n        const active = searchData.sort.column === id;\r\n        if (active) {\r\n            direction = searchData.sort.direction === 'asc' ? 'desc' : 'asc';\r\n        }\r\n\r\n        setSortConfig({\r\n            column: id,\r\n            direction\r\n        })\r\n    }\r\n\r\n    const fetchData = () => {\r\n        setLoading(true);\r\n        const {search, pagination, sort} = searchData;\r\n        const {page, pageSize} = pagination;\r\n        return DemandsService.get(page, pageSize, {\r\n            ...search.filters,\r\n            ...search.params,\r\n        }, sort).then(x => setLoading(false));\r\n    }\r\n\r\n    const createDeleteButton = (onClick, {actions}) => {\r\n        if (actions.delete) {\r\n            return <WorkableIconDeleteButton onClick={onClick}/>\r\n        }\r\n    }\r\n    const createCloneButton = (onClick, {actions}) => {\r\n        if (actions.clone) {\r\n            return <WorkableIconDuplicateButton onClick={onClick}/>\r\n        }\r\n    }\r\n\r\n    const handleEnterDemand = (item) => {\r\n        const {actions} = item;\r\n        if (actions.stepOne) {\r\n            const href = RouterPath.createPath(rp.steps.MP_1_ID, {id: item.identity});\r\n            RouterPath.redirect(href)\r\n        } else if (actions.stepTwo) {\r\n            const href = RouterPath.createPath(rp.steps.MP_2_ID, {id: item.identity});\r\n            RouterPath.redirect(href)\r\n        } else if (actions.stepThree) {\r\n            const href = RouterPath.createPath(rp.steps.MP_3_ID, {id: item.identity});\r\n            RouterPath.redirect(href)\r\n        } else if (actions.stepFour) {\r\n            const href = RouterPath.createPath(rp.steps.MP_4_ID, {id: item.identity});\r\n            RouterPath.redirect(href)\r\n        } else if (actions.oldSystemUrl) {\r\n            window.location.href = actions.oldSystemUrl.url;\r\n        }\r\n    }\r\n\r\n    const handleDelete = (id = openDeleteId) => {\r\n        setOpenDeleteId(0);\r\n        DemandService.deleteDemand(id)\r\n            .then(() => fetchData())\r\n    }\r\n\r\n    const handleClone = (id = openCloneId) => {\r\n        setOpenCloneId(0);\r\n        DemandService.clone(id);\r\n    }\r\n\r\n    const getSortProps = (id) => {\r\n        return {\r\n            active: searchData.sort.column === id,\r\n            direction: searchData.sort.direction,\r\n            onClick: () => {\r\n                handleSortChange(id)\r\n            }\r\n        }\r\n    }\r\n    const hasClone = useMemo(() => !!items && !!items.find(x => !!x.actions.clone), [items]);\r\n    const hasDelete = useMemo(() => !!items && !!items.find(x => !!x.actions.delete), [items]);\r\n\r\n    const getHeaders = () => {\r\n        if (!items) return;\r\n        const headers = [];\r\n        headers.push(Tr('demand_number'));\r\n        headers.push({\r\n            value: Tr('name'),\r\n            sort: getSortProps('name')\r\n        });\r\n        headers.push(Tr('type'));\r\n        headers.push({\r\n            value: Tr('publish_data'),\r\n            sort: getSortProps('procedureStartDate')\r\n        });\r\n        headers.push({\r\n            value: Tr('deadline_for_offers'),\r\n            sort: getSortProps('deadlineForOffers')\r\n        });\r\n        headers.push(Tr('status'));\r\n        if (hasDelete) {\r\n            headers.push('');\r\n        }\r\n        if (hasClone) {\r\n            headers.push('');\r\n        }\r\n        headers.push('');\r\n        return headers;\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const headers = useMemo(getHeaders, [items]);\r\n\r\n    const getHeaderClasses = () => {\r\n        if (!items) return;\r\n        const headers = [];\r\n        headers.push(classes.numberColumn);\r\n        headers.push(undefined);\r\n        headers.push(classes.typeColumn);\r\n        headers.push(classes.dateColumn);\r\n        headers.push(classes.dateColumn);\r\n        headers.push(classes.statusColumn);\r\n        if (hasDelete) {\r\n            headers.push(classes.button);\r\n        }\r\n        if (hasClone) {\r\n            headers.push(classes.button);\r\n        }\r\n        headers.push(classes.button);\r\n\r\n        return headers;\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const headerClasses = useMemo(getHeaderClasses, [items]);\r\n\r\n    const getRows = () => {\r\n        if (!items) return;\r\n        const rows = items.map((item) => {\r\n            const row = [];\r\n            row.push(item.number);\r\n            row.push(item.name);\r\n            row.push(ProcedureTypeTr[item.procedureType]);\r\n            row.push(item.datePublish ? moment(item.datePublish).format(DateFormats.DATETIME_FORMAT) : \"--\");\r\n            row.push(item.deadlineForOffers ? moment(item.deadlineForOffers).format(DateFormats.DATETIME_FORMAT) : \"--\");\r\n            row.push(ProcedureStatusLabels[item.state]);\r\n            if (hasDelete) {\r\n                row.push(createDeleteButton(() => setOpenDeleteId(item.identity), item));\r\n            }\r\n            if (hasClone) {\r\n                row.push(createCloneButton(() => setOpenCloneId(item.identity), item));\r\n            }\r\n            row.push(<WorkableIconForwardButton onClick={()=> handleEnterDemand(item)} />);\r\n            return row;\r\n        });\r\n        return rows;\r\n    };\r\n\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    const rows = useMemo(getRows, [items]);\r\n\r\n    if (!items) return <Loading/>;\r\n\r\n    return (\r\n        <>\r\n            <SearchBar\r\n                setFilters={setFilters}\r\n                filters={searchData.search.filters}\r\n            />\r\n            {loading ?\r\n                <Loading/>\r\n                :\r\n                <SimpleTable\r\n                    headers={headers}\r\n                    items={rows}\r\n                    columnClasses={headerClasses}\r\n                    cellClassName={classes.cell}\r\n                />\r\n            }\r\n\r\n            {/* <GalleryList /> */}\r\n            <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount}/>\r\n\r\n            <Confirm\r\n                open={Boolean(openDeleteId)}\r\n                onConfirm={() => handleDelete()}\r\n                onCancel={() => setOpenDeleteId(0)}\r\n                confirmText=\"delete_popup_text1\"\r\n                confirmText2=\"delete_popup_text2\"\r\n            />\r\n            <Confirm\r\n                open={Boolean(openCloneId)}\r\n                onConfirm={() => handleClone()}\r\n                onCancel={() => setOpenCloneId(0)}\r\n                confirmText=\"confirm_clone_demand\"\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\nStarted.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nStarted.defaultProps = {}\r\n\r\nexport default connect((state) => ({\r\n    resources: state.resources.demands\r\n}), {})(Started);","import React from 'react'\r\nimport {Route, Switch} from 'react-router-dom';\r\nimport Started from './started/Started';\r\n\r\n\r\nfunction HomeRoute() {\r\n\treturn (\r\n\t\t<Switch>\r\n\t\t\t<Route exact component={Started} />\r\n\t\t</Switch>\r\n\t)\r\n}\r\n\r\nHomeRoute.propTypes = {\r\n}\r\n\r\nHomeRoute.defaultProps = {\r\n}\r\n\r\nexport default HomeRoute;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from 'components/Page';\r\nimport Workspace from 'components/Workspace';\r\nimport Tr from 'translations/Translations';\r\nimport HomeRoute from './HomeRoute';\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction MyProcedureHome() {\r\n\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <Page\r\n                floatingWorkspace\r\n            >\r\n                <Workspace\r\n                    title={Tr('my_procedure')}\r\n                >\r\n                    {/*<TabsPage tabs={tabs}>*/}\r\n                    <HomeRoute/>\r\n                    {/*</TabsPage>*/}\r\n                </Workspace>\r\n            </Page>\r\n        </div>\r\n    )\r\n}\r\n\r\nMyProcedureHome.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nMyProcedureHome.defaultProps = {}\r\n\r\nexport default MyProcedureHome;\r\n","import React from 'react'\r\nimport {Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport StepperPages from './scenes/StepperPages';\r\nimport MyProcedureHome from './scenes/home/MyProcedureHome';\r\n\r\nconst rp = RouterPath.myProcedure;\r\n\r\nfunction MyProcedure() {\r\n\r\n    return (\r\n        <Switch>\r\n            {Object.values(rp.steps).map((x, i) => (\r\n                <Route exact key={i} path={x} component={StepperPages}/>\r\n            ))}\r\n            <Route component={MyProcedureHome}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nexport default MyProcedure;\r\n\r\n","import React, {useRef} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport {makeStyles, Tooltip} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ExpansionPanel from 'components/ExpansionPanel';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowUp'\r\nimport clsx from 'clsx';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\n\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {\r\n    getSectionVariant,\r\n    PurchasingGroupStageSections,\r\n    StageSectionNameToSectionParam,\r\n    StageSectionParamToSectionName,\r\n    StageSectionsComponents\r\n} from \"../constants/PurchasingGroupStageSections\";\r\nimport ExpansionPanelTitleAvatar from \"components/ExpansionPanelTitleAvatar\";\r\nimport Typography from \"components/Typography\";\r\nimport {connect} from \"react-redux\";\r\nimport {setConfirmCloseStepper} from \"redux/actions\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        '&:not(:first-child)': {\r\n            // marginTop: theme.spacing(1)\r\n        }\r\n    },\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    adornmentGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(2)\r\n        }\r\n    },\r\n    titleGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 10000,\r\n        }\r\n    }\r\n}))\r\n\r\nconst rps = RouterPath.purchasingGroup;\r\n\r\nfunction PurchasingGroupStageSection(\r\n    {\r\n        validationSection,\r\n        stateCloseValidator,\r\n        setConfirmCloseStepper\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const stage = params.stage;\r\n    const openedSectionParam = params.section;\r\n\r\n\r\n    const openedSection = openedSectionParam ? StageSectionParamToSectionName[openedSectionParam] : undefined;\r\n    const expanded = openedSection === validationSection.section;\r\n    const panelRef = useRef();\r\n\r\n    const handleClick = id => {\r\n        if (validationSection.status !== DemandValidationSectionStatus.DISABLED) {\r\n            if (stateCloseValidator && stateCloseValidator() === false) {\r\n                setConfirmCloseStepper(() => doHandleClick(id));\r\n                return\r\n            }\r\n            doHandleClick(id)\r\n        }\r\n    }\r\n    const doHandleClick = id => {\r\n        if (openedSection === id) {\r\n            RouterPath.redirectWithoutHistory(RouterPath.createPath(rps.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {id: groupId, stage: stage}))\r\n        } else {\r\n            RouterPath.redirectWithoutHistory(RouterPath.createPath(rps.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR_SECTION, {\r\n                id: groupId, stage: stage,\r\n                section: StageSectionNameToSectionParam[id]\r\n            }))\r\n        }\r\n    }\r\n\r\n    const Component = StageSectionsComponents[validationSection.section];\r\n    return (\r\n        <ExpansionPanel\r\n            panelRef={panelRef}\r\n            id={validationSection.section}\r\n            title={<GridBlock alignItems=\"center\">\r\n                <ExpansionPanelTitleAvatar variant={getSectionVariant(validationSection)}/>\r\n                <Typography variant='h6'>\r\n                    {validationSection.name}\r\n                </Typography>\r\n            </GridBlock>}\r\n            classesObj={{titleGrid: classes.titleGrid, root: classes.root}}\r\n            titleAdornment={\r\n                <GridBlock\r\n                    wrap='nowrap'\r\n                    className={classes.adornmentGrid}\r\n                    alignItems='center'\r\n                >\r\n                    <div/>\r\n                    <Tooltip title={expanded ? Tr('collapse') : Tr('expand')} placement='top'>\r\n                        <ArrowIcon\r\n                            className={clsx({\r\n                                [classes.rotate]: !expanded\r\n                            })}\r\n                        />\r\n                    </Tooltip>\r\n                </GridBlock>\r\n            }\r\n            expanded={expanded}\r\n            onChange={() => handleClick(validationSection.section)}\r\n        >\r\n            {expanded &&\r\n                <Component panelRef={panelRef} validationSection={validationSection}/>\r\n            }\r\n        </ExpansionPanel>\r\n    )\r\n\r\n}\r\n\r\nPurchasingGroupStageSection.propTypes = {\r\n    validationSection: PropTypes.shape({\r\n        editable: PropTypes.bool.isRequired,\r\n        infoMessages: PropTypes.array,\r\n        messages: PropTypes.array,\r\n        name: PropTypes.string.isRequired,\r\n        required: PropTypes.bool.isRequired,\r\n        section: PropTypes.oneOf(Object.keys(PurchasingGroupStageSections)).isRequired,\r\n        status: PropTypes.oneOf(Object.keys(DemandValidationSectionStatus)).isRequired,\r\n        validateAfterSave: PropTypes.bool\r\n    })\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stateCloseValidator: state.stepper.stateCloseValidator,\r\n}), {\r\n    setConfirmCloseStepper\r\n})(PurchasingGroupStageSection)\r\n","import React, {useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {useParams, withRouter} from \"react-router\";\r\nimport Loading from \"components/Loading\";\r\nimport {PurchasingGroupStageSections, StageSectionNameToSectionParam} from \"../constants/PurchasingGroupStageSections\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport PurchasingGroupStageSection from \"../components/PurchasingGroupStageSection\";\r\nimport NavigationBar from \"components/complex/floatingMenu/NavigationBar\";\r\nimport createButton from \"components/complex/floatingMenu/createButton\";\r\nimport SaveIcon from \"@material-ui/icons/Save\";\r\nimport ArrowIcon from \"@material-ui/icons/KeyboardArrowUp\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport reduxStore from 'redux/store'\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport RefreshIcon from \"@material-ui/icons/Refresh\";\r\nimport ClearIcon from '@material-ui/icons/Clear';\r\nimport MailIcon from \"@material-ui/icons/Mail\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport ListIcon from \"@material-ui/icons/List\";\r\nimport DemandRelatedObjectsPopup from \"components/popup/relatedObjects/DemandRelatedObjectsPopup\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        height: '100%',\r\n        '&>*:not(:first-child)': {\r\n            marginTop: theme.spacing(2)\r\n        }\r\n    },\r\n    floatingMenu: {\r\n        marginBottom: theme.spacing(2),\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        top: 108\r\n    }\r\n}));\r\n\r\nfunction PurchasingGroupStage(\r\n    {\r\n        mainSectionName,\r\n        stageSections,\r\n        purchasingGroupHeader,\r\n        stateCloseValidator,\r\n        formValues,\r\n        dealing,\r\n        dealingsList\r\n    }\r\n) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const stage = params.stage;\r\n    const section = params.section;\r\n    const {enqueueErrorSnackbar, enqueueInfoSnackbar} = useSnackbar();\r\n    const [relatedObjectPopup, setRelatedObjectPopup] = useState(false)\r\n\r\n    const navigationBarButtons = useMemo(() => {\r\n        const changes = section !== StageSectionNameToSectionParam.TEMPLATE && (stateCloseValidator && stateCloseValidator() === false);\r\n        const buttons = [];\r\n        if (changes) {\r\n            buttons.push(createButton('discard_changes', () => closeSection(false), 'outlined', ClearIcon, \"primary\", !section));\r\n        }\r\n        buttons.push(createButton(changes ? 'save' : 'close', () => closeSection(changes), undefined, changes ? SaveIcon : ArrowIcon, \"primary\", !section));\r\n\r\n        if (stageSections) {\r\n            const stageSection = stageSections[mainSectionName] || {};\r\n\r\n            if (stageSection && stageSection.emailListAvailable)\r\n                buttons.push(createButton('email_list', () => {\r\n                    const href = RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_EMAIL_LIST, {id: groupId});\r\n                    RouterPath.redirect(href)\r\n                }, undefined, MailIcon, 'primary', false, true));\r\n\r\n            if (stageSection && stageSection.showUpdateNumber)\r\n                if (purchasingGroupHeader.showUpdateNumber) {\r\n                    buttons.push(createButton(\"update_number\", () => enqueueInfoSnackbar(\"Nie zaimplementowano\"), undefined, RefreshIcon, \"primary\", !!section, true));\r\n                }\r\n\r\n            if (purchasingGroupHeader && purchasingGroupHeader.hasDemand)\r\n                buttons.push(createButton('related_objects', () => setRelatedObjectPopup(true),\r\n                    \"outlined\", ListIcon, 'primary', false, true));\r\n\r\n        }\r\n        return buttons;\r\n        // eslint-disable-next-line\r\n    }, [section, stageSections, closeSection, purchasingGroupHeader, enqueueInfoSnackbar, formValues, stateCloseValidator, dealingsList, dealing])\r\n\r\n\r\n    const closeSection = (save) => {\r\n        if (save) {\r\n            const {form} = reduxStore.getState();\r\n            const func = form[section];\r\n            if (func) {\r\n                func();\r\n            } else {\r\n                enqueueErrorSnackbar(Tr(\"unknown_error_message\"));\r\n            }\r\n        } else {\r\n\r\n            if (section === StageSectionNameToSectionParam.TEMPLATE && stateCloseValidator && !stateCloseValidator()) {\r\n                simpleConfirm(\"modification_cancel_popup_text\", () => {\r\n                    RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n                        id: groupId,\r\n                        stage: stage\r\n                    }))\r\n                })\r\n            } else {\r\n                RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n                    id: groupId,\r\n                    stage: stage\r\n                }))\r\n\r\n            }\r\n        }\r\n    };\r\n\r\n\r\n    if (!stageSections) return <Loading/>\r\n    return (<div className={classes.root}>\r\n            {(!!(navigationBarButtons?.length)) &&\r\n                <div className={classes.floatingMenu}>\r\n                    <NavigationBar buttons={navigationBarButtons}/>\r\n                </div>\r\n            }\r\n\r\n            {Object.keys(PurchasingGroupStageSections).filter((sectionId) => {\r\n                const section = stageSections[sectionId];\r\n                return !!section && section.status !== DemandValidationSectionStatus.UNAVAILABLE\r\n            })\r\n                .map((sectionId) => {\r\n                    return (<PurchasingGroupStageSection key={sectionId} validationSection={stageSections[sectionId]}/>)\r\n                })}\r\n            {\r\n                relatedObjectPopup &&\r\n                <DemandRelatedObjectsPopup relatedObjectServiceFunction={PurchasingGroupStage1Service.getRelatedObjects} demandId={groupId} onClose={() => setRelatedObjectPopup(false)}/>\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nPurchasingGroupStage.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n    purchasingGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID],\r\n    stateCloseValidator: state.stepper.stateCloseValidator,\r\n    formValues: state.formValues,\r\n    dealing: state.resources.dealing,\r\n    dealingsList: state.resources.dealingsList,\r\n}), {})(withRouter(PurchasingGroupStage));\r\n","import React, {useEffect, useRef} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport {useParams} from \"react-router\";\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {PurchasingGroupStageSections} from \"../constants/PurchasingGroupStageSections\";\r\nimport PurchasingGroupStage from \"../components/PurchasingGroupStage\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport UserService from \"services/UserService\";\r\nimport scheduleReloadTimeout from \"../utils/scheduleReloadTimeout\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nfunction PurchasingGroupStage2(\r\n    {\r\n        stageSections,\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const {enqueueInfoSnackbar} = useSnackbar();\r\n    const reloadTimeout = useRef(0);\r\n\r\n    useDebouncedEffect(() => {\r\n        if (reloadTimeout.current) {\r\n            clearTimeout(reloadTimeout.current);\r\n            reloadTimeout.current = 0;\r\n        }\r\n\r\n        if (stageSections) {\r\n            (async () => {\r\n                const mainSection = stageSections[PurchasingGroupStageSections.STAGE_2_SECTION];\r\n                if (mainSection && mainSection.schedule) {\r\n                    const serverTime = await UserService.serverTime();\r\n                    let newReloadTimeout = scheduleReloadTimeout(mainSection.schedule, serverTime);\r\n                    if (newReloadTimeout) {\r\n                        reloadTimeout.current = setTimeout(() => {\r\n                            enqueueInfoSnackbar(Tr(\"purchasing_group_schedule_time_reached\"))\r\n                            getStage2Sections();\r\n                        }, newReloadTimeout)\r\n                    }\r\n                }\r\n            })()\r\n        }\r\n        // eslint-disable-next-line\r\n    }, {timeout: 1000, ignoreInitialCall: true}, [stageSections]);\r\n\r\n    const getStage2Sections = () => {\r\n        PurchasingGroupSectionService.getStage2Sections(groupId);\r\n    }\r\n    useEffect(() => {\r\n        return () => {\r\n            if (reloadTimeout.current) {\r\n                clearTimeout(reloadTimeout.current);\r\n                reloadTimeout.current = 0;\r\n            }\r\n            PurchasingGroupSectionService.clearResources(PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID)\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n    useEffect(() => {\r\n        if (groupId)\r\n            PurchasingGroupSectionService.getStage2Sections(groupId);\r\n        return () => {\r\n            PurchasingGroupSectionService.clearResources(PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID)\r\n        }\r\n    }, [groupId])\r\n\r\n\r\n    return (<PurchasingGroupStage mainSectionName={PurchasingGroupStageSections.STAGE_2_SECTION}/>)\r\n}\r\n\r\nPurchasingGroupStage2.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n}), {})(PurchasingGroupStage2);\r\n","import React, {useEffect, useRef} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from 'react-redux'\r\nimport PurchasingGroupSectionService from \"services/PurchasingGroupSectionService\";\r\nimport {useParams} from \"react-router\";\r\nimport {PurchasingGroupStageSections} from \"../constants/PurchasingGroupStageSections\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport Tr from \"translations/Translations\";\r\nimport scheduleReloadTimeout from \"../utils/scheduleReloadTimeout\";\r\nimport UserService from \"services/UserService\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport PurchasingGroupStage from \"../components/PurchasingGroupStage\";\r\n\r\nfunction PurchasingGroupStage1(\r\n    {\r\n        stageSections,\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const groupId = params.id;\r\n    const {enqueueInfoSnackbar} = useSnackbar();\r\n    const reloadTimeout = useRef(0);\r\n\r\n    useDebouncedEffect(() => {\r\n        if (reloadTimeout.current) {\r\n            clearTimeout(reloadTimeout.current);\r\n            reloadTimeout.current = 0;\r\n        }\r\n\r\n        if (stageSections) {\r\n            (async () => {\r\n                const mainSection = stageSections[PurchasingGroupStageSections.STAGE_1_SECTION];\r\n                if (mainSection && mainSection.schedule) {\r\n                    const serverTime = await UserService.serverTime();\r\n                    let newReloadTimeout = scheduleReloadTimeout(mainSection.schedule, serverTime);\r\n                    if (newReloadTimeout) {\r\n                        reloadTimeout.current = setTimeout(() => {\r\n                            enqueueInfoSnackbar(Tr(\"purchasing_group_schedule_time_reached\"))\r\n                            getStage1Sections();\r\n                        }, newReloadTimeout)\r\n                    }\r\n                }\r\n            })()\r\n        }\r\n        // eslint-disable-next-line\r\n    }, {timeout: 1000, ignoreInitialCall: true}, [stageSections]);\r\n\r\n    const getStage1Sections = () => {\r\n        PurchasingGroupSectionService.getStage1Sections(groupId);\r\n    }\r\n    useEffect(() => {\r\n        getStage1Sections();\r\n        return () => {\r\n            if (reloadTimeout.current) {\r\n                clearTimeout(reloadTimeout.current);\r\n                reloadTimeout.current = 0;\r\n            }\r\n            PurchasingGroupSectionService.clearResources(PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID)\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [groupId])\r\n\r\n\r\n    return (<PurchasingGroupStage mainSectionName={PurchasingGroupStageSections.STAGE_1_SECTION}/>)\r\n}\r\n\r\nPurchasingGroupStage1.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stageSections: state.resources[PurchasingGroupSectionService.PURCHASING_GROUP_STAGE_SECTIONS_RESOURCE_ID],\r\n}), {})(PurchasingGroupStage1);\r\n","import React from 'react'\r\nimport PurchasingGroupStage2 from \"./stage2/PurchasingGroupStage2\";\r\nimport PurchasingGroupStage1 from \"./stage1/PurchasingGroupStage1\";\r\n\r\n\r\nfunction PurchasingGroupStageNr(\r\n    {\r\n        match\r\n    }) {\r\n    const stage = match.params.stage;\r\n    return (stage === \"2\" ? <PurchasingGroupStage2/> : <PurchasingGroupStage1/>)\r\n}\r\n\r\nPurchasingGroupStageNr.propTypes = {}\r\n\r\nexport default PurchasingGroupStageNr;\r\n\t\r\n","import React from 'react'\r\nimport {Redirect, Route, Switch} from \"react-router-dom\";\r\nimport RouterPath from \"../../../../libs/RouterPath\";\r\nimport NotFound from \"../../../NotFound/NotFound\";\r\nimport PurchasingGroupStageNr from \"./PurchasingGroupStageNr\";\r\nimport EmailListPanel from \"../../MyProcedure/scenes/emailList/EmailListPanel\";\r\n\r\n\r\nconst rp = RouterPath.purchasingGroup;\r\n\r\nfunction PurchasingGroupStagesRouter(\r\n    {\r\n        match\r\n    }) {\r\n    const groupId = match.params.id;\r\n\r\n    return (\r\n        <Switch>\r\n            <Route path={rp.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR_SECTION} component={PurchasingGroupStageNr}/>\r\n            <Route path={rp.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR} component={PurchasingGroupStageNr}/>\r\n            <Route path={rp.MP_PURCHASING_GROUP_GROUP_ID_EMAIL_LIST} component={EmailListPanel}/>\r\n            <Route exact path={rp.MP_PURCHASING_GROUP_GROUP_ID}>\r\n                <Redirect to={groupId ? RouterPath.createPath(rp.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n                    id: groupId,\r\n                    stage: 1\r\n                }) : RouterPath.createPath(rp.MP_PURCHASING_GROUP_LIST)} push={false}/>\r\n            </Route>\r\n            <Route exact path={rp.MP_PURCHASING_GROUP_GROUP_ID_STAGE}>\r\n                <Redirect to={groupId ? RouterPath.createPath(rp.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {\r\n                    id: groupId,\r\n                    stage: 1\r\n                }) : RouterPath.createPath(rp.MP_PURCHASING_GROUP_LIST)} push={false}/>\r\n            </Route>\r\n            <Route component={NotFound}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nPurchasingGroupStagesRouter.propTypes = {}\r\n\r\nexport default PurchasingGroupStagesRouter;\r\n\t\r\n","import React from 'react'\r\nimport {AppBar, Grid, Typography} from '@material-ui/core';\r\nimport Tr from 'translations/Translations';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PropTypes from \"prop-types\";\r\nimport {getUserFullNameWithDeputy} from \"libs/userNameGetter\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        borderBottom: `solid 1px ${theme.palette.primary.main}`,\r\n        padding: theme.spacing(2),\r\n        backgroundColor: theme.palette.background.greyBackground,\r\n    }\r\n}))\r\n\r\nfunction PurchaserGroupInfoBar(\r\n    {\r\n        purchaserGroupHeader\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return (\r\n        <>\r\n            <AppBar\r\n                id='appBar'\r\n                className={classes.root}\r\n                component='div'\r\n                elevation={0}\r\n                position='relative'\r\n            >\r\n                <Grid\r\n                    container\r\n                    direction='column'\r\n                >\r\n                    <Typography>\r\n                        <b>{Tr('name')}:{' '}</b>{purchaserGroupHeader.name}\r\n                    </Typography>\r\n                    <Typography>\r\n                        <b>{Tr('demand_number')}:{' '}</b>{purchaserGroupHeader.number}\r\n                    </Typography>\r\n                    <Typography>\r\n                        <b>{Tr('purchasing_group_author')}:{' '}</b>{getUserFullNameWithDeputy(purchaserGroupHeader.author)}\r\n                    </Typography>\r\n                </Grid>\r\n            </AppBar>\r\n        </>\r\n    )\r\n}\r\n\r\nPurchaserGroupInfoBar.propTypes = {\r\n    purchaserGroupHeader: PropTypes.object.isRequired\r\n}\r\n\r\n\r\nexport default PurchaserGroupInfoBar;\r\n","import React from 'react'\r\nimport {AppBar} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport StageElement from './components/StageElement';\r\nimport GridBlock from 'components/GridBlock';\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        backgroundColor: theme.palette.background.paper,\r\n        top: 64,\r\n        zIndex: 1099\r\n    },\r\n    gridItem: {\r\n        flexGrow: 1\r\n    },\r\n    modification: {\r\n        fontWeight: 400\r\n    }\r\n}))\r\n\r\nexport const createStageBarElement = (label, path, current, historyPush = true, label2, onClick) => ({label, path, current, historyPush, label2, onClick})\r\n\r\nfunction StageBarCommon(\r\n    {\r\n        location,\r\n        elements\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    const stageClick = ({onClick, path, historyPush}) => {\r\n        if (onClick) {\r\n            onClick();\r\n        } else if (path) {\r\n            if (historyPush)\r\n                RouterPath.redirect(path);\r\n            else\r\n                RouterPath.redirectWithoutHistory(path);\r\n        }\r\n    }\r\n\r\n    return (\r\n        <AppBar\r\n            id='stageBar'\r\n            component='div'\r\n            elevation={0}\r\n            position='sticky'\r\n            className={classes.root}\r\n        >\r\n            <GridBlock\r\n                itemClassName={classes.gridItem}\r\n            >\r\n                {elements.map((element, i) => {\r\n                    const {label, path, current, label2, onClick} = element;\r\n                    return (\r\n                        <StageElement\r\n                            key={i}\r\n                            current={current}\r\n                            onClick={onClick || path ? () => stageClick(element) : undefined}\r\n                        >\r\n                            {label} {!!label2 && <span className={classes.modification}>({label2})</span>}\r\n                        </StageElement>\r\n                    )\r\n                })}\r\n            </GridBlock>\r\n        </AppBar>\r\n    )\r\n}\r\n\r\nStageBarCommon.propTypes = {\r\n    elements: PropTypes.arrayOf(PropTypes.shape({\r\n        label: PropTypes.string.isRequired,\r\n        path: PropTypes.string,\r\n        current: PropTypes.bool,\r\n        historyPush: PropTypes.bool,\r\n        label2: PropTypes.string,\r\n        onClick: PropTypes.func\r\n    }))\r\n}\r\n\r\nexport default StageBarCommon;","import Tr from \"translations/Translations\";\r\n\r\nexport const PurchasingGroupStatus = {\r\n    PREPARING: 'PREPARING',\r\n    DATA_COLLECTION: 'DATA_COLLECTION',\r\n    REALIZATION: \"REALIZATION\",\r\n    FINISHED: \"FINISHED\",\r\n    CANCELED: \"CANCELED\"\r\n}\r\nconst _TR_PREFIX = 'purchasing_group_status_';\r\n\r\nexport const PurchasingGroupStatusLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));","import React, {useMemo} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport {withRouter} from \"react-router\";\r\nimport RouterPath from 'libs/RouterPath';\r\nimport StageBarCommon, {createStageBarElement} from \"components/complex/stagebar/StageBarCommon\";\r\nimport {PurchasingGroupStatus} from \"../../constants/PurchasingGroupStatus\";\r\nimport PropTypes from \"prop-types\";\r\nimport {PurchasingGroupRole} from \"../constants/PurchasingGroupRole\";\r\n\r\nconst rps = RouterPath.purchasingGroup;\r\n\r\nfunction PurchaserGroupStageBar(\r\n    {\r\n        match,\r\n        location,\r\n        purchaserGroupHeader\r\n    }) {\r\n    const groupId = match.params.id;\r\n    const stage = match.params.stage;\r\n\r\n    const stageBarElements = useMemo(() => {\r\n        const elems = [];\r\n\r\n        elems[0] = createStageBarElement(\r\n            Tr('purchase_group_stage_1'),\r\n            groupId ? RouterPath.createPath(rps.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {id: groupId, stage: 1}) : undefined,\r\n            stage === \"1\",\r\n            false\r\n        )\r\n        elems[1] = createStageBarElement(\r\n            Tr('purchase_group_stage_2'),\r\n            groupId && purchaserGroupHeader.status !== PurchasingGroupStatus.PREPARING && (purchaserGroupHeader.userRole !== PurchasingGroupRole.MEMBER || purchaserGroupHeader.lastStageStarted >= 5) ? RouterPath.createPath(rps.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {id: groupId, stage: 2}) : undefined,\r\n            stage === \"2\",\r\n            false\r\n        )\r\n        return elems;\r\n\r\n\r\n    }, [stage, groupId, purchaserGroupHeader])\r\n\r\n    return (\r\n        <StageBarCommon elements={stageBarElements}/>\r\n    )\r\n}\r\n\r\nPurchaserGroupStageBar.propTypes = {\r\n    purchaserGroupHeader: PropTypes.object.isRequired\r\n}\r\n\r\nexport default withRouter(PurchaserGroupStageBar);","import React, {useEffect} from 'react'\r\nimport Page from 'components/Page';\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PurchasingGroupStagesRouter from \"./PurchasingGroupStagesRouter\";\r\nimport PurchaserGroupInfoBar from \"./components/PurchaserGroupInfoBar\";\r\nimport {connect} from \"react-redux\";\r\nimport PurchasingGroupStage1Service from \"../../../../services/PurchasingGroupStage1Service\";\r\nimport PurchaserGroupStageBar from \"./components/PurchaserGroupStageBar\";\r\nimport Loading from \"../../../../components/Loading\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    content: {\r\n        padding: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nfunction PurchasingGroupStages(\r\n    {\r\n        match,\r\n        location,\r\n        purchaserGroupHeader\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const groupId = match.params.id;\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupStage1Service.getHeader(groupId);\r\n        return () => {\r\n            PurchasingGroupStage1Service.clearResources(PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID)\r\n        }\r\n    }, [groupId])\r\n\r\n    return (<Page>\r\n        {!purchaserGroupHeader ? <div className={classes.content}><Loading /></div> : <>\r\n\r\n            <PurchaserGroupInfoBar purchaserGroupHeader={purchaserGroupHeader}/>\r\n            <PurchaserGroupStageBar purchaserGroupHeader={purchaserGroupHeader}/>\r\n            <div className={classes.content}>\r\n                <PurchasingGroupStagesRouter match={match}/>\r\n            </div>\r\n        </>}\r\n    </Page>)\r\n}\r\n\r\nPurchasingGroupStages.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    purchaserGroupHeader: state.resources[PurchasingGroupStage1Service.PURCHASING_GROUP_HEADER_RESOURCE_ID]\r\n}), {})(PurchasingGroupStages);\r\n\t\r\n","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {PurchasingGroupStatus, PurchasingGroupStatusLabel} from \"../constants/PurchasingGroupStatus\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    state: {\r\n        width: 200,\r\n    },\r\n    search: {\r\n        width: 350,\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {state: \"\", search: ''}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nconst decisionsList = [{label: Tr('procedure_status_0'), value: \"\"}, ...Object.keys(PurchasingGroupStatus).map(key => ({\r\n    label: PurchasingGroupStatusLabel(key),\r\n    value: key\r\n}))];\r\n\r\nfunction PurchasingGroupSearch(\r\n    {\r\n        searchInProgress,\r\n        doSearch\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState({...EMPTY_SEARCH_OBJECT});\r\n    const [submitState, setSubmitState] = useState(0);\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => value[k])\r\n                .reduce((a, k) => ({...a, [k]: value[k]}), {});\r\n            doSearch(valueFiltered);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        setSubmitState(x => x + 1)\r\n    };\r\n\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (e.key === 'Enter') {\r\n            e.preventDefault();\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <BoldTypography>{Tr('search_box')}</BoldTypography>\r\n            <GridBlock\r\n                alignItems='flex-end'\r\n                className={classes.root}\r\n            >\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('search')}\r\n                    onChange={e => handleChange('search', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.search}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n\r\n                <SimpleSelect\r\n                    className={classes.state}\r\n                    label={Tr('status')}\r\n                    items={decisionsList}\r\n                    value={value.state}\r\n                    onChange={(e) => {\r\n                        handleChange(\"state\", e);\r\n                        handleSubmit();\r\n                    }}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={() => {\r\n                        setValue(EMPTY_SEARCH_OBJECT);\r\n                        handleSubmit()\r\n                    }}/>\r\n                </div>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nPurchasingGroupSearch.propTypes = {\r\n    doSearch: PropTypes.func.isRequired,\r\n    searchInProgress: PropTypes.bool\r\n}\r\n\r\n\r\nexport default PurchasingGroupSearch;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from \"components/Page\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport PurchasingGroupStage1Service from \"services/PurchasingGroupStage1Service\";\r\nimport Pagination from \"components/Pagination\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport Loading from \"components/Loading\";\r\nimport Workspace from \"components/Workspace\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {PurchasingGroupStatus, PurchasingGroupStatusLabel} from \"../constants/PurchasingGroupStatus\";\r\nimport PurchasingGroupSearch from \"./PurchasingGroupSearch\";\r\nimport Button from \"components/Button\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    numberColumn: {\r\n        width: 120,\r\n        wordBreak: 'break-all'\r\n    },\r\n    typeColumn: {\r\n        width: 170\r\n    },\r\n    dateTimeColumn: theme.components.table.dateTimeColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    nameColumn: {\r\n        wordBreak: \"break-all\",\r\n        paddingRight: theme.spacing(2),\r\n    },\r\n}));\r\n\r\nfunction PurchasingGroupList(\r\n    {\r\n        match,\r\n        member\r\n    }\r\n) {\r\n    const classes = useStyles();\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig, setSortConfig} = useSearch({\r\n        sort: {\r\n            column: 'dateInserted',\r\n            direction: 'desc',\r\n        }\r\n    });\r\n    const [purchasingGroupList, setPurchasingGroupList] = useState(false);\r\n    const [actions, setActions] = useState({});\r\n    const [working, setWorking] = useState();\r\n\r\n    useEffect(() => {\r\n        if (!member)\r\n            PurchasingGroupStage1Service.getPurchasingGroupListActions().then((resp) => setActions(resp || {}))\r\n    }, [member])\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        const promise = member ? PurchasingGroupStage1Service.getPurchasingGroupMemberList(searchData) : PurchasingGroupStage1Service.getPurchasingGroupList(searchData);\r\n        promise.then((resp) => {\r\n            setTotalCount(resp.totalCount)\r\n            setPurchasingGroupList(resp);\r\n        }).finally(() => setWorking(false));\r\n        // eslint-disable-next-line\r\n    }, [searchData]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (purchasingGroupList?.totalCount !== undefined) {\r\n            setTotalCount(purchasingGroupList.totalCount)\r\n        }\r\n    }, [purchasingGroupList]);\r\n\r\n    const goToGroup = (x, section) => {\r\n        let stage = 2;\r\n        if (PurchasingGroupStatus.PREPARING === x.status || (member && x.lastStageStarted < 5)) {\r\n            stage = 1;\r\n        }\r\n\r\n        const path = section ? RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR_SECTION, {\r\n                id: x.identity,\r\n                stage: stage,\r\n                section: section\r\n            })\r\n            :\r\n            RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR, {id: x.identity, stage: stage});\r\n        RouterPath.redirect(path)\r\n    }\r\n\r\n    const handleSortChange = (id) => {\r\n        let direction = 'desc';\r\n        const active = searchData.sort.column === id;\r\n        if (active) {\r\n            direction = searchData.sort.direction === 'asc' ? 'desc' : 'asc';\r\n        }\r\n\r\n        setSortConfig({\r\n            column: id,\r\n            direction\r\n        })\r\n    }\r\n\r\n    const getSortProps = (id) => {\r\n        return {\r\n            active: searchData.sort.column === id,\r\n            direction: searchData.sort.direction,\r\n            onClick: () => {\r\n                handleSortChange(id)\r\n            }\r\n        }\r\n    }\r\n\r\n    const getHeaders = () => {\r\n        const headers = [];\r\n        headers.push({\r\n            value: Tr('demand_number'),\r\n            sort: getSortProps('number')\r\n        });\r\n        headers.push({\r\n            value: Tr('name'),\r\n            sort: getSortProps('name')\r\n        });\r\n        headers.push({\r\n            value: Tr('add_data'),\r\n            sort: getSortProps('dateInserted')\r\n        });\r\n        headers.push({\r\n            value: Tr('status'),\r\n            sort: getSortProps('state')\r\n        });\r\n        headers.push('');\r\n        return headers;\r\n    };\r\n\r\n    return (<Page className={classes.root}>\r\n        <Workspace\r\n            title={Tr('purchase_groups')}\r\n        >\r\n            {\r\n                !purchasingGroupList ? <Loading/> :\r\n                    <>\r\n                        <GridBlock justify='space-between'>\r\n                            <PurchasingGroupSearch doSearch={setSearchConfig} searchInProgress={working}/>\r\n                            {actions.hasAdd === true && <Button\r\n                                onClick={() => {\r\n                                    goToGroup({identity: 0, status: PurchasingGroupStatus.PREPARING}, 'basic-data')\r\n                                }}\r\n                            >\r\n                                {Tr(\"purchase_group_add\")}\r\n                            </Button>}\r\n                        </GridBlock>\r\n\r\n                        <SimpleTable\r\n                            headers={\r\n                                getHeaders()\r\n                            }\r\n                            items={\r\n                                purchasingGroupList.items.map((x, i) => {\r\n                                    return [\r\n                                        x.number,\r\n                                        x.name,\r\n                                        moment(x.dateModified).format(DateFormats.DATETIME_FORMAT),\r\n                                        x.status ? PurchasingGroupStatusLabel(x.lastStageStarted < 5 ? PurchasingGroupStatus.PREPARING : x.status) : null,\r\n                                        <WorkableIconPreviewButton tooltip={Tr('details')} onClick={() => goToGroup(x)}/>\r\n                                    ]\r\n                                })\r\n                            }\r\n                            columnClasses={\r\n                                [\r\n                                    classes.numberColumn,\r\n                                    classes.nameColumn,\r\n                                    classes.typeColumn,\r\n                                    classes.typeColumn,\r\n                                    classes.buttonColumn,\r\n                                ]\r\n                            }\r\n                        />\r\n                        {\r\n                            !purchasingGroupList.items.length && <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                        }\r\n                        <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n                    </>\r\n            }\r\n        </Workspace>\r\n    </Page>)\r\n}\r\n\r\nPurchasingGroupList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default PurchasingGroupList;","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport PurchasingGroupList from \"./PurchasingGroupList\";\r\n\r\nfunction PurchasingGroupMemberList(\r\n    {\r\n        match\r\n    }\r\n) {\r\n    return <PurchasingGroupList match={match} member/>\r\n}\r\n\r\nPurchasingGroupMemberList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default PurchasingGroupMemberList;","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\nimport applySortParams from \"../libs/applySortParams\";\r\nimport reduxStore from \"redux/store\";\r\nimport {setSaveStatusClosed, setSaveStatusError, setSaveStatusLoading} from \"../redux/actions\";\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport Tr   from \"translations/Translations\";\r\n\r\nconst __get = async (url) => {\r\n    try {\r\n        let res = await RestRequestGET(url)\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst __save = async (url, values) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const resp = await RestRequestPOST(url, values)\r\n        isResponseValid(resp, (e) => {\r\n            throw new Error(e);\r\n        })\r\n        reduxStore.dispatch(setSaveStatusClosed());\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n        reduxStore.dispatch(setSaveStatusError(Tr('internal_server_error')))\r\n    }\r\n}\r\n\r\n\r\nconst getTemplatesList = async (searchData) => {\r\n    const {pagination, search, sort} = searchData;\r\n\r\n    let params = {\r\n        ...pagination\r\n    }\r\n    params = applySearchParams(search, params);\r\n    params = applySortParams(sort, params);\r\n    return await RestRequestGET(Endpoints.PURCHASING_GROUP_TEMPLATES_LIST(), {params});\r\n}\r\n\r\nconst getTemplateListHasEdit = async () => {\r\n    return __get(Endpoints.PURCHASING_GROUP_TEMPLATES_LIST_HAS_EDIT())\r\n}\r\nconst getTemplate = async (templateId) => {\r\n    return __get(Endpoints.PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID(templateId))\r\n}\r\n\r\nconst saveTemplate = async (templateId, values) => {\r\n    return __save(Endpoints.PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID(templateId), values)\r\n}\r\n\r\nconst cloneTemplate = async (templateId) => {\r\n    return RestRequestPOST(Endpoints.PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_CLONE(templateId))\r\n}\r\n\r\nconst deleteTemplate = async (templateId) => {\r\n    return RestRequestDELETE(Endpoints.PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID(templateId))\r\n}\r\nconst activateTemplate = async (templateId) => {\r\n    return RestRequestPUT(Endpoints.PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_ACTIVATE(templateId));\r\n}\r\nconst deactivateTemplate = async (templateId) => {\r\n    return RestRequestPUT(Endpoints.PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID_DEACTIVATE(templateId));\r\n}\r\n\r\n\r\nexport default {\r\n    getTemplatesList,\r\n    getTemplateListHasEdit,\r\n    getTemplate,\r\n    saveTemplate,\r\n    cloneTemplate,\r\n    deleteTemplate,\r\n    activateTemplate,\r\n    deactivateTemplate\r\n}","import React from 'react'\r\nimport ToggleOnIcon from '@material-ui/icons/ToggleOn';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconDeactivateButton(\r\n    {\r\n        tooltip = Tr('deactivate'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={ToggleOnIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconDeactivateButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconDeactivateButton;","import React from 'react'\r\nimport ToggleOffIcon from '@material-ui/icons/ToggleOff';\r\nimport Tr from 'translations/Translations';\r\nimport PropTypes from \"prop-types\";\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\n\r\nfunction WorkableIconActivateButton(\r\n    {\r\n        tooltip = Tr('activate'),\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={ToggleOffIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconActivateButton.propTypes = {\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconActivateButton;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from \"components/Page\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport Pagination from \"components/Pagination\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport Loading from \"components/Loading\";\r\nimport Workspace from \"components/Workspace\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Button from \"components/Button\";\r\nimport PurchasingGroupTemplateService from \"services/PurchasingGroupTemplateService\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport WorkableIconSearchButton from \"components/button/WorkableIconSearchButton\";\r\nimport EditDescriptionPopup, {createEditDescriptionFile} from \"components/popup/EditDescriptionPopup\";\r\nimport WorkableIconDeactivateButton from \"components/button/WorkableIconDeactivateButton\";\r\nimport WorkableIconActivateButton from \"components/button/WorkableIconActivateButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport WorkableIconDuplicateButton from \"components/button/WorkableIconDuplicateButton\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    dateTimeColumn: {\r\n        width: 160,\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    statusColumn: {\r\n        width: 100\r\n    },\r\n    nameColumn: {\r\n        wordBreak: \"break-all\",\r\n        paddingRight: theme.spacing(2),\r\n    },\r\n    error: {\r\n        color: theme.palette.error.main\r\n    },\r\n    success: {\r\n        color: theme.palette.success.main\r\n    }\r\n}));\r\n\r\nfunction PurchasingGroupTemplatesList(\r\n    {\r\n        match\r\n    }\r\n) {\r\n    const classes = useStyles();\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig, setSortConfig} = useSearch({\r\n        sort: {\r\n            column: 'dateInserted',\r\n            direction: 'desc',\r\n        }\r\n    });\r\n    const [templatesList, setTemplatesList] = useState(false);\r\n    const [hasEdit, setHasEdit] = useState(false);\r\n    const [working, setWorking] = useState();\r\n    const [editDescriptionFile, setEditDescriptionFile] = useState(false);\r\n    const [workingIds, setWorkingIds] = useState({});\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        PurchasingGroupTemplateService.getTemplatesList(searchData).then((resp) => {\r\n            setTotalCount(resp.totalCount)\r\n            setTemplatesList(resp);\r\n        }).finally(() => setWorking(false));\r\n        PurchasingGroupTemplateService.getTemplateListHasEdit().then(resp => setHasEdit(resp.success && resp.result));\r\n        // eslint-disable-next-line\r\n    }, [searchData]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (templatesList?.totalCount !== undefined) {\r\n            setTotalCount(templatesList.totalCount)\r\n        }\r\n    }, [templatesList]);\r\n\r\n    const goToTpl = (x) => {\r\n        const path = RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID, {\r\n            id: x.identity\r\n        })\r\n        RouterPath.redirect(path)\r\n    }\r\n\r\n    const handleSortChange = (id) => {\r\n        let direction = 'desc';\r\n        const active = searchData.sort.column === id;\r\n        if (active) {\r\n            direction = searchData.sort.direction === 'asc' ? 'desc' : 'asc';\r\n        }\r\n\r\n        setSortConfig({\r\n            column: id,\r\n            direction\r\n        })\r\n    }\r\n\r\n    const getSortProps = (id) => {\r\n        return {\r\n            active: searchData.sort.column === id,\r\n            direction: searchData.sort.direction,\r\n            onClick: () => {\r\n                handleSortChange(id)\r\n            }\r\n        }\r\n    }\r\n\r\n    const onEditDescriptionFile = (row) => {\r\n        setEditDescriptionFile(createEditDescriptionFile(0, 0,\r\n            row.name, row.description || \"\", true, false, false))\r\n    }\r\n\r\n    const getHeaders = () => {\r\n        const headers = [];\r\n        headers.push({\r\n            value: Tr('name'),\r\n            sort: getSortProps('name')\r\n        });\r\n        headers.push(Tr('description'));\r\n        headers.push({\r\n            value: Tr('modyfication_date'),\r\n            sort: getSortProps('dateModified')\r\n        });\r\n        headers.push({\r\n            value: Tr('status'),\r\n            sort: getSortProps('active')\r\n        });\r\n        headers.push('');\r\n        headers.push('');\r\n        headers.push('');\r\n        headers.push('');\r\n        return headers;\r\n    };\r\n\r\n    const setWorkingId = (row, action) => setWorkingIds({...workingIds, [\"_\" + row.identity]: action});\r\n    const clearWorkingId = (row) => {\r\n        const ids = {...workingIds};\r\n        delete ids[\"_\" + row.identity];\r\n        setWorkingIds(ids)\r\n    }\r\n\r\n    const doDelete = (row) => {\r\n        simpleConfirm(\"confirm_delete_template\", () => {\r\n            setWorkingId(row, \"delete\")\r\n            PurchasingGroupTemplateService.deleteTemplate(row.identity).then(() => {\r\n                setPaginationConfig(searchData.pagination);\r\n            }).finally(() => clearWorkingId(row))\r\n        })\r\n    }\r\n\r\n    const doActivate = (row) => {\r\n        setWorkingId(row, \"activate\")\r\n        PurchasingGroupTemplateService.activateTemplate(row.identity).then((resp) => {\r\n            setTemplatesList({...templatesList, items: templatesList.items.map(x => x.identity === resp.identity ? resp : x)})\r\n        }).finally(() => clearWorkingId(row))\r\n    }\r\n    const doDeactivate = (row) => {\r\n        setWorkingId(row, \"activate\")\r\n        PurchasingGroupTemplateService.deactivateTemplate(row.identity).then((resp) => {\r\n            setTemplatesList({...templatesList, items: templatesList.items.map(x => x.identity === resp.identity ? resp : x)})\r\n        }).finally(() => clearWorkingId(row))\r\n    }\r\n    const doClone = (row) => {\r\n        setWorkingId(row, \"clone\")\r\n        PurchasingGroupTemplateService.cloneTemplate(row.identity).then(resp => {\r\n            if (resp && resp.success) {\r\n                enqueueSuccessSnackbar(Tr('saved'))\r\n                RouterPath.redirect(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID, {\r\n                    id: resp.result\r\n                }))\r\n            }\r\n        }).finally(() => clearWorkingId(row))\r\n    }\r\n\r\n    return (<Page className={classes.root}>\r\n        <Workspace\r\n            title={Tr('purchase_groups_templates')}\r\n        >\r\n            {\r\n                !templatesList ? <Loading/> :\r\n                    <>\r\n                        <GridBlock justify='space-between'>\r\n                            <BasicSearch doSearch={setSearchConfig} searchInProgress={working} label={Tr('search2')}/>\r\n                            <Button\r\n                                disabled={!hasEdit}\r\n                                onClick={() => {\r\n                                    goToTpl({identity: 0})\r\n                                }}\r\n                            >\r\n                                {Tr(\"purchase_groups_templates_add\")}\r\n                            </Button>\r\n                        </GridBlock>\r\n\r\n                        <SimpleTable\r\n                            headers={\r\n                                getHeaders()\r\n                            }\r\n                            items={\r\n                                templatesList.items.map((x, i) => {\r\n                                    return [\r\n                                        x.name,\r\n                                        <WorkableIconSearchButton\r\n                                            onClick={() => onEditDescriptionFile(x)}\r\n                                            tooltip={x.description ? <p className={classes.descriptionTooltip}>{x.description}</p> :\r\n                                                <i>{Tr('no_description')}</i>}\r\n                                        />,\r\n                                        moment(x.dateModified).format(DateFormats.DATETIME_FORMAT),\r\n                                        Tr(x.active ? 'status_active' : 'status_inactive'),\r\n                                        x.active ?\r\n                                            <WorkableIconDeactivateButton className={classes.success} onClick={() => doDeactivate(x)}\r\n                                                                          working={workingIds[\"_\" + x.identity] === \"activate\"}\r\n                                                                          disabled={!x.hasEdit || !!workingIds[\"_\" + x.identity]}/> :\r\n                                            <WorkableIconActivateButton className={classes.error} onClick={() => doActivate(x)}\r\n                                                                        working={workingIds[\"_\" + x.identity] === \"activate\"}\r\n                                                                        disabled={!x.hasEdit || !!workingIds[\"_\" + x.identity]}/>,\r\n                                        <WorkableIconDeleteButton onClick={() => doDelete(x)} working={workingIds[\"_\" + x.identity] === \"delete\"}\r\n                                                                  disabled={x.primary || !x.hasEdit || !!workingIds[\"_\" + x.identity]}/>,\r\n                                        <WorkableIconDuplicateButton onClick={() => doClone(x)} working={workingIds[\"_\" + x.identity] === \"clone\"}\r\n                                                                     disabled={!x.hasEdit || !!workingIds[\"_\" + x.identity]}/>,\r\n                                        <WorkableIconPreviewButton tooltip={Tr('details')} onClick={() => goToTpl(x)}\r\n                                                                   disabled={!!workingIds[\"_\" + x.identity]}/>,\r\n                                    ]\r\n                                })\r\n                            }\r\n                            columnClasses={\r\n                                [\r\n                                    classes.nameColumn,\r\n                                    classes.buttonColumn,\r\n                                    classes.dateTimeColumn,\r\n                                    classes.statusColumn,\r\n                                    classes.buttonColumn,\r\n                                    classes.buttonColumn,\r\n                                    classes.buttonColumn,\r\n                                    classes.buttonColumn,\r\n                                ]\r\n                            }\r\n                        />\r\n                        {\r\n                            !templatesList.items.length && <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                        }\r\n                        <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n\r\n                        {Boolean(editDescriptionFile) &&\r\n                            <EditDescriptionPopup\r\n                                editDescriptionFile={editDescriptionFile}\r\n                                onUpdated={() => setEditDescriptionFile(null)}\r\n                                onClose={() => setEditDescriptionFile(null)}\r\n                                service={{\r\n                                    updateDescription: async () => {\r\n                                    }\r\n                                }}\r\n                            />\r\n                        }\r\n                    </>\r\n            }\r\n        </Workspace>\r\n    </Page>)\r\n}\r\n\r\nPurchasingGroupTemplatesList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default PurchasingGroupTemplatesList;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport IconButton from './IconButton';\r\nimport DragIndicator from '@material-ui/icons/DragHandle';\r\n\r\nfunction IconDragButton({\r\n\ttooltip = Tr('move_part'),\r\n\t...props\r\n}) {\r\n\treturn <IconButton\r\n\t\ttooltip={tooltip}\r\n\t\tIcon={DragIndicator}\r\n\t\t{...props}\r\n\t/>\r\n}\r\n\r\nexport default IconDragButton;","import React from 'react'\r\nimport {SortableHandle as SortableHandleComponent} from 'react-sortable-hoc';\r\nimport IconDragButton from 'components/button/IconDragButton'\r\n\r\nconst SortableHandle = SortableHandleComponent((props) => {\r\n\r\n    return (\r\n        <IconDragButton/>\r\n    )\r\n})\r\n\r\nexport default SortableHandle;","import React, { memo } from 'react'\r\nimport { RadioGroup as RadioGroupUI, FormControl, FormLabel, FormHelperText } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport RadioGroupElement from './RadioGroupElement';\r\nimport Tr from 'translations/Translations';\r\n\r\nimport getObjectValue from 'libs/getObjectValue'\r\nimport { withStyles } from '@material-ui/styles';\r\n\r\nconst style = theme => ({\r\n\terror: {\r\n\t\tmarginTop: 0,\r\n\t\tmarginBottom: theme.spacing(2),\r\n\t}\r\n})\r\n\r\nconst items = [{label: Tr(\"yes\"), value: \"true\"}, {label: Tr(\"no\"), value: \"false\"}]\r\n\r\nfunction RadioGroupYesNo({\r\n\tclasses,\r\n\tformikProps,\r\n\tlabel,\r\n\tid,\r\n\tchildren,\r\n\tclassName,\r\n\trequired,\r\n\tnoError,\r\n\tonChange = ()=> {},\r\n\tdisabled\r\n}) {\r\n\tconst errorValue = getObjectValue(id, formikProps.errors, '')\r\n\tconst touched = getObjectValue(id, formikProps.touched, false)\r\n\tconst value = \"\" + getObjectValue(id, formikProps.values, '')\r\n\tconst editable = getObjectValue('_editable', formikProps.values, true);\r\n\r\n\tconst isError = !noError && (!!errorValue && touched)\r\n\r\n\t// const isError = !!formikProps.errors[id] && formikProps.touched[id]\r\n\tconst helperText = (isError && errorValue) || ' ';\r\n\r\n\tlet _label = label;\r\n\tif (required) _label += '*';\r\n\r\n\treturn (\r\n\t\t<FormControl\r\n\t\t\terror={isError}\r\n\t\t\tclassName={className}\r\n\t\t>\r\n\t\t\t<FormLabel>{_label}</FormLabel>\r\n\t\t\t<RadioGroupUI\r\n\t\t\t\tname={id}\r\n\t\t\t\tonChange={(event) => {\r\n\t\t\t\t\tonChange(event);\r\n\t\t\t\t\tformikProps.handleChange(event);\r\n\t\t\t\t}}\r\n\t\t\t\tonBlur={formikProps.handleBlur}\r\n\t\t\t\t// value={formikProps.values[id]}\r\n\t\t\t\tvalue={value}\r\n\t\t\t>\r\n\t\t\t\t{items.map((item, i) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<RadioGroupElement\r\n\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\tvalue={\"\"+item.value}\r\n\t\t\t\t\t\t\tdisabled={!editable || disabled}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{item.label}\r\n\t\t\t\t\t\t</RadioGroupElement>\r\n\t\t\t\t\t)\r\n\t\t\t\t})}\r\n\t\t\t\t{children}\r\n\t\t\t</RadioGroupUI>\r\n\t\t\t<FormHelperText className={classes.error}>{helperText}</FormHelperText>\r\n\t\t</FormControl>\r\n\t)\r\n}\r\n\r\nRadioGroupYesNo.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tlabel: PropTypes.string,\r\n\tid: PropTypes.string,\r\n\tformikProps: PropTypes.object,\r\n}\r\n\r\nRadioGroupYesNo.defaultProps = {\r\n\titems: []\r\n}\r\n\r\nexport default withStyles(style)(memo(RadioGroupYesNo, (prevProps, nextProps) => {\r\n\tif (prevProps.label !== nextProps.label) return false;\r\n\tif (prevProps.id !== nextProps.id) return false;\r\n\tif (prevProps.disabled !== nextProps.disabled) return false;\r\n\tif (JSON.stringify(prevProps.items) !== JSON.stringify(nextProps.items)) return false;\r\n\tif (prevProps.children !== nextProps.children) return false;\r\n\tconst id = nextProps.id;\r\n\t// if (prevProps.formikProps.values[id] !== nextProps.formikProps.values[id]) return false;\r\n\t// if (prevProps.formikProps.errors[id] !== nextProps.formikProps.errors[id]) return false;\r\n\t// if (prevProps.formikProps.touched[id] !== nextProps.formikProps.touched[id]) return false;\r\n\tif (getObjectValue(id, prevProps.formikProps.values) !== getObjectValue(id, nextProps.formikProps.values)) return false;\r\n\tif (getObjectValue(id, prevProps.formikProps.errors) !== getObjectValue(id, nextProps.formikProps.errors)) return false;\r\n\tif (getObjectValue(id, prevProps.formikProps.touched) !== getObjectValue(id, nextProps.formikProps.touched)) return false;\r\n\treturn true;\r\n}))","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport getObjectValue from 'libs/getObjectValue';\r\nimport TextInput from \"components/TextInput\";\r\nimport Tr from 'translations/Translations'\r\nimport SortableHandle from \"components/complex/sortable/SortableHandle\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport Button from \"components/Button\";\r\nimport {FormHelperText, makeStyles} from \"@material-ui/core\";\r\nimport RadioGroupYesNo from \"components/RadioGroupYesNo\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {PurchasingGroupTemplateFieldType, PurchasingGroupTemplateFieldTypeLabel} from \"../constants/PurchasingGroupTemplateFieldType\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginTop: theme.spacing(2),\r\n        \"&>*:nth-child(1)\": {\r\n            width: 60,\r\n            alignSelf: \"center\"\r\n        },\r\n        \"&>*:nth-child(2)\": {\r\n            width: 25,\r\n            alignSelf: \"center\"\r\n        },\r\n        \"&>*:nth-child(3)\": {\r\n            flexGrow: 1,\r\n            paddingRight: theme.spacing(3)\r\n        },\r\n        \"&>*:nth-child(4)\": {\r\n            width: 120,\r\n            paddingRight: theme.spacing(3)\r\n        },\r\n        \"&>*:nth-child(5)\": {\r\n            paddingRight: theme.spacing(2),\r\n            textAlign: 'center'\r\n        },\r\n        \"&>*:nth-child(6)\": {\r\n            alignSelf: \"center\"\r\n        }\r\n    },\r\n    yesNo: {\r\n        \"&>*.MuiFormGroup-root\": {\r\n            flexDirection: \"row\"\r\n        }\r\n    },\r\n    ol: {\r\n        paddingInlineStart: theme.spacing(2),\r\n        marginLeft: theme.spacing(),\r\n        marginRight: theme.spacing(),\r\n    },\r\n    error: {\r\n        marginTop: theme.spacing(),\r\n        marginBottom: theme.spacing(2),\r\n    }\r\n}))\r\n\r\nfunction PurchasingGroupTemplateField(\r\n    {\r\n        index,\r\n        id,\r\n        setAggregatedFieldId,\r\n        formikProps,\r\n        hasEdit\r\n    }) {\r\n    const fieldId = `${id}.${index}`\r\n    const createId = key => `${fieldId}.${key}`\r\n    const classes = useStyle();\r\n    const field = getObjectValue(fieldId, formikProps.values, {});\r\n    const aggregatedFieldErrorValue = getObjectValue(createId(\"aggregatedFields\"), formikProps.errors, '')\r\n\r\n    const getTooltip = () => {\r\n        if (field && field.aggregatedFields && field.aggregatedFields.length > 0) {\r\n            const fields = getObjectValue(id, formikProps.values, []);\r\n            return <ul className={classes.ol}>{fields.map((x, i) => ({\r\n                ...x,\r\n                order: i + 1\r\n            })).filter(x => field.aggregatedFields.includes(x.uniqueId)).map((x, i) => <li key={i}>{x.order + \". \" + x.name}</li>)}</ul>\r\n        }\r\n    }\r\n\r\n    const onTypeChange = (e) => {\r\n        if (e.target.value !== PurchasingGroupTemplateFieldType.NUMBER) {\r\n            const allFields = getObjectValue(id, formikProps.values, []);\r\n            let updated = false;\r\n            const newAllFields = allFields.map(x => x.type === PurchasingGroupTemplateFieldType.AGGREGATE ? {\r\n                ...x, aggregatedFields:\r\n                    (() => {\r\n                        if (x.aggregatedFields.indexOf(field.uniqueId) > -1) {\r\n                            updated = true;\r\n                            return x.aggregatedFields.filter(y => y !== field.uniqueId);\r\n                        } else {\r\n                            return x.aggregatedFields;\r\n                        }\r\n                    })()\r\n            } : x)\r\n            if (updated) {\r\n                formikProps.setFieldValue(id, newAllFields.map(x => x.uniqueId === field.uniqueId ? {...x, type: e.target.value} : x), true)\r\n            }\r\n        }\r\n    }\r\n\r\n    const doDelete = (e) => {\r\n        const allFields = getObjectValue(id, formikProps.values, []);\r\n        const newAllFields = allFields.filter(x => x.uniqueId !== field.uniqueId).map(x => x.type === PurchasingGroupTemplateFieldType.AGGREGATE ? {\r\n            ...x, aggregatedFields:\r\n                (() => {\r\n                    if (x.aggregatedFields.indexOf(field.uniqueId) > -1) {\r\n                        return x.aggregatedFields.filter(y => y !== field.uniqueId);\r\n                    } else {\r\n                        return x.aggregatedFields;\r\n                    }\r\n                })()\r\n        } : x)\r\n        formikProps.setFieldValue(id, newAllFields, true)\r\n    }\r\n\r\n    return (\r\n        <GridBlock className={classes.root}>\r\n\r\n            <SortableHandle/>\r\n            <BoldTypography className={classes.index}>{index + 1}.</BoldTypography>\r\n            <TextInput\r\n                formikProps={formikProps}\r\n                id={createId('name')}\r\n                label={Tr('name')}\r\n                required\r\n                disabled={!hasEdit}\r\n                multiline\r\n            />\r\n\r\n            <Select\r\n                formikProps={formikProps}\r\n                id={createId('type')}\r\n                label={Tr(\"type\")}\r\n                items={Object.keys(PurchasingGroupTemplateFieldType).map(x => createSelectItem(x, PurchasingGroupTemplateFieldTypeLabel(x)))}\r\n                onChange={onTypeChange}\r\n                disabled={!hasEdit}\r\n            />\r\n\r\n            {\r\n                field.type === \"AGGREGATE\" ?\r\n                    <>\r\n                        <Button disabled={!hasEdit} tooltip={getTooltip()} onClick={() => setAggregatedFieldId(createId('aggregatedFields'))}>\r\n                            {Tr(\"selected_fields\") + \": \" + getObjectValue(createId('aggregatedFields'), formikProps.values, []).length}\r\n                        </Button>\r\n                        <FormHelperText error className={classes.error}>{aggregatedFieldErrorValue}</FormHelperText>\r\n                    </>\r\n                    : <RadioGroupYesNo\r\n                        className={classes.yesNo}\r\n                        formikProps={formikProps}\r\n                        id={createId('required')}\r\n                        label={Tr(\"required_field\")}\r\n                        items={[{value: true, label: Tr(\"yes\")}, {value: false, label: Tr(\"no\")}]}\r\n                        disabled={!hasEdit}\r\n                    />\r\n            }\r\n\r\n            <WorkableIconDeleteButton onClick={doDelete} disabled={!hasEdit} />\r\n\r\n        </GridBlock>\r\n    )\r\n}\r\n\r\nPurchasingGroupTemplateField.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default PurchasingGroupTemplateField;","import React, {useEffect, useRef, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\nimport VS from \"constants/ValidationShema\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport PartsTable from \"components/PartsTable\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport {PurchasingGroupTemplateFieldType} from \"../constants/PurchasingGroupTemplateFieldType\";\r\n\r\nfunction PurchasingGroupTemplateAggregatedFieldsPopup(\r\n    {\r\n        formikProps,\r\n        fieldId,\r\n        onClose,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const sendType = useRef('');\r\n    const [working, setWorking] = useState(true);\r\n    const [fieldsList, setFieldsList] = useState([]);\r\n    const formId = useId();\r\n    const curSelected = getObjectValue(fieldId, formikProps.values, [])\r\n\r\n    const handleSubmit = (type) => {\r\n        sendType.current = type;\r\n        formSubmit[formId]();\r\n    }\r\n\r\n    useEffect(() => {\r\n        const fieldsListTmp = getObjectValue(\"fields\", formikProps.values, [])\r\n            .map((x, i) => ({identity: x.uniqueId, name: x.name, order: i+1, type: x.type}))\r\n            .filter(x => x.type === PurchasingGroupTemplateFieldType.NUMBER);\r\n        setFieldsList(fieldsListTmp);\r\n        setWorking(false)\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n\r\n    const onSubmit = ({uniqueIds}) => {\r\n        const aggregatedFields = Object.keys(uniqueIds).filter(x => uniqueIds[x] === true);\r\n        formikProps.setFieldValue(fieldId, aggregatedFields, true);\r\n        onClose();\r\n\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', working));\r\n        buttons.push(createButton(Tr('save'), () => handleSubmit('save'), undefined, working));\r\n        return buttons;\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            open={true}\r\n            maxWidth='md'\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n        >\r\n            {\r\n                !!fieldsList &&\r\n                <Form\r\n                    initialValues={{\r\n                        uniqueIds: fieldsList.reduce((prev, cur) => {\r\n                            prev[cur.identity] = curSelected.includes(cur.identity);\r\n                            return prev;\r\n                        }, {}),\r\n                    }}\r\n                    validationSchema={Yup.object().shape({\r\n                        uniqueIds: VS.lazy((memberIds) => {\r\n                            const index = Object.keys(memberIds).findIndex(r => memberIds[r] === true);\r\n                            return index === -1 ? VS.immediatelyError(Tr(\"choose_at_least_one\")) : VS.any();\r\n                        })\r\n                    })}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <PartsTable\r\n                            formikProps={formikProps}\r\n                            label={Tr('choose_aggregated_fields')}\r\n                            id=\"uniqueIds\"\r\n                            elementList={fieldsList}\r\n                            orderLabel=\"field_number\"\r\n                        />\r\n                    )}\r\n                </Form>\r\n            }\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(PurchasingGroupTemplateAggregatedFieldsPopup);","import React, {useState} from 'react'\r\nimport {Divider, FormHelperText} from \"@material-ui/core\";\r\nimport TextInput from \"components/TextInput\";\r\nimport Tr from \"translations/Translations\";\r\nimport SortableContainer from \"components/complex/sortable/SortableContainer\";\r\nimport PurchasingGroupTemplateField from \"./PurchasingGroupTemplateField\";\r\nimport PurchasingGroupTemplateAggregatedFieldsPopup from \"./PurchasingGroupTemplateAggregatedFieldsPopup\";\r\nimport Button from \"components/Button\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport PlusOneIcon from \"@material-ui/icons/PlusOne\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\n\r\nfunction PurchasingGroupTemplateForm(\r\n    {\r\n        formikProps,\r\n        hasEdit,\r\n    }) {\r\n\r\n    const [aggregatedFieldId, setAggregatedFieldId] = useState(null);\r\n    const fieldsErrorValue = hasEdit ? getObjectValue(\"fieldsCount\", formikProps.errors, '') : '';\r\n\r\n    const addField = () => {\r\n        const fields = getObjectValue(\"fields\", formikProps.values, []);\r\n        const newFields = [...fields];\r\n        newFields.push({\r\n            identity: 0,\r\n            uniqueId: \"ftf_\" + Math.random().toString(36).substring(2),\r\n            name: \"\",\r\n            ordinalNumber: 0,\r\n            type: \"NUMBER\",\r\n            required: true,\r\n            aggregatedFields: []\r\n        })\r\n        formikProps.setFieldValue(\"fields\", newFields, true)\r\n    }\r\n\r\n\r\n    return <>\r\n        <TextInput\r\n            formikProps={formikProps}\r\n            id=\"name\"\r\n            label={Tr('name')}\r\n            required\r\n            limit={250}\r\n            disabled={!hasEdit}\r\n            multiline\r\n        />\r\n        <TextInput\r\n            formikProps={formikProps}\r\n            id=\"description\"\r\n            label={Tr('description')}\r\n            required\r\n            multiline\r\n            limit={1000}\r\n            disabled={!hasEdit}\r\n        />\r\n\r\n        <BoldTypography>Pola szablonu</BoldTypography>\r\n        <FormHelperText error>{fieldsErrorValue}</FormHelperText>\r\n\r\n        <SortableContainer\r\n            formikProps={formikProps}\r\n            id=\"fields\"\r\n        >\r\n            {(formikProps, id, index) => {\r\n                return (\r\n                    <div>\r\n                        <PurchasingGroupTemplateField\r\n                            id={id}\r\n                            formikProps={formikProps}\r\n                            index={index}\r\n                            setAggregatedFieldId={setAggregatedFieldId}\r\n                            hasEdit={hasEdit}\r\n                        />\r\n                        <Divider />\r\n                    </div>\r\n                )\r\n            }}\r\n        </SortableContainer>\r\n\r\n        {hasEdit &&<Button Icon={PlusOneIcon} onClick={addField}>{Tr(\"add_field\")}</Button>}\r\n\r\n        {\r\n            !!aggregatedFieldId && <PurchasingGroupTemplateAggregatedFieldsPopup fieldId={aggregatedFieldId} formikProps={formikProps} onClose={()=> setAggregatedFieldId(null)} />\r\n        }\r\n    </>\r\n\r\n}\r\n\r\nPurchasingGroupTemplateForm.propTypes = {}\r\n\r\nexport default PurchasingGroupTemplateForm;\r\n\t\r\n","import React, {useEffect, useState} from 'react'\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport Page from \"components/Page\";\r\nimport Workspace from \"components/Workspace\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Button from \"components/Button\";\r\nimport ArrowBackIosIcon from \"@material-ui/icons/ArrowBackIos\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport PurchasingGroupTemplateService from \"services/PurchasingGroupTemplateService\";\r\nimport Form from \"components/Form\";\r\nimport Loading from \"components/Loading\";\r\nimport PurchasingGroupTemplateForm from \"./components/PurchasingGroupTemplateForm\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport SaveIcon from '@material-ui/icons/Save'\r\nimport {connect} from \"react-redux\";\r\nimport {PurchasingGroupTemplateFieldType} from \"./constants/PurchasingGroupTemplateFieldType\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    back: {\r\n        position: \"absolute\"\r\n    },\r\n    save: {\r\n        position: \"absolute\",\r\n        right: 0\r\n    },\r\n    bar: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        top: 67,\r\n        padding: theme.spacing(2),\r\n        backgroundColor: theme.palette.background.paper,\r\n        borderBottom: `solid 1px ${theme.palette.primary.main}`,\r\n    },\r\n}));\r\n\r\nfunction PurchasingGroupTemplate(\r\n    {\r\n        match,\r\n        formSubmit\r\n    }) {\r\n    const classes = useStyles();\r\n    const FORM_ID = \"PURCHASING_GROUP_TEMPLATE\";\r\n    const templateId = match.params.id;\r\n    const [tpl, setTpl] = useState(null);\r\n    const [hasEdit, setHasEdit] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    useEffect(() => {\r\n        PurchasingGroupTemplateService.getTemplate(templateId).then((resp) => {\r\n            if (resp) {\r\n                const {hasEdit, ...other} = resp;\r\n                setTpl(other)\r\n                setHasEdit(hasEdit)\r\n            }\r\n        });\r\n    }, [templateId])\r\n\r\n    const goToList = () => {\r\n        RouterPath.redirect(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_TEMPLATES_LIST))\r\n    }\r\n\r\n    const saveTemplate = (values) => {\r\n        const {fields, fieldsCount, ...other} = values;\r\n        const req = {\r\n            ...other,\r\n            fields: fields.map((x, i) => ({\r\n                ...x,\r\n                ordinalNumber: i + 1,\r\n                aggregatedFields: x.type === PurchasingGroupTemplateFieldType.AGGREGATE ? x.aggregatedFields : null\r\n            }))\r\n        }\r\n        PurchasingGroupTemplateService.saveTemplate(templateId, req).then(resp => {\r\n            if (resp && resp.success) {\r\n                enqueueSuccessSnackbar(Tr('saved'))\r\n                RouterPath.redirect(RouterPath.createPath(RouterPath.purchasingGroup.MP_PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID, {\r\n                    id: resp.result\r\n                }))\r\n            }\r\n        })\r\n\r\n    }\r\n\r\n    return <Page className={classes.root}>\r\n        <Workspace>\r\n            <GridBlock justify=\"space-between\" className={classes.bar}>\r\n                <Button className={classes.back} variant=\"outlined\" Icon={ArrowBackIosIcon} onClick={goToList}>{Tr(\"back_to_list\")}</Button>\r\n                <BoldTypography variant=\"h5\">{Tr(\"purchase_groups_template\")}</BoldTypography>\r\n                {hasEdit ? <Button className={classes.save} Icon={SaveIcon} onClick={() => formSubmit[FORM_ID]()}>{Tr(\"save\")}</Button> : <div></div>}\r\n            </GridBlock>\r\n\r\n\r\n            {\r\n                !tpl ? <Loading/> :\r\n                    <Form\r\n                        id={FORM_ID}\r\n                        initialValues={{...tpl, fieldsCount: \"\"}}\r\n                        validationSchema={\r\n                            VS.lazy((values) => {\r\n                                const {fields} = values;\r\n\r\n                                const obj = {\r\n                                    name: VS.stringMax(250),\r\n                                    description: VS.stringMax(1000),\r\n                                    fields: VS.arrayOf(VS.lazy((field) => {\r\n                                        return VS.object({\r\n                                            name: VS.stringMax(250).test(\r\n                                                'uniqueName',\r\n                                                Tr('v_names_no_unique'),\r\n                                                (formValue, testContext) => {\r\n                                                    const index = fields.findIndex(x => x.name === formValue && field.uniqueId !== x.uniqueId);\r\n                                                    return index === -1;\r\n                                                }\r\n                                            ),\r\n                                            type: VS.string(),\r\n                                            required: VS.requiredBoolean(),\r\n                                            aggregatedFields: VS.any().when(\"type\", {\r\n                                                is: PurchasingGroupTemplateFieldType.AGGREGATE,\r\n                                                then: VS.arrayRequired(),\r\n                                                otherwise: VS.any().strip()\r\n                                            })\r\n\r\n                                        })\r\n                                    })),\r\n                                    fieldsCount: fields.length === 0 ? VS.immediatelyError(Tr(\"required_field\")) : VS.any()\r\n                                }\r\n                                return VS.object(obj);\r\n                            })\r\n                        }\r\n                        onSubmit={saveTemplate}\r\n                    >{(formikProps) => {\r\n                        return <PurchasingGroupTemplateForm hasEdit={hasEdit} formikProps={formikProps}/>\r\n                    }}</Form>\r\n            }\r\n\r\n\r\n        </Workspace></Page>\r\n}\r\n\r\nPurchasingGroupTemplate.propTypes = {}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(PurchasingGroupTemplate);\r\n\t\r\n","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport PurchasingGroupStages from \"./stages/PurchasingGroupStages\";\r\nimport PurchasingGroupList from \"./list/PurchasingGroupList\";\r\nimport PurchasingGroupMemberList from \"./list/PurchasingGroupMemberList\";\r\nimport NotFound from \"../../NotFound/NotFound\";\r\nimport PurchasingGroupTemplatesList from \"./templates/PurchasingGroupTemplatesList\";\r\nimport PurchasingGroupTemplate from \"./templates/PurchasingGroupTemplate\";\r\n\r\nconst rp = RouterPath.purchasingGroup;\r\n\r\nfunction PurchasingGroup() {\r\n\r\n    return (<>\r\n            <Switch>\r\n                <Route exact path={rp.MP_PURCHASING_GROUP}>\r\n                    <Redirect to={rp.MP_PURCHASING_GROUP_LIST} push={false}/>\r\n                </Route>\r\n                <Route path={rp.MP_PURCHASING_GROUP_LIST} component={PurchasingGroupList}/>\r\n                <Route path={rp.MP_PURCHASING_GROUP_MEMBER_LIST} component={PurchasingGroupMemberList}/>\r\n\r\n                <Route exact path={rp.MP_PURCHASING_GROUP_TEMPLATES}>\r\n                    <Redirect to={rp.MP_PURCHASING_GROUP_TEMPLATES_LIST} push={false}/>\r\n                </Route>\r\n                <Route path={rp.MP_PURCHASING_GROUP_TEMPLATES_LIST} component={PurchasingGroupTemplatesList}/>\r\n                <Route path={rp.MP_PURCHASING_GROUP_TEMPLATES_TEMPLATE_ID} component={PurchasingGroupTemplate}/>\r\n\r\n                <Route path={rp.MP_PURCHASING_GROUP_GROUP_ID_STAGE_NR} component={PurchasingGroupStages}/>\r\n                <Route path={rp.MP_PURCHASING_GROUP_GROUP_ID} component={PurchasingGroupStages}/>\r\n                <Route path={rp.MP_PURCHASING_GROUP_GROUP} component={PurchasingGroupStages}/>\r\n\r\n                <Route component={NotFound}/>\r\n            </Switch>\r\n        </>\r\n    )\r\n}\r\n\r\nexport default PurchasingGroup;\r\n\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestGET, RestRequestPOST} from 'libs/RestRequest';\r\nimport applySearchParams from \"../libs/applySearchParams\";\r\nimport applySortParams from \"../libs/applySortParams\";\r\nimport {setResource} from \"../redux/actions\";\r\nimport reduxStore from 'redux/store'\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\n\r\nconst __get = async (url, resourcesName) => {\r\n    try {\r\n        let res = await RestRequestGET(url)\r\n        if (resourcesName) {\r\n            reduxStore.dispatch(setResource(resourcesName, res))\r\n        }\r\n        return res;\r\n    } catch (error) {\r\n    }\r\n}\r\n\r\nconst __save = async (url, values) => {\r\n    try {\r\n        const resp = await RestRequestPOST(url, values)\r\n        isResponseValid(resp, (e) => {\r\n            throw new Error(e);\r\n        })\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e)\r\n    }\r\n}\r\n\r\nconst getRegistrationsList = async (searchData) => {\r\n    const {pagination, search, sort} = searchData;\r\n\r\n    let params = {\r\n        ...pagination\r\n    }\r\n    params = applySearchParams(search, params);\r\n    params = applySortParams(sort, params);\r\n    return await RestRequestGET(Endpoints.ADMIN_USER_REGISTRATION_LIST, {params});\r\n};\r\n\r\nconst acceptRegistration = async (regId, values) => {\r\n    return await __save(Endpoints.ADMIN_USER_REGISTRATION_ID_ACCEPT(regId), values)\r\n}\r\n\r\nconst rejectRegistration = async (regId, values) => {\r\n    return await __save(Endpoints.ADMIN_USER_REGISTRATION_ID_REJECT(regId), values)\r\n}\r\n\r\nconst getRegistration = async (regId) => {\r\n    return await __get(Endpoints.ADMIN_USER_REGISTRATION_ID(regId))\r\n};\r\n\r\n\r\nconst getAvailableOrgs = async () => {\r\n    return await __get(Endpoints.ADMIN_USER_REGISTRATION_AVAILABLE_ORGS)\r\n}\r\n\r\nconst getRegistrationOrganization = async (regId) => {\r\n    return await __get(Endpoints.ADMIN_USER_REGISTRATION_ID_ORGANIZATION(regId))\r\n};\r\n\r\nconst saveRegistrationOrganization = async (regId, values) => {\r\n    return await RestRequestPOST(Endpoints.ADMIN_USER_REGISTRATION_ID_ORGANIZATION(regId), values)\r\n};\r\n\r\nexport default {\r\n    getRegistrationsList,\r\n    getRegistration,\r\n    getAvailableOrgs,\r\n    acceptRegistration,\r\n    rejectRegistration,\r\n    getRegistrationOrganization,\r\n    saveRegistrationOrganization\r\n}","import Tr from \"translations/Translations\";\r\n\r\nexport const RegistrationStatus = {\r\n    NEW: \"NEW\",\r\n    ACCEPTED: \"ACCEPTED\",\r\n    REJECTED: \"REJECTED\"\r\n}\r\nconst _TR_PREFIX = 'registration_status_';\r\n\r\nexport const RegistrationStatusLabel = (status) => (Tr(_TR_PREFIX + status.toLowerCase()));","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Tr from \"translations/Translations\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ClearIcon from \"@material-ui/icons/Clear\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {RegistrationStatus, RegistrationStatusLabel} from \"../constants/RegistrationStatus\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        marginBottom: theme.spacing(2),\r\n        '&>*:not(:first-child):not(:last-child)': {\r\n            marginLeft: theme.spacing(4),\r\n        }\r\n    },\r\n    state: {\r\n        width: 200,\r\n    },\r\n    search: {\r\n        width: 350,\r\n    }\r\n}));\r\n\r\nconst EMPTY_SEARCH_OBJECT = {state: \"\", search: ''}\r\nconst MAX_SEARCH_LENGTH = 100;\r\n\r\nconst decisionsList = [{label: Tr('procedure_status_0'), value: \"\"}, ...Object.keys(RegistrationStatus).map(key => ({\r\n    label: RegistrationStatusLabel(key),\r\n    value: key\r\n}))];\r\n\r\nfunction RegistrationsSearch(\r\n    {\r\n        searchInProgress,\r\n        initSearch,\r\n        doSearch\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [value, setValue] = useState(initSearch ? {...initSearch} : {...EMPTY_SEARCH_OBJECT});\r\n    const [submitState, setSubmitState] = useState(0);\r\n\r\n    useEffect(() => {\r\n        if (submitState && !searchInProgress) {\r\n            const valueFiltered = Object.keys(value)\r\n                .filter((k) => value[k])\r\n                .reduce((a, k) => ({...a, [k]: value[k]}), {});\r\n            doSearch(valueFiltered);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [submitState]);\r\n\r\n    const handleChange = (id, e) => {\r\n        setValue({...value, [id]: e.target.value});\r\n    }\r\n\r\n    const handleSubmit = () => {\r\n        setSubmitState(x => x + 1)\r\n    };\r\n\r\n\r\n    const handleKeyPress = (e) => {\r\n        if (e.key === 'Enter') {\r\n            e.preventDefault();\r\n            handleSubmit()\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <BoldTypography>{Tr('search_box')}</BoldTypography>\r\n            <GridBlock\r\n                alignItems='flex-end'\r\n                className={classes.root}\r\n            >\r\n\r\n                <TextField\r\n                    className={classes.search}\r\n                    label={Tr('search')}\r\n                    onChange={e => handleChange('search', e)}\r\n                    onKeyUp={handleKeyPress}\r\n                    fullWidth\r\n                    value={value.search}\r\n                    inputProps={{maxLength: MAX_SEARCH_LENGTH}}\r\n                />\r\n\r\n                <SimpleSelect\r\n                    className={classes.state}\r\n                    label={Tr('status')}\r\n                    items={decisionsList}\r\n                    value={value.state}\r\n                    onChange={(e) => {\r\n                        handleChange(\"state\", e);\r\n                        handleSubmit();\r\n                    }}\r\n                />\r\n\r\n                <div>\r\n                    <WorkableIconButton Icon={SearchIcon} working={searchInProgress} onClick={handleSubmit} tooltip={Tr('search')}/>\r\n                    <IconButton disabled={searchInProgress} Icon={ClearIcon} tooltip={Tr('clear')} onClick={() => {\r\n                        setValue(EMPTY_SEARCH_OBJECT);\r\n                        handleSubmit()\r\n                    }}/>\r\n                </div>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nRegistrationsSearch.propTypes = {\r\n    doSearch: PropTypes.func.isRequired,\r\n    searchInProgress: PropTypes.bool\r\n}\r\n\r\n\r\nexport default RegistrationsSearch;","import React, {useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from \"components/Page\";\r\nimport useSearch from \"hooks/useSearch\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport Pagination from \"components/Pagination\";\r\nimport Tr from \"translations/Translations\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport Loading from \"components/Loading\";\r\nimport Workspace from \"components/Workspace\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport RegistrationService from \"services/RegistrationService\";\r\nimport RegistrationsSearch from \"./RegistrationsSearch\";\r\nimport {RegistrationStatusLabel} from \"../constants/RegistrationStatus\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    organizationNameColumn: {\r\n        wordBreak: \"break-all\",\r\n        paddingRight: theme.spacing(2),\r\n    },\r\n\r\n    emailColumn: theme.components.table.emailColumn,\r\n    numberColumn: {\r\n        width: 120,\r\n        wordBreak: 'break-all'\r\n    },\r\n    typeColumn: {\r\n        width: 170\r\n    },\r\n    dateTimeColumn: theme.components.table.dateTimeColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n\r\n}));\r\n\r\nfunction RegistrationsList(\r\n    {\r\n        match\r\n    }\r\n) {\r\n    const classes = useStyles();\r\n    const {searchData, totalCount, setTotalCount, setPaginationConfig, setSearchConfig, setSortConfig} = useSearch({\r\n        search: {\r\n            state: \"\",\r\n            search: \"\"\r\n        },\r\n        sort: {\r\n            column: 'dateInserted',\r\n            direction: 'desc',\r\n        }\r\n    });\r\n    const [registrationsList, setRegistrationsList] = useState(false);\r\n    const [working, setWorking] = useState();\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        RegistrationService.getRegistrationsList(searchData).then((resp) => {\r\n            setTotalCount(resp.totalCount)\r\n            setRegistrationsList(resp);\r\n        }).finally(() => setWorking(false));\r\n        // eslint-disable-next-line\r\n    }, [searchData]);\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (registrationsList?.totalCount !== undefined) {\r\n            setTotalCount(registrationsList.totalCount)\r\n        }\r\n    }, [registrationsList]);\r\n\r\n    const goToRegistration = (x) => {\r\n        RouterPath.redirect(RouterPath.createPath(RouterPath.admin.ADMIN_REGISTRATION_ID, {id: x.identity}))\r\n    }\r\n\r\n    const handleSortChange = (id) => {\r\n        let direction = 'desc';\r\n        const active = searchData.sort.column === id;\r\n        if (active) {\r\n            direction = searchData.sort.direction === 'asc' ? 'desc' : 'asc';\r\n        }\r\n\r\n        setSortConfig({\r\n            column: id,\r\n            direction\r\n        })\r\n    }\r\n\r\n    const getSortProps = (id) => {\r\n        return {\r\n            active: searchData.sort.column === id,\r\n            direction: searchData.sort.direction,\r\n            onClick: () => {\r\n                handleSortChange(id)\r\n            }\r\n        }\r\n    }\r\n\r\n    const getHeaders = () => {\r\n        const headers = [];\r\n        headers.push({\r\n            value: Tr('organizational_unit'),\r\n            sort: getSortProps('organizationName')\r\n        });\r\n        headers.push({\r\n            value: Tr('date_of_receipt'),\r\n            sort: getSortProps('dateInserted')\r\n        });\r\n        headers.push({\r\n            value: Tr('date_of_decision'),\r\n            sort: getSortProps('decisionDate')\r\n        });\r\n        headers.push({\r\n            value: Tr('status'),\r\n            sort: getSortProps('status')\r\n        });\r\n        headers.push('');\r\n        return headers;\r\n    };\r\n\r\n    return (<Page className={classes.root}>\r\n        <Workspace\r\n            title={Tr('registration_user_list')}\r\n        >\r\n            {\r\n                !registrationsList ? <Loading/> :\r\n                    <>\r\n                        <RegistrationsSearch initSearch={searchData.search} doSearch={setSearchConfig} searchInProgress={working}/>\r\n\r\n                        <SimpleTable\r\n                            headers={\r\n                                getHeaders()\r\n                            }\r\n                            items={\r\n                                registrationsList.items.map((x, i) => {\r\n                                    return [\r\n                                        x.organizationName,\r\n                                        moment(x.dateInserted).format(DateFormats.DATETIME_FORMAT),\r\n                                        x.decisionDate ? moment(x.decisionDate).format(DateFormats.DATETIME_FORMAT) : null,\r\n                                        x.status ? RegistrationStatusLabel(x.status) : null,\r\n                                        <WorkableIconPreviewButton tooltip={Tr('details')} onClick={() => goToRegistration(x)}/>\r\n                                    ]\r\n                                })\r\n                            }\r\n                            columnClasses={\r\n                                [\r\n                                    classes.organizationNameColumn,\r\n                                    classes.dateTimeColumn,\r\n                                    classes.dateTimeColumn,\r\n                                    classes.numberColumn,\r\n                                    classes.buttonColumn,\r\n                                ]\r\n                            }\r\n                        />\r\n                        {\r\n                            !registrationsList.items.length && <BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography>\r\n                        }\r\n                        <Pagination config={searchData.pagination} setConfig={setPaginationConfig} totalCount={totalCount} disabled={working}/>\r\n                    </>\r\n            }\r\n        </Workspace>\r\n    </Page>)\r\n}\r\n\r\nRegistrationsList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default RegistrationsList;","import React from 'react'\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport PropTypes from \"prop-types\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport Typography from \"components/Typography\";\r\nimport Tr from \"translations/Translations\";\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        borderBottom: \"solid 1px\",\r\n        marginBottom: theme.spacing(3),\r\n        paddingBottom: theme.spacing()\r\n    },\r\n    titleRoot: {\r\n        '&>*:nth-child(1)': {\r\n            flexGrow: 1\r\n        }\r\n    },\r\n    content: {\r\n        marginLeft: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nfunction InfoEntry(\r\n    {\r\n        label,\r\n        className,\r\n        children\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n\r\n    return <div className={clsx(classes.root, className)}>\r\n        <BoldTypography component=\"span\">{`${Tr(label)}: `}</BoldTypography><Typography component=\"span\">{children}</Typography>\r\n    </div>\r\n\r\n}\r\n\r\nInfoEntry.propTypes = {\r\n    label: PropTypes.string.isRequired,\r\n    collapsible: PropTypes.bool\r\n}\r\n\r\nexport default InfoEntry;","import React from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport TextInput from 'components/TextInput';\r\nimport * as Yup from 'yup';\r\nimport validationShema from 'constants/ValidationShema';\r\nimport useId from 'hooks/useId';\r\nimport {connect} from 'react-redux'\r\n\r\nfunction UserRegistrationRejectPopup(\r\n    {\r\n        onClose,\r\n        onReject,\r\n        formSubmit\r\n    }) {\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]()\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('reject')}\r\n            open\r\n            maxWidth={'md'}\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('reject')}\r\n                    onClickFirst={onClose}\r\n                    onClickSecond={handleSubmit}\r\n                />}\r\n        >\r\n            <Form\r\n                initialValues={{\r\n                    rejectionReason: \"\"\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    rejectionReason: validationShema.stringMaxNoRq(500),\r\n                })}\r\n                onSubmit={onReject}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        <TextInput\r\n                            id='rejectionReason'\r\n                            formikProps={formikProps}\r\n                            label={Tr('registration_form_reject_reason')}\r\n                            limit={500}\r\n                            multiline\r\n                        />\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(UserRegistrationRejectPopup);","import React, {useEffect, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport DoubleButton from 'components/popup/components/DoubleButton';\r\nimport useId from 'hooks/useId';\r\nimport RegistrationService from \"services/RegistrationService\";\r\nimport Loading from \"components/Loading\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport {connect} from \"react-redux\";\r\nimport TextInput from \"components/TextInput\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Form from \"components/Form\";\r\nimport Button from \"components/Button\";\r\nimport PlusOneIcon from \"@material-ui/icons/PlusOne\";\r\nimport {FieldArray} from \"formik\";\r\nimport Select, {createSelectItem} from \"components/Select\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport {FormHelperText, makeStyles} from \"@material-ui/core\";\r\nimport isResponseValid from \"../../../../../libs/isResponseValid\";\r\nimport useSnackbar from \"../../../../../hooks/useSnackbar\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    representativeGrid: {\r\n        \"&>*:nth-child(1)\": {\r\n            width: 160,\r\n            marginRight: theme.spacing(3)\r\n        },\r\n        \"&>*:nth-child(2)\": {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(3)\r\n        },\r\n        \"&>*:nth-child(3)\": {\r\n            width: 350,\r\n            marginRight: theme.spacing(3)\r\n        },\r\n        \"&>*:nth-child(4)\": {\r\n            width: 25,\r\n            marginRight: theme.spacing(3)\r\n        },\r\n    }\r\n}))\r\n\r\n\r\nconst EMPTY_REPRESENTATIVE = {identity: 0, title: \"\", name: \"\", role: \"\"}\r\n\r\nfunction UserRegistrationAddOrganizationUnit(\r\n    {\r\n        registrationId,\r\n        onCancel,\r\n        onCreate,\r\n        formSubmit\r\n    }) {\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]()\r\n    const [wrapper, setWrapper] = useState(null);\r\n    const {enqueueErrorSnackbar} = useSnackbar();\r\n\r\n    useEffect(() => {\r\n        RegistrationService.getRegistrationOrganization(registrationId).then(setWrapper);\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const addRepresentative = (arrayHelpers) => {\r\n        arrayHelpers.push(EMPTY_REPRESENTATIVE);\r\n    }\r\n\r\n    const removeRepresentative = (arrayHelpers, index) => {\r\n        arrayHelpers.remove(index);\r\n    }\r\n\r\n    const onSubmit = (values) => {\r\n        RegistrationService.saveRegistrationOrganization(registrationId, values).then((resp) => {\r\n            if(isResponseValid(resp, enqueueErrorSnackbar)) {\r\n                onCreate(resp)\r\n            }\r\n        }).catch(()=> enqueueErrorSnackbar(Tr(\"unknown_error_message\")));\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr('add_organization_unit')}\r\n            open\r\n            maxWidth=\"lg\"\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('add_organization_unit')}\r\n                    onClickFirst={onCancel}\r\n                    onClickSecond={handleSubmit}\r\n                    disabledSecond={!wrapper}\r\n                />}\r\n        >\r\n            {\r\n                !wrapper ? <Loading/> :\r\n                    <Form\r\n                        initialValues={{\r\n                            ...wrapper.organization,\r\n                            fieldsCount: 1\r\n                        }}\r\n                        validationSchema={VS.lazy((values) => {\r\n\r\n                            return VS.object({\r\n                                name: VS.stringMax(200),\r\n                                externalId: VS.stringMax(10),\r\n                                city: VS.stringMax(50),\r\n                                address: VS.stringMax(200),\r\n                                postCode: VS.stringMax(6),\r\n                                phone: VS.phoneOptional(),\r\n                                fax: VS.phoneOptional(),\r\n                                email: VS.emailMaxNoRq(255),\r\n                                nip: VS.vatinPLOptional(),\r\n                                regon: VS.stringMaxNoRq(14),\r\n                                representatives: VS.arrayOfShape({\r\n                                    title: VS.string(),\r\n                                    name: VS.stringMax(250),\r\n                                    role: VS.string()\r\n                                }),\r\n                                fieldsCount: values.representatives.length === 0 ? VS.immediatelyError(Tr(\"required_field\")) : VS.any()\r\n                            })\r\n                        })}\r\n                        onSubmit={onSubmit}\r\n                        id={formId}\r\n                    >\r\n                        {(formikProps) => (\r\n                            <GridBlock column>\r\n                                <TextInput\r\n                                    id='name'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('organization_name')}\r\n                                    limit={200}\r\n                                    required\r\n                                />\r\n                                <TextInput\r\n                                    id='externalId'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('organization_externalId')}\r\n                                    limit={10}\r\n                                    required\r\n                                />\r\n                                <TextInput\r\n                                    id='city'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('city')}\r\n                                    limit={50}\r\n                                    required\r\n                                />\r\n                                <TextInput\r\n                                    id='address'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('address')}\r\n                                    limit={200}\r\n                                    required\r\n                                />\r\n                                <TextInput\r\n                                    id='postCode'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('zip_code')}\r\n                                    limit={6}\r\n                                    required\r\n                                />\r\n                                <TextInput\r\n                                    id='phone'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('phone_number')}\r\n                                    limit={20}\r\n                                />\r\n                                <TextInput\r\n                                    id='fax'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('fax')}\r\n                                    limit={20}\r\n                                />\r\n                                <TextInput\r\n                                    id='email'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('email')}\r\n                                />\r\n                                <TextInput\r\n                                    id='nip'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('nip')}\r\n                                    limit={10}\r\n                                />\r\n                                <TextInput\r\n                                    id='regon'\r\n                                    formikProps={formikProps}\r\n                                    label={Tr('regon')}\r\n                                    limit={14}\r\n                                />\r\n\r\n                                {!!wrapper.representativesTitleDictionary && !!wrapper.representativesRoleDictionary && <FieldArray\r\n                                    name=\"representatives\"\r\n                                    render={(arrayHelpers) => (<>\r\n                                        <BoldTypography>{Tr(\"representatives\")}*</BoldTypography>\r\n\r\n                                        <FormHelperText error>{getObjectValue(\"fieldsCount\", formikProps.errors, null)}</FormHelperText>\r\n\r\n                                        {\r\n                                            getObjectValue(\"representatives\", formikProps.values, [])\r\n                                                .map((x, i) => (<OrganizationUnitRepresentative\r\n                                                    key={i}\r\n                                                    formikProps={formikProps}\r\n                                                    index={i}\r\n                                                    representativesRoleDictionary={wrapper.representativesRoleDictionary}\r\n                                                    representativesTitleDictionary={wrapper.representativesTitleDictionary}\r\n                                                    removeRepresentative={() => removeRepresentative(arrayHelpers, i)}\r\n                                                />))\r\n                                        }\r\n                                        <GridBlock>\r\n                                            <Button Icon={PlusOneIcon} variant=\"outlined\" onClick={() => addRepresentative(arrayHelpers)}>\r\n                                                {Tr('add_representative')}\r\n                                            </Button>\r\n                                        </GridBlock>\r\n                                    </>)}\r\n                                />\r\n                                }\r\n\r\n\r\n                            </GridBlock>\r\n                        )}\r\n                    </Form>\r\n            }\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(UserRegistrationAddOrganizationUnit);\r\n\r\nfunction OrganizationUnitRepresentative(\r\n    {\r\n        formikProps,\r\n        index,\r\n        representativesTitleDictionary,\r\n        representativesRoleDictionary,\r\n        removeRepresentative\r\n\r\n    }) {\r\n    const classes = useStyle();\r\n\r\n    return <>\r\n        <GridBlock className={classes.representativeGrid}>\r\n            <Select\r\n                formikProps={formikProps}\r\n                id={`representatives.${index}.title`}\r\n                label={Tr(\"representative_title\")}\r\n                items={Object.keys(representativesTitleDictionary).map(x => createSelectItem(x, representativesTitleDictionary[x]))}\r\n                required\r\n            />\r\n            <TextInput\r\n                formikProps={formikProps}\r\n                id={`representatives.${index}.name`}\r\n                label={Tr(\"representative_name\")}\r\n                required\r\n            />\r\n            <Select\r\n                formikProps={formikProps}\r\n                id={`representatives.${index}.role`}\r\n                label={Tr(\"representative_role\")}\r\n                items={Object.keys(representativesRoleDictionary).map(x => createSelectItem(x, representativesRoleDictionary[x]))}\r\n                required\r\n            />\r\n            <WorkableIconDeleteButton onClick={removeRepresentative}/>\r\n        </GridBlock>\r\n\r\n    </>\r\n\r\n}","import React, {useEffect, useReducer, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport Workspace from \"components/Workspace\";\r\nimport Page from \"components/Page\";\r\nimport RegistrationService from \"services/RegistrationService\";\r\nimport Loading from \"components/Loading\";\r\nimport InfoEntry from \"./InfoEntry\";\r\nimport moment from \"moment\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport {RegistrationStatusLabel} from \"../constants/RegistrationStatus\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Form from \"components/Form\";\r\nimport VS from 'constants/ValidationShema';\r\nimport PartsTable from \"components/PartsTable\";\r\nimport Tr from \"translations/Translations\";\r\nimport {connect} from \"react-redux\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Button from \"components/Button\";\r\nimport ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport RemoveCircleIcon from '@material-ui/icons/RemoveCircle';\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport OrganizationInput from \"components/OrganizationInput\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport {getUserFullNameWithEmailAndDeputy} from \"libs/userNameGetter\";\r\nimport UserRegistrationRejectPopup from \"./UserRegistrationRejectPopup\";\r\nimport UserRegistrationAddOrganizationUnit from \"./UserRegistrationAddOrganizationUnit\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    margin: {\r\n        marginLeft: theme.spacing(2),\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    column: {\r\n        flex: \"1 0 50%\",\r\n        padding: theme.spacing(2),\r\n        paddingBottom: 0\r\n    },\r\n    backGrid: {\r\n        '&>*:first-child': {\r\n            marginRight: \"auto\"\r\n        }\r\n    },\r\n    attributes: {\r\n        marginLeft: theme.spacing(4)\r\n    },\r\n    back: {\r\n        position: \"absolute\"\r\n    }\r\n\r\n}))\r\n\r\nfunction UserRegistration(\r\n    {\r\n        match,\r\n        formSubmit\r\n    }\r\n) {\r\n\r\n    const classes = useStyles();\r\n    const FORM_ID = \"registration_form\"\r\n    const regId = match.params.id;\r\n    const [registration, setRegistration] = useState();\r\n    const [availableOrganizations, setAvailableOrganizations] = useState([]);\r\n    const [rejectPopup, setRejectPopup] = useState(false);\r\n    const [addOrgPopup, setAddOrgPopup] = useState(false);\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n    const [iconWorks, dispatchIconWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        accept: false,\r\n        reject: false\r\n    });\r\n\r\n    const handleSubmit = () => formSubmit[FORM_ID]();\r\n\r\n    useEffect(() => {\r\n        RegistrationService.getRegistration(regId).then((resp) => {\r\n            setRegistration(resp);\r\n            if (resp && resp.editable && !resp.emailAlreadyUsed) {\r\n                RegistrationService.getAvailableOrgs().then(orgs => setAvailableOrganizations(orgs))\r\n            } else {\r\n                setAvailableOrganizations([]);\r\n            }\r\n\r\n        })\r\n\r\n    }, [regId])\r\n\r\n    const goToList = () => {\r\n        RouterPath.redirect(RouterPath.createPath(RouterPath.admin.ADMIN_REGISTRATIONS_LIST))\r\n    }\r\n\r\n    const getInitValues = () => {\r\n        const initVal = {};\r\n        const curRoles = registration.form.roles || [];\r\n        const roles = registration.availableRoles.reduce((prev, cur) => {\r\n            prev[\"_\" + cur.identity] = curRoles.includes(cur.identity);\r\n            return prev;\r\n        }, {})\r\n        initVal.roles = roles;\r\n\r\n        const attrKeys = Object.keys(registration.availableAttributes);\r\n        for (let attrKey of attrKeys) {\r\n            const selected = registration.form.attributes[attrKey] || [];\r\n            const initAttr = registration.availableAttributes[attrKey].reduce((prev, cur) => {\r\n                prev[cur] = selected.includes(cur);\r\n                return prev;\r\n            }, {})\r\n            initVal[attrKey] = initAttr;\r\n        }\r\n        initVal.organization = registration.form.organization\r\n        return initVal;\r\n    }\r\n\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('back_to_list'), goToList, 'outlined', iconWorks.anyWorks, undefined, false, ArrowBackIosIcon));\r\n        buttons.push(createButton(Tr('reject'), onReject, 'outlined', !registration.editable || iconWorks.anyWorks, undefined, iconWorks.reject, RemoveCircleIcon));\r\n        buttons.push(createButton(Tr('accept'), handleSubmit, undefined, registration.emailAlreadyUsed || !registration.editable || iconWorks.anyWorks, undefined, iconWorks.accept, CheckCircleIcon));\r\n        return buttons;\r\n    }\r\n\r\n    const onSubmit = (values) => {\r\n\r\n        simpleConfirm(\"registration_form_accept_confirm\", () => {\r\n            const {organization, roles, ...rest} = values;\r\n            const form = {\r\n                orgId: organization.orgId,\r\n                roles: Object.keys(roles).filter(k => roles[k] === true).map(k => parseInt(k.substring(1)))\r\n            }\r\n            const attributes = {}\r\n            for (let key of Object.keys(rest)) {\r\n                attributes[key] = Object.keys(rest[key]).filter(k => rest[key][k] === true)\r\n            }\r\n            form.attributes = attributes;\r\n\r\n            dispatchIconWorks({type: 'accept', works: true})\r\n            RegistrationService.acceptRegistration(regId, form).then(resp => {\r\n                if (resp && resp.success) {\r\n                    enqueueSuccessSnackbar(Tr(\"registration_form_accepted\"));\r\n                    goToList();\r\n                } else {\r\n                    enqueueErrorSnackbar(Tr('unknown_error_message'))\r\n                    dispatchIconWorks({type: 'accept', works: false})\r\n                }\r\n            }).catch(() => {\r\n                enqueueErrorSnackbar(Tr('unknown_error_message'));\r\n                dispatchIconWorks({type: 'accept', works: false})\r\n            });\r\n        })\r\n    }\r\n\r\n    const onReject = () => {\r\n        setRejectPopup(true);\r\n    }\r\n    const doReject = (values) => {\r\n        setRejectPopup(false);\r\n        dispatchIconWorks({type: 'reject', works: true})\r\n        RegistrationService.rejectRegistration(regId, values).then(resp => {\r\n            if (resp && resp.success) {\r\n                enqueueSuccessSnackbar(Tr(\"registration_form_rejected\"));\r\n                goToList();\r\n            } else {\r\n                enqueueErrorSnackbar(Tr('unknown_error_message'))\r\n                dispatchIconWorks({type: 'reject', works: false})\r\n            }\r\n        }).catch(() => {\r\n            enqueueErrorSnackbar(Tr('unknown_error_message'));\r\n            dispatchIconWorks({type: 'reject', works: false})\r\n        })\r\n    }\r\n\r\n    const selectOrganization = (formikProps, org) => {\r\n        formikProps.setFieldValue(\"organization\", org);\r\n        setAvailableOrganizations([...availableOrganizations, org])\r\n        setAddOrgPopup(false)\r\n    }\r\n\r\n    return (<Page className={classes.root}>\r\n        <Workspace>\r\n            <GridBlock justify=\"space-between\">\r\n                <Button className={classes.back} variant=\"outlined\" Icon={ArrowBackIosIcon} onClick={goToList}\r\n                        disabled={iconWorks.anyWorks}>{Tr(\"back_to_list\")}</Button>\r\n                <BoldTypography variant=\"h5\">{Tr(\"registration_form\")}</BoldTypography>\r\n                <div></div>\r\n            </GridBlock>\r\n            {(!registration || !availableOrganizations) ? <Loading/> :\r\n                <>\r\n                    {!!registration.emailAlreadyUsed && <>\r\n                        <BoldTypography color=\"error\">{Tr(\"registration_email_already_used\")}</BoldTypography>\r\n                        {!!registration.editable && <Button Icon={RemoveCircleIcon} onClick={onReject} disabled={iconWorks.anyWorks}>{Tr(\"reject\")}</Button>}\r\n                    </>}\r\n\r\n                    <GridBlock itemClassName={classes.column}>\r\n                        <div>\r\n                            <InfoEntry label=\"firstName\">{registration.form.firstName}</InfoEntry>\r\n                            <InfoEntry label=\"email\">{registration.form.email}</InfoEntry>\r\n                            <InfoEntry label=\"organizational_unit\">{registration.form.organizationName}</InfoEntry>\r\n                            <InfoEntry label=\"regon\">{registration.form.regon}</InfoEntry>\r\n                            <InfoEntry label=\"city\">{registration.form.city}</InfoEntry>\r\n                        </div>\r\n                        <div>\r\n                            <InfoEntry label=\"lastName\">{registration.form.lastName}</InfoEntry>\r\n                            <InfoEntry label=\"phone\">{registration.form.phone}</InfoEntry>\r\n                            <InfoEntry label=\"nip\">{registration.form.nip}</InfoEntry>\r\n                            <InfoEntry label=\"address\">{registration.form.address}</InfoEntry>\r\n                            <InfoEntry label=\"zip_code\">{registration.form.postCode}</InfoEntry>\r\n                        </div>\r\n                    </GridBlock>\r\n\r\n                    <InfoEntry className={classes.margin} label=\"notes\">{registration.form.notes}</InfoEntry>\r\n                    <InfoEntry className={classes.margin}\r\n                               label=\"date_of_receipt\">{moment(registration.form.dateInserted).format(DateFormats.DATETIME_FORMAT)}</InfoEntry>\r\n                    <InfoEntry className={classes.margin}\r\n                               label=\"status\">{registration.form.status ? RegistrationStatusLabel(registration.form.status) : null}</InfoEntry>\r\n                    {!!registration.form.decisionDate &&\r\n                        <InfoEntry className={classes.margin}\r\n                                   label=\"date_of_decision\">{moment(registration.form.decisionDate).format(DateFormats.DATETIME_FORMAT)}</InfoEntry>\r\n                    }\r\n                    {!!registration.form.decisionUser &&\r\n                        <InfoEntry className={classes.margin}\r\n                                   label=\"decision_user\">{getUserFullNameWithEmailAndDeputy(registration.form.decisionUser)}</InfoEntry>\r\n                    }\r\n                    <Form\r\n                        id={FORM_ID}\r\n                        initialValues={getInitValues()}\r\n                        validationSchema={VS.object({\r\n                            organization: VS.anyRequired(),\r\n                            roles: VS.lazy((roles) => {\r\n                                const index = Object.keys(roles).findIndex(r => roles[r] === true);\r\n                                return index === -1 ? VS.immediatelyError(Tr(\"choose_at_least_one_role\")) : VS.any();\r\n                            })\r\n                        })}\r\n                        onSubmit={onSubmit}>\r\n                        {(formikProps) => (<>\r\n\r\n                            <GridBlock justify=\"space-between\">\r\n\r\n                                <OrganizationInput\r\n                                    formikProps={formikProps}\r\n                                    id=\"organization\"\r\n                                    availableOrganizations={availableOrganizations}\r\n                                    disabled={registration.emailAlreadyUsed || !registration.editable || iconWorks.anyWorks}\r\n                                    required\r\n                                />\r\n                                <Button disabled={registration.emailAlreadyUsed || !registration.editable || iconWorks.anyWorks} onClick={() => setAddOrgPopup(true)}>{Tr(\"add_organization_unit\")}</Button>\r\n                            </GridBlock>\r\n\r\n                            <PartsTable\r\n                                formikProps={formikProps}\r\n                                id=\"roles\"\r\n                                label={Tr('system_role')}\r\n                                elementList={registration.availableRoles.map(r => ({identity: \"_\" + r.identity, name: r.name}))}\r\n                                required={false}\r\n                                disabled={registration.emailAlreadyUsed || !registration.editable || iconWorks.anyWorks}\r\n                            />\r\n\r\n                            {Object.keys(registration.availableAttributes).length > 0 &&\r\n                                <>\r\n                                    <BoldTypography variant=\"h6\">{Tr(\"attributes\")}</BoldTypography>\r\n                                    <div className={classes.attributes}>\r\n                                        {\r\n                                            Object.keys(registration.availableAttributes).map(a => (\r\n\r\n                                                <PartsTable\r\n                                                    key={a}\r\n                                                    formikProps={formikProps}\r\n                                                    id={a}\r\n                                                    label={a}\r\n                                                    elementList={registration.availableAttributes[a].map(r => ({identity: r, name: r}))}\r\n                                                    required={false}\r\n                                                    disabled={registration.emailAlreadyUsed || !registration.editable || iconWorks.anyWorks}\r\n                                                />\r\n                                            ))\r\n                                        }\r\n                                    </div>\r\n\r\n                                </>}\r\n                            <MultiButton className={classes.backGrid} buttons={getButtons()}/>\r\n                            {addOrgPopup && <UserRegistrationAddOrganizationUnit registrationId={regId}  onCreate={(val) => selectOrganization(formikProps, val)} onCancel={() => setAddOrgPopup(false)}/>}\r\n                        </>)}\r\n                    </Form>\r\n                    {rejectPopup && <UserRegistrationRejectPopup onReject={doReject} onClose={() => setRejectPopup(false)}/>}\r\n                </>\r\n            }\r\n        </Workspace>\r\n    </Page>)\r\n}\r\n\r\nUserRegistration.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({formSubmit: state.form}), {})(UserRegistration);","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from \"../../NotFound/NotFound\";\r\nimport RegistrationsList from \"./registrations/list/RegistrationsList\";\r\nimport UserRegistration from \"./registrations/registration/UserRegistration\";\r\n\r\nconst rp = RouterPath.admin;\r\n\r\nfunction Admin() {\r\n\r\n    return (<>\r\n            <Switch>\r\n                <Route exact path={rp.ADMIN_REGISTRATIONS}>\r\n                    <Redirect to={rp.ADMIN_REGISTRATIONS_LIST} push={false}/>\r\n                </Route>\r\n                <Route path={rp.ADMIN_REGISTRATIONS_LIST} component={RegistrationsList}/>\r\n                <Route path={rp.ADMIN_REGISTRATION_ID} component={UserRegistration}/>\r\n                <Route component={NotFound}/>\r\n            </Switch>\r\n        </>\r\n    )\r\n}\r\n\r\nexport default Admin;\r\n\r\n","import React, {useContext, useRef} from 'react'\r\nimport {useParams} from \"react-router\";\r\nimport {makeStyles, Tooltip} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport ExpansionPanel from 'components/ExpansionPanel';\r\nimport ArrowIcon from '@material-ui/icons/KeyboardArrowUp'\r\nimport clsx from 'clsx';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Tr from 'translations/Translations';\r\nimport {StageSectionsUrlParams, StageSectionParamToSectionName, StageSectionsComponents, StageSectionsTitles} from \"../../constants/StageSections\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {OfferSectionProvider} from \"context/OfferSectionContext\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport {connect} from \"react-redux\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    rotate: {\r\n        transform: 'rotate(180deg)'\r\n    },\r\n    adornmentGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 1,\r\n            marginRight: theme.spacing(2)\r\n        }\r\n    },\r\n    titleGrid: {\r\n        '&>*:first-child': {\r\n            flexGrow: 10000,\r\n        }\r\n    }\r\n}))\r\n\r\nfunction OfferExpansionSections(\r\n    {\r\n        section,\r\n        stateCloseValidator\r\n    }) {\r\n    const classes = useStyle();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const openedSectionParam = params.section;\r\n    const openedSection = openedSectionParam ? StageSectionParamToSectionName[openedSectionParam] : undefined;\r\n    const expanded = openedSection === section.section;\r\n    const panelRef = useRef();\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n\r\n    const handleClick = id => {\r\n\r\n        if (section.status === DemandValidationSectionStatus.DISABLED)\r\n            return false;\r\n\r\n\r\n        if (stateCloseValidator && !stateCloseValidator()) {\r\n            simpleConfirm(\"modification_cancel_popup_text\", () => {\r\n                doHandleClick(id)\r\n            })\r\n        } else {\r\n            doHandleClick(id)\r\n        }\r\n    }\r\n\r\n    const doHandleClick = id => {\r\n        if (openedSection === id) {\r\n            if (purchaserOfferContext) {\r\n                RouterPath.redirectWithoutHistory(\r\n                    RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID, {\r\n                        id: demandId,\r\n                        contractorDepartmentId: purchaserOfferContext.contractorDepartmentId,\r\n                        stageId\r\n                    })\r\n                )\r\n            } else {\r\n                    RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID,\r\n                        {id: demandId, stageId}))\r\n            }\r\n        } else {\r\n            if (purchaserOfferContext) {\r\n                RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID_SECTION, {\r\n                    id: demandId,\r\n                    contractorDepartmentId: purchaserOfferContext.contractorDepartmentId,\r\n                    stageId,\r\n                    section: StageSectionsUrlParams[id]\r\n                }))\r\n            } else {\r\n                RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION, {\r\n                    id: demandId,\r\n                    stageId,\r\n                    section: StageSectionsUrlParams[id]\r\n                }))\r\n            }\r\n        }\r\n    }\r\n\r\n    const Component = StageSectionsComponents[section.section];\r\n    const TitleComponent = StageSectionsTitles[section.section];\r\n    return (\r\n        <ExpansionPanel\r\n            panelRef={panelRef}\r\n            id={section.section}\r\n            title={<TitleComponent expanded={expanded} section={section}/>}\r\n            classesObj={{titleGrid: classes.titleGrid}}\r\n            titleAdornment={\r\n                <GridBlock\r\n                    wrap='nowrap'\r\n                    className={classes.adornmentGrid}\r\n                    alignItems='center'\r\n                >\r\n                    <div/>\r\n                    {section.status !== DemandValidationSectionStatus.DISABLED &&\r\n                        <Tooltip title={expanded ? Tr('collapse') : Tr('expand')} placement='top'>\r\n                            <ArrowIcon\r\n                                className={clsx({\r\n                                    [classes.rotate]: !expanded\r\n                                })}\r\n                            />\r\n                        </Tooltip>}\r\n                </GridBlock>\r\n            }\r\n            expanded={expanded}\r\n            onChange={() => handleClick(section.section)}\r\n        >\r\n            {expanded && <OfferSectionProvider value={section}>\r\n                <Component panelRef={panelRef} sectionId={section.section}/>\r\n            </OfferSectionProvider>}\r\n        </ExpansionPanel>\r\n    )\r\n\r\n}\r\n\r\nOfferExpansionSections.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    stateCloseValidator: state.stepper.stateCloseValidator}))(OfferExpansionSections);","import React, {useEffect, useState} from 'react';\r\nimport Dialog from \"components/Dialog\";\r\nimport {TextField} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport SingleButton from \"components/popup/components/SingleButton\";\r\nimport {connect} from \"react-redux\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Typography from \"components/Typography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport {ContractorPasswordState} from \"constants/ContractorPasswordState\";\r\nimport {useParams} from \"react-router\";\r\n\r\n\r\nconst DefineOfferPasswordPopup = (\r\n    {\r\n        popupConfig\r\n    }) => {\r\n    const params = useParams();\r\n    const [passwordInfo, setPasswordInfo] = useState(null);\r\n    const [error, setError] = useState(null);\r\n    const [working, setWorking] = useState(false);\r\n    const [password, setPassword] = useState(\"\");\r\n    const [passwordError, setPasswordError] = useState(null);\r\n\r\n\r\n    useEffect(() => {\r\n        if (popupConfig) {\r\n            DemandOffersService.getPasswordStatus(params.id, params.stageId)\r\n                .then((resp) => {\r\n                    if (isResponseValid(resp, setError)) {\r\n                        if (resp.result.state === ContractorPasswordState.HAS_PASSWORD_STORED) {\r\n                            onSuccess();\r\n                        }\r\n                        setPasswordInfo(resp.result)\r\n                    }\r\n                })\r\n                .catch(onError);\r\n        } else {\r\n            setPasswordInfo(null);\r\n            setError(null);\r\n            setWorking(false);\r\n            setPassword(\"\");\r\n            setPasswordError(null);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [popupConfig])\r\n\r\n    const onError = () => {\r\n        if (popupConfig && popupConfig.errorCallback) popupConfig.errorCallback();\r\n        DemandOffersService.clearResources(DemandOffersService.DEMAND_CONTRACTOR_PASSWORD_POPUP);\r\n    }\r\n    const onSuccess = () => {\r\n        if (popupConfig && popupConfig.successCallback) popupConfig.successCallback();\r\n        DemandOffersService.clearResources(DemandOffersService.DEMAND_CONTRACTOR_PASSWORD_POPUP);\r\n    }\r\n\r\n    const onStorePassword = () => {\r\n        if (working)\r\n            return;\r\n\r\n        setWorking(true);\r\n        DemandOffersService.savePassword(params.id, params.stageId, password).then(resp => {\r\n            if (isResponseValid(resp, setPasswordError)) {\r\n                onSuccess();\r\n            } else {\r\n                setWorking(false);\r\n            }\r\n        }).catch(() => setWorking(false))\r\n\r\n    }\r\n\r\n    const handleKeyUp = (e) => {\r\n        if (e.key === 'Enter') {\r\n            onStorePassword();\r\n        }\r\n    }\r\n\r\n    if (!popupConfig) {\r\n        return null;\r\n    }\r\n    return (<Dialog\r\n        open\r\n        titleCentered\r\n        maxWidth={'md'}\r\n        fullWidth={true}\r\n        onClose={onError}\r\n        dialogActions={<SingleButton\r\n            justify='flex-end'\r\n            label={Tr('cancel')}\r\n            onClick={onError}\r\n            variant=\"outlined\"\r\n            disabled={working}\r\n        />}\r\n        loading={!passwordInfo && !error}\r\n    >\r\n\r\n        {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n        {!!passwordInfo && <>\r\n            <BoldTypography>{passwordInfo.title}</BoldTypography>\r\n            <br/>\r\n            <Typography dangerouslySetInnerHTML={{__html: passwordInfo.messageHtml}}/>\r\n\r\n            {!!passwordError && <Typography color=\"error\">{passwordError}</Typography>}\r\n            <GridBlock\r\n                justify=\"center\"\r\n                alignItems=\"flex-end\"\r\n            >\r\n                <TextField\r\n                    label={Tr('password')}\r\n                    disabled={working}\r\n                    onKeyUp={handleKeyUp}\r\n                    onChange={(e) => setPassword(e.target.value)}\r\n                />\r\n                <WorkableButton\r\n                    working={working} disabled={password === ''} onClick={() => onStorePassword()}>{Tr('confirm')}</WorkableButton>\r\n            </GridBlock>\r\n        </>}\r\n    </Dialog>)\r\n\r\n}\r\n\r\n\r\nDefineOfferPasswordPopup.propTypes = {};\r\n\r\nexport default connect((state) => ({\r\n    popupConfig: state.resources[DemandOffersService.DEMAND_CONTRACTOR_PASSWORD_POPUP]\r\n}))(DefineOfferPasswordPopup);","import React, {useContext} from 'react'\r\nimport {makeStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport {StageSections, StageSectionsOrder} from \"../constants/StageSections\";\r\nimport OfferExpansionSections from \"./common/OfferExpansionSections\";\r\nimport DefineOfferPasswordPopup from \"./common/DefineOfferPasswordPopup\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport Button from \"components/Button\";\r\nimport ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\"\r\nimport PurchaserOfferContext from \"context/PurchaserOfferContext\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {useParams} from \"react-router\";\r\n\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        height: '100%',\r\n        '&>*:not(:first-child)': {\r\n            marginTop: theme.spacing(2)\r\n        }\r\n    }\r\n}))\r\n\r\nfunction OfferSections(\r\n    {\r\n        demandStageSectionsList\r\n    }) {\r\n    const classes = useStyle();\r\n    const purchaserOfferContext = useContext(PurchaserOfferContext)\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n\r\n    const backClick = () => {\r\n        if(demandStageSectionsList[StageSections.DASHBOARD].oldPlatformOfferTabUrl) {\r\n            window.location.href = demandStageSectionsList[StageSections.DASHBOARD].oldPlatformOfferTabUrl;\r\n        } else {\r\n            RouterPath.redirect(RouterPath.createPath(RouterPath.myProcedure.steps.MP_3_ID, {id: demandId}));\r\n        }\r\n    }\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            {\r\n                purchaserOfferContext && <GridBlock justify=\"flex-end\">\r\n                <Button onClick={backClick} Icon={ArrowBackIosIcon} variant={\"outlined\"}>{Tr(\"back_to_demand\")}</Button>\r\n            </GridBlock>\r\n            }\r\n            {StageSectionsOrder.filter((sectionId) => {\r\n                const section = demandStageSectionsList[sectionId];\r\n                return !!section && section.status !== DemandValidationSectionStatus.UNAVAILABLE\r\n            })\r\n                .map((sectionId) => {\r\n                    return (<OfferExpansionSections key={sectionId} section={demandStageSectionsList[sectionId]}/>)\r\n                })}\r\n\r\n            <DefineOfferPasswordPopup />\r\n        </div>\r\n    )\r\n}\r\n\r\nOfferSections.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default OfferSections;","import React, {useCallback, useEffect, useMemo, useState} from 'react'\r\nimport Workspace from \"components/Workspace\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {connect} from 'react-redux'\r\nimport Loading from \"components/Loading\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport OfferSections from \"../../../../contractor/demand/scenes/offer/components/OfferSections\";\r\nimport {PurchaserOfferContextProvider} from \"context/PurchaserOfferContext\";\r\nimport {OfferStageTranslationsContextProvider} from \"context/OfferStageTranslationsContext\";\r\nimport DemandService from \"services/DemandService\";\r\nimport PrivilegeService from \"services/PrivilegeService\";\r\n\r\nfunction PurchaserOfferPanel(\r\n    {\r\n        match,\r\n        demandStagesList,\r\n        demandStageSectionsList\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n    const stageId = match.params.stageId;\r\n    const contractorDepartmentId = match.params.contractorDepartmentId;\r\n    const [stageTranslations, setStageTranslations] = useState({});\r\n    const supplierId = useMemo(() => {\r\n        if (stageId && demandStagesList)\r\n            return (demandStagesList.find(x => x.identity === parseInt(stageId)) || {supplierId: null}).supplierId\r\n    }, [stageId, demandStagesList])\r\n\r\n    useEffect(() => {\r\n        if (demandStagesList) {\r\n            if (!stageId) {\r\n                const href = RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID, {\r\n                    id: demandId,\r\n                    contractorDepartmentId: contractorDepartmentId,\r\n                    stageId: demandStagesList[demandStagesList.length - 1].identity\r\n                });\r\n                RouterPath.redirectWithoutHistory(href);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandStagesList, stageId, contractorDepartmentId])\r\n\r\n\r\n    useEffect(() => {\r\n        DemandOffersService.getStages(demandId, contractorDepartmentId);\r\n        return () => {\r\n            DemandOffersService.clearResources(DemandOffersService.DEMAND_STAGES_LIST);\r\n        }\r\n    }, [demandId, contractorDepartmentId])\r\n\r\n\r\n    useEffect(() => {\r\n        if (stageId && supplierId) {\r\n            DemandOffersService.getStageSections(demandId, stageId, supplierId);\r\n            DemandOffersService.getStageTranslations(demandId, stageId, supplierId).then(resp => setStageTranslations(resp))\r\n            DemandService.getBuyerPrivileges(demandId);\r\n        }\r\n        return () => {\r\n            PrivilegeService.cleanupPrivileges(PrivilegeService.DEMAND_PRIVILEGE_STORE_KEY);\r\n            DemandOffersService.clearResources(DemandOffersService.DEMAND_STAGE_SECTIONS_LIST, supplierId);\r\n        }\r\n    }, [demandId, stageId, supplierId])\r\n\r\n    const getStageTranslation = useCallback((trKey) => {\r\n        return stageTranslations[trKey] || trKey;\r\n    }, [stageTranslations]);\r\n\r\n    return (\r\n        <>\r\n            {(!demandStagesList || !demandStageSectionsList || !supplierId) ? <Loading/> :\r\n                <PurchaserOfferContextProvider value={{contractorDepartmentId: parseInt(contractorDepartmentId), supplierId: supplierId}}>\r\n                    <OfferStageTranslationsContextProvider value={getStageTranslation}>\r\n                        <Workspace\r\n                            render={<>\r\n                                <OfferSections demandStageSectionsList={demandStageSectionsList}/>\r\n                            </>}\r\n                        />\r\n                    </OfferStageTranslationsContextProvider>\r\n                </PurchaserOfferContextProvider>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandStagesList: state.resources[DemandOffersService.DEMAND_STAGES_LIST],\r\n    demandStageSectionsList: state.resources[DemandOffersService.DEMAND_STAGE_SECTIONS_LIST],\r\n}), {})(PurchaserOfferPanel)","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport PurchaserOfferPanel from \"./offer/PurchaserOfferPanel\";\r\n\r\nconst rp = RouterPath.purchaserDemand;\r\n\r\nfunction PurchaserScenesRouter() {\r\n    return (\r\n        <Switch>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID} component={PurchaserOfferPanel}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_PREVIEW} component={PurchaserOfferPanel}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE} component={PurchaserOfferPanel}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID} component={PurchaserOfferPanel}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID_SECTION} component={PurchaserOfferPanel}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nPurchaserScenesRouter.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nPurchaserScenesRouter.defaultProps = {}\r\n\r\nexport default PurchaserScenesRouter;","import React, {useMemo} from 'react'\r\nimport {AppBar, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport StageElement from './components/StageElement';\r\nimport GridBlock from 'components/GridBlock';\r\nimport {withRouter} from \"react-router\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {connect} from \"react-redux\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        backgroundColor: theme.palette.background.paper,\r\n        top: 64,\r\n        zIndex: 1099\r\n    },\r\n    gridItem: {\r\n        flexGrow: 1\r\n    },\r\n    modification: {\r\n        fontWeight: 400\r\n    }\r\n})\r\n\r\nfunction ContractorStageBar(\r\n    {\r\n        contractor,\r\n        classes,\r\n        match,\r\n        demandStagesList = [],\r\n        demandHeader\r\n    }) {\r\n    const demandId = match.params.id;\r\n    const stageId = match.params.stageId;\r\n    const contractorDepartmentId = !contractor ? match.params.contractorDepartmentId : undefined;\r\n\r\n    const createElement = (label, label2, onClick, current) => ({label, label2, onClick, current})\r\n\r\n    const stageClick = (path) => {\r\n        RouterPath.redirect(path);\r\n    }\r\n\r\n\r\n    const elements = useMemo(() => {\r\n\r\n        const elements = demandStagesList.map(x => createElement(\r\n            x.name,\r\n            undefined,\r\n            () => {\r\n                if (contractor) {\r\n                    if(demandHeader?.apiOffers) {\r\n                        stageClick(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID, {id: demandId, stageId: x.identity}))\r\n                    } else {\r\n                        window.location.href = demandHeader.oldPlatformRoundStatusUrl;\r\n                    }\r\n\r\n                } else {\r\n                    stageClick(RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID, {\r\n                        id: demandId,\r\n                        contractorDepartmentId,\r\n                        stageId: x.identity\r\n                    }))\r\n                }\r\n            },\r\n            \"\" + x.identity === stageId))\r\n\r\n        return elements;\r\n        // eslint-disable-next-line\r\n    }, [demandStagesList, stageId, contractorDepartmentId]);\r\n\r\n\r\n    return (\r\n        <AppBar\r\n            id='stageBar'\r\n            component='div'\r\n            elevation={0}\r\n            position='sticky'\r\n            className={classes.root}\r\n        >\r\n            <GridBlock\r\n                itemClassName={classes.gridItem}\r\n            >\r\n                {elements.map(({label, label2, onClick, current}, i) => {\r\n                    return (\r\n                        <StageElement\r\n                            key={i}\r\n                            current={current}\r\n                            onClick={onClick}\r\n                            thin\r\n                        >\r\n                            {label} {!!label2 && <span className={classes.modification}>({label2})</span>}\r\n                        </StageElement>\r\n                    )\r\n                })}\r\n            </GridBlock>\r\n        </AppBar>\r\n    )\r\n}\r\n\r\nContractorStageBar.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader,\r\n}), {})(withRouter(withStyles(style)(ContractorStageBar)));","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from 'components/Page';\r\nimport InfoBar from \"components/complex/infobar/InfoBar\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport PurchaserScenesRouter from \"./PurchaserScenesRouter\";\r\nimport DemandOffersService from \"../../../../services/DemandOffersService\";\r\nimport {connect} from \"react-redux\";\r\nimport StageBar from \"../../../../components/complex/stagebar/StageBar\";\r\nimport ContractorStageBar from \"../../../../components/complex/stagebar/ContractorStageBar\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    content: {\r\n        padding: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nfunction PurchaserStepperPages(\r\n    {\r\n        match,\r\n        demandStagesList\r\n    }) {\r\n    const classes = useStyles();\r\n    return (\r\n\r\n        <Page>\r\n            <InfoBar />\r\n            <StageBar />\r\n            <ContractorStageBar demandStagesList={demandStagesList} />\r\n            <div className={classes.content}>\r\n                <PurchaserScenesRouter/>\r\n            </div>\r\n        </Page>\r\n    )\r\n}\r\n\r\nPurchaserStepperPages.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    //inicjalizowane są w konkretntm kontekście, np: nie będzie dla korespondencji, inne będą dla oferty wykonawcy a inne dla postępowania wieloetapowego\r\n    demandStagesList: state.resources[DemandOffersService.DEMAND_STAGES_LIST]\r\n}), {})(PurchaserStepperPages);\r\n\r\n","import React, {useCallback, useEffect, useRef, useState} from 'react'\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {connect} from 'react-redux'\r\nimport Loading from \"components/Loading\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {PurchaserOfferContextProvider} from \"context/PurchaserOfferContext\";\r\nimport {OfferStageTranslationsContextProvider} from \"context/OfferStageTranslationsContext\";\r\nimport OfferEditPanel from \"../../../../contractor/demand/scenes/offer/components/panels/offerEdit/OfferEditPanel\";\r\nimport {StageSectionsUrlParams} from \"../../../../contractor/demand/scenes/offer/constants/StageSections\";\r\nimport {useParams} from \"react-router\";\r\nimport DemandOffersOfferService from \"services/DemandOffersOfferService\";\r\nimport {OfferMode} from \"../../../../contractor/demand/scenes/offer/components/common/constants/OfferMode\";\r\nimport {OfferSectionProvider} from \"context/OfferSectionContext\";\r\nimport InfoBar from \"components/complex/infobar/InfoBar\";\r\nimport StageBar from \"components/complex/stagebar/StageBar\";\r\nimport Page from \"components/Page\";\r\nimport {makeStyles} from \"@material-ui/core\";\r\nimport GridBlock from \"../../../../../components/GridBlock\";\r\nimport Button from \"../../../../../components/Button\";\r\nimport ArrowBackIosIcon from \"@material-ui/icons/ArrowBackIos\";\r\nimport Tr from \"../../../../../translations/Translations\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    content: {\r\n        margin: theme.spacing(2),\r\n        padding: theme.spacing(2),\r\n        border: `solid 1px ${theme.palette.background.paper}`,\r\n        borderRadius: theme.shape.borderRadius,\r\n        backgroundColor: theme.palette.background.paper\r\n    },\r\n    button: {\r\n        margin: theme.spacing(2),\r\n    }\r\n}));\r\n\r\nfunction PurchaserOfferPanel(\r\n    {\r\n        match,\r\n        demandHeader\r\n    }) {\r\n    const classes = useStyles();\r\n    const params = useParams();\r\n    const demandId = match.params.id;\r\n    const stageId = match.params.stageId;\r\n    const openedSectionParam = params.section;\r\n    const [stageTranslations, setStageTranslations] = useState({});\r\n    const panelRef = useRef();\r\n    const [contextSection, setContextSection] = useState(null);\r\n\r\n\r\n    useEffect(() => {\r\n        if (stageId === undefined || openedSectionParam === undefined) {\r\n            const href = RouterPath.createPath(RouterPath.purchaserDemand.PURCHASER_DEMAND_ID_PREVIEW_ID_STAGE_ID_SECTION, {\r\n                id: demandId,\r\n                stageId: 0,\r\n                section: StageSectionsUrlParams.OFFER_EDIT\r\n            });\r\n            RouterPath.redirectWithoutHistory(href);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [openedSectionParam, stageId])\r\n\r\n\r\n    useEffect(() => {\r\n        if (stageId !== undefined && openedSectionParam !== undefined) {\r\n            DemandOffersService.getStageTranslations(demandId, stageId, 1).then(resp => setStageTranslations(resp));\r\n            DemandOffersOfferService.getPreviewSection(demandId, stageId, 1, OfferMode.EDIT).then((resp) => setContextSection(resp))\r\n        }\r\n        return () => {\r\n            DemandOffersService.clearResources(DemandOffersService.DEMAND_STAGE_SECTIONS_LIST);\r\n\r\n        }\r\n    }, [demandId, stageId, openedSectionParam])\r\n\r\n    const getStageTranslation = useCallback((trKey) => {\r\n        return stageTranslations[trKey] || trKey;\r\n    }, [stageTranslations]);\r\n\r\n    const backClick = () => {\r\n        if(demandHeader.forceRedirectOldPlatform) {\r\n            window.location.href = demandHeader.forceRedirectOldPlatform;\r\n        } else {\r\n            RouterPath.redirect(RouterPath.createPath(RouterPath.myProcedure.steps.MP_1_ID, {id: demandId}));\r\n        }\r\n    }\r\n\r\n    return (\r\n        <>\r\n            {\r\n                !contextSection ? <Loading/> :\r\n                    <Page>\r\n                        <InfoBar/>\r\n                        <StageBar/>\r\n                                        {\r\n                                            <GridBlock justify=\"flex-end\">\r\n                                                <Button\r\n                                                    onClick={backClick}\r\n                                                    Icon={ArrowBackIosIcon}\r\n                                                    variant={\"outlined\"}\r\n                                                    className={classes.button}\r\n                                                >{Tr(\"back_to_demand\")}</Button>\r\n                                            </GridBlock>\r\n                                        }\r\n                        <div className={classes.content}>\r\n                            <PurchaserOfferContextProvider value={{contractorDepartmentId: 1, supplierId: 1, preview: true}}>\r\n                                <OfferStageTranslationsContextProvider value={getStageTranslation}>\r\n                                    <OfferSectionProvider value={contextSection}>\r\n\r\n                                        <OfferEditPanel panelRef={panelRef} sectionId={contextSection.section}/>\r\n                                    </OfferSectionProvider>\r\n                                </OfferStageTranslationsContextProvider>\r\n                            </PurchaserOfferContextProvider>\r\n                        </div>\r\n                    </Page>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandHeader: state.resources.demandHeader\r\n}), {})(PurchaserOfferPanel)","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from \"../../NotFound/NotFound\";\r\nimport PurchaserStepperPages from \"./scenes/PurchaserStepperPages\";\r\nimport PurchaserPreviewPanel from \"./scenes/preview/PurchaserPreviewPanel\";\r\n\r\nconst rp = RouterPath.purchaserDemand;\r\n\r\nfunction PurchaserDemand() {\r\n\r\n    return (\r\n        <Switch>\r\n            {/*zmiana */}\r\n            <Redirect exact from={RouterPath.DEMAND} to={RouterPath.MY_PROCEDURE} />\r\n            <Redirect exact from={rp.PURCHASER_DEMAND_ID} to={RouterPath.myProcedure.steps.MP_1_ID} />\r\n            <Redirect exact from={rp.PURCHASER_DEMAND_ID_OFFER} to={RouterPath.myProcedure.steps.MP_1_ID} />\r\n            <Redirect exact from={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR} to={RouterPath.myProcedure.steps.MP_1_ID} />\r\n\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_PREVIEW} component={PurchaserPreviewPanel} />\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_PREVIEW_ID_STAGE_ID_SECTION} component={PurchaserPreviewPanel} />\r\n\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID} component={PurchaserStepperPages}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE} component={PurchaserStepperPages}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID} component={PurchaserStepperPages}/>\r\n            <Route exact path={rp.PURCHASER_DEMAND_ID_OFFER_CONTRACTOR_ID_STAGE_ID_SECTION} component={PurchaserStepperPages}/>\r\n\r\n            <Route component={NotFound}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nexport default PurchaserDemand;\r\n","import Tr from \"translations/Translations\";\r\n\r\nconst AnnualReportStatus = {\r\n    DRAFT: \"DRAFT\",\r\n    SENDING: \"SENDING\",\r\n    SENT: \"SENT\",\r\n    APPROVED: \"APPROVED\",\r\n    APPROVED_MODIFIED: \"APPROVED_MODIFIED\"\r\n}\r\nexport default AnnualReportStatus\r\nexport const annualReportStatusTr = (status) => Tr(\"ezamowienia_mmia_state_\" + status)","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestBLOB, RestRequestDELETE, RestRequestGET, RestRequestPOST, RestRequestPUT} from 'libs/RestRequest';\r\nimport isResponseValid from \"../libs/isResponseValid\";\r\nimport Tr from \"../translations/Translations\";\r\nimport reduxStore from \"../redux/store\";\r\nimport {clearResource, setResource, setSaveStatusClosed, setSaveStatusError, setSaveStatusLoading} from \"../redux/actions\";\r\nimport saveStatus from \"constants/status.save\";\r\nimport AnnualReportStatus from \"../pages/purchaser/annualReport/report/constants/AnnualReportStatus\";\r\n\r\nconst ANNUAL_REPORT_TABLES_RESOURCE_ID = \"annualReportTables\"\r\nconst ANNUAL_REPORT_LIST_RESOURCE_ID = \"annualReportList\"\r\nconst ANNUAL_REPORT_RESOURCE_ID = \"annualReport\"\r\n\r\nconst getAnnualReportList = async (year) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.ANNUAL_REPORT_REPORT_YEAR(year));\r\n        reduxStore.dispatch(setResource(ANNUAL_REPORT_LIST_RESOURCE_ID, resp))\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\nconst getAnnualReportListAvailableOrgs = async (year) => {\r\n    return await RestRequestGET(Endpoints.ANNUAL_REPORT_REPORT_YEAR_AVAILABLE_ORGS(year));\r\n};\r\nconst addAnnualReport = async (data) => {\r\n    return await RestRequestPOST(Endpoints.ANNUAL_REPORT, data);\r\n};\r\nconst getAnnualReport = async (reportId) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.ANNUAL_REPORT_REPORT_ID(reportId));\r\n        if (isResponseValid(resp, showError)) {\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_RESOURCE_ID, resp.result))\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\nconst getAnnualReportPrevVersions = async (reportId) => {\r\n    try {\r\n        return await RestRequestGET(Endpoints.ANNUAL_REPORT_REPORT_ID_ACTION(reportId, \"prevVersions\"));\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\nconst sendAnnualReportToEzamowienia = async (reportId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_ACTION(reportId, \"send\"));\r\n        await getAnnualReport(reportId);\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\nconst submitAnnualReportToEzamowienia = async (reportId) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_ACTION(reportId, \"submit\"));\r\n        await getAnnualReport(reportId);\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\nconst correctAnnualReportToEzamowienia = async (reportId, year) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_ACTION(reportId, \"correct\"));\r\n        if (isResponseValid(resp, showError)) {\r\n            await getAnnualReportList(year);\r\n            return resp;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\n\r\nconst downloadAnnualReportPdfFromEzamowienia = async (reportId) => {\r\n    try {\r\n        await RestRequestBLOB(Endpoints.ANNUAL_REPORT_REPORT_ID_ACTION(reportId, \"getPdf\"))\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n};\r\n\r\nconst initializeTable = async (reportId, formName) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_INITIALIZE_FORM_NAME(reportId, formName));\r\n        if (isResponseValid(resp, showError)) {\r\n            await getAnnualReportFormValues(reportId, formName);\r\n            markDraft();\r\n            reduxStore.dispatch(setSaveStatusClosed());\r\n        }\r\n    } catch (e) {\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\nconst initializeTableFromPrevVersion = async (reportId, formName) => {\r\n    reduxStore.dispatch(setSaveStatusLoading());\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_INITIALIZE_FROM_PREV_FORM_NAME(reportId, formName));\r\n        if (isResponseValid(resp, showError)) {\r\n            await getAnnualReportFormValues(reportId, formName);\r\n            markDraft();\r\n            reduxStore.dispatch(setSaveStatusClosed());\r\n        }\r\n    } catch (e) {\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\nconst getAnnualReportTranslations = async () => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.ANNUAL_REPORT_TRANSLATIONS);\r\n        if (isResponseValid(resp, showError)) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\nconst getAnnualReportDictionaries = async () => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.ANNUAL_REPORT_DICTIONARIES);\r\n        if (isResponseValid(resp, showError)) {\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\nconst getAnnualReportFormValues = async (reportId, formName) => {\r\n    try {\r\n        const resp = await RestRequestGET(Endpoints.ANNUAL_REPORT_REPORT_ID_FORM_NAME(reportId, formName));\r\n        if (isResponseValid(resp, showError)) {\r\n            const {resources} = reduxStore.getState();\r\n            const annualReport = resources[ANNUAL_REPORT_TABLES_RESOURCE_ID] || {};\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_TABLES_RESOURCE_ID, {\r\n                ...annualReport,\r\n                [formName]: resp.result\r\n            }))\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\nconst saveAnnualReportTableEntry = async (reportId, reportStep, data) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_FORM_NAME(reportId, reportStep), data);\r\n        if (resp.success) {\r\n            const result = resp.result;\r\n            const {resources} = reduxStore.getState();\r\n            const annualReport = resources[ANNUAL_REPORT_TABLES_RESOURCE_ID];\r\n            let form;\r\n            if (data.identity === 0) {\r\n                form = {\r\n                    ...annualReport[reportStep],\r\n                    [result.type]: [...annualReport[reportStep][result.type], result]\r\n                }\r\n            } else {\r\n                const distTypeIndex = annualReport[reportStep][result.type].findIndex(x => x.identity === result.identity);\r\n                if (distTypeIndex !== -1) {\r\n                    form = {\r\n                        ...annualReport[reportStep],\r\n                        [result.type]: annualReport[reportStep][result.type].map(x => x.identity === result.identity ? result : x)\r\n                    }\r\n                } else {\r\n                    const currentType = Object.keys(annualReport[reportStep]).find(key => annualReport[reportStep][key].some(x => x.identity === data.identity));\r\n                    const distType = data.type;\r\n                    let index = annualReport[reportStep][distType].findIndex(x => x.identity > result.identity);\r\n                    if (index === -1) index = annualReport[reportStep][distType].length;\r\n                    const distArr = [...annualReport[reportStep][distType]];\r\n                    distArr.splice(index, 0, result);\r\n                    form = {\r\n                        ...annualReport[reportStep],\r\n                        [currentType]: annualReport[reportStep][currentType].filter((entry) => entry.identity !== data.identity),\r\n                        [distType]: distArr\r\n                    }\r\n                }\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_TABLES_RESOURCE_ID, {\r\n                ...annualReport,\r\n                [reportStep]: form\r\n            }))\r\n            markDraft();\r\n        }\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\nconst initializeTableEntry = async (reportId, reportStep, currentType, tableIdentity) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_INITIALIZE_FORM_NAME_TABLE_ID(reportId, reportStep, tableIdentity));\r\n        if (resp.success) {\r\n            const result = resp.result;\r\n            const {resources} = reduxStore.getState();\r\n            const annualReport = resources[ANNUAL_REPORT_TABLES_RESOURCE_ID];\r\n            let form;\r\n            if (currentType === result.type) {\r\n                form = {\r\n                    ...annualReport[reportStep],\r\n                    [result.type]: annualReport[reportStep][result.type].map(x => x.identity === result.identity ? result : x)\r\n                }\r\n            } else {\r\n                const distType = result.type;\r\n                let index = annualReport[reportStep][distType].findIndex(x => x.identity > result.identity);\r\n                if (index === -1) index = annualReport[reportStep][distType].length;\r\n                const distArr = [...annualReport[reportStep][distType]];\r\n                distArr.splice(index, 0, result);\r\n                form = {\r\n                    ...annualReport[reportStep],\r\n                    [currentType]: annualReport[reportStep][currentType].filter((entry) => entry.identity !== result.identity),\r\n                    [distType]: distArr\r\n                }\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_TABLES_RESOURCE_ID, {\r\n                ...annualReport,\r\n                [reportStep]: form\r\n            }))\r\n            markDraft();\r\n        }\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\nconst deleteAnnualReportTableEntry = async (reportId, tableEntryId, reportStep, currentType) => {\r\n    const data = {\r\n        identity: tableEntryId\r\n    }\r\n    reduxStore.dispatch(setSaveStatusLoading())\r\n    try {\r\n        const resp = await RestRequestDELETE(Endpoints.ANNUAL_REPORT_REPORT_ID_FORM_NAME(reportId, reportStep), {data: data});\r\n        if (isResponseValid(resp, showError)) {\r\n            const {resources} = reduxStore.getState();\r\n            const annualReport = resources[ANNUAL_REPORT_TABLES_RESOURCE_ID];\r\n\r\n            const formPart = {\r\n                ...annualReport[reportStep],\r\n                [currentType]: annualReport[reportStep][currentType].filter((entry) => entry.identity !== tableEntryId)\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_TABLES_RESOURCE_ID, {\r\n                ...annualReport,\r\n                [reportStep]: formPart\r\n            }))\r\n            markDraft();\r\n            reduxStore.dispatch(setSaveStatusClosed())\r\n            return resp.result;\r\n        }\r\n    } catch (e) {\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\nconst moveAnnualReportTableEntry = async (reportId, tableEntryId, reportStep, currentType, distType) => {\r\n    const data = {\r\n        identity: tableEntryId,\r\n        destination: distType\r\n    }\r\n    reduxStore.dispatch(setSaveStatusLoading())\r\n    try {\r\n        const resp = await RestRequestPUT(Endpoints.ANNUAL_REPORT_REPORT_ID_FORM_NAME(reportId, reportStep), data);\r\n        if (isResponseValid(resp, showError)) {\r\n            const {resources} = reduxStore.getState();\r\n            const annualReport = resources[ANNUAL_REPORT_TABLES_RESOURCE_ID];\r\n\r\n            const formPart = {\r\n                ...annualReport[reportStep],\r\n                [currentType]: annualReport[reportStep][currentType].filter((entry) => entry.identity !== tableEntryId),\r\n                [distType]: [...annualReport[reportStep][distType], resp.result]\r\n            }\r\n\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_TABLES_RESOURCE_ID, {\r\n                ...annualReport,\r\n                [reportStep]: formPart\r\n            }))\r\n            markDraft();\r\n            reduxStore.dispatch(setSaveStatusClosed())\r\n            return resp.result;\r\n        }\r\n\r\n    } catch (e) {\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\n\r\nconst saveAnnualReportForm = async (reportId, reportStep, data) => {\r\n    try {\r\n        const resp = await RestRequestPOST(Endpoints.ANNUAL_REPORT_REPORT_ID_FORM_NAME(reportId, reportStep), data);\r\n        if (resp.success) {\r\n            const {resources} = reduxStore.getState();\r\n            const annualReport = resources[ANNUAL_REPORT_TABLES_RESOURCE_ID];\r\n\r\n            reduxStore.dispatch(setResource(ANNUAL_REPORT_TABLES_RESOURCE_ID, {\r\n                ...annualReport,\r\n                [reportStep]: resp.result\r\n            }))\r\n            markDraft();\r\n        }\r\n        return resp;\r\n    } catch (e) {\r\n        console.error(e);\r\n        showError(Tr('internal_server_error'));\r\n    }\r\n}\r\n\r\nconst markDraft = () => {\r\n    const {resources} = reduxStore.getState()\r\n    if (resources[ANNUAL_REPORT_RESOURCE_ID] && resources[ANNUAL_REPORT_RESOURCE_ID].status !== AnnualReportStatus.DRAFT) {\r\n        reduxStore.dispatch(setResource(ANNUAL_REPORT_RESOURCE_ID, {...resources[ANNUAL_REPORT_RESOURCE_ID], status: AnnualReportStatus.DRAFT}))\r\n    }\r\n}\r\n\r\nconst showError = (message) => {\r\n    if (reduxStore.getState().store.saveStatus !== saveStatus.ERROR)\r\n        reduxStore.dispatch(setSaveStatusError(message))\r\n}\r\n\r\nconst clearResources = (resId) => {\r\n    reduxStore.dispatch(clearResource(resId))\r\n}\r\n\r\nexport default {\r\n    getAnnualReportList,\r\n    getAnnualReportListAvailableOrgs,\r\n    addAnnualReport,\r\n    getAnnualReport,\r\n    getAnnualReportPrevVersions,\r\n    sendAnnualReportToEzamowienia,\r\n    submitAnnualReportToEzamowienia,\r\n    correctAnnualReportToEzamowienia,\r\n    downloadAnnualReportPdfFromEzamowienia,\r\n\r\n    getAnnualReportFormValues,\r\n\r\n    //table-based steps\r\n    saveAnnualReportTableEntry,\r\n    moveAnnualReportTableEntry,\r\n    deleteAnnualReportTableEntry,\r\n    initializeTable,\r\n    initializeTableFromPrevVersion,\r\n    initializeTableEntry,\r\n\r\n    //single-form steps\r\n    saveAnnualReportForm,\r\n\r\n    getAnnualReportDictionaries,\r\n    getAnnualReportTranslations,\r\n    clearResources,\r\n    ANNUAL_REPORT_TABLES_RESOURCE_ID,\r\n    ANNUAL_REPORT_RESOURCE_ID,\r\n    ANNUAL_REPORT_LIST_RESOURCE_ID\r\n}","import React, {useEffect, useState} from 'react'\r\nimport {connect} from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport PropTypes from 'prop-types'\r\nimport {createSelectItem} from \"components/Select\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport useEzamowieniaOauth from \"hooks/useEzamowieniaOauth\";\r\nimport {useParams} from \"react-router\";\r\nimport RadioGroup from \"components/RadioGroup\";\r\nimport Loading from \"components/Loading\";\r\nimport {MMiA_REQUIRED_GROUPS} from \"constants/EzamowieniaRequiredGroups\";\r\n\r\nfunction AddAnnualReportPopup(\r\n    {\r\n        onClose,\r\n        formSubmit,\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n    const [working, setWorking] = useState(true);\r\n    const [error, setError] = useState(null);\r\n    const {authorizeEzamowienia} = useEzamowieniaOauth();\r\n\r\n    useEffect(() => {\r\n        AnnualReportsService.getAnnualReportListAvailableOrgs(params.year).then(resp => {\r\n            if (isResponseValid(resp, setError)) {\r\n                setItems(resp.result.map(item => createSelectItem(item.orgId, item.name)));\r\n            } else {\r\n                setItems([]);\r\n            }\r\n        }).finally(() => setWorking(false))\r\n    }, [params.year]);\r\n\r\n    const [items, setItems] = useState(null);\r\n\r\n    const onUpdate = (values) => {\r\n        setError(null);\r\n        setWorking(true);\r\n\r\n        authorizeEzamowienia(() => {\r\n            AnnualReportsService.addAnnualReport(values).then((resp) => {\r\n                if (isResponseValid(resp, setError)) {\r\n                    onClose(true);\r\n                } else {\r\n                    setWorking(false);\r\n                }\r\n            }).catch(() => setWorking(false))\r\n        }, () => {\r\n            setWorking(false)\r\n        }, MMiA_REQUIRED_GROUPS)\r\n    }\r\n\r\n\r\n    return (\r\n        <Dialog\r\n            title={Tr(\"annual_report_add\") + \" \" + params.year}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('confirm')}\r\n                    onClickFirst={() => onClose(false)}\r\n                    onClickSecond={handleSubmit}\r\n                    disabledSecond={working || items.length === 0}\r\n                    disabledFirst={working}\r\n                    workingSecond={working || !items}\r\n                />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    year: params.year,\r\n                    orgId: null,\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    orgId: VS.anyRequired()\r\n                })}\r\n                onSubmit={onUpdate}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    !items ? <Loading/> :\r\n                        <GridBlock column>\r\n                            {!!error && <Typography color='error'>{error}</Typography>}\r\n                            {\r\n                                items.length > 0 &&\r\n                                <RadioGroup\r\n                                    items={items}\r\n                                    formikProps={formikProps}\r\n                                    label={Tr(\"organizational_unit\")}\r\n                                    id=\"orgId\"\r\n                                />\r\n\r\n                            }\r\n                        </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAddAnnualReportPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(AddAnnualReportPopup);","import React, {useReducer, useState} from 'react';\r\nimport {TableCell, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportStatus, {annualReportStatusTr} from \"../../report/constants/AnnualReportStatus\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport Tr from \"translations/Translations\"\r\nimport moment from \"libs/moment\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport WorkableIconPreviewButton from \"components/button/WorkableIconPreviewButton\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport SimpleTable from \"components/complex/simpleTable/SimpleTable\";\r\nimport AddBoxIcon from '@material-ui/icons/AddBox';\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport {simpleConfirm} from \"libs/ConfirmNotification\";\r\nimport useEzamowieniaOauth from \"hooks/useEzamowieniaOauth\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport {MMiA_REQUIRED_GROUPS} from \"constants/EzamowieniaRequiredGroups\";\r\n\r\nfunction AnnualReportListTableRow(\r\n    {\r\n        report,\r\n        parentWorking,\r\n        classes,\r\n        hasEdit,\r\n    }) {\r\n\r\n    const [expanded, setExpanded] = useState(false);\r\n    const {authorizeEzamowienia} = useEzamowieniaOauth();\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const [buttonWorks, dispatchButtonWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        correct: false,\r\n        loading: false,\r\n    });\r\n    const [prevVersions, setPrevVersions] = useState(null);\r\n\r\n    const goToReport = (x) => {\r\n        const href = RouterPath.createPath(RouterPath.annualReport.MP_ANNUAL_REPORT_REPORT_ID, {id: x.identity});\r\n        RouterPath.redirect(href);\r\n    }\r\n\r\n    const loadReports = () => {\r\n        if (expanded) {\r\n            setExpanded(false);\r\n        } else if (prevVersions) {\r\n            setExpanded(true);\r\n        } else {\r\n            dispatchButtonWorks({type: 'loading', works: true});\r\n            AnnualReportsService.getAnnualReportPrevVersions(report.identity).then(resp => {\r\n                if (resp) {\r\n                    setPrevVersions(resp);\r\n                    setExpanded(true);\r\n                }\r\n            }).finally(() => dispatchButtonWorks({type: 'loading', works: false}))\r\n        }\r\n    }\r\n\r\n    const correctReport = () => {\r\n        dispatchButtonWorks({type: 'correct', works: true});\r\n        simpleConfirm(\"annual_report_correct_confirm\", () => {\r\n            authorizeEzamowienia(\r\n                () => {\r\n                    AnnualReportsService.correctAnnualReportToEzamowienia(report.identity, report.year)\r\n                        .then((resp) => {\r\n                            if (resp && resp.success) {\r\n                                enqueueSuccessSnackbar(Tr(\"annual_report_correct_success\"));\r\n                            }\r\n                        })\r\n                        .finally(() => dispatchButtonWorks({\r\n                            type: 'correct',\r\n                            works: false\r\n                        }))\r\n                },\r\n                () => dispatchButtonWorks({type: 'correct', works: false}),\r\n                MMiA_REQUIRED_GROUPS)\r\n        }, () => dispatchButtonWorks({type: 'correct', works: false}))\r\n    }\r\n\r\n    return <>\r\n        <TableRow>\r\n            <TableCell>{report.organization.name}</TableCell>\r\n            <TableCell>{report.ezamowieniaNumber}</TableCell>\r\n            <TableCell>{report.version}</TableCell>\r\n            <TableCell>{moment(report.dateInserted).format(DateFormats.DATETIME_FORMAT)}</TableCell>\r\n            <TableCell>{report.dateModified ? moment(report.dateModified).format(DateFormats.DATETIME_FORMAT) : null}</TableCell>\r\n            <TableCell>{report.dateSend ? moment(report.dateSend).format(DateFormats.DATETIME_FORMAT) : null}</TableCell>\r\n            <TableCell>{annualReportStatusTr(report.status)}</TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                {report.status === AnnualReportStatus.APPROVED &&\r\n                    <WorkableIconButton\r\n                        Icon={AddBoxIcon}\r\n                        tooltip={Tr(\"annual_report_correct\")}\r\n                        onClick={correctReport}\r\n                        working={buttonWorks.correct}\r\n                        disabled={parentWorking || !hasEdit || buttonWorks.anyWorks}\r\n                    />\r\n                }\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}>\r\n                <WorkableIconPreviewButton\r\n                    disabled={parentWorking || buttonWorks.anyWorks}\r\n                    tooltip={Tr(\"details\")} onClick={() => goToReport(report)}\r\n                />\r\n            </TableCell>\r\n            <TableCell className={classes.buttonColumn}><WorkableIconExpandButton\r\n                working={buttonWorks.loading}\r\n                expanded={expanded}\r\n                disabled={parentWorking || buttonWorks.anyWorks || report.version === 1}\r\n                onClick={loadReports}\r\n                tooltip={Tr(expanded ? \"collapse_prev_versions\" : \"expand_prev_versions\")}\r\n            /></TableCell>\r\n        </TableRow>\r\n\r\n        {\r\n            expanded && !!prevVersions && <TableRow><TableCell className={classes.versionsCell} colSpan={10}>\r\n                <SimpleTable\r\n                    className={classes.versionsTable}\r\n                    headers={[\r\n                        Tr(\"organizational_unit\"),\r\n                        Tr(\"number_of_processing\"),\r\n                        Tr(\"version\"),\r\n                        Tr(\"add_data\"),\r\n                        Tr(\"modyfication_date\"),\r\n                        Tr(\"transfer_date\"),\r\n                        Tr(\"status\"),\r\n                        ''\r\n                    ]}\r\n                    items={\r\n                        prevVersions.map((x, i) => {\r\n                            return [\r\n                                x.organization.name,\r\n                                x.ezamowieniaNumber,\r\n                                x.version,\r\n                                moment(x.dateInserted).format(DateFormats.DATETIME_FORMAT),\r\n                                x.dateModified ? moment(x.dateModified).format(DateFormats.DATETIME_FORMAT) : null,\r\n                                x.dateSend ? moment(x.dateSend).format(DateFormats.DATETIME_FORMAT) : null,\r\n                                annualReportStatusTr(x.status),\r\n                                <WorkableIconPreviewButton disabled={parentWorking || buttonWorks.anyWorks} tooltip={Tr('details')} onClick={() => goToReport(x)}/>\r\n                            ]\r\n                        })\r\n                    }\r\n                    columnClasses={\r\n                        [\r\n                            classes.orgColumn,\r\n                            classes.numberColumn,\r\n                            classes.versionColumn,\r\n                            classes.dateTimeColumn,\r\n                            classes.dateTimeColumn,\r\n                            classes.dateTimeColumn,\r\n                            classes.statusColumn,\r\n                            classes.buttonColumn,\r\n                        ]\r\n                    }\r\n                />\r\n            </TableCell></TableRow>\r\n\r\n        }\r\n    </>\r\n\r\n\r\n}\r\n\r\nAnnualReportListTableRow.propTypes = {}\r\n\r\nexport default AnnualReportListTableRow;","import React, {useEffect, useMemo, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from \"components/Page\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Tr from \"translations/Translations\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {makeStyles, Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport Workspace from \"components/Workspace\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport AddIcon from '@material-ui/icons/Add'\r\nimport AddAnnualReportPopup from \"./components/AddAnnualReportPopup\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {createSelectItem} from \"components/Select\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport {useParams} from \"react-router\";\r\nimport AnnualReportListTableRow from \"./components/AnnualReportListTableRow\";\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    versionColumn: {\r\n        width: 50\r\n    },\r\n    orgColumn: {\r\n    },\r\n    statusColumn: {\r\n        width: 270\r\n    },\r\n    numberColumn: {\r\n        width: 180\r\n    },\r\n    dateTimeColumn: theme.components.table.dateTimeColumn,\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    select: {\r\n        width: 200\r\n    },\r\n    versionsCell: {\r\n        background: theme.palette.background.greyBackground\r\n    },\r\n    versionsTable: {\r\n        background: theme.palette.background.paper\r\n    }\r\n}));\r\n\r\nconst empty_object = {}\r\n\r\nfunction AnnualReportsList(\r\n    {\r\n        reportsList = empty_object\r\n    }\r\n) {\r\n    const classes = useStyles();\r\n    const params = useParams();\r\n    const [addPopup, setAddPopup] = useState(false);\r\n    const [working, setWorking] = useState(false);\r\n    const items = useMemo(() => {\r\n        const years = [];\r\n        if (reportsList.minYear && reportsList.maxYear) {\r\n            for (let i = reportsList.maxYear; i >= reportsList.minYear; i--) {\r\n                years.push(createSelectItem(`${i}`, `${i}`));\r\n            }\r\n        } else {\r\n                years.push(createSelectItem(params.year, params.year));\r\n        }\r\n        return years;\r\n    }, [reportsList, params.year])\r\n\r\n\r\n    useEffect(() => {\r\n        setWorking(true);\r\n        AnnualReportsService.getAnnualReportList(params.year).finally(() => setWorking(false));\r\n        return () => {\r\n            AnnualReportsService.clearResources(AnnualReportsService.ANNUAL_REPORT_LIST_RESOURCE_ID)\r\n        }\r\n    }, [params.year]);\r\n\r\n    const closeAddPopup = (added) => {\r\n        if (added) {\r\n            AnnualReportsService.getAnnualReportList(params.year).finally(() => setAddPopup(false))\r\n        } else {\r\n            setAddPopup(null)\r\n        }\r\n    }\r\n\r\n    return (<Page className={classes.root}>\r\n        <Workspace title={`${Tr('annual_reports')} ${params.year}`}>\r\n\r\n            <GridBlock justify='space-between'>\r\n                <SimpleSelect\r\n                    items={items}\r\n                    label={Tr('annual_report_year')}\r\n                    className={classes.select}\r\n                    value={params.year}\r\n                    disabled={working}\r\n                    onChange={(e) => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.annualReport.MP_ANNUAL_REPORT_YEAR_LIST, {year: e.target.value}))}\r\n                />\r\n                <WorkableButton disabled={working || !reportsList.hasEdit} Icon={AddIcon} variant='contained'\r\n                                onClick={() => setAddPopup(true)}>{Tr('annual_report_add') + \" \" + params.year}</WorkableButton>\r\n            </GridBlock>\r\n\r\n            <Table>\r\n                <TableHead>\r\n                    <TableRow>\r\n                        <TableCell className={classes.orgColumn}>{Tr(\"organizational_unit\")}</TableCell>\r\n                        <TableCell className={classes.numberColumn}>{Tr(\"number_of_processing\")}</TableCell>\r\n                        <TableCell className={classes.versionColumn}>{Tr(\"version\")}</TableCell>\r\n                        <TableCell className={classes.dateTimeColumn}>{Tr(\"add_data\")}</TableCell>\r\n                        <TableCell className={classes.dateTimeColumn}>{Tr(\"modyfication_date\")}</TableCell>\r\n                        <TableCell className={classes.dateTimeColumn}>{Tr(\"transfer_date\")}</TableCell>\r\n                        <TableCell className={classes.statusColumn}>{Tr(\"status\")}</TableCell>\r\n                        <TableCell className={classes.buttonColumn}></TableCell>\r\n                        <TableCell className={classes.buttonColumn}></TableCell>\r\n                        <TableCell className={classes.buttonColumn}></TableCell>\r\n                    </TableRow>\r\n                </TableHead>\r\n                <TableBody>\r\n                    {\r\n                        !reportsList.items ? <TableRow><TableCell colSpan={10}><Loading/></TableCell></TableRow> :\r\n                            <>\r\n\r\n                                {reportsList.items.map((x, i) => (<AnnualReportListTableRow\r\n                                    key={x.identity}\r\n                                    classes={classes}\r\n                                    report={x}\r\n                                    parentWorking={working}\r\n                                    hasEdit={reportsList.hasEdit}\r\n                                />))}\r\n                                {\r\n                                    !reportsList.items.length &&\r\n                                    <TableRow><TableCell colSpan={10}><BoldTypography align='center' variant=\"h6\">{Tr('no_options')}</BoldTypography></TableCell></TableRow>\r\n                                }\r\n                            </>\r\n                    }\r\n                </TableBody>\r\n            </Table>\r\n\r\n            {\r\n                addPopup && <AddAnnualReportPopup onClose={closeAddPopup}/>\r\n            }\r\n\r\n        </Workspace>\r\n    </Page>)\r\n}\r\n\r\nAnnualReportsList.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    reportsList: state.resources[AnnualReportsService.ANNUAL_REPORT_LIST_RESOURCE_ID]\r\n}))(AnnualReportsList);","const annualReportSteps = {\r\n    purchaser: \"purchaser\",\r\n    belowEu: \"belowEu\",\r\n    aboveEu: \"aboveEu\",\r\n    conflict: \"conflict\",\r\n    community: \"community\",\r\n    social: \"social\",\r\n    innovative: \"innovative\",\r\n    exception: \"exception\",\r\n    notIncluded: \"notIncluded\",\r\n}\r\n\r\nexport const annualReportStepsOrder = [annualReportSteps.purchaser, annualReportSteps.belowEu, annualReportSteps.aboveEu, annualReportSteps.conflict,\r\n    annualReportSteps.community, annualReportSteps.social, annualReportSteps.innovative, annualReportSteps.exception, annualReportSteps.notIncluded];\r\nexport const annualReportTablesWithInitialize = [annualReportSteps.belowEu, annualReportSteps.aboveEu, annualReportSteps.conflict, annualReportSteps.community,\r\n    annualReportSteps.social, annualReportSteps.innovative, annualReportSteps.exception, annualReportSteps.notIncluded]\r\nexport default annualReportSteps","import {makeStyles} from \"@material-ui/styles\";\r\n\r\nexport default makeStyles(theme => ({\r\n    root: {\r\n        padding: theme.spacing(2)\r\n    },\r\n    marginBottom: {\r\n        marginBottom: theme.spacing(2)\r\n    },\r\n    marginTop: {\r\n        marginTop: theme.spacing(2)\r\n    },\r\n    marginRight: {\r\n        marginRight: theme.spacing(2)\r\n    },\r\n    tableCell: {\r\n        padding: theme.spacing()\r\n    },\r\n    tableCellBorderRight: {\r\n        borderRight: `1px solid ${theme.palette.divider}`\r\n    },\r\n    tableCellBorderLeft: {\r\n        borderLeft: `1px solid ${theme.palette.divider}`\r\n    },\r\n    variantRow: {\r\n        position: \"sticky\",\r\n        top: 127,\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        background: theme.palette.background.paper,\r\n        height: 65,\r\n        \"&> th, &> td\": {\r\n            fontWeight: \"bold\",\r\n            textAlign: \"center\",\r\n            fontSize: '1rem',\r\n            color: theme.palette.primary.main,\r\n            \"&:first-child, &:nth-child(2)\": {\r\n                cursor: \"pointer\"\r\n            }\r\n        }\r\n    },\r\n    variantRow2: {\r\n        position: \"sticky\",\r\n        top: 191,\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        background: theme.palette.background.paper,\r\n        \"&> th\": {\r\n            textAlign: \"center\"\r\n        }\r\n    },\r\n    demandsRow: {\r\n        \"&:hover\": {\r\n            \"& > td\": {\r\n                background: theme.palette.background.default\r\n            }\r\n        },\r\n        \"&.complete\": {\r\n            background: theme.palette.common.lightGreen\r\n        }, \"&.incomplete\": {\r\n            background: theme.palette.common.lightRed\r\n        }\r\n    },\r\n    demandsCell: {\r\n        padding: theme.spacing(3),\r\n        background: theme.palette.background.greyBackground\r\n    },\r\n    demandsTable: {\r\n        background: theme.palette.background.paper\r\n    },\r\n    buttonColumn: theme.components.table.buttonColumn,\r\n    addCell: {\r\n        textAlign: \"right\"\r\n    },\r\n    sectionErrorIcon: {\r\n        color: theme.palette.common.error,\r\n    },\r\n    tableMainHeaderRow: {\r\n        \"&> th\": {\r\n            textAlign: \"center\",\r\n            verticalAlign: \"bottom\",\r\n            \"&> div\": {\r\n                overflow: 'hidden',\r\n                textOverflow: 'ellipsis',\r\n            }\r\n        }\r\n    },\r\n    noOptions: {\r\n        fontWeight: \"bold\",\r\n    },\r\n    exceptionChip: {\r\n        \"& .MuiChip-label\": {\r\n            maxWidth: 800\r\n        }\r\n    },\r\n    moveEntryRadio: {\r\n        width: \"100%\",\r\n        \"&>.MuiFormLabel-root\": {\r\n            color: theme.palette.text.primary,\r\n            fontWeight: theme.typography.fontWeightBold,\r\n            marginBottom: theme.spacing()\r\n        },\r\n        \"& .MuiFormGroup-root .MuiFormControlLabel-root\": {\r\n            margin: theme.spacing(0, 0, 1, 0),\r\n\r\n            \"&:hover\": {\r\n                backgroundColor: theme.palette.primary.main\r\n            }\r\n        }\r\n    },\r\n    exceptionName: {\r\n        textAlign: \"left !important\"\r\n    }\r\n\r\n}))","import React, {useMemo} from 'react'\r\nimport {createSelectItem} from \"components/Select\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport ArrowIconLeft from \"@material-ui/icons/KeyboardArrowLeft\";\r\nimport ArrowIconRight from \"@material-ui/icons/KeyboardArrowRight\";\r\nimport {Paper} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\"\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport {annualReportStepsOrder} from \"../../constants/annualReportSteps\";\r\nimport SimpleSelect from \"components/SimpleSelect\";\r\nimport EZamowieniaIcon from \"components/icon/EZamowieniaIcon\";\r\nimport {simpleConfirm} from \"../../../../../../libs/ConfirmNotification\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        position: 'sticky',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        top: 67,\r\n        marginBottom: theme.spacing(2),\r\n    },\r\n    paper: {\r\n        padding: theme.spacing(0.5),\r\n        border: `solid 2px ${theme.palette.border.dark}`,\r\n    },\r\n    select: {\r\n        minWidth: 550,\r\n        \"&> .MuiInput-root .MuiSelect-root\": {\r\n            maxWidth: 550\r\n        }\r\n    },\r\n    margin: {\r\n        margin: `0 ${theme.spacing()}px`\r\n    }\r\n}))\r\n\r\nfunction AnnualReportNavigator(\r\n    {\r\n        formTr,\r\n        disabled,\r\n        buttonWorks,\r\n        curStep,\r\n        onCurStepChange,\r\n        onSendToEzamowienia,\r\n        onSubmitInEzamowienia,\r\n    }) {\r\n    const classes = useStyle();\r\n    const memoItems = useMemo(() => annualReportStepsOrder.map((x, i, arr) => createSelectItem(x, `${formTr(`mmia.${x}`)} (${i + 1}/${arr.length})`)), [formTr])\r\n    const curIndex = annualReportStepsOrder.indexOf(curStep);\r\n\r\n\r\n    return (<div className={classes.root}>\r\n        <Paper className={classes.paper}>\r\n            <GridBlock justify=\"space-between\" alignItems=\"center\" flexGrow>\r\n                <GridBlock justify=\"center\" alignItems=\"center\">\r\n                    <IconButton\r\n                        className={classes.margin}\r\n                        disabled={buttonWorks.anyWorks || curIndex < 1}\r\n                        tooltip={curIndex > 0 ? formTr(`mmia.${annualReportStepsOrder[curIndex - 1]}`) : undefined}\r\n                        variant=\"outlined\"\r\n                        onClick={() => onCurStepChange(annualReportStepsOrder[curIndex - 1])}\r\n                        Icon={ArrowIconLeft}/>\r\n                    <SimpleSelect disabled={buttonWorks.anyWorks} onChange={(e) => onCurStepChange(e.target.value)} className={classes.select} items={memoItems}\r\n                                  value={curStep}/>\r\n                    <IconButton\r\n                        className={classes.margin}\r\n                        disabled={buttonWorks.anyWorks || curIndex === annualReportStepsOrder.length - 1}\r\n                        tooltip={curIndex < annualReportStepsOrder.length - 1 ? formTr(`mmia.${annualReportStepsOrder[curIndex + 1]}`) : undefined}\r\n                        variant=\"outlined\"\r\n                        onClick={() => onCurStepChange(annualReportStepsOrder[curIndex + 1])}\r\n                        Icon={ArrowIconRight}/>\r\n                </GridBlock>\r\n                <GridBlock justify=\"flex-end\" alignItems=\"center\">\r\n                    {!!onSendToEzamowienia &&\r\n                        <WorkableButton\r\n                            Icon={EZamowieniaIcon}\r\n                            working={buttonWorks.ezamowienia}\r\n                            disabled={disabled || buttonWorks.anyWorks}\r\n                            variant=\"outlined\"\r\n                            onClick={onSendToEzamowienia}>{Tr('annual_report_send_to_ezamowienia')}\r\n                        </WorkableButton>}\r\n                    {!!onSubmitInEzamowienia &&\r\n                        <WorkableButton\r\n                            Icon={EZamowieniaIcon}\r\n                            working={buttonWorks.ezamowienia}\r\n                            disabled={disabled || buttonWorks.anyWorks}\r\n                            onClick={() => simpleConfirm(\"annual_report_submit_to_ezamowienia_confirm\", onSubmitInEzamowienia)}>{Tr('annual_report_submit_to_ezamowienia')}\r\n                        </WorkableButton>}\r\n                </GridBlock>\r\n            </GridBlock>\r\n        </Paper>\r\n    </div>)\r\n}\r\n\r\nAnnualReportNavigator.propTypes = {};\r\n\r\nexport default AnnualReportNavigator;\r\n","const AnnualReportNoticeSource = {\r\n    BZP: \"BZP\",\r\n    TED: \"TED\",\r\n}\r\n\r\nexport default AnnualReportNoticeSource;","import VS from 'constants/ValidationShema';\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportNoticeSource from \"./AnnualReportNoticeSource\";\r\n\r\nconst purchaser = VS.object({\r\n    dataLoaded: VS.requiredBoolean(),\r\n    purchaserName: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.stringMax(300),\r\n        otherwise: VS.stringMaxNoRq(300)\r\n    }),\r\n    purchaserPartName: VS.stringMaxNoRq(300),\r\n    purchaserIdentifier: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.stringMax(100),\r\n        otherwise: VS.stringMaxNoRq(100)\r\n    }),\r\n    purchaserType: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.string().nullable(),\r\n        otherwise: VS.stringNoRq().nullable()\r\n    }),\r\n    purchaserOtherType: VS.any().when([\"complete\", \"dataLoaded\", \"purchaserType\"], {\r\n        is: (complete, dataLoaded, purchaserType) => complete && !dataLoaded && purchaserType === \"1.5\",\r\n        then: VS.stringMax(200),\r\n        otherwise: VS.stringMaxNoRq(200)\r\n    }),\r\n    purchaserActivityType: VS.any(),\r\n    purchaserStreet: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.stringMax(100),\r\n        otherwise: VS.stringMaxNoRq(100)\r\n    }),\r\n    purchaserCity: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.stringMax(200),\r\n        otherwise: VS.stringMaxNoRq(200)\r\n    }),\r\n    purchaserCode: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.stringMax(100),\r\n        otherwise: VS.stringMaxNoRq(100)\r\n    }),\r\n    purchaserProvince: VS.any(),\r\n    purchaserCountry: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.string().nullable(),\r\n        otherwise: VS.stringNoRq().nullable()\r\n    }),\r\n    purchaserUrl: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.urlMax(250).nullable(),\r\n        otherwise: VS.string(250).nullable()\r\n    }),\r\n    purchaserEmail: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.emailMax(250).nullable(),\r\n        otherwise: VS.emailMaxNoRq(250).nullable()\r\n    }),\r\n    purchaserPhone: VS.any().when([\"complete\", \"dataLoaded\"], {\r\n        is: (complete, dataLoaded) => complete && !dataLoaded,\r\n        then: VS.stringMax(100),\r\n        otherwise: VS.stringMaxNoRq(100)\r\n    }),\r\n    issueNumber: VS.any().when(\"complete\", {is: true, then: VS.stringMax(100), otherwise: VS.stringMaxNoRq(100)}),\r\n    complete: VS.requiredBoolean()\r\n})\r\nconst belowEu = VS.object({\r\n    type: VS.string(),\r\n    number: VS.stringMax(50),\r\n    orderType: VS.string(),\r\n    amount: VS.any().when(\"complete\", {is: true, then: VS.amount(0, false), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst aboveEu = VS.object({\r\n    type: VS.string(),\r\n    number: VS.stringMax(50),\r\n    noticeNumber: VS.any().when(\"complete\", {is: true, then: VS.stringMax(50), otherwise: VS.stringMaxNoRq(50)}),\r\n    orderType: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    codeCPV: VS.any().when(\"complete\", {is: true, then: VS.requiredObject(), otherwise: VS.any()}),\r\n    tenderMode: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    contractorCountryList: VS.any().when(\"complete\", {is: true, then: VS.arrayRequired(), otherwise: VS.any()}),\r\n    contractValue: VS.any().when(\"complete\", {is: true, then: VS.amount(0, true), otherwise: VS.any()}),\r\n    numberOfAwardedLots: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfOffers: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfRejectedOffers: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfOffersSubmittedByMMSP: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    contractAwardedToMMSP: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst conflict = VS.object({\r\n    type: VS.string(),\r\n    source: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    number: VS.stringMax(50),\r\n    noticeNumber: VS.any().when(\"complete\", {is: true, then: VS.stringMax(50), otherwise: VS.stringMaxNoRq(50)}),\r\n    orderType: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    codeCpv: VS.any().when(\"complete\", {is: true, then: VS.requiredObject(), otherwise: VS.any()}),\r\n    tenderModeBzp: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.BZP, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    tenderModeTed: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.TED, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    numberOfCasesOfConflictOfInterest: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfDetectedAgreements: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfContractorsWithRejectedOffer: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst community = VS.object({\r\n    type: VS.string(),\r\n    source: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    number: VS.stringMax(50),\r\n    noticeNumber: VS.any().when(\"complete\", {is: true, then: VS.stringMax(50), otherwise: VS.stringMaxNoRq(50)}),\r\n    serviceDescription: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    codeCpv: VS.any().when(\"complete\", {is: true, then: VS.requiredObject(), otherwise: VS.any()}),\r\n    tenderModeBzp: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.BZP, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    tenderModeTed: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.TED, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    reservedTender: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    amount: VS.any().when(\"complete\", {is: true, then: VS.amount(0, true), otherwise: VS.any()}),\r\n    numberOfAwardedLots: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfOffers: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfOffersMMSP: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst social = VS.object({\r\n    type: VS.string(),\r\n    source: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    number: VS.stringMax(50),\r\n    noticeNumber: VS.any().when(\"complete\", {is: true, then: VS.stringMax(50), otherwise: VS.stringMaxNoRq(50)}),\r\n    orderType: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    codeCpv: VS.any().when(\"complete\", {is: true, then: VS.requiredObject(), otherwise: VS.any()}),\r\n    tenderModeBzp: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.BZP, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    tenderModeTed: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.TED, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    contractValue: VS.any().when(\"complete\", {is: true, then: VS.amount(0, true), otherwise: VS.any()}),\r\n    numberOfAwardedLots: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    numberOfOffers: VS.any().when(\"complete\", {is: true, then: VS.integerMin(), otherwise: VS.any()}),\r\n    reservedTender: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    inDescriptionRequirementsForAccessibility: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    definedSocialAspectsInOfferEvaluationCriteria: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    definedRequirementsBasedOnEmploymentRelationship: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    definedSocialAspectsRequirements: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    definedLabelRelatedToSocialAspects: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    contractorType: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst innovative = VS.object({\r\n    type: VS.string(),\r\n    source: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    number: VS.stringMax(50),\r\n    noticeNumber: VS.any().when(\"complete\", {is: true, then: VS.stringMax(50), otherwise: VS.stringMaxNoRq(50)}),\r\n    orderType: VS.any().when(\"complete\", {is: true, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    codeCpv: VS.any().when(\"complete\", {is: true, then: VS.requiredObject(), otherwise: VS.any()}),\r\n    tenderModeBzp: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.BZP, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    tenderModeTed: VS.any().when([\"complete\", \"source\"], {is: (complete, source) => complete && source === AnnualReportNoticeSource.TED, then: VS.string().nullable(), otherwise: VS.stringNoRq().nullable()}),\r\n    contractValue: VS.any().when(\"complete\", {is: true, then: VS.amount(0, true), otherwise: VS.any()}),\r\n    environmentalRequirements: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    environmentalManagementSystemAndStandards: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    environmentalAspectsInEvaluationCriteria: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    costCriterionUsingLifeCycleCostingApplied: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    environmentalAspectsRequirements: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    labelRelatedToEnvAspectsOrMeasureOfEvidence: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    innovativeAspectsInEvaluationCriteria: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    innovativeAspectsRequirements: VS.any().when(\"complete\", {is: true, then: VS.requiredBoolean(), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst exception = VS.object({\r\n    type: VS.any().when(\"complete\", {is: true, then: VS.stringNotOneOf([\"0\"], Tr('required_field')), otherwise: VS.string()}),\r\n    number: VS.stringMax(50),\r\n    name: VS.stringMaxNoRq(400),\r\n    contractValue: VS.any().when(\"complete\", {is: true, then: VS.amount(0, false), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nconst notIncluded = VS.object({\r\n    type: VS.string(),\r\n    number: VS.stringMax(50),\r\n    name: VS.stringMaxNoRq(400),\r\n    contractValue: VS.any().when(\"complete\", {is: true, then: VS.amount(0, true), otherwise: VS.any()}),\r\n    complete: VS.requiredBoolean()\r\n})\r\n\r\nexport default {\r\n    purchaser,\r\n    belowEu,\r\n    aboveEu,\r\n    conflict,\r\n    community,\r\n    social,\r\n    innovative,\r\n    exception,\r\n    notIncluded\r\n}","import React, {useContext, useRef, useState} from \"react\"\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport Form from \"components/Form\";\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport Typography from \"components/Typography\";\r\nimport Tr from \"translations/Translations\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport {useParams} from \"react-router\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport annualReportValidation from \"../../constants/annualReportValidation\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport AnnualReportStatus, {annualReportStatusTr} from \"../../constants/AnnualReportStatus\";\r\n\r\nfunction AnnualReportPurchaserForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled,\r\n        setFrom\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const [error, setError] = useState();\r\n    const {getDict, formTr} = useContext(FormTranslationContext);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n    const submitSemaphore = useRef(false);\r\n\r\n    const onSubmit = (values, actions) => {\r\n        submitSemaphore.current = false;\r\n        AnnualReportsService.saveAnnualReportForm(params.id, annualReportSteps.purchaser, values).then((resp) => {\r\n            if (resp) {\r\n                if (resp.success) {\r\n                    enqueueSuccessSnackbar(Tr(\"saved\"))\r\n                    actions.resetForm();\r\n                } else {\r\n                    if (resp.errors instanceof Object) {\r\n                        for (let key of Object.keys(resp.errors)) {\r\n                            setError(formTr(`mmia.${annualReportSteps.purchaser}.${key}`) + \": \" + resp.errors[key])\r\n                            break;\r\n                        }\r\n                    }\r\n                }\r\n\r\n            }\r\n        })\r\n    }\r\n\r\n    const handleSubmit = (formikProps, complete) => {\r\n        setError(null)\r\n        formikProps.setFieldValue('complete', complete);\r\n        submitSemaphore.current = true;\r\n        setTimeout((formikProps) => formikProps.submitForm(), 0, formikProps)\r\n        setTimeout((formId, submitSemaphore) => submitSemaphore.current && scrollTo(\"#\" + formId + \" .MuiFormHelperText-root.Mui-error\", 200), 200, annualReportSteps.purchaser, submitSemaphore);\r\n    }\r\n\r\n    if (!initValues) return <Loading/>\r\n    return (<Form\r\n            htmlFormId={annualReportSteps.purchaser}\r\n            initialValues={{\r\n                ...initValues\r\n            }}\r\n            validationSchema={annualReportValidation.purchaser}\r\n            validateOnMount\r\n            onSubmit={onSubmit}\r\n        >{(formikProps) => {\r\n            setFrom(formikProps)\r\n            return <>\r\n                <GridBlock justify=\"space-between\" className={classes.variantRow}>\r\n                    <GridBlock alignItems=\"flex-end\">\r\n                        <BoldTypography variant=\"h5\" className={classes.marginRight}>{formTr(\"mmia.purchaser\")}</BoldTypography>\r\n                        {!initValues.complete && <Typography color=\"error\">({annualReportStatusTr(AnnualReportStatus.DRAFT)})</Typography>}\r\n                    </GridBlock>\r\n                    <>\r\n\r\n                        <WorkableButton\r\n                            className={classes.marginRight}\r\n                            disabled={disabled || !formikProps.dirty}\r\n                            variant=\"outlined\"\r\n                            onClick={() => formikProps.resetForm()}>\r\n                            {Tr('discard_changes')}\r\n                        </WorkableButton>\r\n                        <WorkableButton\r\n                            className={classes.marginRight}\r\n                            disabled={disabled}\r\n                            onClick={() => handleSubmit(formikProps, false)}\r\n                            variant=\"outlined\">\r\n                            {Tr('save_draft_version')}\r\n                        </WorkableButton>\r\n                        <WorkableButton\r\n                            disabled={disabled}\r\n                            onClick={() => handleSubmit(formikProps, true)}>\r\n                            {Tr('save')}\r\n                        </WorkableButton>\r\n                    </>\r\n                </GridBlock>\r\n\r\n                <BoldTypography variant=\"h6\">{formTr(\"mmia.purchaserS1\")}</BoldTypography>\r\n                <br/>\r\n                {initValues.dataLoaded && <BoldTypography color=\"primary\">{formTr(\"mmia.purchaser.dataLoaded\")}<br/><br/></BoldTypography>}\r\n\r\n                {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon>}\r\n                <NoticeTextInput\r\n                    id=\"purchaserName\"\r\n                    label=\"mmia.purchaser.purchaserName\"\r\n                    formikProps={formikProps}\r\n                    disabled\r\n                />\r\n                <NoticeTextInput\r\n                    id=\"purchaserPartName\"\r\n                    label=\"mmia.purchaser.purchaserPartName\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n\r\n                <NoticeTextInput\r\n                    id=\"purchaserIdentifier\"\r\n                    label=\"mmia.purchaser.purchaserIdentifier\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeGlossaryInput\r\n                    id=\"purchaserType\"\r\n                    label=\"mmia.purchaser.purchaserType\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"SL.MO.013\")}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <Collapse in={getObjectValue(\"purchaserType\", formikProps.values, null) === \"1.5\"}>\r\n                    <NoticeTextInput\r\n                        id=\"purchaserOtherType\"\r\n                        label=\"mmia.purchaser.purchaserOtherType\"\r\n                        formikProps={formikProps}\r\n                        disabled={initValues.dataLoaded || disabled}\r\n                    />\r\n                </Collapse>\r\n\r\n                <NoticeGlossaryInput\r\n                    id=\"purchaserActivityType\"\r\n                    label=\"mmia.purchaser.purchaserActivityType\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"SL.MMiA.065\")}\r\n                    disabled={disabled}\r\n                />\r\n\r\n                <br/>\r\n                <BoldTypography variant=\"h6\">{formTr(\"mmia.purchaserS2\")}</BoldTypography>\r\n                <br/>\r\n                <NoticeTextInput\r\n                    id=\"purchaserStreet\"\r\n                    label=\"mmia.purchaser.purchaserStreet\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeTextInput\r\n                    id=\"purchaserCity\"\r\n                    label=\"mmia.purchaser.purchaserCity\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeTextInput\r\n                    id=\"purchaserCode\"\r\n                    label=\"mmia.purchaser.purchaserCode\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeGlossaryInput\r\n                    id=\"purchaserProvince\"\r\n                    label=\"mmia.purchaser.purchaserProvince\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"MMIA.SL.MT.007\")}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeGlossaryInput\r\n                    id=\"purchaserCountry\"\r\n                    label=\"mmia.purchaser.purchaserCountry\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"SL.MT.005\")}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeTextInput\r\n                    id=\"purchaserUrl\"\r\n                    label=\"mmia.purchaser.purchaserUrl\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeTextInput\r\n                    id=\"purchaserEmail\"\r\n                    label=\"mmia.purchaser.purchaserEmail\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n                <NoticeTextInput\r\n                    id=\"purchaserPhone\"\r\n                    label=\"mmia.purchaser.purchaserPhone\"\r\n                    formikProps={formikProps}\r\n                    disabled={initValues.dataLoaded || disabled}\r\n                />\r\n\r\n                <BoldTypography variant=\"h6\">{formTr(\"mmia.purchaserS3\")}</BoldTypography>\r\n\r\n                <NoticeTextInput\r\n                    id=\"issueNumber\"\r\n                    label=\"mmia.purchaser.issueNumber\"\r\n                    formikProps={formikProps}\r\n                    disabled={disabled}\r\n                />\r\n            </>\r\n        }}\r\n        </Form>\r\n    )\r\n\r\n\r\n}\r\n\r\nAnnualReportPurchaserForm.prototype = {\r\n    initValues: PropTypes.object,\r\n    setFrom: PropTypes.func.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportPurchaserForm;","import React from \"react\";\r\nimport {TableCell} from \"@material-ui/core\";\r\nimport clsx from \"clsx\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\n\r\nfunction AnnualReportTableCell(\r\n    {\r\n        children,\r\n        className,\r\n        borderRight,\r\n        borderLeft,\r\n        ...props\r\n    }\r\n) {\r\n    const classes = annulaReportClasses();\r\n\r\n    return (\r\n        <TableCell className={\r\n            clsx( classes.tableCell, {\r\n                [classes.tableCellBorderRight]: borderRight,\r\n                [classes.tableCellBorderLeft]: borderLeft\r\n            }, className)} {...props}>{children}</TableCell>);\r\n\r\n}\r\n\r\n\r\n\r\nexport default AnnualReportTableCell;","import React, {useContext, useReducer, useRef, useState} from 'react'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport PropTypes from 'prop-types'\r\nimport {useParams} from \"react-router\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport {annualReportStepsOrder, annualReportTablesWithInitialize} from \"../../constants/annualReportSteps\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport useDebouncedEffect from \"hooks/useDebouncedEffect\";\r\nimport annualReportValidation from \"../../constants/annualReportValidation\";\r\nimport Form from \"components/Form\";\r\nimport ReplayIcon from \"@material-ui/icons/Replay\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport scrollToContainer from \"libs/scrollToContainer\";\r\n\r\nexport const getAnnualReportEditPopup = (entry, newEntry = false, autoValidate = false) => {\r\n    if (newEntry) {\r\n        entry = {identity: 0}\r\n    }\r\n    return ({entry, newEntry, autoValidate})\r\n}\r\n\r\nfunction AnnualReportEditPopup(\r\n    {\r\n        onClose,\r\n        config,\r\n        reportStep,\r\n        FormComponent\r\n    }) {\r\n    const [error, setError] = useState(null);\r\n    const params = useParams();\r\n    const {formTr} = useContext(FormTranslationContext)\r\n    const form = useRef();\r\n    const setForm = (formikProps) => form.current = formikProps;\r\n    const submitSemaphore = useRef(false);\r\n\r\n    const [buttonWorks, dispatchButtonWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        save: false,\r\n        draft: false,\r\n        reload: false\r\n    });\r\n    const handleSubmit = (complete) => {\r\n        form.current.setFieldValue('complete', complete);\r\n        submitSemaphore.current = true;\r\n        setTimeout(() => form.current.submitForm(), 0);\r\n        setTimeout((formId, submitSemaphore) => submitSemaphore.current && scrollToContainer(\"#annual-report-edit-popup .MuiDialogContent-root\", \"#\" + formId + \" .MuiFormHelperText-root.Mui-error\", 200), 200, reportStep, submitSemaphore);\r\n\r\n    }\r\n    const {enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n\r\n    useDebouncedEffect(() => {\r\n        if (config.autoValidate)\r\n            handleSubmit(true);\r\n    }, {timeout: 500, ignoreInitialCall: false}, [])\r\n\r\n    const submitFrom = (values, actions) => {\r\n        submitSemaphore.current = false;\r\n        setError(null);\r\n        dispatchButtonWorks({type: values.complete ? \"save\" : \"draft\", works: true});\r\n        AnnualReportsService.saveAnnualReportTableEntry(params.id, reportStep, values).then((resp) => {\r\n            if (resp) {\r\n                if (resp.success) {\r\n                    enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + resp.result.number);\r\n                    onClose();\r\n                } else {\r\n                    dispatchButtonWorks({type: values.complete ? \"save\" : \"draft\", works: false})\r\n                    if (resp.errors instanceof Object) {\r\n                        for (let key of Object.keys(resp.errors)) {\r\n                            setError(formTr(`mmia.${reportStep}.${key}`) + \": \" + resp.errors[key])\r\n                            break;\r\n                        }\r\n                    }\r\n\r\n                }\r\n            } else {\r\n                dispatchButtonWorks({type: values.complete ? \"save\" : \"draft\", works: false})\r\n            }\r\n        }).catch(() => dispatchButtonWorks({type: values.complete ? \"save\" : \"draft\", works: false}))\r\n\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onClose, 'outlined', buttonWorks.anyWorks));\r\n        buttons.push(createButton(Tr('save_draft_version'), () => handleSubmit(false), 'outlined', buttonWorks.anyWorks, undefined, buttonWorks.draft));\r\n        buttons.push(createButton(Tr('save'), () => handleSubmit(true), undefined, buttonWorks.anyWorks, undefined, buttonWorks.save));\r\n        return buttons;\r\n    }\r\n\r\n    const getReloadButton = () => {\r\n        return annualReportTablesWithInitialize.includes(reportStep) && !config.newEntry &&\r\n            <WorkableButton working={buttonWorks.reload} disabled={buttonWorks.anyWorks} Icon={ReplayIcon} variant=\"outlined\"\r\n                            onClick={() => simpleConfirmNoTranslate(Tr(\"annual_report_reload_demand_confirm\"),\r\n                                () => {\r\n                                    dispatchButtonWorks({type: \"reload\", works: true})\r\n                                    AnnualReportsService.initializeTableEntry(params.id, reportStep, config.entry.type, config.entry.identity).then(resp => {\r\n                                        if (isResponseValid(resp, enqueueErrorSnackbar)) {\r\n                                            config.entry = resp.result;\r\n                                            form.current.resetForm();\r\n                                            enqueueSuccessSnackbar(Tr(\"annual_report_reloaded_demand\"))\r\n                                        }\r\n                                    }).finally(() => dispatchButtonWorks({type: \"reload\", works: false}))\r\n                                }\r\n                            )}\r\n            >{Tr(\"annual_report_reload_demand\")}</WorkableButton>\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open={true}\r\n            title={!!error ? <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{error}</TypographyWithIcon> : null}\r\n            maxWidth=\"md\"\r\n            dialogActions={\r\n                <MultiButton\r\n                    before={getReloadButton()}\r\n                    buttons={getButtons()}\r\n                />\r\n            }\r\n            htmlId=\"annual-report-edit-popup\"\r\n        >\r\n            <Form\r\n                htmlFormId={reportStep}\r\n                initialValues={{\r\n                    ...config.entry\r\n                }}\r\n                validationSchema={annualReportValidation[reportStep]}\r\n                onSubmit={submitFrom}\r\n            >\r\n                {(formikProps) => {\r\n                    setForm(formikProps);\r\n                    return (<FormComponent\r\n                        entry={config.entry}\r\n                        newEntry={config.newEntry}\r\n                        buttonWorks={buttonWorks}\r\n                        reportStep={reportStep}\r\n                        formikProps={formikProps}\r\n                    />)\r\n                }}\r\n            </Form>\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nAnnualReportEditPopup.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    config: PropTypes.shape({\r\n        entry: PropTypes.object,\r\n        newEntry: PropTypes.bool,\r\n        autoValidate: PropTypes.bool\r\n    }),\r\n    reportStep: PropTypes.oneOf(annualReportStepsOrder).isRequired,\r\n    FormComponent: PropTypes.func.isRequired\r\n}\r\n\r\nexport default AnnualReportEditPopup;","export default (scrollContainer, querySelector, extraOffset = 0) => {\r\n    if (!querySelector) {\r\n        return;\r\n    }\r\n\r\n    const container = document.querySelector(scrollContainer);\r\n    const element = querySelector instanceof Element ? querySelector : container.querySelector(querySelector);\r\n    if (!element) {\r\n        return;\r\n    }\r\n    const boundingClientRect = element.getBoundingClientRect();\r\n    let offsetTop = boundingClientRect.top;\r\n    offsetTop -= 20;\r\n    offsetTop -= extraOffset\r\n\r\n    container.scrollTo({behavior: 'smooth', top: offsetTop});\r\n}\r\n","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeCpvInput from \"components/complex/nationalNotice/components/inputs/NoticeCpvInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport NoticeIntegerInput from \"components/complex/nationalNotice/components/inputs/NoticeIntegerInput\";\r\nimport NoticeYesNoInput from \"components/complex/nationalNotice/components/inputs/NoticeYesNoInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\n\r\nfunction AnnualReportAboveEuEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const classes = annulaReportClasses();\r\n    return (<>\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.type`}\r\n                id=\"type\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.OrdersType\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.number`}\r\n                id=\"number\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.noticeNumber`}\r\n                id=\"noticeNumber\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.orderType`}\r\n                id=\"orderType\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.002\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeCpvInput\r\n                label={`mmia.${reportStep}.codeCPV`}\r\n                id=\"codeCPV\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                className={classes.exceptionChip}\r\n                label={`mmia.${reportStep}.tenderMode`}\r\n                id=\"tenderMode\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.018_019_TED\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.contractorCountryList`}\r\n                id=\"contractorCountryList\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"SL.MT.005\")}\r\n                prefixLabelsWithKeys\r\n                multiple\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeNumericInput\r\n                label={`mmia.${reportStep}.contractValue`}\r\n                id=\"contractValue\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfAwardedLots`}\r\n                id=\"numberOfAwardedLots\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfOffers`}\r\n                id=\"numberOfOffers\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfRejectedOffers`}\r\n                id=\"numberOfRejectedOffers\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfOffersSubmittedByMMSP`}\r\n                id=\"numberOfOffersSubmittedByMMSP\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.contractAwardedToMMSP`}\r\n                id=\"contractAwardedToMMSP\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nAnnualReportAboveEuEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportAboveEuEditForm;","import Tr from \"translations/Translations\";\r\n\r\nconst formatBoolean = (val) => {\r\n    if (val === null || val === undefined) {\r\n        return null;\r\n    }\r\n    return !val ? Tr(\"no\") : Tr(\"yes\");\r\n}\r\n\r\nexport default formatBoolean;","const formatInteger = (val) => {\r\n    if (val === null || val === undefined) {\r\n        return null;\r\n    }\r\n    return val;\r\n}\r\n\r\nexport default formatInteger;","import React, {useContext, useEffect} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BasicSearch from \"components/BasicSearch\";\r\nimport Tr from \"translations/Translations\";\r\nimport Button from \"components/Button\";\r\nimport AddIcon from \"@material-ui/icons/AddBoxOutlined\";\r\nimport {getAnnualReportEditPopup} from \"./AnnualReportEditPopup\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport HelpTooltip from \"components/HelpTooltip\";\r\nimport useSearch from \"../../../../../../hooks/useSearch\";\r\n\r\nfunction AnnualReportSearchBar(\r\n    {\r\n        classes,\r\n        setSearch,\r\n        reportStep,\r\n        disabled,\r\n        setEditPopup\r\n    }\r\n) {\r\n    const {searchData, setSearchConfig} = useSearch();\r\n    useEffect(()=> {\r\n        setSearch(searchData.search)\r\n    },[searchData, setSearch])\r\n\r\n    const {formTip, formTr} = useContext(FormTranslationContext);\r\n    const tip = formTip(\"mmia.\" + reportStep);\r\n    return (<>\r\n            <BoldTypography variant=\"h5\">{formTr(\"mmia.\" + reportStep)} {!!tip && <HelpTooltip text={formTip(\"mmia.\" + reportStep)}/>}</BoldTypography>\r\n\r\n            <GridBlock justify=\"space-between\" className={classes.marginBottom}>\r\n                <BasicSearch\r\n                    label={Tr('search_by_demand_number')}\r\n                    doSearch={setSearchConfig}\r\n                />\r\n                <Button disabled={disabled} Icon={AddIcon} onClick={() => setEditPopup(getAnnualReportEditPopup(null, true))}>{Tr(\"add_demand\")}</Button>\r\n            </GridBlock>\r\n        </>\r\n    )\r\n}\r\n\r\nAnnualReportSearchBar.propTypes = {\r\n    classes: PropTypes.object.isRequired,\r\n    setSearch: PropTypes.func.isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    setEditPopup: PropTypes.func.isRequired\r\n}\r\nexport default AnnualReportSearchBar;","import React, {useContext} from \"react\";\r\nimport AnnualReportTableCell from \"./AnnualReportTableCell\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Tooltip} from \"@material-ui/core\";\r\n\r\nfunction AnnualReportTableHeadCell(\r\n    {\r\n        label,\r\n        className,\r\n        borderRight,\r\n        borderLeft = true,\r\n        maxWidth,\r\n        ...props\r\n    }\r\n) {\r\n    const {formTr, formTip} = useContext(FormTranslationContext);\r\n    const tip = formTip(label);\r\n    return (<AnnualReportTableCell style={maxWidth ? {maxWidth: maxWidth} : undefined} borderLeft={borderLeft} borderRight={borderRight} className={className} {...props}>\r\n        {\r\n            !!tip ? <Tooltip title={tip}>\r\n                <div>{formTr(label)}</div>\r\n            </Tooltip> : <div>{formTr(label)}</div>\r\n        }\r\n    </AnnualReportTableCell>);\r\n\r\n}\r\n\r\n\r\nexport default AnnualReportTableHeadCell;","import React from 'react'\r\nimport {connect} from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Form from 'components/Form';\r\nimport * as Yup from 'yup';\r\nimport useId from 'hooks/useId';\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport PropTypes from 'prop-types'\r\nimport RadioGroup from \"components/RadioGroup\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\n\r\n\r\nexport const getMoveAnnualReportEntryConfig = (reportId, tableEntryId, currentType) => ({reportId, tableEntryId, currentType})\r\n\r\nfunction MoveAnnualReportEntry(\r\n    {\r\n        onClose,\r\n        items,\r\n        inputLabel,\r\n        config,\r\n        reportStep,\r\n        formSubmit\r\n    }) {\r\n    const classes = annulaReportClasses();\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const submitFrom = (values) => {\r\n        onClose();\r\n        AnnualReportsService.moveAnnualReportTableEntry(config.reportId, config.tableEntryId, reportStep, config.currentType, values.type).then((result) => {\r\n            if(result) {\r\n                const section =  items.find(x => x.value === result.type);\r\n                enqueueSuccessSnackbar(Tr(\"moved_demand_number_to_section\", {number: result.number, section: (section ? section.label : \"\")}))\r\n            }\r\n        })\r\n\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={inputLabel}\r\n            open={true}\r\n            maxWidth={'sm'}\r\n            dialogActions={\r\n                <DoubleButton\r\n                    justify='flex-end'\r\n                    labelFirst={Tr('cancel')}\r\n                    labelSecond={Tr('confirm')}\r\n                    onClickFirst={onClose}\r\n                    onClickSecond={handleSubmit}\r\n                    disabledSecond={items.length === 0}\r\n                />}\r\n        >\r\n\r\n            <Form\r\n                initialValues={{\r\n                    type: null,\r\n                }}\r\n                validationSchema={Yup.object().shape({\r\n                    type: VS.anyRequired()\r\n                })}\r\n                onSubmit={submitFrom}\r\n                id={formId}\r\n            >\r\n                {(formikProps) => (\r\n                    <GridBlock column>\r\n                        {\r\n                            items.length > 0 &&\r\n                            <RadioGroup\r\n                                items={items}\r\n                                formikProps={formikProps}\r\n                                // label={inputLabel}\r\n                                id=\"type\"\r\n                                className={classes.moveEntryRadio}\r\n                            />\r\n                        }\r\n                    </GridBlock>\r\n                )}\r\n            </Form>\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nMoveAnnualReportEntry.propTypes = {\r\n    onClose: PropTypes.func.isRequired,\r\n    items: PropTypes.arrayOf(PropTypes.shape({\r\n        label: PropTypes.string.isRequired,\r\n        value: PropTypes.string.isRequired\r\n    })).isRequired,\r\n    inputLabel: PropTypes.string,\r\n    config: PropTypes.shape({\r\n        reportId: PropTypes.string.isRequired,\r\n        tableEntryId: PropTypes.number.isRequired,\r\n        currentType: PropTypes.string.isRequired\r\n    }).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(MoveAnnualReportEntry);","import React from 'react'\r\nimport ErrorIcon from '@material-ui/icons/Error';\r\nimport WorkableIconButton from \"./WorkableIconButton\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nfunction WorkableIconErrorButton(\r\n    {\r\n        tooltip,\r\n        ...props\r\n    }) {\r\n    return <WorkableIconButton\r\n        tooltip={tooltip}\r\n        Icon={ErrorIcon}\r\n        {...props}\r\n    />\r\n}\r\n\r\nWorkableIconErrorButton.propTypes = {\r\n    expanded: PropTypes.bool,\r\n    working: PropTypes.bool,\r\n    disabled: PropTypes.bool,\r\n    tooltip: PropTypes.string,\r\n    hideTooltip: PropTypes.bool,\r\n    color: PropTypes.string,\r\n    onClick: PropTypes.func\r\n}\r\n\r\nexport default WorkableIconErrorButton;","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport {TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport SwapVerticalCircleIcon from '@material-ui/icons/SwapVerticalCircle';\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport {getMoveAnnualReportEntryConfig} from \"../common/MoveAnnualReportEntry\";\r\nimport clsx from \"clsx\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport WorkableIconErrorButton from \"components/button/WorkableIconErrorButton\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport {useParams} from \"react-router\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';\r\nimport RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked';\r\nimport IconButton from \"components/button/IconButton\";\r\nimport {getAnnualReportEditPopup} from \"../common/AnnualReportEditPopup\";\r\nimport scrollTo from \"libs/scrollTo\";\r\n\r\nfunction AnnualReportTablePart(\r\n    {\r\n        type,\r\n        reportStep,\r\n        partName,\r\n        classes,\r\n        disabled,\r\n        entries,\r\n        search,\r\n        setEditPopup,\r\n        setMovePopup,\r\n        columnCount,\r\n        getRowValues,\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const [expanded, setExpanded] = useState(false);\r\n    const [hasIncomplete, setHasIncomplete] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const entriesFilteres = useMemo(() => {\r\n        if (search.search) {\r\n            return entries.filter((entry) => entry.number.includes(search.search))\r\n        }\r\n        return entries;\r\n    }, [entries, search])\r\n\r\n    useEffect(() => {\r\n        setHasIncomplete(entries.some(entry => !entry.complete))\r\n    }, [entries])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (!expanded && search.search && entries.some((entry) => entry.number.includes(search.search))) {\r\n            setExpanded(true);\r\n        }\r\n    }, [search])\r\n\r\n    const doDelete = (entry) => {\r\n        simpleConfirmNoTranslate(Tr(\"confirm_delete_annual_entry\", {number: entry.number}), () => {\r\n            AnnualReportsService.deleteAnnualReportTableEntry(params.id, entry.identity, reportStep, type).then((result) => {\r\n                if (result) {\r\n                    enqueueSuccessSnackbar(Tr(\"deleted\") + \" \" + entry.number)\r\n                }\r\n            })\r\n        })\r\n    }\r\n\r\n    const changeComplete = (entry, complete) => {\r\n        const data = {\r\n            ...entry,\r\n            complete\r\n        }\r\n        AnnualReportsService.saveAnnualReportTableEntry(params.id, reportStep, data)\r\n            .then((resp) => {\r\n                if (resp) {\r\n                    if (resp.success) {\r\n                        enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + entry.number)\r\n                    } else {\r\n                        setEditPopup(getAnnualReportEditPopup(entry, false, true))\r\n                    }\r\n                }\r\n\r\n            })\r\n    }\r\n\r\n    return (<>\r\n            <TableRow className={classes.variantRow}>\r\n                <AnnualReportTableCell borderLeft colSpan={columnCount - 1} onClick={() => setExpanded(!expanded)}>\r\n                    {`${partName} (${entriesFilteres.length}/${entries.length})`}\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell onClick={() => setExpanded(!expanded)}>\r\n                    {\r\n                        hasIncomplete && <WorkableIconErrorButton\r\n                            onClick={(e) => {\r\n                                e.stopPropagation();\r\n                                setExpanded(true);\r\n                                const incompleteEntry = entriesFilteres.find(x => !x.complete);\r\n                                if (incompleteEntry) {\r\n                                    setTimeout((identity) => scrollTo(`#${reportStep}-${identity}`, 200), 100, incompleteEntry.identity)\r\n                                }\r\n                            }}\r\n                            tooltip={Tr(\"annual_report_section_incomplete\")}\r\n                            className={classes.sectionErrorIcon}\r\n\r\n                        />\r\n                    }\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell borderRight colSpan={2}>\r\n                    <WorkableIconExpandButton expanded={expanded} onClick={() => setExpanded(!expanded)}/>\r\n                </AnnualReportTableCell>\r\n            </TableRow>\r\n            {expanded && entriesFilteres.map((entry) => (\r\n                <TableRow id={`${reportStep}-${entry.identity}`} key={entry.identity}\r\n                          className={clsx(type, classes.demandsRow, {complete: entry.complete, incomplete: !entry.complete})}>\r\n\r\n                    {\r\n                        getRowValues(entry).map((x, i) => <AnnualReportTableCell borderLeft key={i}>{x}</AnnualReportTableCell>)\r\n                    }\r\n\r\n                    <AnnualReportTableCell borderLeft className={classes.buttonColumn}>\r\n                        <WorkableIconEditButton disabled={disabled} onClick={() => setEditPopup(getAnnualReportEditPopup(entry))}/>\r\n                        {\r\n                            entry.complete ?\r\n                                <IconButton disabled={disabled} tooltip={Tr(\"mark_draft_version\")} Icon={CheckCircleOutlineIcon}\r\n                                            onClick={() => changeComplete(entry, false)}/>\r\n                                :\r\n                                <IconButton disabled={disabled} tooltip={Tr(\"mark_saved_version\")} Icon={RadioButtonUncheckedIcon}\r\n                                            onClick={() => changeComplete(entry, true)}/>\r\n                        }\r\n                    </AnnualReportTableCell>\r\n                    <AnnualReportTableCell borderRight className={classes.buttonColumn}>\r\n                        <WorkableIconButton\r\n                            disabled={disabled}\r\n                            Icon={SwapVerticalCircleIcon}\r\n                            tooltip={Tr(\"change_order_type\")}\r\n                            onClick={() => setMovePopup(getMoveAnnualReportEntryConfig(params.id, entry.identity, type))}\r\n                        />\r\n                        <WorkableIconDeleteButton\r\n                            disabled={disabled}\r\n                            onClick={() => doDelete(entry)}\r\n                        />\r\n                    </AnnualReportTableCell>\r\n                </TableRow>\r\n            ))\r\n            }\r\n            {expanded && !entriesFilteres.length && <TableRow>\r\n                <AnnualReportTableCell className={classes.noOptions} borderRight borderLeft colSpan={columnCount + 2}>\r\n                    {Tr(\"no_options\")}\r\n                </AnnualReportTableCell>\r\n            </TableRow>}\r\n        </>\r\n    );\r\n}\r\n\r\nAnnualReportTablePart.propTypes = {\r\n    type: PropTypes.string.isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    partName: PropTypes.string.isRequired,\r\n    classes: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    entries: PropTypes.array.isRequired,\r\n    search: PropTypes.shape({\r\n        search: PropTypes.string\r\n    }).isRequired,\r\n    setEditPopup: PropTypes.func.isRequired,\r\n    setMovePopup: PropTypes.func.isRequired,\r\n    columnCount: PropTypes.number.isRequired,\r\n    getRowValues: PropTypes.func.isRequired\r\n}\r\n\r\n\r\nexport default AnnualReportTablePart;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableBody, TableHead, TableRow, Tooltip} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportAboveEuEditForm from \"./AnnualReportAboveEuEditForm\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport formatBoolean from \"libs/formatBoolean\";\r\nimport formatInteger from \"libs/formatInteger\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\nimport AnnualReportTablePart from \"../common/AnnualReportTablePart\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\n\r\nconst columns = [\"number\", \"noticeNumber\", \"orderType\", \"codeCPV\", \"tenderMode\", \"contractorCountryList\", \"contractValue\", \"numberOfAwardedLots\",\r\n    \"numberOfOffers\", \"numberOfRejectedOffers\", \"numberOfOffersSubmittedByMMSP\", \"contractAwardedToMMSP\"];\r\nconst reportStep = annualReportSteps.aboveEu;\r\n\r\nfunction AnnualReportAboveEuForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, dictTranslations} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"MP.MMiA.OrdersType\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    const getRowValues = (entry) => ([\r\n        entry.number,\r\n        entry.noticeNumber,\r\n        entry.orderType ? dictTranslations.orderType[entry.orderType] : null,\r\n        entry.codeCPV ? <Tooltip title={entry.codeCPV.name}><span>{entry.codeCPV.publicCode}</span></Tooltip> : null,\r\n        entry.tenderMode ? dictTranslations.tenderModeTed[entry.tenderMode] : null,\r\n        entry.contractorCountryList ? entry.contractorCountryList.join(\", \") : null,\r\n        formatAmountNumber(entry.contractValue),\r\n        formatInteger(entry.numberOfAwardedLots),\r\n        formatInteger(entry.numberOfOffers),\r\n        formatInteger(entry.numberOfRejectedOffers),\r\n        formatInteger(entry.numberOfOffersSubmittedByMMSP),\r\n        formatBoolean(entry.contractAwardedToMMSP)\r\n    ])\r\n\r\n    if (!initValues) return <Loading/>\r\n    return <>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    {columns.map(x => (<AnnualReportTableHeadCell key={x} label={`mmia.${reportStep}.${x}`}/>))}\r\n                    <AnnualReportTableCell borderLeft borderRight colSpan={2}></AnnualReportTableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            reportStep={reportStep}\r\n                            partName={dictTranslations.type[type.value]}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            columnCount={columns.length}\r\n                            getRowValues={getRowValues}\r\n                        />\r\n                    )\r\n                }\r\n            </TableBody>\r\n\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={annualReportSteps.aboveEu}\r\n                FormComponent={AnnualReportAboveEuEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"order_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n    </>\r\n\r\n\r\n}\r\n\r\nAnnualReportAboveEuForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportAboveEuForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\n\r\nfunction AnnualReportBelowEuEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    return (<>\r\n        <NoticeGlossaryInput\r\n            label={`mmia.${reportStep}.type`}\r\n            id=\"type\"\r\n            formikProps={formikProps}\r\n            items={getDict(\"MP.MMiA.BelowEU.procedure\")}\r\n            disabled={buttonWorks.anyWorks}\r\n        />\r\n        <NoticeTextInput\r\n            label={`mmia.${reportStep}.number`}\r\n            id=\"number\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n        />\r\n        <NoticeGlossaryInput\r\n            label={`mmia.${reportStep}.orderType`}\r\n            id=\"orderType\"\r\n            formikProps={formikProps}\r\n            items={getDict(\"ENUM.002\")}\r\n            disabled={buttonWorks.anyWorks}\r\n        />\r\n        <NoticeNumericInput\r\n            label={`mmia.${reportStep}.amount`}\r\n            id=\"amount\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks}\r\n        />\r\n    </>)\r\n}\r\n\r\nAnnualReportBelowEuEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportBelowEuEditForm;","import React, {useContext, useEffect, useMemo, useState} from \"react\";\r\nimport {Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport SwapVerticalCircleIcon from '@material-ui/icons/SwapVerticalCircle';\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport {getMoveAnnualReportEntryConfig} from \"../common/MoveAnnualReportEntry\";\r\nimport WorkableIconErrorButton from \"components/button/WorkableIconErrorButton\";\r\nimport {useParams} from \"react-router\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport {getAnnualReportEditPopup} from \"../common/AnnualReportEditPopup\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport CheckCircleOutlineIcon from \"@material-ui/icons/CheckCircleOutline\";\r\nimport RadioButtonUncheckedIcon from \"@material-ui/icons/RadioButtonUnchecked\";\r\nimport AnnualReportSteps from \"../../constants/annualReportSteps\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport clsx from \"clsx\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport formatAmountNumber from \"../../../../../../libs/formatAmountNumber\";\r\n\r\nfunction AnnualReportBelowEuTablePart(\r\n    {\r\n        type,\r\n        classes,\r\n        disabled,\r\n        entries,\r\n        search,\r\n        setEditPopup,\r\n        setMovePopup\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const {formTr, dictTranslations} = useContext(FormTranslationContext)\r\n    const [expanded, setExpanded] = useState(false);\r\n    const [hasIncomplete, setHasIncomplete] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const [entriesCounted, setEntriesCounted] = useState({\r\n        worksCount: 0,\r\n        worksAmount: 0,\r\n        deliveriesCount: 0,\r\n        deliveriesAmount: 0,\r\n        servicesCount: 0,\r\n        servicesAmount: 0,\r\n    })\r\n\r\n    const entriesFilteres = useMemo(() => {\r\n        if (search.search) {\r\n            return entries.filter((entry) => entry.number.includes(search.search))\r\n        }\r\n        return entries;\r\n    }, [entries, search])\r\n\r\n    useEffect(() => {\r\n        let incomplete = false;\r\n        setEntriesCounted(entries.reduce((acc, entry) => {\r\n            incomplete = incomplete || !entry.complete;\r\n            if (entry.orderType === \"Services\") {\r\n                if (entry.amount)\r\n                        acc.servicesAmount += entry.amount\r\n                acc.servicesCount++\r\n            }\r\n            if (entry.orderType === \"Delivery\") {\r\n                if (entry.amount)\r\n                    acc.deliveriesAmount += entry.amount\r\n                acc.deliveriesCount++\r\n            }\r\n            if (entry.orderType === \"Works\") {\r\n                if (entry.amount)\r\n                    acc.worksAmount += entry.amount\r\n                acc.worksCount++\r\n            }\r\n            return acc;\r\n        }, {worksCount: 0, worksAmount: 0, deliveriesCount: 0, deliveriesAmount: 0, servicesCount: 0, servicesAmount: 0,}))\r\n        setHasIncomplete(incomplete);\r\n    }, [entries])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (!expanded && search.search && entries.some((entry) => entry.number.includes(search.search))) {\r\n            setExpanded(true);\r\n        }\r\n    }, [search])\r\n\r\n    const doDelete = (entry) => {\r\n        simpleConfirmNoTranslate(Tr(\"confirm_delete_annual_entry\", {number: entry.number}), () => {\r\n            AnnualReportsService.deleteAnnualReportTableEntry(params.id, entry.identity, AnnualReportSteps.belowEu, type).then((result) => {\r\n                if (result) {\r\n                    enqueueSuccessSnackbar(Tr(\"deleted\") + \" \" + entry.number)\r\n                }\r\n            })\r\n        })\r\n    }\r\n\r\n    const changeComplete = (entry, complete) => {\r\n        const data = {\r\n            ...entry,\r\n            complete\r\n        }\r\n        AnnualReportsService.saveAnnualReportTableEntry(params.id, annualReportSteps.belowEu, data)\r\n            .then((resp) => {\r\n                if (resp) {\r\n                    if (resp.success) {\r\n                        enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + entry.number)\r\n                    } else {\r\n                        setEditPopup(getAnnualReportEditPopup(entry, false, true))\r\n                    }\r\n                }\r\n\r\n            })\r\n    }\r\n\r\n    return (<>\r\n            <TableRow className={classes.variantRow}>\r\n                <AnnualReportTableCell borderLeft colSpan={6} onClick={() => setExpanded(!expanded)}>\r\n                    {`${dictTranslations.procedures[type]} (${entriesFilteres.length}/${entries.length})`}\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell onClick={() => setExpanded(!expanded)}>\r\n                    {hasIncomplete &&\r\n                        <WorkableIconErrorButton\r\n                            onClick={(e) => {\r\n                                e.stopPropagation();\r\n                                setExpanded(true);\r\n                                const incompleteEntry = entriesFilteres.find(x => !x.complete);\r\n                                if (incompleteEntry) {\r\n                                    setTimeout((identity) => scrollTo(`#${annualReportSteps.belowEu}-${identity}`, 200), 100, incompleteEntry.identity)\r\n                                }\r\n                            }}\r\n                            tooltip={Tr(\"annual_report_section_incomplete\")}\r\n                            className={classes.sectionErrorIcon}\r\n                        />\r\n                    }\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell borderLeft borderRight rowSpan={2}>\r\n                    <WorkableIconExpandButton expanded={expanded} onClick={() => setExpanded(!expanded)}/>\r\n                </AnnualReportTableCell>\r\n            </TableRow>\r\n            <TableRow className={classes.variantRow2}>\r\n                <AnnualReportTableCell borderLeft borderRight colSpan={2}>\r\n                    {dictTranslations.orderType[\"Services\"] + \": \"}\r\n                    {entriesCounted.servicesCount}\r\n                    {\" | \" + Tr(\"value\") + \": \"}\r\n                    {formatAmountNumber(entriesCounted.servicesAmount) + \" zł\"}\r\n                </AnnualReportTableCell>\r\n\r\n                <AnnualReportTableCell borderRight colSpan={2}>\r\n                    {dictTranslations.orderType[\"Delivery\"] + \": \"}\r\n                    {entriesCounted.deliveriesCount}\r\n                    {\" | \" + Tr(\"value\") + \": \"}\r\n                    {formatAmountNumber(entriesCounted.deliveriesAmount) + \" zł\"}\r\n                </AnnualReportTableCell>\r\n\r\n                <AnnualReportTableCell colSpan={3}>\r\n                    {dictTranslations.orderType[\"Works\"] + \": \"}\r\n                    {entriesCounted.worksCount}\r\n                    {\" | \" + Tr(\"value\") + \": \"}\r\n                    {formatAmountNumber(entriesCounted.worksAmount) + \" zł\"}\r\n                </AnnualReportTableCell>\r\n\r\n            </TableRow>\r\n            {expanded &&\r\n                <TableRow>\r\n                    <AnnualReportTableCell colSpan={8} borderLeft borderRight className={classes.demandsCell}>\r\n                        <Table className={classes.demandsTable}>\r\n                            <TableHead>\r\n                                <TableRow>\r\n                                    <AnnualReportTableCell>\r\n                                        {formTr(\"mmia.belowEu.number\")}\r\n                                    </AnnualReportTableCell>\r\n                                    <AnnualReportTableCell>\r\n                                        {formTr(\"mmia.belowEu.orderType\")}\r\n                                    </AnnualReportTableCell>\r\n                                    <AnnualReportTableCell>\r\n                                        {formTr(\"mmia.belowEu.amount\")}\r\n                                    </AnnualReportTableCell>\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                </TableRow>\r\n                            </TableHead>\r\n                            <TableBody>\r\n                                {entriesFilteres.map((entry, index) => (\r\n                                    <TableRow id={`${annualReportSteps.belowEu}-${entry.identity}`} key={index}\r\n                                              className={clsx(classes.demandsRow, {complete: entry.complete, incomplete: !entry.complete})}>\r\n                                        <AnnualReportTableCell>\r\n                                            {entry.number}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell>\r\n                                            {dictTranslations.orderType[entry.orderType]}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell>\r\n                                            {formatAmountNumber(entry.amount)}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell className={classes.buttonColumn}>\r\n                                            <WorkableIconEditButton disabled={disabled} onClick={() => setEditPopup(getAnnualReportEditPopup(entry))}/>\r\n                                            {\r\n                                                entry.complete ?\r\n                                                    <IconButton tooltip={Tr(\"mark_draft_version\")} onClick={() => changeComplete(entry, false)}\r\n                                                                Icon={CheckCircleOutlineIcon} disabled={disabled}/>\r\n                                                    :\r\n                                                    <IconButton tooltip={Tr(\"mark_saved_version\")} onClick={() => changeComplete(entry, true)}\r\n                                                                disabled={disabled} Icon={RadioButtonUncheckedIcon}/>\r\n                                            }\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell className={classes.buttonColumn}>\r\n                                            <WorkableIconButton\r\n                                                tooltip={Tr(\"change_variant\")} Icon={SwapVerticalCircleIcon} disabled={disabled}\r\n                                                onClick={() => setMovePopup(getMoveAnnualReportEntryConfig(params.id, entry.identity, type))}/>\r\n                                            <WorkableIconDeleteButton disabled={disabled} onClick={() => doDelete(entry)}\r\n                                            />\r\n                                        </AnnualReportTableCell>\r\n                                    </TableRow>\r\n                                ))}\r\n\r\n                                {!entriesFilteres.length && <TableRow>\r\n                                    <AnnualReportTableCell className={classes.noOptions} colSpan={5}>\r\n                                        {Tr(\"no_options\")}\r\n                                    </AnnualReportTableCell>\r\n                                </TableRow>}\r\n                            </TableBody>\r\n                        </Table>\r\n                    </AnnualReportTableCell>\r\n                </TableRow>\r\n            }\r\n\r\n        </>\r\n    );\r\n}\r\n\r\nAnnualReportBelowEuTablePart.propTypes = {\r\n    type: PropTypes.string.isRequired,\r\n    classes: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    entries: PropTypes.array.isRequired,\r\n    search: PropTypes.shape({\r\n        search: PropTypes.string\r\n    }).isRequired,\r\n    setEditPopup: PropTypes.func.isRequired,\r\n    setMovePopup: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default AnnualReportBelowEuTablePart;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableHead, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportBelowEuEditForm from \"./AnnualReportBelowEuEditForm\";\r\nimport AnnualReportBelowEuTablePart from \"./AnnualReportBelowEuTablePart\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\n\r\nconst reportStep = annualReportSteps.belowEu;\r\n\r\nfunction AnnualReportBelowEuForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, dictTranslations} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"MP.MMiA.BelowEU.procedure\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    if (!initValues) return <Loading/>\r\n    return (<>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableCell borderLeft borderRight colSpan={2}>\r\n                        {dictTranslations.orderType[\"Services\"]}\r\n                    </AnnualReportTableCell>\r\n                    <AnnualReportTableCell borderRight colSpan={2}>\r\n                        {dictTranslations.orderType[\"Delivery\"]}\r\n                    </AnnualReportTableCell>\r\n                    <AnnualReportTableCell borderRight colSpan={3}>\r\n                        {dictTranslations.orderType[\"Works\"]}\r\n                    </AnnualReportTableCell>\r\n                    <AnnualReportTableCell borderRight></AnnualReportTableCell>\r\n                </TableRow>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableHeadCell label=\"mmia.belowEu.count\"/>\r\n                    <AnnualReportTableHeadCell borderLeft={false} borderRight label=\"mmia.belowEu.amount\"/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.belowEu.count\"/>\r\n                    <AnnualReportTableHeadCell borderLeft={false} borderRight label=\"mmia.belowEu.amount\"/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.belowEu.count\"/>\r\n                    <AnnualReportTableHeadCell borderLeft={false} borderRight label=\"mmia.belowEu.amount\" colSpan={2}/>\r\n                    <AnnualReportTableCell borderRight>\r\n                    </AnnualReportTableCell>\r\n                </TableRow>\r\n\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportBelowEuTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                        />\r\n                    )\r\n                }\r\n            </TableHead>\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={annualReportSteps.belowEu}\r\n                FormComponent={AnnualReportBelowEuEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"demand_realization_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n    </>)\r\n\r\n\r\n}\r\n\r\nAnnualReportBelowEuForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportBelowEuForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeCpvInput from \"components/complex/nationalNotice/components/inputs/NoticeCpvInput\";\r\nimport NoticeIntegerInput from \"components/complex/nationalNotice/components/inputs/NoticeIntegerInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport AnnualReportNoticeSource from \"../../constants/AnnualReportNoticeSource\";\r\n\r\nfunction AnnualReportConflictEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const classes = annulaReportClasses();\r\n    return (<>\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.type`}\r\n                id=\"type\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.OrdersType\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.number`}\r\n                id=\"number\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.source`}\r\n                id=\"source\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.Source\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.noticeNumber`}\r\n                id=\"noticeNumber\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.orderType`}\r\n                id=\"orderType\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.002\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeCpvInput\r\n                label={`mmia.${reportStep}.codeCpv`}\r\n                id=\"codeCpv\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.BZP}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeBzp`}\r\n                    id=\"tenderModeBzp\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_BZP\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.TED}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeTed`}\r\n                    id=\"tenderModeTed\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_TED\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfCasesOfConflictOfInterest`}\r\n                id=\"numberOfCasesOfConflictOfInterest\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfDetectedAgreements`}\r\n                id=\"numberOfDetectedAgreements\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfContractorsWithRejectedOffer`}\r\n                id=\"numberOfContractorsWithRejectedOffer\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nAnnualReportConflictEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportConflictEditForm;","import AnnualReportNoticeSource from \"./AnnualReportNoticeSource\";\r\n\r\nconst annualReportTenderMode = (entry, dictTranslations) => {\r\n    if (entry.source === AnnualReportNoticeSource.BZP) {\r\n        return entry.tenderModeBzp ? dictTranslations.tenderModeBzp[entry.tenderModeBzp] : null\r\n    } else if (entry.source === AnnualReportNoticeSource.TED) {\r\n        return entry.tenderModeTed ? dictTranslations.tenderModeTed[entry.tenderModeTed] : null\r\n    }\r\n    return null;\r\n}\r\nexport default annualReportTenderMode;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableBody, TableHead, TableRow, Tooltip} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportConflictEditForm from \"./AnnualReportConflictEditForm\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\nimport AnnualReportTablePart from \"../common/AnnualReportTablePart\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport formatInteger from \"libs/formatInteger\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport Tr from \"translations/Translations\";\r\nimport annualReportTenderMode from \"../../constants/annualReportTenderMode\";\r\n\r\nconst reportStep = annualReportSteps.conflict;\r\n\r\nfunction AnnualReportConflictForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, dictTranslations} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"MP.MMiA.OrdersType\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    const getRowValues = (entry) => ([\r\n        entry.number,\r\n        entry.source ? dictTranslations.source[entry.source] : null,\r\n        entry.noticeNumber,\r\n        entry.orderType ? dictTranslations.orderType[entry.orderType] : null,\r\n        entry.codeCpv ? <Tooltip title={entry.codeCpv.name}><span>{entry.codeCpv.publicCode}</span></Tooltip> : null,\r\n        annualReportTenderMode(entry, dictTranslations),\r\n        formatInteger(entry.numberOfCasesOfConflictOfInterest),\r\n        formatInteger(entry.numberOfDetectedAgreements),\r\n        formatInteger(entry.numberOfContractorsWithRejectedOffer),\r\n    ])\r\n\r\n    if (!initValues) return <Loading/>\r\n    return <>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.number\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.source\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.noticeNumber\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.orderType\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.codeCpv\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.tenderModeBzp\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.numberOfCasesOfConflictOfInterest\" rowSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.complete\" colSpan={2} borderRight/>\r\n                    <AnnualReportTableCell borderLeft borderRight rowSpan={2} colSpan={2}></AnnualReportTableCell>\r\n                </TableRow>\r\n                <TableRow>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.numberOfDetectedAgreements\"/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.conflict.numberOfContractorsWithRejectedOffer\"/>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            reportStep={reportStep}\r\n                            partName={dictTranslations.type[type.value]}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            columnCount={9}\r\n                            getRowValues={getRowValues}\r\n                        />\r\n                    )\r\n                }\r\n            </TableBody>\r\n\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={annualReportSteps.conflict}\r\n                FormComponent={AnnualReportConflictEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"order_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n    </>\r\n\r\n\r\n}\r\n\r\nAnnualReportConflictForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportConflictForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeCpvInput from \"components/complex/nationalNotice/components/inputs/NoticeCpvInput\";\r\nimport NoticeIntegerInput from \"components/complex/nationalNotice/components/inputs/NoticeIntegerInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeYesNoInput from \"components/complex/nationalNotice/components/inputs/NoticeYesNoInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport AnnualReportNoticeSource from \"../../constants/AnnualReportNoticeSource\";\r\n\r\nfunction AnnualReportCommunityEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const classes = annulaReportClasses();\r\n    return (<>\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.type`}\r\n                id=\"type\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.OrdersType\").filter(item => item.value !== \"DEFENSE_AND_SECURITY\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.number`}\r\n                id=\"number\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.source`}\r\n                id=\"source\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.Source\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.noticeNumber`}\r\n                id=\"noticeNumber\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.serviceDescription`}\r\n                id=\"serviceDescription\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeCpvInput\r\n                label={`mmia.${reportStep}.codeCpv`}\r\n                id=\"codeCpv\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.BZP}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeBzp`}\r\n                    id=\"tenderModeBzp\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_BZP\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.TED}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeTed`}\r\n                    id=\"tenderModeTed\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_TED\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.reservedTender`}\r\n                id=\"reservedTender\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeNumericInput\r\n                label={`mmia.${reportStep}.amount`}\r\n                id=\"amount\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfAwardedLots`}\r\n                id=\"numberOfAwardedLots\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfOffers`}\r\n                id=\"numberOfOffers\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfOffersMMSP`}\r\n                id=\"numberOfOffersMMSP\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nAnnualReportCommunityEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportCommunityEditForm;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableBody, TableHead, TableRow, Tooltip} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportCommunityEditForm from \"./AnnualReportCommunityEditForm\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport AnnualReportTablePart from \"../common/AnnualReportTablePart\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport formatBoolean from \"libs/formatBoolean\";\r\nimport formatInteger from \"libs/formatInteger\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\nimport annualReportTenderMode from \"../../constants/annualReportTenderMode\";\r\n\r\nconst columns = [\"number\", \"source\", \"noticeNumber\", \"serviceDescription\", \"codeCpv\", \"tenderModeBzp\", \"reservedTender\", \"amount\",\r\n    \"numberOfAwardedLots\", \"numberOfOffers\", \"numberOfOffersMMSP\"];\r\nconst reportStep = annualReportSteps.community;\r\n\r\nfunction AnnualReportCommunityForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, dictTranslations} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"MP.MMiA.OrdersType\").filter(item => item.value !== \"DEFENSE_AND_SECURITY\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    const getRowValues = (entry) => ([\r\n        entry.number,\r\n        entry.source ? dictTranslations.source[entry.source] : null,\r\n        entry.noticeNumber,\r\n        entry.serviceDescription,\r\n        entry.codeCpv ? <Tooltip title={entry.codeCpv.name}><span>{entry.codeCpv.publicCode}</span></Tooltip> : null,\r\n        annualReportTenderMode(entry, dictTranslations),\r\n        formatBoolean(entry.reservedTender),\r\n        formatAmountNumber(entry.amount),\r\n        formatInteger(entry.numberOfAwardedLots),\r\n        formatInteger(entry.numberOfOffers),\r\n        formatInteger(entry.numberOfOffersMMSP),\r\n    ])\r\n\r\n    if (!initValues) return <Loading/>\r\n    return <>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    {columns.map(x => (<AnnualReportTableHeadCell key={x} label={`mmia.${reportStep}.${x}`}/>))}\r\n                    <AnnualReportTableCell borderLeft borderRight colSpan={2}></AnnualReportTableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            reportStep={reportStep}\r\n                            partName={dictTranslations.type[type.value]}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            columnCount={columns.length}\r\n                            getRowValues={getRowValues}\r\n                        />\r\n                    )\r\n                }\r\n            </TableBody>\r\n\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={annualReportSteps.community}\r\n                FormComponent={AnnualReportCommunityEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"order_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n    </>\r\n}\r\n\r\nAnnualReportCommunityForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportCommunityForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeCpvInput from \"components/complex/nationalNotice/components/inputs/NoticeCpvInput\";\r\nimport NoticeIntegerInput from \"components/complex/nationalNotice/components/inputs/NoticeIntegerInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeYesNoInput from \"components/complex/nationalNotice/components/inputs/NoticeYesNoInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\nimport AnnualReportNoticeSource from \"../../constants/AnnualReportNoticeSource\";\r\n\r\nfunction AnnualReportSocialEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const classes = annulaReportClasses();\r\n\r\n    return (<>\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.type`}\r\n                id=\"type\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.OrdersType\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.number`}\r\n                id=\"number\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.source`}\r\n                id=\"source\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.Source\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.noticeNumber`}\r\n                id=\"noticeNumber\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.orderType`}\r\n                id=\"orderType\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.002\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeCpvInput\r\n                label={`mmia.${reportStep}.codeCpv`}\r\n                id=\"codeCpv\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.BZP}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeBzp`}\r\n                    id=\"tenderModeBzp\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_BZP\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.TED}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeTed`}\r\n                    id=\"tenderModeTed\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_TED\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n            <NoticeNumericInput\r\n                label={`mmia.${reportStep}.contractValue`}\r\n                id=\"contractValue\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfAwardedLots`}\r\n                id=\"numberOfAwardedLots\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeIntegerInput\r\n                label={`mmia.${reportStep}.numberOfOffers`}\r\n                id=\"numberOfOffers\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.reservedTender`}\r\n                id=\"reservedTender\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.inDescriptionRequirementsForAccessibility`}\r\n                id=\"inDescriptionRequirementsForAccessibility\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.definedSocialAspectsInOfferEvaluationCriteria`}\r\n                id=\"definedSocialAspectsInOfferEvaluationCriteria\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.definedRequirementsBasedOnEmploymentRelationship`}\r\n                id=\"definedRequirementsBasedOnEmploymentRelationship\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.definedSocialAspectsRequirements`}\r\n                id=\"definedSocialAspectsRequirements\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.definedLabelRelatedToSocialAspects`}\r\n                id=\"definedLabelRelatedToSocialAspects\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.contractorType`}\r\n                id=\"contractorType\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"SL.MMiA.062\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nAnnualReportSocialEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportSocialEditForm;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableBody, TableHead, TableRow, Tooltip} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportSocialEditForm from \"./AnnualReportSocialEditForm\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\nimport AnnualReportTablePart from \"../common/AnnualReportTablePart\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport formatBoolean from \"libs/formatBoolean\";\r\nimport formatInteger from \"libs/formatInteger\";\r\nimport annualReportTenderMode from \"../../constants/annualReportTenderMode\";\r\n\r\nconst reportStep = annualReportSteps.social;\r\n\r\nfunction AnnualReportSocialForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, dictTranslations} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"MP.MMiA.OrdersType\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    const getRowValues = (entry) => ([\r\n        entry.number,\r\n        entry.source ? dictTranslations.source[entry.source] : null,\r\n        entry.noticeNumber,\r\n        entry.orderType ? dictTranslations.orderType[entry.orderType] : null,\r\n        entry.codeCpv ? <Tooltip title={entry.codeCpv.name}><span>{entry.codeCpv.publicCode}</span></Tooltip> : null,\r\n        annualReportTenderMode(entry, dictTranslations),\r\n        formatAmountNumber(entry.contractValue),\r\n        formatInteger(entry.numberOfAwardedLots),\r\n        formatInteger(entry.numberOfOffers),\r\n        formatBoolean(entry.reservedTender),\r\n        formatBoolean(entry.inDescriptionRequirementsForAccessibility),\r\n        formatBoolean(entry.definedSocialAspectsInOfferEvaluationCriteria),\r\n        formatBoolean(entry.definedRequirementsBasedOnEmploymentRelationship),\r\n        formatBoolean(entry.definedSocialAspectsRequirements),\r\n        formatBoolean(entry.definedLabelRelatedToSocialAspects),\r\n        dictTranslations.contractorType[entry.contractorType],\r\n    ])\r\n\r\n    if (!initValues) return <Loading/>\r\n    return <>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.number`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.source`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.noticeNumber`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.orderType`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.codeCpv`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.tenderModeBzp`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.contractValue`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.numberOfAwardedLots`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.numberOfOffers`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.reservedTender`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.inDescriptionRequirementsForAccessibility`} maxWidth={130}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.definedSocialAspectsInOfferEvaluationCriteria`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.definedRequirementsBasedOnEmploymentRelationship`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.definedSocialAspectsRequirements`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.definedLabelRelatedToSocialAspects`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.contractorType`}/>\r\n                    <AnnualReportTableCell borderLeft borderRight colSpan={2}></AnnualReportTableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            reportStep={reportStep}\r\n                            partName={dictTranslations.type[type.value]}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            columnCount={16}\r\n                            getRowValues={getRowValues}\r\n                        />\r\n                    )\r\n                }\r\n            </TableBody>\r\n\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={annualReportSteps.social}\r\n                FormComponent={AnnualReportSocialEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"order_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n    </>\r\n\r\n\r\n}\r\n\r\nAnnualReportSocialForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportSocialForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeCpvInput from \"components/complex/nationalNotice/components/inputs/NoticeCpvInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport NoticeYesNoInput from \"components/complex/nationalNotice/components/inputs/NoticeYesNoInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport AnnualReportNoticeSource from \"../../constants/AnnualReportNoticeSource\";\r\nimport getObjectValue from \"libs/getObjectValue\";\r\n\r\nfunction AnnualReportInnovativeEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext)\r\n    const classes = annulaReportClasses();\r\n    return (<>\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.type`}\r\n                id=\"type\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.OrdersType\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.number`}\r\n                id=\"number\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.source`}\r\n                id=\"source\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"MP.MMiA.Source\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeTextInput\r\n                label={`mmia.${reportStep}.noticeNumber`}\r\n                id=\"noticeNumber\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeGlossaryInput\r\n                label={`mmia.${reportStep}.orderType`}\r\n                id=\"orderType\"\r\n                formikProps={formikProps}\r\n                items={getDict(\"ENUM.002\")}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeCpvInput\r\n                label={`mmia.${reportStep}.codeCpv`}\r\n                id=\"codeCpv\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.BZP}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeBzp`}\r\n                    id=\"tenderModeBzp\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_BZP\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n\r\n            <Collapse in={getObjectValue(\"source\", formikProps.values) === AnnualReportNoticeSource.TED}>\r\n                <NoticeGlossaryInput\r\n                    className={classes.exceptionChip}\r\n                    label={`mmia.${reportStep}.tenderModeTed`}\r\n                    id=\"tenderModeTed\"\r\n                    formikProps={formikProps}\r\n                    items={getDict(\"ENUM.018_019_TED\")}\r\n                    disabled={buttonWorks.anyWorks}\r\n                />\r\n            </Collapse>\r\n\r\n            <NoticeNumericInput\r\n                label={`mmia.${reportStep}.contractValue`}\r\n                id=\"contractValue\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.environmentalRequirements`}\r\n                id=\"environmentalRequirements\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.environmentalManagementSystemAndStandards`}\r\n                id=\"environmentalManagementSystemAndStandards\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.environmentalAspectsInEvaluationCriteria`}\r\n                id=\"environmentalAspectsInEvaluationCriteria\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.costCriterionUsingLifeCycleCostingApplied`}\r\n                id=\"costCriterionUsingLifeCycleCostingApplied\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.environmentalAspectsRequirements`}\r\n                id=\"environmentalAspectsRequirements\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.labelRelatedToEnvAspectsOrMeasureOfEvidence`}\r\n                id=\"labelRelatedToEnvAspectsOrMeasureOfEvidence\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.innovativeAspectsInEvaluationCriteria`}\r\n                id=\"innovativeAspectsInEvaluationCriteria\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n            <NoticeYesNoInput\r\n                label={`mmia.${reportStep}.innovativeAspectsRequirements`}\r\n                id=\"innovativeAspectsRequirements\"\r\n                formikProps={formikProps}\r\n                disabled={buttonWorks.anyWorks}\r\n            />\r\n\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nAnnualReportInnovativeEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportInnovativeEditForm;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableBody, TableHead, TableRow, Tooltip} from \"@material-ui/core\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportInnovativeEditForm from \"./AnnualReportInnovativeEditForm\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport AnnualReportTablePart from \"../common/AnnualReportTablePart\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport formatBoolean from \"libs/formatBoolean\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport annualReportTenderMode from \"../../constants/annualReportTenderMode\";\r\n\r\n\r\nconst reportStep = annualReportSteps.innovative;\r\n\r\nfunction AnnualReportInnovativeForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, dictTranslations} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"MP.MMiA.OrdersType\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n\r\n    const getRowValues = (entry) => ([\r\n        entry.number,\r\n        entry.source ? dictTranslations.source[entry.source] : null,\r\n        entry.noticeNumber,\r\n        entry.orderType ? dictTranslations.orderType[entry.orderType] : null,\r\n        entry.codeCpv ? <Tooltip title={entry.codeCpv.name}><span>{entry.codeCpv.publicCode}</span></Tooltip> : null,\r\n        annualReportTenderMode(entry, dictTranslations),\r\n        formatAmountNumber(entry.contractValue),\r\n        formatBoolean(entry.environmentalRequirements),\r\n        formatBoolean(entry.environmentalManagementSystemAndStandards),\r\n        formatBoolean(entry.environmentalAspectsInEvaluationCriteria),\r\n        formatBoolean(entry.costCriterionUsingLifeCycleCostingApplied),\r\n        formatBoolean(entry.environmentalAspectsRequirements),\r\n        formatBoolean(entry.labelRelatedToEnvAspectsOrMeasureOfEvidence),\r\n        formatBoolean(entry.innovativeAspectsInEvaluationCriteria),\r\n        formatBoolean(entry.innovativeAspectsRequirements),\r\n    ])\r\n\r\n    if (!initValues) return <Loading/>\r\n    return <>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.number`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.source`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.noticeNumber`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.orderType`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.codeCpv`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.tenderModeBzp`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.contractValue`}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.environmentalRequirements`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.environmentalManagementSystemAndStandards`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.environmentalAspectsInEvaluationCriteria`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.costCriterionUsingLifeCycleCostingApplied`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.environmentalAspectsRequirements`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.labelRelatedToEnvAspectsOrMeasureOfEvidence`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.innovativeAspectsInEvaluationCriteria`} maxWidth={100}/>\r\n                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.innovativeAspectsRequirements`} maxWidth={100}/>\r\n                    <AnnualReportTableCell borderLeft borderRight colSpan={2}></AnnualReportTableCell>\r\n                </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            reportStep={reportStep}\r\n                            partName={dictTranslations.type[type.value]}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            columnCount={15}\r\n                            getRowValues={getRowValues}\r\n                        />\r\n                    )\r\n                }\r\n            </TableBody>\r\n\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={reportStep}\r\n                FormComponent={AnnualReportInnovativeEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"order_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n    </>\r\n\r\n\r\n}\r\n\r\nAnnualReportInnovativeForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportInnovativeForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\n\r\nfunction AnnualReportExceptionEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext);\r\n    const classes = annulaReportClasses();\r\n    return (<>\r\n        <NoticeGlossaryInput\r\n            className={classes.exceptionChip}\r\n            label={`mmia.${reportStep}.type`}\r\n            id=\"type\"\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MMiA.063\").map((item, index) => ({\r\n                label: index + \" - \" + item.label,\r\n                value: item.value\r\n            }))}\r\n            disabled={buttonWorks.anyWorks}\r\n        />\r\n        <NoticeTextInput\r\n            label={`mmia.${reportStep}.number`}\r\n            id=\"number\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n        />\r\n        <NoticeTextInput\r\n            label={`mmia.${reportStep}.name`}\r\n            id=\"name\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks || entry.demandId != null}\r\n        />\r\n        <NoticeNumericInput\r\n            label={`mmia.${reportStep}.contractValue`}\r\n            id=\"contractValue\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks}\r\n        />\r\n    </>)\r\n}\r\n\r\nAnnualReportExceptionEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportExceptionEditForm;","import React, {useContext, useEffect, useMemo, useState} from \"react\";\r\nimport {Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport SwapVerticalCircleIcon from '@material-ui/icons/SwapVerticalCircle';\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport {getMoveAnnualReportEntryConfig} from \"../common/MoveAnnualReportEntry\";\r\nimport WorkableIconErrorButton from \"components/button/WorkableIconErrorButton\";\r\nimport {useParams} from \"react-router\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport {getAnnualReportEditPopup} from \"../common/AnnualReportEditPopup\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport CheckCircleOutlineIcon from \"@material-ui/icons/CheckCircleOutline\";\r\nimport RadioButtonUncheckedIcon from \"@material-ui/icons/RadioButtonUnchecked\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport clsx from \"clsx\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\n\r\nfunction AnnualReportExceptionTablePart(\r\n    {\r\n        type,\r\n        reportStep,\r\n        classes,\r\n        disabled,\r\n        entries,\r\n        index,\r\n        search,\r\n        setEditPopup,\r\n        setMovePopup\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const {dictTranslations} = useContext(FormTranslationContext)\r\n    const [expanded, setExpanded] = useState(false);\r\n    const [hasIncomplete, setHasIncomplete] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const [entriesCounted, setEntriesCounted] = useState({\r\n        count: 0,\r\n        contractValue: 0,\r\n    })\r\n\r\n    const entriesFilteres = useMemo(() => {\r\n        if (search.search) {\r\n            return entries.filter((entry) => entry.number.includes(search.search))\r\n        }\r\n        return entries;\r\n    }, [entries, search])\r\n\r\n    useEffect(() => {\r\n        let incomplete = false;\r\n        setEntriesCounted(entries.reduce((acc, entry) => {\r\n            incomplete = incomplete || !entry.complete;\r\n            if (entry.contractValue)\r\n                acc.contractValue += parseFloat(entry.contractValue)\r\n            acc.count++\r\n            return acc;\r\n        }, {count: 0, contractValue: 0}))\r\n        setHasIncomplete(incomplete);\r\n    }, [entries])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (!expanded && search.search && entries.some((entry) => entry.number.includes(search.search))) {\r\n            setExpanded(true);\r\n        }\r\n    }, [search])\r\n\r\n    const doDelete = (entry) => {\r\n        simpleConfirmNoTranslate(Tr(\"confirm_delete_annual_entry\", {number: entry.number}), () => {\r\n            AnnualReportsService.deleteAnnualReportTableEntry(params.id, entry.identity, reportStep, type).then((result) => {\r\n                if (result) {\r\n                    enqueueSuccessSnackbar(Tr(\"deleted\") + \" \" + entry.number)\r\n                }\r\n            })\r\n        })\r\n    }\r\n\r\n    const changeComplete = (entry, complete) => {\r\n        const data = {\r\n            ...entry,\r\n            complete\r\n        }\r\n        AnnualReportsService.saveAnnualReportTableEntry(params.id, reportStep, data)\r\n            .then((resp) => {\r\n                if (resp) {\r\n                    if (resp.success) {\r\n                        enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + entry.number)\r\n                    } else {\r\n                        setEditPopup(getAnnualReportEditPopup(entry, false, true))\r\n                    }\r\n                }\r\n\r\n            })\r\n    }\r\n\r\n    return (<>\r\n            <TableRow className={classes.variantRow}>\r\n                <AnnualReportTableCell borderLeft>{index !== 0 ? index : null }</AnnualReportTableCell>\r\n                <AnnualReportTableCell borderLeft onClick={() => setExpanded(!expanded)} className={classes.exceptionName}>\r\n                    {`${dictTranslations.exceptions[type]} (${entriesFilteres.length}/${entries.length})`}\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell onClick={() => setExpanded(!expanded)}>\r\n                    {hasIncomplete &&\r\n                        <WorkableIconErrorButton\r\n                            onClick={(e) => {\r\n                                e.stopPropagation();\r\n                                setExpanded(true);\r\n                                const incompleteEntry = entriesFilteres.find(x => !x.complete);\r\n                                if (incompleteEntry) {\r\n                                    setTimeout((identity) => scrollTo(`#${reportStep}-${identity}`, 200), 100, incompleteEntry.identity)\r\n                                }\r\n                            }}\r\n                            tooltip={Tr(\"annual_report_section_incomplete\")}\r\n                            className={classes.sectionErrorIcon}\r\n                        />\r\n                    }\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell borderLeft>{entriesCounted.count}</AnnualReportTableCell>\r\n                <AnnualReportTableCell borderLeft>{formatAmountNumber(entriesCounted.contractValue) + \" zł\"}</AnnualReportTableCell>\r\n\r\n                <AnnualReportTableCell borderLeft borderRight>\r\n                    <WorkableIconExpandButton expanded={expanded} onClick={() => setExpanded(!expanded)}/>\r\n                </AnnualReportTableCell>\r\n            </TableRow>\r\n            {expanded &&\r\n                <TableRow>\r\n                    <AnnualReportTableCell colSpan={6} borderLeft borderRight className={classes.demandsCell}>\r\n                        <Table className={classes.demandsTable}>\r\n                            <TableHead>\r\n                                <TableRow>\r\n                                    <AnnualReportTableHeadCell borderLeft={false} label={`mmia.${reportStep}.number`}/>\r\n                                    <AnnualReportTableHeadCell borderLeft={false} label={`mmia.${reportStep}.name`}/>\r\n                                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.contractValue`}/>\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                </TableRow>\r\n                            </TableHead>\r\n                            <TableBody>\r\n                                {entriesFilteres.map((entry, index) => (\r\n                                    <TableRow id={`${reportStep}-${entry.identity}`} key={index}\r\n                                              className={clsx(classes.demandsRow, {complete: entry.complete, incomplete: !entry.complete})}>\r\n                                        <AnnualReportTableCell>\r\n                                            {entry.number}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell>\r\n                                            {entry.name}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell>\r\n                                            {formatAmountNumber(entry.contractValue)}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell className={classes.buttonColumn}>\r\n                                            <WorkableIconEditButton disabled={disabled} onClick={() => setEditPopup(getAnnualReportEditPopup(entry))}/>\r\n                                            {\r\n                                                entry.complete ?\r\n                                                    <IconButton tooltip={Tr(\"mark_draft_version\")} onClick={() => changeComplete(entry, false)}\r\n                                                                Icon={CheckCircleOutlineIcon} disabled={disabled}/>\r\n                                                    :\r\n                                                    <IconButton tooltip={Tr(\"mark_saved_version\")} onClick={() => changeComplete(entry, true)}\r\n                                                                disabled={disabled} Icon={RadioButtonUncheckedIcon}/>\r\n                                            }\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell className={classes.buttonColumn}>\r\n                                            <WorkableIconButton\r\n                                                tooltip={Tr(\"change_exclusion\")} Icon={SwapVerticalCircleIcon} disabled={disabled}\r\n                                                onClick={() => setMovePopup(getMoveAnnualReportEntryConfig(params.id, entry.identity, type))}/>\r\n                                            <WorkableIconDeleteButton disabled={disabled} onClick={() => doDelete(entry)}\r\n                                            />\r\n                                        </AnnualReportTableCell>\r\n                                    </TableRow>\r\n                                ))}\r\n\r\n                                {!entriesFilteres.length && <TableRow>\r\n                                    <AnnualReportTableCell className={classes.noOptions} colSpan={5}>\r\n                                        {Tr(\"no_options\")}\r\n                                    </AnnualReportTableCell>\r\n                                </TableRow>}\r\n                            </TableBody>\r\n                        </Table>\r\n                    </AnnualReportTableCell>\r\n                </TableRow>\r\n            }\r\n\r\n        </>\r\n    );\r\n}\r\n\r\nAnnualReportExceptionTablePart.propTypes = {\r\n    type: PropTypes.string.isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    classes: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    entries: PropTypes.array.isRequired,\r\n    search: PropTypes.shape({\r\n        search: PropTypes.string\r\n    }).isRequired,\r\n    setEditPopup: PropTypes.func.isRequired,\r\n    setMovePopup: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default AnnualReportExceptionTablePart;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableHead, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportExceptionEditForm from \"./AnnualReportExceptionEditForm\";\r\nimport AnnualReportExceptionTablePart from \"./AnnualReportExceptionTablePart\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\n\r\nconst reportStep = annualReportSteps.exception;\r\n\r\nfunction AnnualReportExceptionForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict, formTr} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"SL.MMiA.063\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    if (!initValues) return <Loading/>\r\n    return (<>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableCell borderLeft>\r\n                        <div>{Tr(\"column_lp\")}</div>\r\n                    </AnnualReportTableCell>\r\n                    <AnnualReportTableHeadCell label=\"mmia.exception.type\" colSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.exception.complete\"/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.exception.contractValue\"/>\r\n                    <AnnualReportTableCell borderRight borderLeft/>\r\n                </TableRow>\r\n\r\n                {\r\n                    types.map((type, index) =>\r\n                        <AnnualReportExceptionTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            index={index}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            reportStep={reportStep}\r\n                        />\r\n                    )\r\n                }\r\n            </TableHead>\r\n        </Table>\r\n\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={reportStep}\r\n                FormComponent={AnnualReportExceptionEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.map((item, index) => ({\r\n                    label: index + \" - \" + item.label,\r\n                    value: item.value\r\n                })).filter((item) => item.value !== movePopup.currentType)}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={formTr(\"mmia.exception.type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n\r\n    </>)\r\n\r\n\r\n}\r\n\r\nAnnualReportExceptionForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportExceptionForm;","import React, {useContext} from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport NoticeTextInput from \"components/complex/nationalNotice/components/inputs/NoticeTextInput\";\r\nimport NoticeGlossaryInput from \"components/complex/nationalNotice/components/inputs/NoticeGlossaryInput\";\r\nimport NoticeNumericInput from \"components/complex/nationalNotice/components/inputs/NoticeNumericInput\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport annulaReportClasses from \"../../constants/annulaReportClasses\";\r\n\r\nfunction AnnualReportNotIncludedEditForm(\r\n    {\r\n        entry,\r\n        newEntry,\r\n        buttonWorks,\r\n        reportStep,\r\n        formikProps\r\n    }) {\r\n    const {getDict} = useContext(FormTranslationContext);\r\n    const classes = annulaReportClasses();\r\n    return (<>\r\n        <NoticeGlossaryInput\r\n            className={classes.exceptionChip}\r\n            label={`mmia.${reportStep}.type`}\r\n            id=\"type\"\r\n            formikProps={formikProps}\r\n            items={getDict(\"SL.MMiA.064\")}\r\n            disabled={buttonWorks.anyWorks}\r\n            prefixLabelsWithKeys\r\n        />\r\n        <NoticeTextInput\r\n            label={`mmia.${reportStep}.number`}\r\n            id=\"number\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks || entry.demandId != null || entry.agreementStateId != null}\r\n        />\r\n        <NoticeTextInput\r\n            label={`mmia.${reportStep}.name`}\r\n            id=\"name\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks || entry.demandId != null || entry.agreementStateId != null}\r\n        />\r\n        <NoticeNumericInput\r\n            label={`mmia.${reportStep}.contractValue`}\r\n            id=\"contractValue\"\r\n            formikProps={formikProps}\r\n            disabled={buttonWorks.anyWorks}\r\n        />\r\n    </>)\r\n}\r\n\r\nAnnualReportNotIncludedEditForm.propTypes = {\r\n    entry: PropTypes.object.isRequired,\r\n    newEntry: PropTypes.bool,\r\n    buttonWorks: PropTypes.shape({anyWorks: PropTypes.bool.isRequired}).isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    formikProps: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportNotIncludedEditForm;","import React, {useContext, useEffect, useMemo, useState} from \"react\";\r\nimport {Table, TableBody, TableCell, TableHead, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport PropTypes from \"prop-types\";\r\nimport Tr from \"translations/Translations\";\r\nimport WorkableIconExpandButton from \"components/button/WorkableIconExpandButton\";\r\nimport WorkableIconDeleteButton from \"components/button/WorkableIconDeleteButton\";\r\nimport SwapVerticalCircleIcon from '@material-ui/icons/SwapVerticalCircle';\r\nimport WorkableIconButton from \"components/button/WorkableIconButton\";\r\nimport {getMoveAnnualReportEntryConfig} from \"../common/MoveAnnualReportEntry\";\r\nimport WorkableIconErrorButton from \"components/button/WorkableIconErrorButton\";\r\nimport {useParams} from \"react-router\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport WorkableIconEditButton from \"components/button/WorkableIconEditButton\";\r\nimport {getAnnualReportEditPopup} from \"../common/AnnualReportEditPopup\";\r\nimport IconButton from \"components/button/IconButton\";\r\nimport CheckCircleOutlineIcon from \"@material-ui/icons/CheckCircleOutline\";\r\nimport RadioButtonUncheckedIcon from \"@material-ui/icons/RadioButtonUnchecked\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport {useDidUpdateEffect} from \"hooks/useDidUpdateEffect\";\r\nimport clsx from \"clsx\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport formatAmountNumber from \"libs/formatAmountNumber\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\n\r\nfunction AnnualReportNotIncludedTablePart(\r\n    {\r\n        type,\r\n        reportStep,\r\n        classes,\r\n        disabled,\r\n        entries,\r\n        search,\r\n        setEditPopup,\r\n        setMovePopup\r\n    }\r\n) {\r\n    const params = useParams();\r\n    const {dictTranslations} = useContext(FormTranslationContext)\r\n    const [expanded, setExpanded] = useState(false);\r\n    const [hasIncomplete, setHasIncomplete] = useState(false);\r\n    const {enqueueSuccessSnackbar} = useSnackbar();\r\n\r\n    const [entriesCounted, setEntriesCounted] = useState({\r\n        contractValue: 0,\r\n    })\r\n\r\n    const entriesFilteres = useMemo(() => {\r\n        if (search.search) {\r\n            return entries.filter((entry) => entry.number.includes(search.search))\r\n        }\r\n        return entries;\r\n    }, [entries, search])\r\n\r\n    useEffect(() => {\r\n        let incomplete = false;\r\n        setEntriesCounted(entries.reduce((acc, entry) => {\r\n            incomplete = incomplete || !entry.complete;\r\n            if (entry.contractValue)\r\n                acc.contractValue += parseFloat(entry.contractValue)\r\n            return acc;\r\n        }, {contractValue: 0}))\r\n        setHasIncomplete(incomplete);\r\n    }, [entries])\r\n\r\n    useDidUpdateEffect(() => {\r\n        if (!expanded && search.search && entries.some((entry) => entry.number.includes(search.search))) {\r\n            setExpanded(true);\r\n        }\r\n    }, [search])\r\n\r\n    const doDelete = (entry) => {\r\n        simpleConfirmNoTranslate(Tr(\"confirm_delete_annual_entry\", {number: entry.number}), () => {\r\n            AnnualReportsService.deleteAnnualReportTableEntry(params.id, entry.identity, reportStep, type).then((result) => {\r\n                if (result) {\r\n                    enqueueSuccessSnackbar(Tr(\"deleted\") + \" \" + entry.number)\r\n                }\r\n            })\r\n        })\r\n    }\r\n\r\n    const changeComplete = (entry, complete) => {\r\n        const data = {\r\n            ...entry,\r\n            complete\r\n        }\r\n        AnnualReportsService.saveAnnualReportTableEntry(params.id, reportStep, data)\r\n            .then((resp) => {\r\n                if (resp) {\r\n                    if (resp.success) {\r\n                        enqueueSuccessSnackbar(Tr(\"saved\") + \" \" + entry.number)\r\n                    } else {\r\n                        setEditPopup(getAnnualReportEditPopup(entry, false, true))\r\n                    }\r\n                }\r\n\r\n            })\r\n    }\r\n\r\n    return (<>\r\n            <TableRow className={classes.variantRow}>\r\n                <AnnualReportTableCell borderLeft>{type}</AnnualReportTableCell>\r\n                <AnnualReportTableCell borderLeft onClick={() => setExpanded(!expanded)} className={classes.exceptionName}>\r\n                    {`${dictTranslations.notIncluded[type]} (${entriesFilteres.length}/${entries.length})`}\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell onClick={() => setExpanded(!expanded)}>\r\n                    {hasIncomplete &&\r\n                        <WorkableIconErrorButton\r\n                            onClick={(e) => {\r\n                                e.stopPropagation();\r\n                                setExpanded(true);\r\n                                const incompleteEntry = entriesFilteres.find(x => !x.complete);\r\n                                if (incompleteEntry) {\r\n                                    setTimeout((identity) => scrollTo(`#${reportStep}-${identity}`, 200), 100, incompleteEntry.identity)\r\n                                }\r\n                            }}\r\n                            tooltip={Tr(\"annual_report_section_incomplete\")}\r\n                            className={classes.sectionErrorIcon}\r\n                        />\r\n                    }\r\n                </AnnualReportTableCell>\r\n                <AnnualReportTableCell borderLeft>{formatAmountNumber(entriesCounted.contractValue) + \" zł\"}</AnnualReportTableCell>\r\n\r\n                <AnnualReportTableCell borderLeft borderRight>\r\n                    <WorkableIconExpandButton expanded={expanded} onClick={() => setExpanded(!expanded)}/>\r\n                </AnnualReportTableCell>\r\n            </TableRow>\r\n            {expanded &&\r\n                <TableRow>\r\n                    <AnnualReportTableCell colSpan={5} borderLeft borderRight className={classes.demandsCell}>\r\n                        <Table className={classes.demandsTable}>\r\n                            <TableHead>\r\n                                <TableRow>\r\n                                    <AnnualReportTableHeadCell borderLeft={false} label={`mmia.${reportStep}.number`}/>\r\n                                    <AnnualReportTableHeadCell borderLeft={false} label={`mmia.${reportStep}.name`}/>\r\n                                    <AnnualReportTableHeadCell label={`mmia.${reportStep}.contractValue`}/>\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                    <TableCell className={classes.buttonColumn}></TableCell>\r\n                                </TableRow>\r\n                            </TableHead>\r\n                            <TableBody>\r\n                                {entriesFilteres.map((entry, index) => (\r\n                                    <TableRow id={`${reportStep}-${entry.identity}`} key={index}\r\n                                              className={clsx(classes.demandsRow, {complete: entry.complete, incomplete: !entry.complete})}>\r\n                                        <AnnualReportTableCell>\r\n                                            {entry.number}\r\n                                        </AnnualReportTableCell>\r\n                                         <AnnualReportTableCell>\r\n                                            {entry.name}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell>\r\n                                            {formatAmountNumber(entry.contractValue)}\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell className={classes.buttonColumn}>\r\n                                            <WorkableIconEditButton disabled={disabled} onClick={() => setEditPopup(getAnnualReportEditPopup(entry))}/>\r\n                                            {\r\n                                                entry.complete ?\r\n                                                    <IconButton tooltip={Tr(\"mark_draft_version\")} onClick={() => changeComplete(entry, false)}\r\n                                                                Icon={CheckCircleOutlineIcon} disabled={disabled}/>\r\n                                                    :\r\n                                                    <IconButton tooltip={Tr(\"mark_saved_version\")} onClick={() => changeComplete(entry, true)}\r\n                                                                disabled={disabled} Icon={RadioButtonUncheckedIcon}/>\r\n                                            }\r\n                                        </AnnualReportTableCell>\r\n                                        <AnnualReportTableCell className={classes.buttonColumn}>\r\n                                            <WorkableIconButton\r\n                                                tooltip={Tr(\"change_order_type\")} Icon={SwapVerticalCircleIcon} disabled={disabled}\r\n                                                onClick={() => setMovePopup(getMoveAnnualReportEntryConfig(params.id, entry.identity, type))}/>\r\n                                            <WorkableIconDeleteButton disabled={disabled} onClick={() => doDelete(entry)}\r\n                                            />\r\n                                        </AnnualReportTableCell>\r\n                                    </TableRow>\r\n                                ))}\r\n\r\n                                {!entriesFilteres.length && <TableRow>\r\n                                    <AnnualReportTableCell className={classes.noOptions} colSpan={5}>\r\n                                        {Tr(\"no_options\")}\r\n                                    </AnnualReportTableCell>\r\n                                </TableRow>}\r\n                            </TableBody>\r\n                        </Table>\r\n                    </AnnualReportTableCell>\r\n                </TableRow>\r\n            }\r\n\r\n        </>\r\n    );\r\n}\r\n\r\nAnnualReportNotIncludedTablePart.propTypes = {\r\n    type: PropTypes.string.isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    classes: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    entries: PropTypes.array.isRequired,\r\n    search: PropTypes.shape({\r\n        search: PropTypes.string\r\n    }).isRequired,\r\n    setEditPopup: PropTypes.func.isRequired,\r\n    setMovePopup: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default AnnualReportNotIncludedTablePart;","import React, {useContext, useState} from \"react\"\r\nimport PropTypes from \"prop-types\";\r\nimport Loading from \"components/Loading\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {Table, TableHead, TableRow} from \"@material-ui/core\";\r\nimport AnnualReportTableCell from \"../common/AnnualReportTableCell\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportEditPopup from \"../common/AnnualReportEditPopup\";\r\nimport AnnualReportNotIncludedEditForm from \"./AnnualReportNotIncludedEditForm\";\r\nimport AnnualReportNotIncludedTablePart from \"./AnnualReportNotIncludedTablePart\";\r\nimport MoveAnnualReportEntry from \"../common/MoveAnnualReportEntry\";\r\nimport AnnualReportSearchBar from \"../common/AnnualReportSearchBar\";\r\nimport AnnualReportTableHeadCell from \"../common/AnnualReportTableHeadCell\";\r\n\r\nconst reportStep = annualReportSteps.notIncluded;\r\n\r\nfunction AnnualReportNotIncludedForm(\r\n    {\r\n        initValues,\r\n        classes,\r\n        disabled\r\n    }\r\n) {\r\n    const {getDict} = useContext(FormTranslationContext);\r\n    const [types] = useState(getDict(\"SL.MMiA.064\"));\r\n    const [editPopup, setEditPopup] = useState(null);\r\n    const [movePopup, setMovePopup] = useState(null);\r\n    const [search, setSearch] = useState({search: \"\"});\r\n\r\n    if (!initValues) return <Loading/>\r\n    return (<>\r\n        <AnnualReportSearchBar reportStep={reportStep} setSearch={setSearch} classes={classes} disabled={disabled} setEditPopup={setEditPopup}/>\r\n\r\n        <Table>\r\n            <TableHead>\r\n                <TableRow className={classes.tableMainHeaderRow}>\r\n                    <AnnualReportTableCell borderLeft>\r\n                        <div>{Tr(\"column_lp\")}</div>\r\n                    </AnnualReportTableCell>\r\n                    <AnnualReportTableHeadCell label=\"mmia.notIncluded.type\" colSpan={2}/>\r\n                    <AnnualReportTableHeadCell label=\"mmia.notIncluded.contractValue\"/>\r\n                    <AnnualReportTableCell borderRight borderLeft/>\r\n                </TableRow>\r\n\r\n                {\r\n                    types.map((type) =>\r\n                        <AnnualReportNotIncludedTablePart\r\n                            key={type.value}\r\n                            classes={classes}\r\n                            type={type.value}\r\n                            disabled={disabled}\r\n                            entries={initValues[type.value]}\r\n                            search={search}\r\n                            setEditPopup={setEditPopup}\r\n                            setMovePopup={setMovePopup}\r\n                            reportStep={reportStep}\r\n                        />\r\n                    )\r\n                }\r\n            </TableHead>\r\n        </Table>\r\n        {\r\n            !!editPopup &&\r\n            <AnnualReportEditPopup\r\n                onClose={() => setEditPopup(null)}\r\n                config={editPopup}\r\n                reportStep={reportStep}\r\n                FormComponent={AnnualReportNotIncludedEditForm}\r\n            />\r\n        }\r\n        {\r\n            !!movePopup &&\r\n            <MoveAnnualReportEntry\r\n                items={types.filter((item) => item.value !== movePopup.currentType).map((item) => ({\r\n                    label: item.value + \" - \" + item.label,\r\n                    value: item.value\r\n                }))}\r\n                onClose={() => setMovePopup(null)}\r\n                inputLabel={Tr(\"order_type\")}\r\n                reportStep={reportStep}\r\n                config={movePopup}\r\n            />\r\n        }\r\n\r\n    </>)\r\n\r\n\r\n}\r\n\r\nAnnualReportNotIncludedForm.prototype = {\r\n    initValues: PropTypes.object.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n    classes: PropTypes.object.isRequired\r\n}\r\n\r\nexport default AnnualReportNotIncludedForm;","const dictToTranslationMap = (dict, oneLevel) => {\r\n    const trMap = {};\r\n    doItems(dict, trMap, oneLevel);\r\n    return trMap;\r\n}\r\n\r\nconst doItems = (items, trMap, oneLevel) => {\r\n    for (let item of items) {\r\n        trMap[item.value] = item.label\r\n        if (!oneLevel && item.items && item.items.length > 0) {\r\n            doItems(item.items, trMap, oneLevel)\r\n        }\r\n    }\r\n}\r\nexport default dictToTranslationMap;","import React from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport { Link as LinkRRD } from 'react-router-dom';\r\nimport { Typography } from '@material-ui/core';\r\nimport { withStyles } from '@material-ui/styles';\r\n\r\nconst style= theme => ({\r\n\tlink: {\r\n\t\tcolor: 'inherit',\r\n\t\ttextDecoration: 'inherit'\r\n\t}\r\n})\r\n\r\nfunction Link({\r\n\tchildren,\r\n\tto,\r\n\tvariant,\r\n\tcomponent,\r\n\tclasses,\r\n\tclassName,\r\n}) {\r\n\treturn (\r\n\t\t<Typography className={className} component={component} variant={variant} >\r\n\t\t\t<LinkRRD className={classes.link} to={to}>\r\n\t\t\t\t{children}\r\n\t\t\t</LinkRRD>\r\n\t\t</Typography>\r\n\t)\r\n}\r\n\r\nLink.propTypes = {\r\n\tchildren: PropTypes.any,\r\n\tto: PropTypes.string,\r\n\tvariant: PropTypes.string,\r\n\tcomponent: PropTypes.string,\r\n}\r\n\r\nLink.defaultProps = {\r\n\tvariant: 'body1',\r\n}\r\n\r\nexport default withStyles(style)(Link);\r\n","import React, {useContext, useMemo} from \"react\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport Typography from \"components/Typography\";\r\nimport Tr from \"translations/Translations\";\r\nimport annualReportSteps from \"../../constants/annualReportSteps\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport Link from \"components/Link\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {useParams} from \"react-router\";\r\n\r\nfunction AnnualReportError(\r\n    {\r\n        report\r\n    }\r\n) {\r\n    const {formTr, dictTranslations} = useContext(FormTranslationContext);\r\n    const params = useParams();\r\n\r\n    const getMapKeys = (iterator) => {\r\n\r\n        const keys = [];\r\n        let next = iterator.next();\r\n        while (!next.done) {\r\n            keys.push(next.value);\r\n            next = iterator.next();\r\n        }\r\n        return keys;\r\n    }\r\n\r\n    const getTranslatedErrorsView = (translatedErrors) => {\r\n        const steps = Object.keys(translatedErrors);\r\n        return <ul>\r\n            {\r\n                steps.map(step => <li key={step}>\r\n                    <Link to={RouterPath.createPath(RouterPath.annualReport.MP_ANNUAL_REPORT_REPORT_ID_TABLE, {\r\n                        id: params.id,\r\n                        table: step\r\n                    })}>{formTr(\"mmia.\" + step)}</Link>\r\n                    <ul>\r\n                        {\r\n                            getMapKeys(translatedErrors[step].keys()).map((x, i) => <li key={i}>\r\n                                {x}\r\n                                <ul>\r\n                                    {\r\n                                        translatedErrors[step].get(x).map((e, j) => <li key={j}>{e}</li>)\r\n                                    }\r\n                                </ul>\r\n                            </li>)\r\n                        }\r\n                    </ul>\r\n\r\n\r\n                </li>)\r\n            }\r\n        </ul>\r\n\r\n    }\r\n\r\n    const getDescribedErrors = () => {\r\n        const described = {};\r\n        Object.keys(report.errorsDescribed).forEach(wholeKey => {\r\n            const split = wholeKey.split(\".\");\r\n            if (!described.hasOwnProperty(split[0])) {\r\n                described[split[0]] = new Map();\r\n            }\r\n\r\n            switch (split[0]) {\r\n                case annualReportSteps.purchaser: {\r\n                    const subKey = split[1];\r\n                    const errors = described[split[0]].get(subKey) || [];\r\n                    errors.push(report.errorsDescribed[wholeKey]);\r\n                    described[split[0]].set(subKey, errors)\r\n                    break;\r\n                }\r\n                case annualReportSteps.belowEu: {\r\n                    const subKey = (dictTranslations.procedures[split[1]] || Tr(\"annual_report_default_error\")) + \" \" + (dictTranslations.orderType[split[2]] || \"\");\r\n                    const errors = described[split[0]].get(subKey) || [];\r\n                    errors.push(report.errorsDescribed[wholeKey]);\r\n                    described[split[0]].set(subKey, errors)\r\n                    break;\r\n                }\r\n                case annualReportSteps.aboveEu:\r\n                case annualReportSteps.conflict:\r\n                case annualReportSteps.community:\r\n                case annualReportSteps.social:\r\n                case annualReportSteps.innovative: {\r\n                    const subKey = (dictTranslations.type[split[1]] || Tr(\"annual_report_default_error\"));\r\n                    const errors = described[split[0]].get(subKey) || [];\r\n                    errors.push(report.errorsDescribed[wholeKey]);\r\n                    described[split[0]].set(subKey, errors)\r\n                    break;\r\n                }\r\n                case annualReportSteps.exception: {\r\n                    const subKey = (dictTranslations.exceptions[split[1]] || Tr(\"annual_report_default_error\"));\r\n                    const errors = described[split[0]].get(subKey) || [];\r\n                    errors.push(report.errorsDescribed[wholeKey]);\r\n                    described[split[0]].set(subKey, errors)\r\n                    break;\r\n                }\r\n                case annualReportSteps.notIncluded: {\r\n                    const subKey = (dictTranslations.notIncluded[split[1]] || Tr(\"annual_report_default_error\"));\r\n                    const errors = described[split[0]].get(subKey) || [];\r\n                    errors.push(report.errorsDescribed[wholeKey]);\r\n                    described[split[0]].set(subKey, errors)\r\n                    break;\r\n                }\r\n                default: {\r\n\r\n                }\r\n            }\r\n        })\r\n        return described;\r\n    }\r\n\r\n    const getErrors = () => {\r\n        let translatedErrors = null;\r\n        if (report.errorsDescribed) {\r\n            try {\r\n                translatedErrors = getDescribedErrors();\r\n            } catch (e) {\r\n                console.error(e);\r\n            }\r\n        }\r\n        return <>\r\n            <BoldTypography>{Tr(\"annual_report_ezamowienia_error\")}</BoldTypography>\r\n            {!!translatedErrors ? getTranslatedErrorsView(translatedErrors) :\r\n                <Typography>{report.error}</Typography>}\r\n        </>\r\n    }\r\n\r\n    const errors = useMemo(() => {\r\n        if (!report.error && !report.errorsDescribed) {\r\n            return null;\r\n        }\r\n        return getErrors();\r\n        // eslint-disable-next-line\r\n    }, [report.error, report.errorsDescribed]);\r\n\r\n    return errors;\r\n\r\n}\r\n\r\n\r\nexport default AnnualReportError;","import React, {useContext} from \"react\";\r\nimport Button from \"components/Button\";\r\nimport ReplayIcon from \"@material-ui/icons/Replay\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport PropTypes from \"prop-types\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {useParams} from \"react-router\";\r\n\r\n\r\nfunction ReloadAnnualReportTableFromPrevVersionButton(\r\n    {\r\n        classes,\r\n        reportStep,\r\n        disabled\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const {formTr} = useContext(FormTranslationContext);\r\n    return (<Button className={classes.marginRight} variant=\"outlined\" disabled={disabled} Icon={ReplayIcon}\r\n                    onClick={() => simpleConfirmNoTranslate(Tr(\"annual_report_reload_table_from_prev_confirm\", {x: formTr(\"mmia.\" + reportStep).substring(0, formTr(\"mmia.\" + reportStep).indexOf(\".\"))}),\r\n                        () => AnnualReportsService.initializeTableFromPrevVersion(params.id, reportStep)\r\n                    )}>\r\n        {Tr(\"annual_report_reload_table_from_prev\")}\r\n    </Button>)\r\n}\r\n\r\nReloadAnnualReportTableFromPrevVersionButton.propTypes = {\r\n    classes: PropTypes.object.isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default ReloadAnnualReportTableFromPrevVersionButton;","import React, {useContext} from \"react\";\r\nimport Button from \"components/Button\";\r\nimport ReplayIcon from \"@material-ui/icons/Replay\";\r\nimport {simpleConfirmNoTranslate} from \"libs/ConfirmNotification\";\r\nimport Tr from \"translations/Translations\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport PropTypes from \"prop-types\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport {useParams} from \"react-router\";\r\n\r\n\r\nfunction ReloadAnnualReportTableButton(\r\n    {\r\n        classes,\r\n        reportStep,\r\n        disabled\r\n    }) {\r\n\r\n    const params = useParams();\r\n    const {formTr} = useContext(FormTranslationContext);\r\n    return (<Button className={classes.marginRight} variant=\"outlined\" disabled={disabled} Icon={ReplayIcon}\r\n                    onClick={() => simpleConfirmNoTranslate(Tr(\"annual_report_reload_table_confirm\", {x: formTr(\"mmia.\" + reportStep).substring(0, formTr(\"mmia.\" + reportStep).indexOf(\".\"))}),\r\n                        () => AnnualReportsService.initializeTable(params.id, reportStep)\r\n                    )}>\r\n        {Tr(\"annual_report_reload_table\")}\r\n    </Button>)\r\n}\r\n\r\nReloadAnnualReportTableButton.propTypes = {\r\n    classes: PropTypes.object.isRequired,\r\n    reportStep: PropTypes.string.isRequired,\r\n    disabled: PropTypes.bool.isRequired,\r\n}\r\n\r\nexport default ReloadAnnualReportTableButton;","import React, {useCallback, useEffect, useReducer, useRef, useState} from 'react'\r\nimport Loading from \"components/Loading\";\r\nimport {Collapse} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport iconWorksReducer from \"libs/iconWorksReducer\";\r\nimport Section from \"pages/purchaser/MyProcedure/scenes/part2/components/Section\";\r\nimport AnnualReportsService from \"services/AnnualReportsService\";\r\nimport annualReportSteps, {annualReportTablesWithInitialize} from \"./constants/annualReportSteps\";\r\nimport Page from \"components/Page\";\r\nimport {useParams} from \"react-router\";\r\nimport annulaReportClasses from \"./constants/annulaReportClasses\";\r\nimport {connect} from \"react-redux\";\r\nimport FormTranslationContext from \"context/FormTranslationContext\";\r\nimport useSnackbar from \"hooks/useSnackbar\";\r\nimport useEzamowieniaOauth from \"hooks/useEzamowieniaOauth\";\r\nimport AnnualReportNavigator from \"./components/common/AnnualReportNavigator\";\r\nimport AnnualReportPurchaserForm from \"./components/purchaser/AnnualReportPurchaserForm\";\r\nimport AnnualReportAboveEuForm from \"./components/aboveEu/AnnualReportAboveEuForm\";\r\nimport AnnualReportBelowEuForm from \"./components/belowEu/AnnualReportBelowEuForm\";\r\nimport AnnualReportConflictForm from \"./components/conflict/AnnualReportConflictForm\";\r\nimport AnnualReportCommunityForm from \"./components/community/AnnualReportCommunityForm\";\r\nimport AnnualReportSocialForm from \"./components/social/AnnualReportSocialForm\";\r\nimport AnnualReportInnovativeForm from \"./components/innovative/AnnualReportInnovativeForm\";\r\nimport AnnualReportExceptionForm from \"./components/exception/AnnualReportExceptionForm\";\r\nimport AnnualReportNotIncludedForm from \"./components/notIncluded/AnnualReportNotIncludedForm\";\r\nimport dictToTranslationMap from \"./constants/dictToTranslationMap\";\r\nimport Typography from \"components/Typography\";\r\nimport AnnualReportStatus, {annualReportStatusTr} from \"./constants/AnnualReportStatus\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport scrollTo from \"libs/scrollTo\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport Button from \"components/Button\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport ArrowBackIosIcon from \"@material-ui/icons/ArrowBackIos\";\r\nimport AnnualReportError from \"./components/common/AnnualReportError\";\r\nimport isResponseValid from \"libs/isResponseValid\";\r\nimport ReloadAnnualReportTableFromPrevVersionButton from \"./components/common/ReloadAnnualReportTableFromPrevVersionButton\";\r\nimport ReloadAnnualReportTableButton from \"./components/common/ReloadAnnualReportTableButton\";\r\nimport EZamowieniaIcon from \"components/icon/EZamowieniaIcon\";\r\nimport previewFile from \"libs/previewFile\";\r\nimport WorkableButton from \"components/button/WorkableButton\";\r\nimport {alertComplex} from \"libs/AlertNotification\";\r\nimport {MMiA_REQUIRED_GROUPS} from \"constants/EzamowieniaRequiredGroups\";\r\n\r\nfunction getKey(id) {\r\n    const split = id.split(\".\").filter(x => !/^\\d+$/.test(x));\r\n    return split.join(\".\");\r\n}\r\n\r\nconst empty_object = {};\r\n\r\nfunction AnnualReportPage(\r\n    {\r\n        initFormValues = empty_object,\r\n        initData\r\n    }) {\r\n    const classes = annulaReportClasses();\r\n    const params = useParams();\r\n    const currentForm = useRef(null);\r\n    const [dictionaries, setDictionaries] = useState(null);\r\n    const [translations, setTranslations] = useState(null);\r\n    const [dictTranslations, setDictTranslations] = useState(null)\r\n    const {authorizeEzamowienia} = useEzamowieniaOauth();\r\n    const {enqueueInfoSnackbar, enqueueSuccessSnackbar, enqueueErrorSnackbar} = useSnackbar();\r\n    const setFrom = (form) => {\r\n        currentForm.current = form;\r\n    }\r\n    const setCurStep = useCallback(newStep =>\r\n        RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.annualReport.MP_ANNUAL_REPORT_REPORT_ID_TABLE, {\r\n            id: params.id,\r\n            table: newStep\r\n        })), [params.id]);\r\n    const backToList = () => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.annualReport.MP_ANNUAL_REPORT_YEAR_LIST, {year: initData.year}));\r\n\r\n    const [buttonWorks, dispatchButtonWorks] = useReducer(iconWorksReducer, {\r\n        anyWorks: false,\r\n        ezamowienia: false,\r\n        loading: false,\r\n        pdf: false\r\n    });\r\n    const disabled = !initData || !initData.hasEdit || buttonWorks.anyWorks\r\n\r\n    const formTr = useCallback((id) => {\r\n        const key = getKey(id);\r\n        return translations.labels[key] || key;\r\n    }, [translations])\r\n    const formTip = useCallback((id) => {\r\n        const key = getKey(id);\r\n        return translations.tips[key];\r\n    }, [translations]);\r\n\r\n    const getDict = useCallback((id) => {\r\n        try {\r\n            return dictionaries[id].items;\r\n        } catch (e) {\r\n            console.error(\"DictId: \" + id)\r\n            console.error(e)\r\n        }\r\n    }, [dictionaries])\r\n\r\n    useEffect(() => {\r\n        Promise.all([\r\n            AnnualReportsService.getAnnualReport(params.id),\r\n            AnnualReportsService.getAnnualReportDictionaries(),\r\n            AnnualReportsService.getAnnualReportTranslations()])\r\n            .then(values => {\r\n                const dictTr = values[1] ? {\r\n                    type: dictToTranslationMap(values[1][\"MP.MMiA.OrdersType\"].items, true),\r\n                    procedures: dictToTranslationMap(values[1][\"MP.MMiA.BelowEU.procedure\"].items, true),\r\n                    source: dictToTranslationMap(values[1][\"MP.MMiA.Source\"].items, false),\r\n                    orderType: dictToTranslationMap(values[1][\"ENUM.002\"].items, true),\r\n                    tenderModeTed: dictToTranslationMap(values[1][\"ENUM.018_019_TED\"].items, false),\r\n                    tenderModeBzp: dictToTranslationMap(values[1][\"ENUM.018_019_BZP\"].items, false),\r\n                    contractorCountryList: dictToTranslationMap(values[1][\"SL.MT.005\"].items, true),\r\n                    contractorType: dictToTranslationMap(values[1][\"SL.MMiA.062\"].items, false),\r\n                    exceptions: dictToTranslationMap(values[1][\"SL.MMiA.063\"].items, false),\r\n                    notIncluded: dictToTranslationMap(values[1][\"SL.MMiA.064\"].items, false),\r\n                } : null\r\n                setDictionaries(values[1]);\r\n                setTranslations(values[2]);\r\n                setDictTranslations(dictTr)\r\n            })\r\n        return () => {\r\n            AnnualReportsService.clearResources(AnnualReportsService.ANNUAL_REPORT_TABLES_RESOURCE_ID)\r\n            AnnualReportsService.clearResources(AnnualReportsService.ANNUAL_REPORT_RESOURCE_ID)\r\n        }\r\n    }, [params.id])\r\n\r\n    useEffect(() => {\r\n        if (!params.table) {\r\n            setCurStep(annualReportSteps.purchaser)\r\n        } else if (!initFormValues[params.table]) {\r\n            dispatchButtonWorks({type: \"loading\", works: true});\r\n            AnnualReportsService.getAnnualReportFormValues(params.id, params.table).finally(() => {\r\n                dispatchButtonWorks({type: \"loading\", works: false});\r\n            })\r\n        }\r\n    }, [params.id, params.table, initFormValues, setCurStep])\r\n\r\n    const onCurStepChange = (newStep) => {\r\n        (async () => {\r\n            const dirty = currentForm.current?.dirty;\r\n            if (dirty) {\r\n                enqueueInfoSnackbar(Tr(\"save_changes_to_go\"))\r\n            } else {\r\n                setFrom(null)\r\n                setCurStep(newStep)\r\n            }\r\n        })()\r\n    }\r\n\r\n    const submitInEzamowienia = () => {\r\n        dispatchButtonWorks({type: \"ezamowienia\", works: true});\r\n        authorizeEzamowienia(\r\n            () => {\r\n                AnnualReportsService.submitAnnualReportToEzamowienia(params.id).then((resp) => {\r\n                    if (resp) {\r\n                        if (isResponseValid(resp, enqueueErrorSnackbar)) {\r\n                            enqueueSuccessSnackbar(Tr(\"annual_report_submited_to_ezamowienia\"))\r\n                        }\r\n                    }\r\n                    dispatchButtonWorks({type: \"ezamowienia\", works: false});\r\n                })\r\n            },\r\n            () => {\r\n                dispatchButtonWorks({type: \"ezamowienia\", works: false});\r\n            },\r\n            MMiA_REQUIRED_GROUPS)\r\n    }\r\n    const sendToEzamowienia = () => {\r\n        dispatchButtonWorks({type: \"ezamowienia\", works: true});\r\n        authorizeEzamowienia(\r\n            () => {\r\n                AnnualReportsService.sendAnnualReportToEzamowienia(params.id).then((resp) => {\r\n                    if (resp && resp.success) {\r\n                        enqueueSuccessSnackbar(Tr(\"annual_report_sent_to_ezamowienia\"))\r\n                    } else if (resp) {\r\n                        const errors = resp.errors;\r\n                        if (Array.isArray(errors)) {\r\n                            if (errors.length > 0)\r\n                                enqueueErrorSnackbar(errors[0]);\r\n                        } else if (typeof errors === 'object' && errors !== null) {\r\n                            const keys = Object.keys(errors);\r\n                            if (keys.length > 0) {\r\n                                const key = keys[0];\r\n                                enqueueErrorSnackbar(errors[key]);\r\n                                if (annualReportSteps.hasOwnProperty(key)) {\r\n                                    setCurStep(key);\r\n                                    setTimeout(() => scrollTo(\".\" + classes.sectionErrorIcon, 200), 200)\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                    dispatchButtonWorks({type: \"ezamowienia\", works: false});\r\n                })\r\n            },\r\n            () => {\r\n                dispatchButtonWorks({type: \"ezamowienia\", works: false});\r\n            },\r\n            MMiA_REQUIRED_GROUPS\r\n        )\r\n    }\r\n    const downloadPdf = () => {\r\n        dispatchButtonWorks({type: \"pdf\", works: true});\r\n        authorizeEzamowienia(\r\n            () => {\r\n                AnnualReportsService.downloadAnnualReportPdfFromEzamowienia(params.id).finally(() => dispatchButtonWorks({type: \"pdf\", works: false}))\r\n            },\r\n            () => {\r\n                dispatchButtonWorks({type: \"pdf\", works: false});\r\n            },\r\n            MMiA_REQUIRED_GROUPS\r\n        )\r\n    }\r\n\r\n    if (!initData || !translations || !dictionaries || !dictTranslations) return <Loading/>\r\n    return (\r\n        <Page className={classes.root}>\r\n            <GridBlock justify=\"space-between\" className={classes.marginBottom}>\r\n                <Button className={classes.back} variant=\"outlined\" Icon={ArrowBackIosIcon} onClick={backToList}>{Tr(\"back_to_list\")}</Button>\r\n                <div>\r\n                    <BoldTypography\r\n                        variant=\"h5\">{`${Tr('annual_reports')} ${initData.year} ${Tr('version').toLowerCase()} ${initData.version}`}</BoldTypography>\r\n                    {!!initData.ezamowieniaNumber && <Typography>{Tr(\"annual_report_number\") + \": \" + initData.ezamowieniaNumber}</Typography>}\r\n                </div>\r\n                <div>\r\n                    {\r\n                        [AnnualReportStatus.SENT, AnnualReportStatus.APPROVED, AnnualReportStatus.APPROVED_MODIFIED].includes(initData.status) &&\r\n                        <WorkableButton Icon={EZamowieniaIcon} disabled={buttonWorks.anyWorks} working={buttonWorks.pdf} variant=\"outlined\"\r\n                                        onClick={downloadPdf}>\r\n                            {Tr(\"annual_report_download_pdf\")}\r\n                        </WorkableButton>\r\n                    }\r\n                </div>\r\n            </GridBlock>\r\n            <Section>\r\n                <FormTranslationContext.Provider value={{\r\n                    formTr, formTip, getDict, dictTranslations\r\n                }}>\r\n                    <AnnualReportError report={initData}/>\r\n\r\n\r\n                    <Typography variant=\"body2\" align='right'><strong>{Tr('current_state')}:</strong> {annualReportStatusTr(initData.status)}\r\n                    </Typography>\r\n                    <AnnualReportNavigator\r\n                        formTr={formTr}\r\n                        disabled={disabled}\r\n                        buttonWorks={buttonWorks}\r\n                        curStep={params.table}\r\n                        onCurStepChange={onCurStepChange}\r\n                        onSendToEzamowienia={AnnualReportStatus.DRAFT === initData.status && sendToEzamowienia}\r\n                        onSubmitInEzamowienia={AnnualReportStatus.SENT === initData.status && submitInEzamowienia}\r\n                    />\r\n                    <Collapse in={params.table === annualReportSteps.purchaser} unmountOnExit>\r\n                        <AnnualReportPurchaserForm\r\n                            initValues={initFormValues[annualReportSteps.purchaser]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                            setFrom={setFrom}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.belowEu} unmountOnExit>\r\n                        <AnnualReportBelowEuForm\r\n                            initValues={initFormValues[annualReportSteps.belowEu]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.aboveEu} unmountOnExit>\r\n                        <AnnualReportAboveEuForm\r\n                            initValues={initFormValues[annualReportSteps.aboveEu]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.conflict} unmountOnExit>\r\n                        <AnnualReportConflictForm\r\n                            initValues={initFormValues[annualReportSteps.conflict]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.community} unmountOnExit>\r\n                        <AnnualReportCommunityForm\r\n                            initValues={initFormValues[annualReportSteps.community]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.social} unmountOnExit>\r\n                        <AnnualReportSocialForm\r\n                            initValues={initFormValues[annualReportSteps.social]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.innovative} unmountOnExit>\r\n                        <AnnualReportInnovativeForm\r\n                            initValues={initFormValues[annualReportSteps.innovative]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.exception} unmountOnExit>\r\n                        <AnnualReportExceptionForm\r\n                            initValues={initFormValues[annualReportSteps.exception]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n                    <Collapse in={params.table === annualReportSteps.notIncluded} unmountOnExit>\r\n                        <AnnualReportNotIncludedForm\r\n                            initValues={initFormValues[annualReportSteps.notIncluded]}\r\n                            disabled={disabled}\r\n                            classes={classes}\r\n                        />\r\n                    </Collapse>\r\n\r\n                    {\r\n                        params.table && <GridBlock className={classes.marginTop}>\r\n                            {initData.hasEdit && annualReportTablesWithInitialize.includes(params.table) &&\r\n                                <ReloadAnnualReportTableButton classes={classes} disabled={disabled} reportStep={params.table}/>\r\n                            }\r\n\r\n                            {\r\n                                initData.hasEdit && initData.version > 1 &&\r\n                                <ReloadAnnualReportTableFromPrevVersionButton classes={classes} disabled={disabled} reportStep={params.table}/>\r\n                            }\r\n                            {\r\n                                [AnnualReportStatus.SENT, AnnualReportStatus.APPROVED, AnnualReportStatus.APPROVED_MODIFIED].includes(initData.status) &&\r\n\r\n                                <Button variant=\"outlined\" Icon={EZamowieniaIcon}\r\n                                        onClick={() => alertComplex({\r\n                                            confirmText: \"annual_report_preview_in_ezamowienia_confirm\", onClose: () => previewFile({url: initData.previewUrl}),\r\n                                            buttonText: Tr(\"go\")\r\n                                        })\r\n                                        }>\r\n                                    {Tr(\"annual_report_preview_in_ezamowienia\")}\r\n                                </Button>\r\n                            }\r\n                        </GridBlock>\r\n                    }\r\n                </FormTranslationContext.Provider>\r\n            </Section>\r\n        </Page>\r\n    )\r\n}\r\n\r\nAnnualReportPage.propTypes = {};\r\n\r\nexport default connect((state) => ({\r\n    initFormValues: state.resources[AnnualReportsService.ANNUAL_REPORT_TABLES_RESOURCE_ID],\r\n    initData: state.resources[AnnualReportsService.ANNUAL_REPORT_RESOURCE_ID],\r\n}))(AnnualReportPage);\r\n","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from \"../../NotFound/NotFound\";\r\nimport AnnualReportsList from \"./list/AnnualReportsList\";\r\nimport AnnualReportPage from \"./report/AnnualReportPage\";\r\nimport moment from \"libs/moment\";\r\n\r\nconst rp = RouterPath.annualReport;\r\n\r\nfunction AnnualReport() {\r\n\r\n    return (<>\r\n            <Switch>\r\n                <Route path={rp.MP_ANNUAL_REPORT_YEAR_LIST} component={AnnualReportsList}/>\r\n                <Route path={rp.MP_ANNUAL_REPORT_REPORT_ID_TABLE} component={AnnualReportPage}/>\r\n                <Route path={rp.MP_ANNUAL_REPORT_REPORT_ID} component={AnnualReportPage}/>\r\n                <Route path={rp.MP_ANNUAL_REPORT}>\r\n                    <Redirect to={RouterPath.createPath(rp.MP_ANNUAL_REPORT_YEAR_LIST, {year: moment().year() - 1})} push={false}/>\r\n                </Route>\r\n                <Route component={NotFound}/>\r\n            </Switch>\r\n        </>\r\n    )\r\n}\r\n\r\nexport default AnnualReport;\r\n\r\n","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from '../NotFound/NotFound';\r\nimport MyProcedure from './MyProcedure/MyProcedure';\r\nimport PurchasingGroup from \"./PurchasingGroup/PurchasingGroup\";\r\nimport Admin from \"./Admin/Admin\";\r\nimport PurchaserDemand from \"./demand/PurchaserDemand\";\r\nimport AnnualReport from \"./annualReport/AnnualReport\";\r\n\r\nfunction PurchaserRouter(props) {\r\n\r\n    return (\r\n        <Switch>\r\n            <Route exact path={RouterPath.BUYER_INIT}>\r\n                <Redirect to={RouterPath.MY_PROCEDURE}/>\r\n            </Route>\r\n            <Route path={RouterPath.MY_PROCEDURE} component={MyProcedure}/>\r\n            <Route exact path={RouterPath.PURCHASER_INIT}>\r\n                <Redirect to={RouterPath.MY_PROCEDURE}/>\r\n            </Route>\r\n            <Route path={RouterPath.PURCHASING_GROUP} component={PurchasingGroup}/>\r\n            <Route path={RouterPath.ANNUAL_REPORT} component={AnnualReport}/>\r\n            <Route path={RouterPath.ADMIN} component={Admin}/>\r\n            <Route path={RouterPath.DEMAND} component={PurchaserDemand}/>\r\n\r\n            <Route component={NotFound}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nexport default PurchaserRouter;\r\n","import Endpoints from 'constants/Endpoints';\r\nimport {RestRequestPOST} from 'libs/RestRequest';\r\n\r\nconst notificationSend = async (functionalityName) => {\r\n    return await RestRequestPOST(Endpoints.SALES_NOTIFICATION_SEND(functionalityName));\r\n}\r\n\r\nexport default {notificationSend}","import React, {useState} from 'react'\r\nimport {clearSalesNotification} from 'redux/actions'\r\nimport {connect} from \"react-redux\";\r\nimport Endpoints from \"../../../constants/Endpoints\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {Box, Dialog, DialogContent, DialogTitle, Typography} from \"@material-ui/core\";\r\nimport Loading from \"../../Loading\";\r\nimport SalesService from \"../../../services/SalesService\";\r\nimport IconCloseButton from \"../../button/IconCloseButton\";\r\nimport DoneOutlineIcon from '@material-ui/icons/DoneOutline'\r\nimport Tr from 'translations/Translations';\r\n\r\nconst useStyle = makeStyles((theme => ({\r\n    paper: {\r\n        width: 688,\r\n        maxWidth: 688,\r\n        minWidth: 688\r\n    },\r\n    content: {\r\n        position: 'relative',\r\n        textAlign: 'center',\r\n        marginBottom: theme.spacing(2),\r\n        paddingTop: 0\r\n    },\r\n    img: {\r\n        width: 640\r\n    },\r\n    click: {\r\n        position: 'absolute',\r\n        height: 62,\r\n        width: 438,\r\n        top: 217,\r\n        left: 51,\r\n        cursor: 'pointer'\r\n    },\r\n    loading: {\r\n        position: 'absolute',\r\n        left: 0,\r\n        top: 0,\r\n        margin: 0,\r\n        width: '100%',\r\n        backgroundColor: 'rgba(0, 0, 0, 0.2)'\r\n    }, closeButtonBox: {\r\n        position: 'absolute',\r\n        right: theme.spacing(1),\r\n        top: theme.spacing(1),\r\n    },\r\n    closeButton: {\r\n        color: theme.palette.primary.main,\r\n    },\r\n    icon: theme.components.icon,\r\n    confirmationMessage: {\r\n        marginBottom: theme.spacing(10),\r\n        marginTop: theme.spacing(4),\r\n        fontWeight: theme.typography.fontWeightBold,\r\n    }\r\n})));\r\n\r\nfunction SalesNotificationPopup(\r\n    {\r\n        salesNotification,\r\n        clearSalesNotification,\r\n    }) {\r\n\r\n    const [working, setWorking] = useState(false);\r\n    const [processed, setProcessed] = useState(false);\r\n\r\n    const classes = useStyle();\r\n    const handleCloseDialog = () => {\r\n        setProcessed(false);\r\n        clearSalesNotification();\r\n    }\r\n\r\n    const sendNotification = () => {\r\n        setWorking(true);\r\n        SalesService.notificationSend(salesNotification).finally(() => {\r\n            setWorking(false);\r\n            setProcessed(true);\r\n        });\r\n    }\r\n\r\n\r\n    return (<Dialog\r\n        classes={{\r\n            paper: classes.paper\r\n        }}\r\n        open={!!salesNotification}\r\n        onClose={handleCloseDialog}\r\n    >\r\n        <DialogTitle>\r\n            &nbsp;\r\n            <Box className={classes.closeButtonBox}>\r\n                <IconCloseButton\r\n                    aria-label=\"close\"\r\n                    className={classes.closeButton}\r\n                    onClick={handleCloseDialog}\r\n                />\r\n            </Box>\r\n        </DialogTitle>\r\n        <DialogContent classes={{root: classes.content}}>\r\n            {salesNotification && !processed &&\r\n            <>\r\n                <img className={classes.img} src={`${Endpoints.SERVER_URL}/pic/images/sales_notification_${salesNotification}.jpg`} alt={salesNotification}/>\r\n                <span className={classes.click} onClick={sendNotification}></span>\r\n            </>}\r\n            {salesNotification && processed &&\r\n            <>\r\n                <DoneOutlineIcon className={classes.icon} color='primary'/>\r\n                <Typography className={classes.confirmationMessage}>{Tr('sales_notification_confirmation_message')}</Typography>\r\n            </>}\r\n            {working && <Loading className={classes.loading}/>}\r\n        </DialogContent>\r\n    </Dialog>)\r\n}\r\n\r\nexport default connect((state) => ({\r\n    salesNotification: state.store.salesNotification\r\n}), {\r\n    clearSalesNotification\r\n})(SalesNotificationPopup);","import React from 'react'\r\nimport {Typography} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Dialog from 'components/Dialog';\r\nimport Tr from 'translations/Translations';\r\nimport MultiButton, {createButton} from \"../components/MultiButton\";\r\n\r\nfunction ConfirmThreeButtons(\r\n    {\r\n        open,\r\n        confirmTitle,\r\n        confirmText,\r\n        confirmText2,\r\n        onConfirm,\r\n        onSecondConfirm,\r\n        onCancel,\r\n        labelConfirm = \"yes\",\r\n        labelCancel = \"no\",\r\n        labelSecondConfirm = \"yes\",\r\n        translateConfirmTexts = true\r\n    }) {\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr(labelCancel), onCancel, 'outlined', false));\r\n        buttons.push(createButton(Tr(labelConfirm), onConfirm, undefined, false));\r\n        buttons.push(createButton(Tr(labelSecondConfirm), onSecondConfirm, undefined, false));\r\n        return buttons;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            title={!!confirmTitle ? Tr(confirmTitle) : Tr('attention')}\r\n            open={open}\r\n            titleCentered\r\n            onClose={onCancel}\r\n            dialogActions={<MultiButton buttons={getButtons()} justify='flex-end' />}\r\n        >\r\n            {!!confirmText && <Typography variant='body1'>\r\n                {translateConfirmTexts ? Tr(confirmText) : confirmText}\r\n            </Typography>}\r\n            {!!confirmText2 && <Typography variant='body1'>\r\n                {translateConfirmTexts ? Tr(confirmText2) : confirmText2}\r\n            </Typography>}\r\n\r\n        </Dialog>\r\n    )\r\n}\r\n\r\nConfirmThreeButtons.propTypes = {\r\n    open: PropTypes.bool.isRequired,\r\n    confirmText: PropTypes.string.isRequired,\r\n    confirmText2: PropTypes.string,\r\n    onConfirm: PropTypes.func.isRequired,\r\n    onCancel: PropTypes.func.isRequired,\r\n    labelConfirm: PropTypes.string,\r\n    labelCancel: PropTypes.string,\r\n    translateConfirmTexts: PropTypes.bool\r\n}\r\n\r\nexport default ConfirmThreeButtons;","import React from 'react'\r\nimport {clearConfirmCloseStepper} from 'redux/actions'\r\nimport {connect} from \"react-redux\";\r\nimport Confirm from \"../confirm/Confirm\";\r\nimport ConfirmThreeButtons from \"../confirm/ConfirmThreeButtons\";\r\nimport Tr from \"translations/Translations\";\r\n\r\n\r\nfunction ConfirmCloseStepper(\r\n    {\r\n        confirmCloseStepper,\r\n        clearConfirmCloseStepper\r\n    }) {\r\n\r\n    if (!!confirmCloseStepper?.handleSecondConfirm) {\r\n        return (<ConfirmThreeButtons\r\n            onCancel={() => {\r\n                clearConfirmCloseStepper();\r\n            }}\r\n            onConfirm={() => {\r\n                confirmCloseStepper.handleConfirm();\r\n                clearConfirmCloseStepper();\r\n            }}\r\n            onSecondConfirm={() => {\r\n                confirmCloseStepper.handleSecondConfirm();\r\n                clearConfirmCloseStepper();\r\n            }}\r\n            confirmText={Tr('confirm_close_section_name', {name: confirmCloseStepper?.sectionName ? confirmCloseStepper.sectionName : \"\"})}\r\n            labelSecondConfirm='confirm_close_section_save_autoSave'\r\n            translateConfirmTexts={false}\r\n            open={!!confirmCloseStepper}\r\n        />)\r\n    } else {\r\n        return (<Confirm\r\n            onCancel={() => {\r\n                clearConfirmCloseStepper();\r\n            }}\r\n            onConfirm={() => {\r\n                confirmCloseStepper.handleConfirm();\r\n                clearConfirmCloseStepper();\r\n            }}\r\n            confirmText={Tr('confirm_close_section_name', {name: confirmCloseStepper?.sectionName ? confirmCloseStepper.sectionName : \"\"})}\r\n            translateConfirmTexts={false}\r\n            open={!!confirmCloseStepper}\r\n        />)\r\n    }\r\n}\r\n\r\nexport default connect((state) => ({\r\n    confirmCloseStepper: state.store.confirmCloseStepper\r\n}), {\r\n    clearConfirmCloseStepper\r\n})(ConfirmCloseStepper);","import React, {useRef, useState} from 'react'\r\nimport {makeStyles} from '@material-ui/styles';\r\nimport PollService from \"services/PollService\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport {AppBar, IconButton, Paper, TextField, Toolbar, Typography} from \"@material-ui/core\";\r\nimport Tr from \"translations/Translations\";\r\nimport NavigateNextIcon from '@material-ui/icons/NavigateNext';\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport Loading from \"components/Loading\";\r\nimport PropTypes from \"prop-types\";\r\nimport ErrorOutlineIcon from \"@material-ui/icons/ErrorOutline\";\r\nimport TypographyWithIcon from \"components/TypographyWithIcon\";\r\nimport PollNpsSwitch from \"components/popup/poll/PollNpsSwitch\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        bottom: 100,\r\n        right: 0,\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        position: \"fixed\",\r\n        maxWidth: 740\r\n    },\r\n    grid: {\r\n        '&>*:first-child': {\r\n            width: \"100%\"\r\n        },\r\n        '&>*:last-child': {\r\n            width: \"100%\",\r\n            marginBottom: theme.spacing(2)\r\n        }\r\n    },\r\n    question: {\r\n        padding: theme.spacing(2),\r\n        textAlign: \"center\"\r\n    },\r\n    openQuestion: {\r\n        width: 700,\r\n        marginTop: theme.spacing(2),\r\n        marginBottom: theme.spacing(4),\r\n    },\r\n}))\r\n\r\nfunction FeedbackContentOpen(\r\n    {\r\n        setOpen,\r\n        poll,\r\n        pollType,\r\n        apiVersion\r\n    }) {\r\n    const classes = useStyle();\r\n    const openQuestionRef = useRef();\r\n    const [score, setScore] = useState();\r\n    const [error, setError] = useState(false);\r\n\r\n\r\n    const sendPool = (close) => {\r\n        const rating = {\r\n            pollType: pollType,\r\n            objectType: \"eZamawiajacy\",\r\n            objectId: apiVersion,\r\n            score: close? null : score,\r\n            answer: (close || openQuestionRef.current.value === '') ? null : openQuestionRef.current.value\r\n        }\r\n\r\n        PollService.savePollRating(rating);\r\n        setOpen(false);\r\n    }\r\n\r\n\r\n    const handleClose = () => {\r\n        sendPool(true);\r\n        setOpen(false);\r\n    }\r\n    const handleSend = () => {\r\n        if (score === undefined) {\r\n            setError(true);\r\n            return;\r\n        }\r\n        sendPool();\r\n    }\r\n\r\n    const scoreChange = (e, rate) => {\r\n        setScore(rate);\r\n        setError(false)\r\n    }\r\n\r\n    return (\r\n        <div className={classes.root}>\r\n            <Paper>\r\n                {!poll ? <Loading/> :\r\n                    <GridBlock direction=\"column\" alignItems='center' className={classes.grid}>\r\n                        <AppBar position=\"static\">\r\n                            <Toolbar variant=\"dense\">\r\n                                <IconButton edge=\"start\" color=\"inherit\" aria-label=\"menu\" onClick={handleClose}>\r\n                                    <NavigateNextIcon/>\r\n                                </IconButton>\r\n                                <Typography variant=\"h6\" color=\"inherit\">\r\n                                    {poll.title}\r\n                                </Typography>\r\n                            </Toolbar>\r\n                        </AppBar>\r\n\r\n                        <BoldTypography className={classes.question}>{poll.question}</BoldTypography>\r\n\r\n                        <PollNpsSwitch scoreChange={scoreChange} score={score} />\r\n\r\n                        {!!error && <TypographyWithIcon Icon={ErrorOutlineIcon} color='error'>{Tr('feedback_missing_rating')}</TypographyWithIcon>}\r\n\r\n                        {!!poll.openQuestion &&\r\n                            <TextField\r\n                                inputRef={openQuestionRef}\r\n                                className={classes.openQuestion}\r\n                                label={poll.openQuestion}\r\n                                fullWidth\r\n                                multiline\r\n                                maxRows={5}\r\n                            />\r\n                        }\r\n                        <DoubleButton\r\n                            justify=\"space-around\"\r\n                            labelFirst={Tr(\"close\")}\r\n                            onClickFirst={handleClose}\r\n                            labelSecond={Tr(\"send\")}\r\n                            onClickSecond={handleSend}\r\n                        />\r\n                    </GridBlock>\r\n                }\r\n            </Paper>\r\n        </div>\r\n    )\r\n}\r\n\r\nFeedbackContentOpen.propTypes = {\r\n    setOpen: PropTypes.func.isRequired,\r\n    apiVersion: PropTypes.number,\r\n    poll: PropTypes.shape({\r\n        title: PropTypes.string.isRequired,\r\n        question: PropTypes.string.isRequired,\r\n        openQuestion: PropTypes.string\r\n    }).isRequired,\r\n    pollType: PropTypes.string.isRequired\r\n}\r\n\r\nexport default FeedbackContentOpen;\r\n","import React from 'react'\r\nimport {makeStyles} from '@material-ui/styles';\r\nimport Button from \"../../Button\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {\r\n        bottom: 100,\r\n        left: '100%',\r\n        zIndex: theme.zIndex.appBar - 1,\r\n        position: \"fixed\",\r\n        transform: \"rotate(-90deg) translateY(-76%)\",\r\n        whiteSpace: \"nowrap\",\r\n        transformOrigin: \"0% 0%\",\r\n        padding: \"0 24px\",\r\n        fontSize: \"0.7rem\"\r\n    }\r\n}))\r\n\r\nfunction FeedbackContentClosed(\r\n    {\r\n        setOpen,\r\n        poll\r\n\r\n    }) {\r\n    const classes = useStyle();\r\n    return (\r\n        <Button variant=\"contained\"  className={classes.root} onClick={() => setOpen(true)}>\r\n            {poll.title}\r\n        </Button>\r\n    )\r\n}\r\n\r\nFeedbackContentClosed.propTypes = {\r\n    setOpen: PropTypes.func.isRequired,\r\n    poll: PropTypes.shape({\r\n        title: PropTypes.string.isRequired,\r\n        question: PropTypes.string.isRequired,\r\n        openQuestion: PropTypes.string\r\n    }).isRequired,\r\n}\r\n\r\n\r\nexport default FeedbackContentClosed;\r\n","import React, {useEffect, useRef, useState} from 'react'\r\nimport FeedbackContentOpen from \"./FeedbackContentOpen\";\r\nimport FeedbackContentClosed from \"./FeedbackContentClosed\";\r\nimport PropTypes from \"prop-types\";\r\nimport PollService from \"services/PollService\";\r\nimport {connect} from \"react-redux\";\r\nimport moment from \"libs/moment\";\r\n\r\nfunction Feedback(\r\n    {\r\n        pollType,\r\n        userData\r\n    }) {\r\n    const [open, setOpen] = useState(false);\r\n    const [poll, setPoll] = useState(null);\r\n    const showTimeout = useRef(null);\r\n\r\n    useEffect(() => {\r\n        PollService.getPoll(pollType).then((resp) => {\r\n            if (resp.enabled) {\r\n                setPoll(resp);\r\n\r\n                if(userData && userData.nextPollDate) {\r\n                    const nextPoll = moment(userData.nextPollDate);\r\n                    const now = moment();\r\n                    //dodaję x skund żeby ne wyskoczyło od razu po załadowaniu strony\r\n                    now.add(5, 'second');\r\n                    const max = moment.max([nextPoll, now]);\r\n                    const secondsFromStart = max.diff(moment(), 's');\r\n                    showTimeout.current = setTimeout(() => {setOpen(true)}, secondsFromStart * 1000);\r\n                }\r\n            }\r\n        })\r\n        return () => {\r\n            if (showTimeout.current)\r\n                clearTimeout(showTimeout.current);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    useEffect(()=> {\r\n        if(!open) {\r\n            if (showTimeout.current)\r\n                clearTimeout(showTimeout.current);\r\n        }\r\n    },[open])\r\n\r\n    if (!poll)\r\n        return null;\r\n    return (\r\n        <>\r\n            {open ? <FeedbackContentOpen setOpen={setOpen} pollType={pollType} apiVersion={userData.apiVersion} poll={poll}/> : <FeedbackContentClosed setOpen={setOpen} poll={poll}/>}\r\n        </>\r\n    )\r\n}\r\n\r\nFeedback.propTypes = {\r\n    pollType: PropTypes.string.isRequired\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    userData: state.resources.userData\r\n}), {})(Feedback);\r\n","import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'\r\nimport {connect} from 'react-redux'\r\nimport Dialog from \"components/Dialog\";\r\nimport Tr from \"translations/Translations\";\r\nimport DoubleButton from \"components/popup/components/DoubleButton\";\r\nimport Typography from \"../../Typography\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport BoldTypography from \"components/BoldTypography\";\r\nimport EzamowieniaService from \"services/EzamowieniaService\";\r\nimport reduxStore from \"redux/store\";\r\nimport {clearEzamowieniaOauth, setEzamowieniaOauth} from \"redux/actions\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    marginTop: {\r\n        marginTop: theme.spacing()\r\n    }\r\n}))\r\n\r\n\r\nfunction EzamowieniaOauth({ezamowieniaOauth}) {\r\n    const classes = useStyle();\r\n\r\n    const [confirmationWindow, setConfirmationWindow] = useState(null);\r\n    const authWindowInterval = useRef(null);\r\n    const authWindow = useRef(null);\r\n    const ezamowieniaOauthRef = useRef(null);\r\n    const callbackUrlRef = useRef(null);\r\n\r\n    const closeWindow = () => {\r\n        if(authWindowInterval.current)\r\n            clearInterval(authWindowInterval.current);\r\n        authWindowInterval.current = null;\r\n        if(authWindow.current) {\r\n            try {\r\n                authWindow.current.close();\r\n            } catch (e) {\r\n                console.error(e)\r\n            }\r\n            authWindow.current = null;\r\n        }\r\n    }\r\n\r\n    const openWindow = useCallback((url) => {\r\n        closeWindow();\r\n        authWindow.current = window.open(url, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=no');\r\n        if(authWindow.current) {\r\n            authWindowInterval.current = setInterval(() => {\r\n                if(authWindowInterval.current && (!authWindow.current || authWindow.current.closed)) {\r\n                    clearInterval(authWindowInterval.current);\r\n                    authWindowInterval.current = null;\r\n                    callFail();\r\n                }\r\n            }, 1000);\r\n        }\r\n    },[])\r\n\r\n    useEffect(() => {\r\n        if (ezamowieniaOauth) {\r\n            ezamowieniaOauthRef.current = ezamowieniaOauth;\r\n\r\n            EzamowieniaService.getAuthorizationStatus().then((resp) => {\r\n                if (resp) {\r\n                    const {authorized, authorizationUrl, logoutUrl, userInfo, callbackOrigin} = resp;\r\n                    callbackUrlRef.current = callbackOrigin;\r\n                    if (!authorized) {\r\n                        openWindow(authorizationUrl);\r\n                    } else {\r\n                        setConfirmationWindow({userInfo, logoutUrl, requiredGroups: ezamowieniaOauth.requiredGroups})\r\n                    }\r\n                } else {\r\n                    if (ezamowieniaOauth.errorCallback) ezamowieniaOauth.errorCallback();\r\n                }\r\n            });\r\n        } else {\r\n            setConfirmationWindow(null);\r\n            authWindow.current = null;\r\n            ezamowieniaOauthRef.current = null;\r\n            authWindowInterval.current = null;\r\n            callbackUrlRef.current = null;\r\n        }\r\n    }, [ezamowieniaOauth, openWindow])\r\n\r\n\r\n    useEffect(() => {\r\n        window.addEventListener(\"message\", receiveMessage, false);\r\n        return () => {\r\n            window.removeEventListener(\"message\", receiveMessage)\r\n        };\r\n        // eslint-disable-next-line\r\n    }, [])\r\n\r\n    const receiveMessage = (event) => {\r\n        if (event.origin === callbackUrlRef.current) {\r\n            if (event.data.action && (typeof event.data.action === 'string' || event.data.action instanceof String)) {\r\n                if (event.data.action === \"ezamowieniaAuthorizationSuccess\") {\r\n                    closeWindow();\r\n                    if(ezamowieniaOauthRef.current) {\r\n                        reduxStore.dispatch(setEzamowieniaOauth({...ezamowieniaOauthRef.current}))\r\n                    }\r\n                }\r\n                if (event.data.action === \"ezamowieniaAuthorizationFailed\") {\r\n                    callFail();\r\n                }\r\n                if (event.data.action === \"ezamowieniaAuthorizationLogout\") {\r\n                    closeWindow();\r\n                    callFail();\r\n                    reduxStore.dispatch(clearEzamowieniaOauth());\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    const callSuccess = () => {\r\n        if (ezamowieniaOauthRef.current && ezamowieniaOauthRef.current.successCallback) {\r\n            ezamowieniaOauthRef.current.successCallback();\r\n        }\r\n        reduxStore.dispatch(clearEzamowieniaOauth())\r\n    }\r\n\r\n    const callFail = () => {\r\n        if (ezamowieniaOauthRef.current && ezamowieniaOauthRef.current.errorCallback) {\r\n            ezamowieniaOauthRef.current.errorCallback();\r\n        }\r\n        reduxStore.dispatch(clearEzamowieniaOauth())\r\n    }\r\n\r\n    const callLogout = () => {\r\n        EzamowieniaService.revokeToken();\r\n        if(confirmationWindow && confirmationWindow.logoutUrl) {\r\n            openWindow(confirmationWindow.logoutUrl);\r\n        }\r\n        setConfirmationWindow(null);\r\n    }\r\n\r\n    const missingRoles = useMemo(() => {\r\n        if (!!confirmationWindow?.requiredGroups?.length > 0) {\r\n            return confirmationWindow.requiredGroups.filter(x => !Array.isArray(confirmationWindow.userInfo.groups) || !confirmationWindow.userInfo.groups.includes(x));\r\n        }\r\n        return [];\r\n    }, [confirmationWindow]);\r\n\r\n    const continueEnabled = useMemo(()=> {\r\n        if (!!confirmationWindow?.userInfo?.organization_role?.includes(\"BUYER\") && missingRoles.length === 0) {\r\n            return true;\r\n        }\r\n        return false\r\n\r\n    }, [confirmationWindow, missingRoles])\r\n\r\n\r\n    return !!confirmationWindow &&\r\n        <Dialog\r\n            title={Tr('ezamowienia_confirm_title')}\r\n            open\r\n            maxWidth=\"md\"\r\n            onClose={callFail}\r\n            dialogActions={<DoubleButton\r\n                justify='flex-end'\r\n                labelFirst={ Tr(continueEnabled ? \"ezamowienia_confirm_use_other_button\" : \"ezamowienia_confirm_logout_button\")}\r\n                labelSecond={Tr('ezamowienia_confirm_continue_button')}\r\n                onClickFirst={callLogout}\r\n                onClickSecond={callSuccess}\r\n                disabledSecond={!continueEnabled}\r\n            />}>\r\n            <Typography component=\"span\">{Tr(\"ezamowienia_loggedin_user\")}: <strong>{\r\n                !!confirmationWindow.userInfo.given_name ?\r\n                    `${confirmationWindow.userInfo.given_name} ${confirmationWindow.userInfo.family_name} (${confirmationWindow.userInfo.sub})` :\r\n                    confirmationWindow.userInfo.sub\r\n            }</strong></Typography>\r\n\r\n            <> {\r\n                !confirmationWindow.userInfo.organizationName ?\r\n                    <Typography component=\"span\" color=\"error\" className={classes.marginTop}>{Tr(\"ezamowienia_loggedin_user_no_org_account\")}</Typography>\r\n                    :\r\n                    <>\r\n                        <Typography\r\n                            component=\"span\">{Tr(\"ezamowienia_loggedin_organization\")}: <strong>{confirmationWindow.userInfo.organizationName}</strong></Typography>\r\n                        {\r\n                            !confirmationWindow.userInfo.organization_role?.includes(\"BUYER\") ?\r\n                                <Typography color=\"error\" className={classes.marginTop}>{Tr(\"ezamowienia_loggedin_missing_buyer_org_role\")}</Typography>\r\n                                :\r\n                                <>\r\n                                    {\r\n                                        missingRoles.length > 0 && <>\r\n                                            <Typography color=\"error\" className={classes.marginTop}>{Tr(\"ezamowienia_loggedin_user_missing_org_roles\")}</Typography>\r\n                                            {missingRoles.map(x => <BoldTypography color=\"error\">• {Tr(\"ezamowienia_auth_group_\" + x)}</BoldTypography>)}\r\n                                        </>\r\n\r\n                                    }\r\n                                </>\r\n                        }\r\n\r\n                    </>\r\n            }\r\n            </>\r\n\r\n\r\n        </Dialog>;\r\n}\r\n\r\nexport default connect((state) => ({\r\n    ezamowieniaOauth: state.store.ezamowieniaOauth\r\n}), {})(EzamowieniaOauth)","import React, {useEffect, useState} from 'react'\r\nimport Navigation from 'components/complex/navigation/Navigation';\r\nimport AppBar from 'components/complex/appbar/AppBar';\r\nimport IEInfo from 'components/popup/IEinfo';\r\nimport Browser from 'libs/Browser';\r\nimport PurchaserRouter from \"./PurchaserRouter\";\r\nimport SalesNotificationPopup from \"components/popup/salesNotification/SalesNotificationPopup\";\r\nimport UploadService from \"services/UploadService\";\r\nimport ConfirmCloseStepper from \"components/popup/confirmCloseStepper/ConfirmCloseStepper\";\r\nimport Feedback from \"components/complex/feedback/Feedback\";\r\nimport EzamowieniaOauth from \"../../components/complex/ezamowienia/EzamowieniaOauth\";\r\n\r\n\r\nfunction PurchaserRoot() {\r\n    const [ieOpen, setIeOpen] = useState(Browser.isIE)\r\n\r\n    useEffect(() => {\r\n        UploadService.getValidExtensions();\r\n        return () => UploadService.clearValidExtensionsResource();\r\n    }, [])\r\n\r\n    return (\r\n        <>\r\n            <Navigation purchaser/>\r\n            <AppBar id=\"toolBar\"/>\r\n            <PurchaserRouter/>\r\n            <IEInfo\r\n                open={ieOpen}\r\n                onClose={() => setIeOpen(false)}\r\n            />\r\n            <Feedback pollType=\"ezam-nps\"/>\r\n            <SalesNotificationPopup />\r\n            <ConfirmCloseStepper />\r\n            <EzamowieniaOauth />\r\n        </>\r\n    )\r\n}\r\n\r\nexport default PurchaserRoot;\r\n","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {connect} from \"react-redux\";\r\nimport Loading from \"components/Loading\";\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport Correspondence from \"components/complex/correspondence/Correspondence\";\r\n\r\nfunction CtrCorrespondenceSection(\r\n    {\r\n        currentRfxRound\r\n    }) {\r\n\r\n    return (\r\n        <div>\r\n            {(!currentRfxRound) ?\r\n                <Loading/>\r\n                :\r\n                <Correspondence rfxRound={currentRfxRound} contractor/>\r\n            }\r\n        </div>\r\n    )\r\n}\r\n\r\nCtrCorrespondenceSection.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n    return {\r\n        demandStatistics: state.resources[StatisticsService.DEMAND_STATISTICS_RESOURCE_ID],\r\n        currentRfxRound: state.resources[StatisticsService.CURRENT_RFX_RESOURCE_ID],\r\n    }\r\n}\r\nconst mapDispatchToProps = {};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(CtrCorrespondenceSection);","import React, {useEffect} from 'react'\r\nimport StatisticsService from \"services/StatisticsService\";\r\nimport Workspace from \"components/Workspace\";\r\nimport CtrCorrespondenceSection from \"./sections/CtrCorrespondenceSection\";\r\n\r\nfunction CtrCorrespondencePanel(\r\n    {\r\n        match\r\n    }) {\r\n\r\n    const demandId = match.params.id;\r\n\r\n    useEffect(() => {\r\n        StatisticsService.getCurrentRound(demandId);\r\n        return () => {\r\n            StatisticsService.clearCurrentRound();\r\n        }\r\n        // eslint-disable-next-line\r\n    }, []);\r\n\r\n\r\n    return (\r\n        <>\r\n            <Workspace\r\n                render={<>\r\n                    <CtrCorrespondenceSection />\r\n                </>}\r\n            />\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nexport default CtrCorrespondencePanel;","import React, {useContext, useEffect, useState} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport moment from \"moment\";\r\nimport RingCountdown from \"components/complex/countdown/RingCountdown\";\r\nimport Workspace from \"components/Workspace\";\r\nimport DateFormats from \"constants/DateFormats\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Typography from \"components/BoldTypography\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport Tr from 'translations/Translations';\r\n\r\nfunction ContractorClock(\r\n    {\r\n        endTimeCallback,\r\n        dashboardSection\r\n    }) {\r\n\r\n\r\n    const [durations, setDurations] = useState([]);\r\n    const [endTime, setEndTime] = useState(null);\r\n    const [secondEndTime, setSecondEndTime] = useState(null);\r\n    const [clockTitle, setClockTitle] = useState(null);\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n    const noOfferStage = !!(dashboardSection?.noOfferStage);\r\n\r\n    useEffect(() => {\r\n        setDurations([])\r\n        setEndTime(null)\r\n        if (!dashboardSection) {\r\n            return;\r\n        }\r\n        const end = moment(dashboardSection.offerEndDate);\r\n        const nowTime = moment(dashboardSection.serverTime);\r\n        const secondEnd = dashboardSection.offerSecondEndDate ? moment(dashboardSection.offerSecondEndDate) : null;\r\n\r\n        if(dashboardSection.cancelled) {\r\n            //nothing\r\n        } else if (!dashboardSection.offerEndDate || nowTime.isSameOrAfter(end)) {\r\n            setDurations([]);\r\n            setEndTime(end.format(DateFormats.DATETIME_FORMAT));\r\n            if (secondEnd) {\r\n                if (nowTime.isSameOrAfter(secondEnd)) {\r\n                    setSecondEndTime(secondEnd.format(DateFormats.DATETIME_FORMAT));\r\n                } else {\r\n                    setClockTitle(Tr(\"offer_second_end_date_left_time\"));\r\n                    setupDuration(secondEnd, dashboardSection.offerStartDate, nowTime);\r\n                }\r\n            }\r\n        } else {\r\n            setClockTitle(stageTr(\"left_to_offer_end_date\"));\r\n            setupDuration(end, dashboardSection.offerStartDate, nowTime);\r\n        }\r\n    }, [dashboardSection, stageTr]);\r\n\r\n    const setupDuration = function(endTime, startDate, nowTime) {\r\n        const duration2 = moment.duration(endTime.diff(nowTime));\r\n        const number = duration2.asSeconds();\r\n\r\n        const startTime = moment(startDate);\r\n        const startDuration = moment.duration(endTime.diff(startTime));\r\n        const startNumber = startDuration.asSeconds();\r\n\r\n        setDurations([number, startNumber]);\r\n    }\r\n\r\n    return (\r\n        <Workspace\r\n            render={\r\n                <>\r\n                    {\r\n                        !!endTime && <>\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography>{stageTr(\"offer_end_date_reached\")}</Typography>\r\n                            </GridBlock>\r\n                            {!noOfferStage && <GridBlock justify=\"center\">\r\n                                <Typography>{endTime}</Typography>\r\n                            </GridBlock>\r\n                            }\r\n                        </>\r\n                    }\r\n\r\n                    {\r\n                        !!secondEndTime && <>\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography>{Tr(\"offer_second_end_date_reached\")}</Typography>\r\n                            </GridBlock>\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography>{secondEndTime}</Typography>\r\n                            </GridBlock>\r\n                        </>\r\n                    }\r\n\r\n                    {\r\n                        !!dashboardSection.cancelled && <>\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography>{Tr(\"procedure_status_6\")}</Typography>\r\n                            </GridBlock>\r\n                        </>\r\n                    }\r\n                    {!!durations.length && <RingCountdown duration={durations[0]} baseDuration={durations[1]} endTimeCallback={endTimeCallback} title={clockTitle}/>}\r\n                </>}/>\r\n    )\r\n\r\n}\r\n\r\nContractorClock.propTypes = {\r\n    dashboardSection: PropTypes.object,\r\n    endTimeCallback: PropTypes.func.isRequired,\r\n}\r\n\r\nexport default ContractorClock;","import React, {useContext} from 'react'\r\nimport {makeStyles} from '@material-ui/core';\r\nimport Tile from 'components/Tile';\r\nimport ForumIcon from '@material-ui/icons/Forum'\r\nimport LocalLibraryIcon from '@material-ui/icons/LocalLibrary'\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport GavelIcon from '@material-ui/icons/Gavel';\r\nimport InfoIcon from '@material-ui/icons/Info';\r\nimport Tr from 'translations/Translations';\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {useParams, withRouter} from \"react-router\";\r\nimport {StageSections, StageSectionsUrlParams} from \"../constants/StageSections\";\r\nimport openInNewTab from \"libs/openInNewTab\";\r\nimport {DemandValidationSectionStatus} from \"constants/DemandValidationSectionStatus\";\r\nimport OfferStageTranslationsContext from \"context/OfferStageTranslationsContext\";\r\nimport clsx from \"clsx\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n    root: {\r\n        display: 'flex',\r\n        justifyContent: 'center',\r\n        '&>*:not(:first-child)': {\r\n            marginLeft: theme.spacing(2),\r\n        },\r\n        marginBottom: theme.spacing(4)\r\n    },\r\n    icon: {\r\n        fontSize: theme.components.icon.fontSize,\r\n    },\r\n    mirror: {\r\n        transform: 'scaleX(-1)'\r\n    },\r\n    tile: {\r\n        width: 225,\r\n        height: 203,\r\n    },\r\n    highlight: {\r\n        color: theme.palette.primary.main\r\n    }\r\n}));\r\n\r\nfunction OfferTilesRow(\r\n    {\r\n        dashboardSection,\r\n        demandStageSectionsList\r\n    }) {\r\n    const classes = useStyles();\r\n    const params = useParams();\r\n    const demandId = params.id;\r\n    const stageId = params.stageId;\r\n    const stageTr = useContext(OfferStageTranslationsContext);\r\n\r\n    const handleOfferFormClick = () => {\r\n        const sectionsToSearch = [StageSections.AUCTION_OFFER_EDIT, StageSections.ADDITIONAL_OFFER_EDIT, StageSections.OFFER_EDIT];\r\n        const section = sectionsToSearch.find(x => demandStageSectionsList[x] && demandStageSectionsList[x].status !== DemandValidationSectionStatus.UNAVAILABLE);\r\n        if (section) {\r\n            RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION,\r\n                {id: demandId, stageId, section: StageSectionsUrlParams[section]}), {scrollTo: true})\r\n        }\r\n    }\r\n\r\n    const getMessagesLabel = () => {\r\n        let label = Tr('messages');\r\n        if (dashboardSection.messagesCount != null && dashboardSection.unreadMessagesCount != null) {\r\n            label += `<br/>${dashboardSection.unreadMessagesCount} / ${dashboardSection.messagesCount}`\r\n        }\r\n        return label;\r\n    }\r\n\r\n    return (\r\n        <>\r\n            <div className={classes.root}>\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<InfoIcon className={classes.icon}/>}\r\n                    text={Tr('basic_data_adn_documents')}\r\n                    dangerouslySetText\r\n                    onClick={(e) => {\r\n                        RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION,\r\n                            {id: demandId, stageId, section: StageSectionsUrlParams.GENERAL_INFO}), {scrollTo: true})\r\n                    }}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<GavelIcon className={classes.icon}/>}\r\n                    text={stageTr(\"offer_form\")}\r\n                    onClick={handleOfferFormClick}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<CheckCircleIcon className={classes.icon}/>}\r\n                    text={Tr(\"check_signature\")}\r\n                    onClick={(e) => {\r\n                        openInNewTab(dashboardSection.digitalSignCheckUrl)\r\n                    }}\r\n                />\r\n                <Tile\r\n                    className={classes.tile}\r\n                    icon={<LocalLibraryIcon className={classes.icon}/>}\r\n                    text={Tr('knowlage_base') + \"<br/><br/>\"}\r\n                    dangerouslySetText\r\n                    onClick={(e) => {\r\n                        openInNewTab(dashboardSection.publicKnowledgeBaseUrl);\r\n                    }}\r\n                />\r\n                <Tile\r\n                    className={clsx(classes.tile, {[classes.highlight]: dashboardSection.unreadMessagesCount > 0})}\r\n                    icon={<ForumIcon className={classes.icon}/>}\r\n                    text={getMessagesLabel()}\r\n                    dangerouslySetText\r\n                    onClick={(e) => {\r\n                        RouterPath.redirect(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_CORRESPONDENCE, {id: demandId}))\r\n                    }}\r\n                />\r\n            </div>\r\n        </>\r\n    )\r\n}\r\n\r\nOfferTilesRow.propTypes = {}\r\n\r\nOfferTilesRow.defaultProps = {}\r\n\r\n\r\nexport default withRouter(OfferTilesRow);","import React, {useCallback, useEffect, useState} from 'react'\r\nimport Workspace from \"components/Workspace\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {connect} from 'react-redux'\r\nimport Loading from \"components/Loading\";\r\nimport RouterPath from \"libs/RouterPath\";\r\nimport {StageSections, StageSectionsUrlParams} from \"./constants/StageSections\";\r\nimport ContractorClock from \"./components/ContractorClock\";\r\nimport OfferTilesRow from \"./components/OfferTilesRow\";\r\nimport OfferSections from \"./components/OfferSections\";\r\nimport Typography from \"components/BoldTypography\";\r\nimport Tr from \"translations/Translations\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport {OfferStageTranslationsContextProvider} from \"../../../../../context/OfferStageTranslationsContext\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    infoMsg: {\r\n        marginBottom: theme.spacing(2),\r\n        cursor: \"pointer\",\r\n        color: theme.palette.primary.main,\r\n    }\r\n}))\r\n\r\nfunction CtrOfferPanel(\r\n    {\r\n        match,\r\n        demandStagesList,\r\n        demandStageSectionsList\r\n    }) {\r\n\r\n    const classes = useStyle();\r\n    const [stageTranslations, setStageTranslations] = useState(null);\r\n    const demandId = match.params.id;\r\n    const stageId = match.params.stageId;\r\n\r\n    const [dashboardSection, setDashboardSection] = useState(null);\r\n\r\n    useEffect(() => {\r\n        if (demandStagesList) {\r\n            if (!stageId) {\r\n                const href = RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID, {\r\n                    id: demandId,\r\n                    stageId: demandStagesList[demandStagesList.length - 1].identity\r\n                });\r\n                RouterPath.redirectWithoutHistory(href);\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [demandStagesList, stageId])\r\n\r\n    useEffect(() => {\r\n        if (demandStageSectionsList)\r\n            setDashboardSection(demandStageSectionsList[StageSections.DASHBOARD]);\r\n\r\n    }, [demandStageSectionsList]);\r\n\r\n    useEffect(() => {\r\n        if (stageId) {\r\n            DemandOffersService.getStageSections(demandId, stageId);\r\n            DemandOffersService.getStageTranslations(demandId, stageId).then(resp => setStageTranslations(resp))\r\n        }\r\n        return () => {\r\n            setStageTranslations(null);\r\n            DemandOffersService.clearResources(DemandOffersService.DEMAND_STAGE_SECTIONS_LIST);\r\n        }\r\n    }, [demandId, stageId])\r\n\r\n    const getStageTranslation = useCallback((trKey) => {\r\n        return stageTranslations[trKey] || trKey;\r\n    }, [stageTranslations])\r\n\r\n    return (\r\n        <>\r\n            {(!demandStagesList || !demandStageSectionsList || !dashboardSection || !stageTranslations) ? <Loading/> :\r\n                <OfferStageTranslationsContextProvider value={getStageTranslation}>\r\n                    <Workspace\r\n                        render={<>\r\n                            <ContractorClock endTimeCallback={() => DemandOffersService.getStageSections(demandId, stageId)}\r\n                                             dashboardSection={dashboardSection}/>\r\n\r\n\r\n                            {!!demandStageSectionsList[StageSections.OFFER_EDIT]?.offerOutOfDateDueToRfxModification &&\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography className={classes.infoMsg}\r\n                                            onClick={() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION, {\r\n                                                id: demandId,\r\n                                                stageId: stageId,\r\n                                                section: StageSectionsUrlParams.OFFER_EDIT\r\n                                            }))}>{Tr('general_info_offer_outdated_due_to_modification')}</Typography>\r\n                            </GridBlock>\r\n                            }\r\n\r\n                            {!!demandStageSectionsList[StageSections.GENERAL_INFO]?.unreadDemandDocuments &&\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography className={classes.infoMsg}\r\n                                            onClick={() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION, {\r\n                                                id: demandId,\r\n                                                stageId: stageId,\r\n                                                section: StageSectionsUrlParams.GENERAL_INFO\r\n                                            }))}>{Tr('general_info_order_documents_new_notification')}</Typography>\r\n                            </GridBlock>\r\n                            }\r\n\r\n                            {!!demandStageSectionsList[StageSections.GENERAL_INFO]?.unreadRfxMessages &&\r\n                            <GridBlock justify=\"center\">\r\n                                <Typography className={classes.infoMsg}\r\n                                            onClick={() => RouterPath.redirectWithoutHistory(RouterPath.createPath(RouterPath.ctrDemand.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION, {\r\n                                                id: demandId,\r\n                                                stageId: stageId,\r\n                                                section: StageSectionsUrlParams.GENERAL_INFO\r\n                                            }))}>{Tr('general_info_answer_on_question_new_notification')}</Typography>\r\n                            </GridBlock>\r\n                            }\r\n                            <OfferTilesRow dashboardSection={dashboardSection} demandStageSectionsList={demandStageSectionsList}/>\r\n                            <OfferSections demandStageSectionsList={demandStageSectionsList}/>\r\n                        </>}\r\n                    />\r\n                </OfferStageTranslationsContextProvider>\r\n            }\r\n        </>\r\n    )\r\n}\r\n\r\n\r\nexport default connect((state) => ({\r\n    demandStagesList: state.resources[DemandOffersService.DEMAND_STAGES_LIST],\r\n    demandStageSectionsList: state.resources[DemandOffersService.DEMAND_STAGE_SECTIONS_LIST]\r\n}), {})(CtrOfferPanel)","import React from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport {Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport CtrCorrespondencePanel from \"./correspondence/CtrCorrespondencePanel\";\r\nimport CtrOfferPanel from \"./offer/CtrOfferPanel\";\r\n\r\nconst rp = RouterPath.ctrDemand.steps;\r\n\r\nfunction CtrScenesRouter() {\r\n    return (\r\n        <Switch>\r\n            <Route exact path={rp.CTR_DEMAND_ID_CORRESPONDENCE} component={CtrCorrespondencePanel}/>\r\n            <Route exact path={rp.CTR_DEMAND_ID_OFFER_STAGE} component={CtrOfferPanel}/>\r\n            <Route exact path={rp.CTR_DEMAND_ID_OFFER_STAGE_ID} component={CtrOfferPanel}/>\r\n            <Route exact path={rp.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION} component={CtrOfferPanel}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nCtrScenesRouter.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nCtrScenesRouter.defaultProps = {}\r\n\r\nexport default CtrScenesRouter;","import React, {useMemo} from \"react\";\r\nimport Tr from \"translations/Translations\";\r\nimport PropTypes from \"prop-types\";\r\nimport Dialog from \"components/Dialog\";\r\nimport MultiButton, {createButton} from \"components/popup/components/MultiButton\";\r\nimport GridBlock from \"components/GridBlock\";\r\nimport Form from \"components/Form\";\r\nimport useId from \"hooks/useId\";\r\nimport VS from \"constants/ValidationShema\";\r\nimport {connect} from \"react-redux\";\r\nimport * as Yup from \"yup\";\r\nimport {SignatureType, SignatureTypeLabel} from \"../../../constants/SignatureType\";\r\nimport RadioGroup from \"../../RadioGroup\";\r\nimport {createSelectItem} from \"../../Select\";\r\n\r\nconst ChooseSignatureTypePopup = (\r\n    {\r\n        signatureTypes,\r\n        onCancel,\r\n        onSuccess,\r\n        formSubmit\r\n    }) => {\r\n\r\n    const formId = useId();\r\n    const handleSubmit = () => formSubmit[formId]();\r\n    const types = useMemo(\r\n        () => signatureTypes.map(x => createSelectItem(x, SignatureTypeLabel(x)))\r\n        , [signatureTypes])\r\n\r\n    const onSubmit = ({signature}) => {\r\n        onSuccess(signature)\r\n    }\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), onCancel, 'outlined'));\r\n        buttons.push(createButton(Tr('select'), handleSubmit, undefined));\r\n        return buttons;\r\n    }\r\n\r\n    return (\r\n        <Dialog\r\n            open\r\n            dialogActions={<MultiButton buttons={getButtons()}/>}\r\n            maxWidth='md'\r\n            title={Tr('signature_select_type_label')}\r\n        >\r\n            <GridBlock\r\n                column\r\n            >\r\n\r\n                <Form\r\n                    initialValues={{\r\n                        signature: null\r\n                    }}\r\n                    validationSchema={Yup.object().shape({\r\n                        signature: VS.string()\r\n                    })}\r\n                    onSubmit={onSubmit}\r\n                    id={formId}\r\n                >\r\n                    {(formikProps) => (\r\n                        <GridBlock\r\n                            column\r\n                        >\r\n                            <RadioGroup\r\n                                id='signature'\r\n                                label=\"\"\r\n                                formikProps={formikProps}\r\n                                items={types}\r\n                            />\r\n                        </GridBlock>\r\n                    )}\r\n                </Form>\r\n\r\n            </GridBlock>\r\n        </Dialog>)\r\n}\r\n\r\nChooseSignatureTypePopup.propTypes = {\r\n    onCancel: PropTypes.func.isRequired,\r\n    onSuccess: PropTypes.func.isRequired,\r\n    signatureTypes: PropTypes.arrayOf(PropTypes.oneOf(Object.keys(SignatureType)))\r\n}\r\n\r\nexport default connect((state) => ({\r\n    formSubmit: state.form\r\n}), {})(ChooseSignatureTypePopup)","const loadExternalLibrary = async (src, id) => {\r\n\r\n    return new Promise((resolve, reject) => {\r\n\r\n        const existingScript = document.getElementById(id);\r\n        if (!existingScript) {\r\n            const script = document.createElement('script');\r\n            script.src = src;\r\n            script.id = id;\r\n            document.head.appendChild(script);\r\n            script.onload = () => {\r\n                    resolve()\r\n            };\r\n            script.onabort = () => {\r\n                reject();\r\n            }\r\n        }\r\n        if (existingScript) resolve();\r\n\r\n    });\r\n};\r\n\r\nexport default loadExternalLibrary;","import React, {useEffect, useRef} from 'react'\r\nimport Dialog from \"../../Dialog\";\r\nimport Tr from \"translations/Translations\";\r\nimport {SignatureType} from \"../../../constants/SignatureType\";\r\nimport Endpoints from \"../../../constants/Endpoints\";\r\nimport loadExternalLibrary from \"../../../libs/loadExternalLibrary\";\r\nimport Typography from \"../../Typography\";\r\nimport GridBlock from \"../../GridBlock\";\r\nimport BoldTypography from \"../../BoldTypography\";\r\n\r\n\r\n// const useStyle = makeStyles(theme => ({\r\n//     root: {}\r\n// }))\r\n\r\nconst SUPPORTED_SIG_TYPES = [SignatureType.PERSONAL_ID, SignatureType.QUALIFIED];\r\nconst isSupportedSigType = (x) => !!x && SUPPORTED_SIG_TYPES.includes(x)\r\n\r\nfunction Szafir(\r\n    {\r\n        config,\r\n        signatureType,\r\n        setSignatureType\r\n    }) {\r\n    const loadedLibrary = useRef(false);\r\n\r\n    const startComponentURIErrorCalback = (error) => {\r\n        config.errorCallback({type: \"startComponentURIErrorCalback\", error})\r\n    }\r\n    const onLoadError = (error) => {\r\n        config.errorCallback({type: \"onLoadError\", error})\r\n    }\r\n    const onConfigError = (error) => {\r\n        config.errorCallback({type: \"onConfigError\", error})\r\n    }\r\n    const onErrorNoExtension = (error, info) => {\r\n        config.errorCallback({type: \"onErrorNoExtension\", error, info})\r\n    }\r\n\r\n    const onErrorNoHostApp = (error, info) => {\r\n        config.errorCallback({type: \"onErrorNoHostApp\", error, info})\r\n    }\r\n\r\n    const taskListErrorCallback = (resultTaskList) => {\r\n        config.errorCallback({type: \"taskListErrorCallback\", error: resultTaskList})\r\n    }\r\n\r\n    const invalidResultCode = (error) => {\r\n        config.errorCallback({type: \"invalidResultCode\", error})\r\n    }\r\n\r\n    const successLoadSzafir = () => {\r\n        window.SZAFIR_SDK.startComponentURI(Endpoints.SERVER_URL + `/js/signature/settings${signatureType === SignatureType.PERSONAL_ID ? \"_polish_id\" : \"\"}.xml`, startComponentURISuccessCalback, startComponentURIErrorCalback);\r\n    }\r\n\r\n    const startComponentURISuccessCalback = () => {\r\n        config.docContentFunc(signatureType).then((resp) => {\r\n            if (resp) {\r\n                const cfg = config.makeTaskListConfig || {\r\n                    signatureFormat: \"PAdES-BES\",\r\n                    dataEmbedding: \"true\"\r\n                }\r\n                var makeTaskList = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><MakeTaskList><MakeSigningTask><MakeSigningTaskProperties><SignatureFormat>' + cfg.signatureFormat\r\n                    + '</SignatureFormat><DataEmbedding>' + cfg.dataEmbedding + '</DataEmbedding></MakeSigningTaskProperties><DataToSign><Base64Binary>' + resp + '</Base64Binary></DataToSign></MakeSigningTask></MakeTaskList>';\r\n                window.SZAFIR_SDK.getTaskList(makeTaskList, function (taskList) {\r\n                    window.SZAFIR_SDK.doTaskList(taskList, taskListSuccessCallback, taskListErrorCallback);\r\n                });\r\n            }\r\n        })\r\n    }\r\n\r\n\r\n    const taskListSuccessCallback = (resultTaskList) => {\r\n        var xmlDoc = window.jQuery.parseXML(resultTaskList);\r\n        var result = window.jQuery(\"Result\", xmlDoc);\r\n        const code = result.attr('code');\r\n        if (result.attr('code') === \"0\") {\r\n            const signature = window.jQuery(\"TaskList SigningTask SigningTaskItem SignatureToCreate Base64Binary\", xmlDoc).text();\r\n            config.successCallback(signatureType, signature.replace(/\\n/g, \"\"), null)\r\n        } else {\r\n            var desc = window.jQuery(\"Description\", xmlDoc);\r\n            invalidResultCode({\r\n                resultCode: code,\r\n                result: result.text(),\r\n                descriptionCode: desc.attr(\"code\"),\r\n                description: desc.text(),\r\n            })\r\n        }\r\n    }\r\n\r\n    useEffect(() => {\r\n        const loadSzafir = () => {\r\n            window.SZAFIR_SDK.loadSzafir(successLoadSzafir, onLoadError);\r\n        }\r\n        if (isSupportedSigType(signatureType)) {\r\n            if (!loadedLibrary.current) {\r\n                loadExternalLibrary(Endpoints.EXT_JS_LIBRARIES.jquery, \"external-lib-jquery\").then(() => {\r\n                    loadExternalLibrary(Endpoints.EXT_JS_LIBRARIES.szafir, \"external-lib-szafir\").then(() => {\r\n                        window.SZAFIR_SDK.config({\r\n                            sdk_location_url: Endpoints.SERVER_URL + \"/js/signature/build/\",\r\n                            versions_file: \"versions.xml\",\r\n                            onError: onConfigError,\r\n                            onErrorNoExtension,\r\n                            onErrorNoHostApp,\r\n                            debug: false\r\n                        });\r\n                        loadedLibrary.current = true;\r\n                        loadSzafir();\r\n                    }).catch(e => console.error(e))\r\n                }).catch(e => console.error(e))\r\n            } else {\r\n                loadSzafir();\r\n            }\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [signatureType])\r\n\r\n    return (\r\n        <Dialog\r\n            open={isSupportedSigType(signatureType)}\r\n            onClose={() => setSignatureType(null)}\r\n        >\r\n            <GridBlock\r\n                justify=\"center\"\r\n            >\r\n                <BoldTypography>{Tr('szafir_loading_info')}</BoldTypography>\r\n                <Typography>{Tr('szafir_loading_info_2')}</Typography>\r\n            </GridBlock>\r\n        </Dialog>\r\n    )\r\n\r\n\r\n}\r\n\r\nSzafir.propTypes = {}\r\n\r\n\r\nexport default Szafir;\r\n","import React, {useEffect, useState} from 'react'\r\nimport Dialog from \"../../Dialog\";\r\nimport Tr from \"translations/Translations\";\r\nimport {SignatureType} from \"../../../constants/SignatureType\";\r\nimport Typography from \"../../Typography\";\r\nimport GridBlock from \"../../GridBlock\";\r\nimport GetAppIcon from '@material-ui/icons/GetApp';\r\nimport MultiButton, {createButton} from \"../../popup/components/MultiButton\";\r\nimport UploadFile from \"../../UploadFile\";\r\nimport {Link} from \"@material-ui/core\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport FilesList from \"../../FilesList\";\r\nimport WorkableButton from \"../../button/WorkableButton\";\r\n\r\nconst useStyle = makeStyles(theme => ({\r\n    root: {},\r\n    step: {\r\n        marginTop: theme.spacing(2)\r\n    }\r\n}))\r\n\r\nconst SUPPORTED_SIG_TYPES = [SignatureType.UNKNOWN, SignatureType.E_PUAP];\r\nconst isSupportedSigType = (x) => !!x && SUPPORTED_SIG_TYPES.includes(x)\r\n\r\nfunction ExternalSignature(\r\n    {\r\n        config,\r\n        signatureType,\r\n        setSignatureType,\r\n        encryptionRoundId\r\n    }) {\r\n    const classes = useStyle();\r\n    const [file, setFile] = useState(null);\r\n    const [error, setError] = useState(null);\r\n    const [downloadWorking, setDownloadWorking] = useState(false);\r\n\r\n    const getButtons = () => {\r\n        const buttons = [];\r\n        buttons.push(createButton(Tr('cancel'), config.cancelCallback, 'outlined'));\r\n        buttons.push(createButton(Tr('confirm'), handlePlaceOffer, undefined));\r\n        return buttons;\r\n    }\r\n\r\n    const handleUpload = (upload) => {\r\n        setError(null);\r\n        setFile(upload);\r\n    }\r\n\r\n    const handlePlaceOffer = () => {\r\n        setError(null);\r\n        if(!file) {\r\n            setError(Tr(\"add_file\"))\r\n        } else {\r\n            config.successCallback(signatureType, null, file.identity)\r\n        }\r\n    }\r\n\r\n    const downloadDocument = () => {\r\n        setDownloadWorking(true);\r\n        config.docContentFunc(signatureType).finally(()=> setDownloadWorking(false))\r\n    }\r\n\r\n\r\n    return (<Dialog\r\n        maxWidth='md'\r\n        open\r\n        title={Tr(\"sign_document\")}\r\n        dialogActions={<MultiButton buttons={getButtons()}/>}\r\n    >\r\n        <GridBlock column>\r\n            <Typography className={classes.step}>{Tr('signature_external_info_' + signatureType.toLowerCase())}</Typography>\r\n\r\n            <WorkableButton working={downloadWorking} Icon={GetAppIcon} onClick={downloadDocument}>{Tr(\"offer_form_download\")}</WorkableButton>\r\n\r\n            {\r\n                signatureType === SignatureType.UNKNOWN && <Typography className={classes.step}>{Tr(config.signatureTypes.includes(SignatureType.E_PUAP) ?\r\n                    'signature_external_info_2_unknown_national' : 'signature_external_info_2_unknown_eu')}</Typography>\r\n            }\r\n            {\r\n                signatureType === SignatureType.E_PUAP && <Typography className={classes.step}>{Tr('signature_external_info_2_e_puap')}\r\n                    <Link target=\"_blank\" href={Tr('signature_external_info_2_e_puap_link')}>{Tr('signature_external_info_2_e_puap_link')}</Link>\r\n                </Typography>\r\n            }\r\n\r\n            <Typography className={classes.step}>{Tr(signatureType === SignatureType.E_PUAP ? 'signature_external_info_3_e_puap' : 'signature_external_info_3')}</Typography>\r\n            <UploadFile\r\n                multiple={false}\r\n                onUpload={handleUpload}\r\n                onUploadPopupClosed={()=> setError(null)}\r\n                encryptRoundId={encryptionRoundId}\r\n            />\r\n            <FilesList elements={file ? [{file}] : undefined} onDelete={()=> setFile(null)}/>\r\n            {error && <Typography color='error'>{error}</Typography>}\r\n        </GridBlock>\r\n    </Dialog>)\r\n\r\n\r\n}\r\n\r\nExternalSignature.propTypes = {}\r\n\r\nExternalSignature.defaultProps = {}\r\n\r\n\r\n\r\nfunction ExternalSignatureWrapper(\r\n    {\r\n        config,\r\n        signatureType,\r\n        setSignatureType\r\n    }) {\r\n\r\n    const [supported, setSupported] = useState(false);\r\n    const [encryptionRoundId, setEncryptionRoundId] = useState(undefined);\r\n    useEffect(()=> {\r\n            setSupported(isSupportedSigType(signatureType));\r\n    }, [signatureType])\r\n\r\n    useEffect(()=> {\r\n        if(supported) {\r\n            config.getEncryptionRoundId().then(resp => {\r\n                if(resp !== undefined)\r\n                    setEncryptionRoundId(resp);\r\n            })\r\n        } else {\r\n            setEncryptionRoundId(undefined);\r\n        }\r\n        // eslint-disable-next-line\r\n    }, [supported])\r\n\r\n    return !!config && encryptionRoundId !== undefined ? <ExternalSignature\r\n        signatureType={signatureType}\r\n        config={config}\r\n        setSignatureType={setSignatureType}\r\n        encryptionRoundId={encryptionRoundId} /> : null\r\n\r\n}\r\n\r\n\r\n\r\nexport default ExternalSignatureWrapper;\r\n","import React, {useState} from 'react'\r\nimport {connect} from \"react-redux\";\r\nimport ChooseSignatureTypePopup from \"./ChooseSignatureTypePopup\";\r\nimport reduxStore from \"redux/store\"\r\nimport {clearSignature} from \"../../../redux/actions\";\r\nimport Szafir from \"./Szafir\";\r\nimport {useDidUpdateEffect} from \"../../../hooks/useDidUpdateEffect\";\r\nimport PropTypes from \"prop-types\";\r\nimport {SignatureType} from \"../../../constants/SignatureType\";\r\nimport ExternalSignature from \"./ExternalSignature\";\r\n// const useStyle = makeStyles(theme => ({\r\n//     root: {}\r\n// }))\r\n\r\nfunction Signature(\r\n    {\r\n        config,\r\n    }) {\r\n\r\n    const [sigType, setSigType] = useState(null);\r\n\r\n    useDidUpdateEffect(()=> {\r\n        if(!config) {\r\n            setSigType(null);\r\n        }\r\n    },[config])\r\n\r\n    const cancel = () => {\r\n        reduxStore.dispatch(clearSignature(\"config\"));\r\n        if(config.cancelCallback)\r\n            config.cancelCallback();\r\n    }\r\n\r\n\r\n    return (\r\n        <>\r\n            {(!!config && sigType === null) && <ChooseSignatureTypePopup\r\n                signatureTypes={config.signatureTypes}\r\n                onSuccess={(selectedType) => setSigType(selectedType)}\r\n                onCancel={cancel}\r\n            />}\r\n            <ExternalSignature signatureType={sigType} setSignatureType={setSigType} config={config} />\r\n            <Szafir signatureType={sigType} setSignatureType={setSigType} config={config} />\r\n        </>\r\n    )\r\n\r\n}\r\n\r\nSignature.propTypes = {\r\n    config: PropTypes.shape({\r\n        docContentFunc: PropTypes.func.isRequired,\r\n        successCallback: PropTypes.func.isRequired,\r\n        errorCallback: PropTypes.func.isRequired,\r\n        cancelCallback: PropTypes.func.isRequired,\r\n        signatureTypes: PropTypes.arrayOf(PropTypes.oneOf(Object.keys(SignatureType))),\r\n        getEncryptionRoundId: PropTypes.func.isRequired,\r\n    })\r\n\r\n}\r\n\r\nSignature.defaultProps = {}\r\n\r\nexport default connect((state) => ({\r\n    config: state.signature.config\r\n}))(Signature);\r\n","import React, {useEffect} from 'react'\r\nimport PropTypes from 'prop-types';\r\nimport Page from 'components/Page';\r\nimport InfoBar from \"components/complex/infobar/InfoBar\";\r\nimport {makeStyles} from \"@material-ui/styles\";\r\nimport CtrScenesRouter from \"./CtrScenesRouter\";\r\nimport DemandOffersService from \"services/DemandOffersService\";\r\nimport {connect} from \"react-redux\";\r\nimport ContractorStageBar from \"components/complex/stagebar/ContractorStageBar\";\r\nimport Signature from \"components/complex/signature/Signature\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n    content: {\r\n        padding: theme.spacing(2)\r\n    }\r\n}));\r\n\r\nfunction CtrStepperPages(\r\n    {\r\n        match,\r\n        demandStagesList\r\n    }) {\r\n    const classes = useStyles();\r\n\r\n    const demandId = match.params.id;\r\n\r\n    useEffect(() => {\r\n        DemandOffersService.getStages(demandId);\r\n        return () => {\r\n            DemandOffersService.clearResources(DemandOffersService.DEMAND_STAGES_LIST);\r\n        }\r\n    }, [demandId])\r\n\r\n    return (\r\n        <Page>\r\n            <Signature/>\r\n            <InfoBar contractor/>\r\n            <ContractorStageBar demandStagesList={demandStagesList} contractor/>\r\n            <div className={classes.content}>\r\n                <CtrScenesRouter/>\r\n            </div>\r\n        </Page>\r\n    )\r\n}\r\n\r\nCtrStepperPages.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    demandStagesList: state.resources[DemandOffersService.DEMAND_STAGES_LIST]\r\n}), {})(CtrStepperPages);\r\n\r\n","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from \"../../NotFound/NotFound\";\r\nimport CtrStepperPages from \"./scenes/CtrStepperPages\";\r\n\r\nconst rp = RouterPath.ctrDemand;\r\n\r\nfunction CtrDemand() {\r\n\r\n    return (\r\n        <Switch>\r\n            {/*zmiana */}\r\n            <Redirect exact from={rp.old.CTR_DEMAND_CORRESPONDENCE_ID} to={rp.steps.CTR_DEMAND_ID_CORRESPONDENCE} />\r\n            <Redirect exact from={rp.steps.CTR_DEMAND_ID} to={rp.steps.CTR_DEMAND_ID_OFFER_STAGE} />\r\n            <Redirect exact from={rp.steps.CTR_DEMAND_ID_OFFER} to={rp.steps.CTR_DEMAND_ID_OFFER_STAGE} />\r\n\r\n\r\n            <Route exact path={rp.steps.CTR_DEMAND_ID_CORRESPONDENCE} component={CtrStepperPages}/>\r\n            <Route exact path={rp.steps.CTR_DEMAND_ID_OFFER_STAGE} component={CtrStepperPages}/>\r\n            <Route exact path={rp.steps.CTR_DEMAND_ID_OFFER_STAGE_ID_SECTION} component={CtrStepperPages}/>\r\n            <Route exact path={rp.steps.CTR_DEMAND_ID_OFFER_STAGE_ID} component={CtrStepperPages}/>\r\n\r\n\r\n            <Route component={NotFound}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nexport default CtrDemand;\r\n","import React from 'react'\r\nimport {Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from '../NotFound/NotFound';\r\nimport {withRouter} from \"react-router\";\r\nimport CtrDemand from \"./demand/CtrDemand\";\r\nimport Endpoints from \"../../constants/Endpoints\";\r\n\r\nfunction ContractorRouter() {\r\n\r\n    return (\r\n        <Switch>\r\n            <Route exact path={RouterPath.CTR_INIT} component={() => {\r\n                window.location.replace( Endpoints.SERVER_URL);\r\n                return null;\r\n            }}/>\r\n            <Route path={RouterPath.CTR_DEMAND} component={CtrDemand}/>\r\n            <Route component={NotFound}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nexport default withRouter(ContractorRouter);\r\n","import React, {useEffect} from 'react'\r\nimport AppBar from 'components/complex/appbar/AppBar';\r\nimport Navigation from \"components/complex/navigation/Navigation\";\r\nimport ContractorRouter from \"./ContractorRouter\";\r\nimport UploadService from \"../../services/UploadService\";\r\n\r\n\r\nfunction ContractorRoot() {\r\n\r\n    useEffect(()=>{\r\n        UploadService.getValidExtensions();\r\n        return ()=> UploadService.clearValidExtensionsResource();\r\n    },[]);\r\n\r\n    return (\r\n        <>\r\n            <Navigation />\r\n            <AppBar id=\"toolBar\"/>\r\n            <ContractorRouter/>\r\n        </>\r\n    )\r\n}\r\n\r\nexport default ContractorRoot;\r\n","import React from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport NotFound from './NotFound/NotFound';\r\nimport PurchaserRoot from \"./purchaser/PurchaserRoot\";\r\nimport ContractorRoot from \"./contractor/ContractorRoot\";\r\n\r\nfunction Router() {\r\n\r\n    return (\r\n        <Switch>\r\n            <Route exact path={RouterPath.BASE}>\r\n                <Redirect to={RouterPath.MY_PROCEDURE}/>\r\n            </Route>\r\n            <Route path={RouterPath.BUYER_INIT} component={PurchaserRoot}/>\r\n            <Route path={RouterPath.CTR_INIT} component={ContractorRoot}/>\r\n            <Route path={RouterPath.PURCHASER_INIT} component={PurchaserRoot}/>\r\n            <Route component={NotFound}/>\r\n        </Switch>\r\n    )\r\n}\r\n\r\nexport default Router;\r\n","import React from 'react'\r\nimport { withStyles, Dialog, DialogContent, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport SmileIcon from '@material-ui/icons/SentimentSatisfiedAlt'\r\nimport Button from 'components/Button';\r\nimport Tr from 'translations/Translations';\r\nimport Title from 'components/Title';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ticon: {\r\n\t\tfontSize: theme.components.icon.fontSize,\r\n\t},\r\n\tcontent: {\r\n\t\ttextAlign: 'center',\r\n\t\t'&>*': {\r\n\t\t\tmarginBottom: theme.spacing(2)\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction WelcomeTutorial({\r\n\tclasses,\r\n\topen,\r\n\tonClick\r\n}) {\r\n\r\n\treturn (\r\n\t\t<Dialog open={open}>\r\n\t\t\t<DialogContent className={classes.content}>\r\n\t\t\t\t<SmileIcon className={classes.icon} />\r\n\t\t\t\t<Title>\r\n\t\t\t\t\t{Tr('tutorial_t_0')}\r\n\t\t\t\t</Title>\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{Tr('tutorial_d_0')}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\tonClick={onClick}\r\n\t\t\t\t\tfullWidth\r\n\t\t\t\t>\r\n\t\t\t\t\t{Tr('start')}\r\n\t\t\t\t</Button>\r\n\t\t\t</DialogContent>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nWelcomeTutorial.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\topen: PropTypes.bool,\r\n\tonClick: PropTypes.func,\r\n}\r\n\r\nWelcomeTutorial.defaultProps = {\r\n\tonClick: () => {}\r\n}\r\n\r\nexport default withStyles(style)(WelcomeTutorial);","import React, { memo } from 'react'\r\nimport { withStyles, Paper, Typography, Button } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport Title from 'components/Title';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t\tpadding: theme.spacing(2),\r\n\t\t'&>*': {\r\n\t\t\t'&:not(:first-child)': {\r\n\t\t\t\tmarginTop: theme.spacing(1)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n})\r\n\r\nfunction TourTooltip({\r\n\tclasses,\r\n\tstep,\r\n\tprimaryProps,\r\n\ttooltipProps,\r\n\tisLastStep,\r\n\tonEnd,\r\n\tchangePage,\r\n}) {\r\n\tconst { title, content, href } = step;\r\n\r\n\tconst handleNextClick = (e) => {\r\n\t\tif (href) {\r\n\t\t\tRouterPath.redirect(href)\r\n\t\t}\r\n\t\tprimaryProps.onClick(e)\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Paper className={classes.root} {...tooltipProps}>\r\n\t\t\t<Title align='center'>\r\n\t\t\t\t{title}\r\n\t\t\t</Title>\r\n\t\t\t<Typography variant='body1' align='justify'>\r\n\t\t\t\t{content}\r\n\t\t\t</Typography>\r\n\t\t\t{!isLastStep &&\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\tcolor='primary'\r\n\t\t\t\t\tfullWidth\r\n\t\t\t\t\tonClick={handleNextClick}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Tr('further')}\r\n\t\t\t\t</Button>\r\n\t\t\t}\r\n\t\t\t<Button\r\n\t\t\t\tvariant='outlined'\r\n\t\t\t\tcolor='primary'\r\n\t\t\t\tfullWidth\r\n\t\t\t\tonClick={onEnd}\r\n\t\t\t>\r\n\t\t\t\t{Tr('exit')}\r\n\t\t\t</Button>\r\n\t\t</Paper>\r\n\t)\r\n}\r\n\r\nTourTooltip.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nTourTooltip.defaultProps = {\r\n}\r\n\r\nexport default memo(withStyles(style)(TourTooltip));","import RouterPath from 'libs/RouterPath';\r\n\r\nconst createStep = (target, title, content, placement, href) => ({\r\n\ttarget,\r\n\ttitle,\r\n\tcontent,\r\n\thref,\r\n\tplacement,\r\n\tdisableBeacon: true,\r\n})\r\n\r\nexport default [\r\n\tcreateStep('.test-step', 'Tytuł 1', 'This is my awesome feature! 1', 'bottom'),\r\n\tcreateStep('.test-step-2', 'Tytuł 2', 'This is my awesome feature! 2', 'left', RouterPath.BUYER_INIT),\r\n\tcreateStep('.tour-stepper', 'Tytuł 3', 'This is my awesome feature! STEPPER', 'right'),\r\n]","import React, { useState, memo } from 'react'\r\nimport { withTheme } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Joyride, { ACTIONS, EVENTS, STATUS } from 'react-joyride'\r\nimport WelcomeTutorial from './WelcomeTutorial';\r\nimport TourTooltip from './TourTooltip';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport steps from './tutorial.steps'\r\nimport { connect } from 'react-redux'\r\nimport { setOpenTutorial } from 'redux/actions'\r\n\r\nfunction Tutorial({\r\n\ttheme,\r\n\topenTutorial,\r\n\tsetOpenTutorial\r\n}) {\r\n\tconst [step, setStep] = useState(0)\r\n\tconst [run, setRun] = useState(false);\r\n\r\n\tconst handleWelcomeClick = () => {\r\n\t\tRouterPath.redirect(RouterPath.TEST)\r\n\t\tsetOpenTutorial(false)\r\n\t\tsetRun(true)\r\n\t}\r\n\r\n\tconst handleEndTour = () => {\r\n\t\tsetRun(false)\r\n\t}\r\n\r\n\tconst handleJoyrideCallback = ({ action, index, status, type }) => {\r\n\t\tif ([EVENTS.STEP_AFTER, EVENTS.TARGET_NOT_FOUND].includes(type)) {\r\n\t\t\t// Update state to advance the tour\r\n\t\t\tsetStep(index + (action === ACTIONS.PREV ? -1 : 1))\r\n\t\t}\r\n\t\telse if ([STATUS.FINISHED, STATUS.SKIPPED].includes(status)) {\r\n\t\t\t// Need to set our running state to false, so we can restart if we click start again.\r\n\t\t\tsetRun(false)\r\n\t\t}else if([STATUS.PAUSED].includes(status)){\r\n\t\t\tsetStep(0)\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<WelcomeTutorial open={openTutorial} onClick={handleWelcomeClick} />\r\n\t\t\t<Joyride\r\n\t\t\t\tcallback={handleJoyrideCallback}\r\n\t\t\t\trun={run}\r\n\t\t\t\ttooltipComponent={(props) =>\r\n\t\t\t\t\t<TourTooltip\r\n\t\t\t\t\t\t{...props}\r\n\t\t\t\t\t\tonEnd={handleEndTour}\r\n\t\t\t\t\t/>}\r\n\t\t\t\tstepIndex={step}\r\n\t\t\t\tdisableOverlayClose\r\n\t\t\t\tcontinuous\r\n\t\t\t\tsteps={steps}\r\n\t\t\t\tstyles={{\r\n\t\t\t\t\toptions: {\r\n\t\t\t\t\t\tzIndex: theme.zIndex.tooltip,\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nTutorial.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nTutorial.defaultProps = {\r\n}\r\n\r\nexport default connect((state) => ({\r\n\topenTutorial: state.store.openTutorial,\r\n}), {\r\n\tsetOpenTutorial\r\n})(memo(withTheme(Tutorial)));","import React, { useState } from 'react'\r\nimport { withStyles, Checkbox, FormControlLabel } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport Tr from 'translations/Translations';\r\nimport SaveIcon from '@material-ui/icons/Save'\r\nimport DeleteIcon from '@material-ui/icons/Delete'\r\nimport SaveDialogBase from './SaveDialogBase';\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t},\r\n\ticon: {\r\n\t\tfontSize: theme.components.icon.fontSize,\r\n\t},\r\n\tpadding: {\r\n\t\tpadding: `${theme.spacing(1)}px 0`\r\n\t}\r\n})\r\n\r\nfunction SaveDialog({\r\n\tclasses,\r\n\tonClose,\r\n\tshowDelete = false\r\n}) {\r\n\r\n\tconst [isChecked, setIsChecked] = useState(false)\r\n\tconst handleChange = (value) => {\r\n\t\tsetIsChecked(value)\r\n\t\tlocalStorage.setItem('show_save_popup', value);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<SaveDialogBase\r\n\t\t\tonClose={onClose}\r\n\t\t\ttitle={showDelete ? Tr('deleted') : Tr('saved')}\r\n\t\t\tIcon={showDelete ? DeleteIcon : SaveIcon}\r\n\t\t>\r\n\t\t\t<FormControlLabel\r\n\t\t\t\tcontrol={<Checkbox color=\"primary\" onChange={() => handleChange(!isChecked)} />}\r\n\t\t\t\tlabel={Tr(\"dont_show\")}\r\n\t\t\t/>\r\n\t\t</SaveDialogBase>\r\n\t)\r\n}\r\n\r\nSaveDialog.propTypes = {\r\n\tclasses: PropTypes.any,\r\n\tonClose: PropTypes.func,\r\n}\r\n\r\nSaveDialog.defaultProps = {\r\n}\r\n\r\nexport default withStyles(style)(SaveDialog);","import React from 'react'\r\nimport { withStyles, Typography } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport SaveDialogBase from './SaveDialogBase';\r\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\r\nimport Tr from 'translations/Translations';\r\nimport { connect } from 'react-redux'\r\n\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t},\r\n\ticon: {\r\n\t\tcolor: theme.palette.common.error,\r\n\t}\r\n})\r\n\r\nfunction SaveDialogError({\r\n\tclasses,\r\n\tonClose,\r\n\tmessage,\r\n\r\n}) {\r\n\r\n\treturn (\r\n\t\t<SaveDialogBase\r\n\t\t\tonClose={onClose}\r\n\t\t\ttitle={Tr('failure')}\r\n\t\t\tIcon={HighlightOffIcon}\r\n\t\t\ticonClassName={classes.icon}\r\n\t\t>\r\n\t\t\t<Typography variant='body1'>\r\n\t\t\t\t{message}\r\n\t\t\t</Typography>\r\n\t\t</SaveDialogBase>\r\n\t)\r\n}\r\n\r\nSaveDialogError.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tmessage: state.store.saveStatusMessage\r\n}), {\r\n\r\n})(withStyles(style)(SaveDialogError));","import React from 'react'\r\nimport {Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport SaveDialogBase from './SaveDialogBase';\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle'\r\nimport {connect} from 'react-redux'\r\n\r\n\r\nconst style = theme => ({\r\n    root: {},\r\n    icon: {\r\n        color: theme.palette.common.success,\r\n    }\r\n})\r\n\r\nfunction SaveDialogInfo(\r\n    {\r\n        classes,\r\n        onClose,\r\n        message,\r\n\r\n    }) {\r\n\r\n    return (\r\n        <SaveDialogBase\r\n            onClose={onClose}\r\n            Icon={CheckCircleIcon}\r\n            iconClassName={classes.icon}\r\n        >\r\n            <Typography variant='body1'>\r\n                {message}\r\n            </Typography>\r\n        </SaveDialogBase>\r\n    )\r\n}\r\n\r\nSaveDialogInfo.propTypes = {\r\n    classes: PropTypes.any,\r\n}\r\n\r\nexport default connect((state) => ({\r\n    message: state.store.saveStatusMessage\r\n}), {})(withStyles(style)(SaveDialogInfo));","import React from 'react'\r\nimport { withStyles } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport LoadingScreen from 'components/complex/loadingScreen/LoadingScreen';\r\nimport SaveDialog from './SaveDialog';\r\nimport saveStatusValues from 'constants/status.save'\r\nimport { connect } from 'react-redux'\r\nimport { setSaveStatusClosed } from 'redux/actions'\r\nimport SaveDialogError from './SaveDialogError';\r\nimport SaveDialogInfo from \"./SaveDialogInfo\";\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\r\n\t}\r\n})\r\n\r\nfunction Save({\r\n\tclasses,\r\n\tstate,\r\n\tsetSaveStatusClosed,\r\n}) {\r\n\tconst handleCloseDialog = () => {\r\n\t\tsetSaveStatusClosed();\r\n\t}\r\n\r\n\tlet isChecked = localStorage.getItem('show_save_popup')\r\n\tswitch (state) {\r\n\t\tcase saveStatusValues.CLOSED: return '';\r\n\t\tcase saveStatusValues.DIALOG: return isChecked === 'true' ? \"\" : <SaveDialog onClose={handleCloseDialog} />;\r\n\t\tcase saveStatusValues.DELETE: return isChecked === 'true' ? \"\" : <SaveDialog showDelete onClose={handleCloseDialog} />;\r\n\t\tcase saveStatusValues.ERROR: return <SaveDialogError onClose={handleCloseDialog} />\r\n\t\tcase saveStatusValues.INFO: return <SaveDialogInfo onClose={handleCloseDialog} />\r\n\t\tdefault: return <LoadingScreen />;\r\n\t}\r\n}\r\n\r\nSave.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nSave.defaultProps = {\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tstate: state.store.saveStatus\r\n}), {\r\n\tsetSaveStatusClosed\r\n})(withStyles(style)(Save));","import { useEffect, useRef, useState } from 'react';\r\n\r\n// https://overreacted.io/making-setinterval-declarative-with-react-hooks/\r\nfunction useInterval(callback, delay, run = true) {\r\n\tconst [intervalId, setIntervalId] = useState(null)\r\n\tconst savedCallback = useRef();\r\n\r\n\t// Remember the latest callback.\r\n\tuseEffect(() => {\r\n\t\tsavedCallback.current = callback;\r\n\t}, [callback]);\r\n\r\n\t// Set up the interval.\r\n\tuseEffect(() => {\r\n\t\tfunction tick() {\r\n\t\t\tsavedCallback.current();\r\n\t\t}\r\n\r\n\t\tif (run && delay !== null) {\r\n\t\t\tconst id = setInterval(tick, delay);\r\n\t\t\tsetIntervalId(id)\r\n\t\t} else {\r\n\t\t\tif (intervalId) {\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn () => {\r\n\t\t\tif (intervalId) {\r\n\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// eslint-disable-next-line\r\n\t}, [run, delay])\r\n}\r\n\r\nexport default useInterval;","import React, {useState} from 'react'\r\nimport {Dialog, DialogActions, DialogContent, Typography, withStyles} from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport PowerIcon from '@material-ui/icons/PowerSettingsNew'\r\nimport Tr from 'translations/Translations';\r\nimport Button from 'components/Button';\r\nimport {connect} from 'react-redux'\r\nimport Title from 'components/Title';\r\nimport useInterval from 'hooks/useInterval';\r\nimport moment from 'moment';\r\nimport UserService from 'services/UserService';\r\nimport OAuthService from 'services/OAuthService';\r\nimport reduxStore from 'redux/store'\r\n\r\nconst style = theme => ({\r\n\troot: {\r\n\t},\r\n\ticon: {\r\n\t\tfontSize: theme.components.icon.fontSize,\r\n\t},\r\n\tcontent: {\r\n\t\ttextAlign: 'center',\r\n\t\t'&>*': {\r\n\t\t\tmarginTop: theme.spacing(2),\r\n\t\t}\r\n\t},\r\n\ttitle: {\r\n\t}\r\n})\r\n\r\nfunction Session({\r\n\tclasses\r\n}) {\r\n\tconst [open, setOpen] = useState(false)\r\n\tconst time = open ? 1000 : 30000;\r\n\r\n\tconst [timeLeft, setTimeLeft] = useState('0:00')\r\n\r\n\tuseInterval(() => {\r\n\t\tconst state = reduxStore.getState();\r\n\t\tconst sessionTime = state.resources.sessionTime;\r\n\t\tif (!sessionTime) return;\r\n\t\tconst { endTime } = sessionTime;\r\n\t\tif (!open) {\r\n\t\t\tconst diff = endTime.diff(moment(), 's')\r\n\t\t\tif (diff <= 305) {\r\n\t\t\t\tsetOpen(true)\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst diff = endTime.diff(moment());\r\n\t\t\tsetTimeLeft(diff > 0 ? moment.utc(diff).format('m:ss') : '0:00');\r\n\t\t\tif (diff <= 0) {\r\n\t\t\t\tsetTimeout(() => OAuthService.logout(), 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t}, time)\r\n\r\n\tconst handleContinue = () => {\r\n\t\tUserService.sessionTime()\r\n\t\t\t.then(() => {\r\n\t\t\t\tsetOpen(false)\r\n\t\t\t})\r\n\t}\r\n\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\topen={open}\r\n\t\t\tclassName={classes.root}\r\n\t\t>\r\n\t\t\t<DialogContent className={classes.content}>\r\n\t\t\t\t<PowerIcon color='primary' className={classes.icon} />\r\n\t\t\t\t<Title className={classes.title}>\r\n\t\t\t\t\t{Tr('session_title')}\r\n\t\t\t\t</Title>\r\n\t\t\t\t<Typography variant='h4' color='primary'>\r\n\t\t\t\t\t{timeLeft}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Typography variant='body1'>\r\n\t\t\t\t\t{Tr('session_d_2')}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Button onClick={handleContinue}>\r\n\t\t\t\t\t{Tr('continue_working')}\r\n\t\t\t\t</Button>\r\n\t\t\t</DialogContent>\r\n\t\t\t<DialogActions />\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nSession.propTypes = {\r\n\tclasses: PropTypes.any,\r\n}\r\n\r\nSession.defaultProps = {\r\n}\r\n\r\nexport default connect((state) => ({\r\n}), {\r\n})(withStyles(style)(Session));","import React from 'react'\r\nimport { setOpenRegisterPopup } from 'redux/actions'\r\nimport { connect } from 'react-redux'\r\nimport Tr from 'translations/Translations';\r\nimport Dialog from 'components/Dialog';\r\nimport { withStyles, Typography, Box } from '@material-ui/core';\r\nimport GridBlock from 'components/GridBlock';\r\nimport Button from 'components/Button';\r\n\r\nconst style = theme => ({\r\n\tpadding: {\r\n\t\tmarginTop: theme.spacing(2)\r\n\t}\r\n})\r\n\r\nfunction RegisterPopup({\r\n\tregisterPopup,\r\n\tsetOpenRegisterPopup,\r\n\tclasses\r\n}) {\r\n\r\n\tconst onClose = () => {\r\n\t\tsetOpenRegisterPopup(false)\r\n\t}\r\n\r\n\tif (!registerPopup) return ''\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\ttitle={Tr('contact_with_us')}\r\n\t\t\topen={registerPopup}\r\n\t\t\tmaxWidth={'xs'}\r\n\t\t\tonClose={onClose}\r\n\t\t>\r\n\t\t\t<GridBlock column>\r\n\r\n\t\t\t\t<Typography component='span' variant='body1'>\r\n\t\t\t\t\t{Tr(\"company_phone_number\")}\r\n\t\t\t\t</Typography>\r\n\r\n\t\t\t\t<Box>\r\n\t\t\t\t\t<Typography component='span' variant='body1'>\r\n\t\t\t\t\t\t{`${Tr(\"email\")}: `}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t<Typography component='a' href={`mailto:${Tr('company_email')}`} variant='body1'>\r\n\t\t\t\t\t\t{Tr(\"company_email\")}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t</Box>\r\n\r\n\t\t\t\t<GridBlock justify='flex-end' className={classes.padding}>\r\n\t\t\t\t\t<Button onClick={onClose}> {Tr('close')} </Button>\r\n\t\t\t\t</GridBlock>\r\n\r\n\t\t\t</GridBlock>\r\n\t\t</Dialog>\r\n\t)\r\n}\r\n\r\nexport default connect((state) => ({\r\n\tregisterPopup: state.store.registerPopup,\r\n}), {\r\n\t\tsetOpenRegisterPopup\r\n\t})(withStyles(style)(RegisterPopup));","import reduxStore from 'redux/store'\r\nimport { setResource } from 'redux/actions'\r\nimport Endpoints from 'constants/Endpoints';\r\nimport RestRequest from 'libs/RestRequest';\r\nimport { setInnerMenuOpen } from 'redux/actions'\r\n\r\n\r\nconst get = async () => {\r\n\tlet url = Endpoints.USER_LOGGED_MENU_LIST;\r\n\ttry {\r\n\t\tconst res = await RestRequest({\r\n\t\t\tmethod: 'get',\r\n\t\t\turl,\r\n\t\t})\r\n\t\treduxStore.dispatch(\r\n\t\t\tsetResource('userLoggedMenuList', res)\r\n\t\t)\r\n\r\n\t\tlet objKey = {}\r\n\t\tres.forEach(x => {\r\n\t\t\tlet temp = x.name.split(\".\")\r\n\t\t\tobjKey[temp[1]] = false\r\n\t\t});\r\n\t\treduxStore.dispatch(\r\n\t\t\tsetInnerMenuOpen(objKey)\r\n\t\t)\r\n\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nexport default {\r\n\tget,\r\n}\r\n","import { RestRequestGET } from 'libs/RestRequest'\r\nimport Endpoints from 'constants/Endpoints'\r\nimport {setClientColors, setResource} from 'redux/actions';\r\nimport reduxStore from 'redux/store'\r\n\r\nconst logo = async () => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(Endpoints.CLIENT_LOGO);\r\n\t\treduxStore.dispatch(setResource('logo', res))\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nconst clientColors = async () => {\r\n\ttry {\r\n\t\tconst res = await RestRequestGET(Endpoints.CLIENT_COLORS);\r\n\t\treduxStore.dispatch(setClientColors(res))\r\n\t} catch (error) {\r\n\t}\r\n}\r\n\r\nexport default {\r\n\tlogo,\r\n\tclientColors\r\n}","import { useEffect, useState, useMemo } from 'react'\r\nimport UserNavigationService from 'services/UserNavigationService'\r\nimport UserService from 'services/UserService';\r\nimport ClientService from 'services/ClientService';\r\nimport Endpoints from 'constants/Endpoints';\r\nimport RouterPath from 'libs/RouterPath';\r\nimport OAuthService from 'services/OAuthService';\r\n\r\nexport default (\r\n\tauthorizeCounter,\r\n\tparams = {},\r\n\tsetRedirectFunc,\r\n\tsetRedirectWithoutHistoryFunc,\r\n\thistory,\r\n\tlocation\r\n) => {\r\n\tconst [isNewToken, setIsNewToken] = useState(false);\r\n\r\n\tconst [refresh, setRefresh] = useState(null);\r\n\tconst refreshState = () => setRefresh(Math.random())\r\n\tconst firstLoad = refresh === null;\r\n\r\n\tconst [canRender, setCanRender] = useState(false)\r\n\tconst [isTokenValid, setIsTokenValid] = useState(false)\r\n\r\n\tconst authorize = JSON.parse(localStorage.getItem(\"authorize\"))\r\n\tconst { code, state } = params;\r\n\r\n\tconst token = useMemo(() => {\r\n\t\tif (authorize) return authorize.access_token;\r\n\t\treturn undefined;\r\n\t}, [authorize])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (firstLoad) {\r\n\t\t\tsetRedirectFunc(history.push);\r\n\t\t\tsetRedirectWithoutHistoryFunc(history.replace)\r\n\t\t\trefreshState();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (isTokenValid) return;\r\n\r\n\t\t(async (token, code, state, isNewToken) => {\r\n\t\t\tif (!token) {\r\n\t\t\t\tif (!code) {\r\n\t\t\t\t\t// no token and no code\r\n\t\t\t\t\t// get code from server\r\n\t\t\t\t\tif (!state) {\r\n\t\t\t\t\t\tif (location.pathname === RouterPath.BASE) {\r\n\t\t\t\t\t\t\tstate = window.btoa(RouterPath.MY_PROCEDURE);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tstate = window.btoa(location.pathname + location.search);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\twindow.location.href = Endpoints.oauth.AUTHORIZE(state)\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// no token but have code\r\n\t\t\t\t\t// get token\r\n\t\t\t\t\tconst tokenGranted = await OAuthService.getToken(code);\r\n\t\t\t\t\tif (tokenGranted)\r\n\t\t\t\t\t\tsetIsNewToken(true);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsetIsTokenValid(true);\r\n\t\t\t\tif (isNewToken) {\r\n\t\t\t\t\t// is new token, can get initialize values\r\n\t\t\t\t\tRouterPath.redirect(window.atob(state))\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})(token, code, state, isNewToken);\r\n\t\r\n\t\t// eslint-disable-next-line\r\n\t}, [token, code, firstLoad, isNewToken])\r\n\r\n\t// get initialize values\r\n\tuseEffect(() => {\r\n\t\tif (isTokenValid) {\r\n\t\t\t(async () => {\r\n\t\t\t\tawait ClientService.clientColors();\r\n\t\t\t\tawait UserNavigationService.get();\r\n\t\t\t\tawait UserService.data();\r\n\t\t\t\tawait UserService.profile();\r\n\t\t\t\tawait UserService.sessionTime();\r\n\t\t\t\tawait ClientService.logo();\r\n\t\t\t\tsetCanRender(true);\r\n\t\t\t})();\r\n\t\t}\r\n\t}, [isTokenValid])\r\n\r\n\t// open or close aside menu\r\n\tuseEffect(() => {\r\n\t\tRouterPath.setMenuOpenOnPath();\r\n\t}, [])\r\n\r\n\treturn canRender;\r\n}","import React from 'react'\r\nimport {clearConfirmNotification} from 'redux/actions'\r\nimport {connect} from \"react-redux\";\r\nimport Confirm from \"./Confirm\";\r\n\r\nfunction HookConfirmPopup(\r\n    {\r\n        confirmNotification,\r\n        clearConfirmNotification\r\n    }) {\r\n\r\n\r\n    const onCancel = () => {\r\n        if (confirmNotification && confirmNotification.onCancel)\r\n            confirmNotification.onCancel();\r\n        clearConfirmNotification();\r\n    }\r\n\r\n    const onConfirm = () => {\r\n        if (confirmNotification && confirmNotification.onConfirm)\r\n            confirmNotification.onConfirm();\r\n        clearConfirmNotification();\r\n    }\r\n\r\n\r\n    return !!confirmNotification && <Confirm\r\n        open\r\n        onCancel={onCancel}\r\n        onConfirm={onConfirm}\r\n        confirmText={confirmNotification.confirmText}\r\n        confirmText2={confirmNotification.confirmText2}\r\n        labelConfirm={confirmNotification.labelConfirm}\r\n        labelCancel={confirmNotification.labelCancel}\r\n        translateConfirmTexts={confirmNotification.translateConfirmTexts}\r\n    />\r\n}\r\n\r\nexport default connect((state) => ({\r\n    confirmNotification: state.store.confirmNotification\r\n}), {\r\n    clearConfirmNotification\r\n})(HookConfirmPopup);","import React from 'react'\r\nimport {clearAlertNotification} from 'redux/actions'\r\nimport {connect} from \"react-redux\";\r\nimport Alert from \"./Alert\";\r\n\r\nfunction HookAlertPopup(\r\n    {\r\n        alertNotification,\r\n        clearAlertNotification\r\n    }) {\r\n\r\n\r\n    const onClose = () => {\r\n        if (alertNotification && alertNotification.onClose)\r\n            alertNotification.onClose();\r\n        clearAlertNotification();\r\n    }\r\n\r\n    return !!alertNotification && <Alert\r\n        open\r\n        onClose={onClose}\r\n        confirmText={alertNotification.confirmText}\r\n        confirmText2={alertNotification.confirmText2}\r\n        translateTexts={alertNotification.translateTexts}\r\n        title={alertNotification.title}\r\n        maxWidth={alertNotification.maxWidth}\r\n        buttonText={alertNotification.buttonText}\r\n    />\r\n}\r\n\r\nexport default connect((state) => ({\r\n    alertNotification: state.store.alertNotification\r\n}), {\r\n    clearAlertNotification\r\n})(HookAlertPopup);","import React from 'react'\r\nimport {connect} from \"react-redux\";\r\nimport LoadingScreen from \"./LoadingScreen\";\r\n\r\nfunction HookLoadingScreen(\r\n    {\r\n        loadingScreen\r\n    }) {\r\n    return !!loadingScreen && <LoadingScreen/>\r\n}\r\n\r\nexport default connect((state) => ({\r\n    loadingScreen: state.store.loadingScreen\r\n}))(HookLoadingScreen);","import React from 'react'\r\nimport Router from './Router';\r\nimport {withStyles} from '@material-ui/core';\r\nimport Tutorial from 'components/complex/tutorial/Tutorial';\r\nimport Save from 'components/popup/save/Save';\r\nimport Session from 'components/popup/session/Session';\r\nimport pjson from '../../package.json'\r\nimport RegisterPopup from 'components/popup/registerPopup/RegisterPopup';\r\nimport {connect} from 'react-redux'\r\nimport useInitialize from 'hooks/useInitialize';\r\nimport usePathParams from 'hooks/usePathParams';\r\nimport Loading from 'components/Loading';\r\nimport {withRouter} from \"react-router\";\r\nimport {setRedirectFunc, setRedirectWithoutHistoryFunc} from 'redux/actions'\r\nimport {SnackbarProvider} from \"notistack\";\r\nimport HookConfirmPopup from \"components/popup/confirm/HookConfirmPopup\";\r\nimport HookAlertPopup from \"components/popup/alert/HookAlertPopup\";\r\nimport HookLoadingScreen from \"components/complex/loadingScreen/HookLoadingScreen\";\r\nimport {SupportModeContextProvider} from \"../context/SupportModeContext\";\r\n\r\nconst style = theme => ({\r\n    root: {\r\n        minHeight: '100vh',\r\n        backgroundColor: theme.palette.background.default,\r\n        minWidth: theme.breakpoints.values.lg\r\n            - theme.scrollSize,\r\n    },\r\n    version: {\r\n        position: 'fixed',\r\n        fontSize: 9,\r\n        bottom: 0,\r\n        right: 0,\r\n        color: theme.palette.text.primary,\r\n    }\r\n})\r\n\r\nfunction Root(\r\n    {\r\n        classes,\r\n        authorizeCounter,\r\n        supportMode,\r\n        location,\r\n        history,\r\n        setRedirectFunc,\r\n        setRedirectWithoutHistoryFunc,\r\n    }) {\r\n\r\n    const params = usePathParams(location);\r\n    const canRenderPage = useInitialize(authorizeCounter, params, setRedirectFunc, setRedirectWithoutHistoryFunc, history, location);\r\n\r\n\r\n    if (!canRenderPage) return (\r\n        <Loading/>\r\n    )\r\n\r\n    return (<SupportModeContextProvider value={supportMode}>\r\n            <SnackbarProvider maxSnack={3} anchorOrigin={{horizontal: \"center\", vertical: \"bottom\"}}>\r\n                <div className={classes.root}>\r\n                    <Tutorial/>\r\n                    <RegisterPopup/>\r\n                    <Router/>\r\n                    <Save/>\r\n                    <Session/>\r\n                    <HookConfirmPopup/>\r\n                    <HookAlertPopup/>\r\n                    <HookLoadingScreen/>\r\n                    <span className={classes.version}>v{pjson.version}</span>\r\n                </div>\r\n            </SnackbarProvider>\r\n        </SupportModeContextProvider>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    authorizeCounter: state.authorize.counter,\r\n    supportMode: !!state.resources?.userData?.supportMode,\r\n}), {\r\n    setRedirectFunc,\r\n    setRedirectWithoutHistoryFunc\r\n})(withStyles(style)(withRouter(Root)));\r\n","import React from 'react';\r\nimport {alpha, createTheme} from '@material-ui/core/styles';\r\nimport {ThemeProvider as ThemeProviderUI} from '@material-ui/styles';\r\nimport {connect} from 'react-redux'\r\nimport appConfig from './theme.config.json'\r\n\r\nconst baseTheme = (colors) => createTheme({\r\n    palette: {\r\n        primary: {\r\n            main: colors['color-primary']\r\n        },\r\n        secondary: {\r\n            main: colors['color-secondary']\r\n        },\r\n        error: {\r\n            main: colors['color-red']\r\n        },\r\n        warning: {\r\n            main: colors['color-yellow']\r\n        },\r\n        info: {\r\n            main: colors['color-blue']\r\n        },\r\n        success: {\r\n            main: colors['color-green']\r\n        },\r\n    }\r\n});\r\n\r\n\r\nconst theme = ({fontSize, colors, baseTheme}) => createTheme({\r\n    typography: {\r\n        fontFamily: appConfig['font-family'],\r\n        fontSize: fontSize,\r\n        cutLines: (num) => ({\r\n            textOverflow: 'ellipsis',\r\n            display: '-webkit-box',\r\n            '-webkit-box-orient': 'vertical',\r\n            overflow: 'hidden',\r\n            lineClamp: num,\r\n        })\r\n    },\r\n    palette: {\r\n        primary: {\r\n            ...baseTheme.palette.primary\r\n        },\r\n        secondary: {\r\n            ...baseTheme.palette.secondary\r\n        },\r\n        error: {\r\n            ...baseTheme.palette.error\r\n        },\r\n        warning: {\r\n            ...baseTheme.palette.warning\r\n        },\r\n        info: {\r\n            ...baseTheme.palette.info\r\n        },\r\n        success: {\r\n            ...baseTheme.palette.success\r\n        },\r\n\r\n        action: {\r\n            active: colors['active'],\r\n            disabled: colors['disabled'],\r\n            disabledBackground: colors['disabled-background']\r\n        },\r\n\r\n\r\n        common: {\r\n            success: colors['color-green'],\r\n            warning: colors['color-yellow'],\r\n            error: colors['color-red'],\r\n            info: colors['color-blue'],\r\n            document: colors['document'],\r\n            gray: colors['color-gray'],\r\n            lightGreen: colors['color-light-green'],\r\n            lightRed: colors['color-light-red'],\r\n        },\r\n        background: {\r\n            default: colors['default-background'],\r\n            paper: colors['paper-background'],\r\n            greyBackground: colors['greyBackground-background'],\r\n            appBarBackground: colors['appBar-background'],\r\n        },\r\n        border: {\r\n            onlyContrast: colors?.border?.onlyContrast,\r\n            dark: colors.border.dark\r\n        },\r\n        text: colors['text'],\r\n        chips: colors['chips'],\r\n    },\r\n    shape: {\r\n        borderRadius: appConfig['border-radius']\r\n    },\r\n    mixins: {\r\n        toolbar: {\r\n            minHeight: 64\r\n        }\r\n    },\r\n    props: {\r\n        MuiTooltip: {\r\n            placement: 'top'\r\n        }\r\n    },\r\n    overrides: {\r\n        MuiAppBar: {\r\n            colorDefault: {\r\n                backgroundColor: baseTheme.palette.background.appBarBackground,\r\n                color: colors.active\r\n            },\r\n        },\r\n        MuiAccordion: {\r\n            root: {\r\n                border: colors?.border?.onlyContrast ? `1px solid ${colors.border.onlyContrast}` : undefined\r\n            }\r\n        },\r\n        MuiInput: {\r\n            underline: {\r\n                '&:before': {\r\n                    borderBottomColor: colors.inputBorder,\r\n                }\r\n            }\r\n        },\r\n        MuiListItem: {\r\n            root: {\r\n                \"&$selected\": {\r\n                    backgroundColor: baseTheme.palette.secondary.main,\r\n                    '&:hover': {\r\n                        backgroundColor: baseTheme.palette.secondary.light\r\n                    }\r\n                }\r\n            },\r\n            button: {\r\n                '&:hover': {\r\n                    backgroundColor: baseTheme.palette.secondary.light\r\n                }\r\n            }\r\n        },\r\n        MuiButton: {\r\n            outlinedPrimary: {\r\n                borderColor: baseTheme.palette.primary.main\r\n            },\r\n            containedPrimary: {\r\n                color: colors.text.button\r\n            },\r\n            containedSecondary: {\r\n                color: colors.text.button\r\n            },\r\n            textSecondary: {\r\n                color: colors.active\r\n            },\r\n            outlinedSecondary: {\r\n                color: colors.active,\r\n            }\r\n        },\r\n        MuiRadio: {\r\n            colorPrimary: {\r\n                \"&$checked\": {\r\n                    color: baseTheme.palette.text.primary\r\n                }\r\n            }\r\n        },\r\n        MuiToggleButton: {\r\n            root: {\r\n                borderColor: baseTheme.palette.primary.main,\r\n                color: baseTheme.palette.primary.main + \" !important\",\r\n                \"&:hover\": {\r\n                    backgroundColor: alpha(baseTheme.palette.primary.main, 0.04),\r\n                },\r\n                \"&$disabled\": {\r\n                    pointerEvents: \"unset\"\r\n                },\r\n                \"&$selected\": {\r\n                    backgroundColor: baseTheme.palette.primary.main,\r\n                    color: colors.text.button + \" !important\",\r\n                    cursor: 'default',\r\n                    \"&:hover\": {\r\n                        backgroundColor: baseTheme.palette.primary.main,\r\n                    }\r\n                }\r\n            }\r\n        },\r\n        MuiTooltip: {\r\n            tooltip: {\r\n                fontSize: '.9rem',\r\n\t\t\t\tlineHeight: '1.1rem',\r\n\t\t\t\tmaxWidth: 400\r\n            }\r\n        },\r\n        MuiTableCell: {\r\n            head: {\r\n                fontWeight: 700\r\n            }\r\n        },\r\n        MuiPaginationItem: {\r\n            textPrimary: {\r\n                \"&$selected\": {\r\n                    fontWeight: 700,\r\n                    color: colors.text.button\r\n                }\r\n            }\r\n        },\r\n        MuiPickersModal: {\r\n            dialogRoot: {\r\n                border: colors?.border?.onlyContrast ? `1px solid ${colors.border.onlyContrast}` : undefined\r\n            }\r\n        },\r\n        MuiInputAdornment: {\r\n            positionEnd: {\r\n                \"& .MuiIconButton-root\": {\r\n                    color: baseTheme.palette.primary.main\r\n                }\r\n            }\r\n        },\r\n        MuiTreeItem: {\r\n            root: {\r\n                \"&.Mui-selected > .MuiTreeItem-content\": {\r\n                    background: baseTheme.palette.primary.main,\r\n                    color: baseTheme.palette.secondary.contrastText\r\n                }\r\n            },\r\n            content: {\r\n                padding: \"8px 0\",\r\n                \"&:hover\": {\r\n                    backgroundColor: baseTheme.palette.primary.main\r\n                }\r\n            },\r\n            label: {\r\n                \"&:hover\": {\r\n                    backgroundColor: \"unset\"\r\n                },\r\n                paddingRight: \"8px\"\r\n            },\r\n            iconContainer: {\r\n                paddingLeft: \"8px\"\r\n            },\r\n\r\n        },\r\n        MuiChip: {\r\n            deleteIcon: {\r\n                color: baseTheme.palette.primary.main,\r\n                '&:hover': {\r\n                    color: baseTheme.palette.primary.dark\r\n                }\r\n            },\r\n            outlined: {\r\n                border: `1px solid ${baseTheme.palette.primary.main}`\r\n            }\r\n        }\r\n    }\r\n})\r\n\r\nconst enrich = (theme) => ({\r\n    ...theme,\r\n    components: {\r\n        paper: {\r\n            padding: theme.spacing(2),\r\n        },\r\n        navigation: {\r\n            width: 300,\r\n            item: {\r\n                primary: {\r\n                    backgroundColor: theme.palette.primary.main,\r\n                    '&:hover': {\r\n                        backgroundColor: theme.palette.primary.light,\r\n                    }\r\n                }\r\n            },\r\n            margin: {\r\n                left: theme.spacing(7) + 1\r\n            },\r\n            transitionProp: {\r\n                easing: theme.transitions.easing.sharp,\r\n                duration: theme.transitions.duration.leavingScreen,\r\n            }\r\n        },\r\n        progressBar: {\r\n            buttons: {\r\n                width: 180\r\n            }\r\n        },\r\n        transferList: {\r\n            row: {\r\n                height: 36\r\n            }\r\n        },\r\n        popup: {\r\n            criteria: {\r\n                width: 800,\r\n            },\r\n            smallContainer: {\r\n                width: 300,\r\n            },\r\n            buttons: {\r\n                width: 120,\r\n            }\r\n        },\r\n        icon: {\r\n            fontSize: 100,\r\n        },\r\n        input: {\r\n            search: {\r\n                width: 400,\r\n            },\r\n            criteria: {\r\n                width: 50\r\n            },\r\n            criteriaKey: {\r\n                width: 190\r\n            }\r\n        },\r\n        table: {\r\n            lpColumn: {\r\n                width: 16,\r\n            },\r\n            dateColumn: {\r\n                width: 120,\r\n            },\r\n            dateTimeColumn: {\r\n                width: 140,\r\n            },\r\n            ipColumn: {\r\n                width: 100,\r\n            },\r\n            emailColumn: {\r\n                width: 230,\r\n            },\r\n            buttonColumn: {\r\n                width: 48,\r\n                padding: '0 !important'\r\n            }\r\n        },\r\n        stageBar: {\r\n            topOffset: 136,\r\n            topOffsetExpanded: 282\r\n        }\r\n    },\r\n    transitions: {\r\n        ...theme.transitions,\r\n        default: {\r\n            open: prop => theme.transitions.create(prop, {\r\n                easing: theme.transitions.easing.sharp,\r\n                duration: theme.transitions.duration.enteringScreen,\r\n            }),\r\n            close: prop => theme.transitions.create(prop, {\r\n                easing: theme.transitions.easing.sharp,\r\n                duration: theme.transitions.duration.leavingScreen,\r\n            }),\r\n        }\r\n    },\r\n    scrollSize: 17\r\n})\r\n\r\nconst applayClientColors = (colors, clientColors) => {\r\n    if (clientColors) {\r\n        if (clientColors.basicColorLight && clientColors.basicColorLightDarken) {\r\n            colors[\"color-primary\"] = \"#\" + clientColors.basicColorLight;\r\n            colors[\"color-primary-dark\"] = \"#\" + clientColors.basicColorLightDarken;\r\n\r\n        }\r\n        if (clientColors.basicColorDark && clientColors.basicColorDarkDarken) {\r\n            colors[\"color-secondary\"] = \"#\" + clientColors.basicColorDark;\r\n            colors[\"color-secondary-dark\"] = \"#\" + clientColors.basicColorDarkDarken;\r\n        }\r\n    }\r\n    return colors;\r\n}\r\n\r\nconst enrichTheme = (isContrast, isLargeText, clientColors) => {\r\n    const fontSize = isLargeText ? appConfig['large-font-size'] : undefined;\r\n    const colors = isContrast ? appConfig.colors['contrast'] : applayClientColors(appConfig.colors['main'], clientColors);\r\n\r\n    const baseThemeRes = baseTheme(colors);\r\n\r\n    const overrideTheme = theme({fontSize, colors, baseTheme: baseThemeRes});\r\n    const finalTheme = enrich(overrideTheme)\r\n\r\n    if (process.env.NODE_ENV === 'development') {\r\n    }\r\n    return finalTheme;\r\n}\r\n\r\nfunction ThemeProvider(\r\n    {\r\n        children,\r\n        contrast,\r\n        largeText,\r\n        clientColors\r\n    }) {\r\n\r\n    return (\r\n        <ThemeProviderUI theme={enrichTheme(contrast, largeText, clientColors)}>\r\n            {children}\r\n        </ThemeProviderUI>\r\n    )\r\n}\r\n\r\nexport default connect((state) => ({\r\n    contrast: state.store.contrast,\r\n    largeText: state.store.largeText,\r\n    clientColors: state.store.clientColors\r\n}), {})(ThemeProvider);","import React from 'react';\r\nimport {Provider} from 'react-redux'\r\nimport store from './redux/store'\r\nimport {BrowserRouter} from 'react-router-dom';\r\nimport {MuiPickersUtilsProvider} from '@material-ui/pickers';\r\nimport MomentUtils from '@date-io/moment';\r\nimport './styles/index.scss'\r\nimport Root from 'pages/Root';\r\nimport ThemeProvider from 'theme/ThemeProvider';\r\nimport moment from 'moment';\r\nimport 'moment/locale/pl'\r\n// import { hotjar } from 'react-hotjar';\r\n// import Endpoints from 'constants/Endpoints'\r\n\r\nfunction App() {\r\n    moment.locale('pl')\r\n    //hotjar.initialize(Endpoints.hotJarSettings.hjid, Endpoints.hotJarSettings.hjsv);\r\n    return (\r\n        <Provider store={store}>\r\n            <BrowserRouter>\r\n                <ThemeProvider>\r\n                    <MuiPickersUtilsProvider utils={MomentUtils}>\r\n                        <Root/>\r\n                    </MuiPickersUtilsProvider>\r\n                </ThemeProvider>\r\n            </BrowserRouter>\r\n        </Provider>\r\n    );\r\n}\r\n\r\nexport default App;\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n  window.location.hostname === 'localhost' ||\r\n    // [::1] is the IPv6 localhost address.\r\n    window.location.hostname === '[::1]' ||\r\n    // 127.0.0.1/8 is considered localhost for IPv4.\r\n    window.location.hostname.match(\r\n      /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n    )\r\n);\r\n\r\nexport function register(config) {\r\n  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n    // The URL constructor is available in all browsers that support SW.\r\n    const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n    if (publicUrl.origin !== window.location.origin) {\r\n      // Our service worker won't work if PUBLIC_URL is on a different origin\r\n      // from what our page is served on. This might happen if a CDN is used to\r\n      // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n      return;\r\n    }\r\n\r\n    window.addEventListener('load', () => {\r\n      const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n      if (isLocalhost) {\r\n        // This is running on localhost. Let's check if a service worker still exists or not.\r\n        checkValidServiceWorker(swUrl, config);\r\n\r\n        // Add some additional logging to localhost, pointing developers to the\r\n        // service worker/PWA documentation.\r\n        navigator.serviceWorker.ready.then(() => {\r\n          console.info(\r\n            'This web app is being served cache-first by a service ' +\r\n              'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n          );\r\n        });\r\n      } else {\r\n        // Is not localhost. Just register service worker\r\n        registerValidSW(swUrl, config);\r\n      }\r\n    });\r\n  }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n  navigator.serviceWorker\r\n    .register(swUrl)\r\n    .then(registration => {\r\n      registration.onupdatefound = () => {\r\n        const installingWorker = registration.installing;\r\n        if (installingWorker == null) {\r\n          return;\r\n        }\r\n        installingWorker.onstatechange = () => {\r\n          if (installingWorker.state === 'installed') {\r\n            if (navigator.serviceWorker.controller) {\r\n              // At this point, the updated precached content has been fetched,\r\n              // but the previous service worker will still serve the older\r\n              // content until all client tabs are closed.\r\n              console.info(\r\n                'New content is available and will be used when all ' +\r\n                  'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n              );\r\n\r\n              // Execute callback\r\n              if (config && config.onUpdate) {\r\n                config.onUpdate(registration);\r\n              }\r\n            } else {\r\n              // At this point, everything has been precached.\r\n              // It's the perfect time to display a\r\n              // \"Content is cached for offline use.\" message.\r\n              console.info('Content is cached for offline use.');\r\n\r\n              // Execute callback\r\n              if (config && config.onSuccess) {\r\n                config.onSuccess(registration);\r\n              }\r\n            }\r\n          }\r\n        };\r\n      };\r\n    })\r\n    .catch(error => {\r\n      console.error('Error during service worker registration:', error);\r\n    });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n  // Check if the service worker can be found. If it can't reload the page.\r\n  fetch(swUrl)\r\n    .then(response => {\r\n      // Ensure service worker exists, and that we really are getting a JS file.\r\n      const contentType = response.headers.get('content-type');\r\n      if (\r\n        response.status === 404 ||\r\n        (contentType != null && contentType.indexOf('javascript') === -1)\r\n      ) {\r\n        // No service worker found. Probably a different app. Reload the page.\r\n        navigator.serviceWorker.ready.then(registration => {\r\n          registration.unregister().then(() => {\r\n            window.location.reload();\r\n          });\r\n        });\r\n      } else {\r\n        // Service worker found. Proceed as normal.\r\n        registerValidSW(swUrl, config);\r\n      }\r\n    })\r\n    .catch(() => {\r\n      console.error(\r\n        'No internet connection found. App is running in offline mode.'\r\n      );\r\n    });\r\n}\r\n\r\nexport function unregister() {\r\n  if ('serviceWorker' in navigator) {\r\n    navigator.serviceWorker.ready.then(registration => {\r\n      registration.unregister();\r\n    });\r\n  }\r\n}\r\n","import 'react-app-polyfill/ie9';\r\nimport 'react-app-polyfill/stable';\r\n\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport App from './App';\r\nimport * as serviceWorker from './serviceWorker';\r\n\r\nReactDOM.render(<App />, document.getElementById('root'));\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}